:root {
  --bg: #fbf7ee;
  --surface: #ffffff;
  --surface-2: #f4eddd;
  --ink: #2a1d14;
  --muted: #6b5a4b;
  --line: #eadfc8;
  --brand: #2fae72;
  --brand-2: #0b6e78;
  --wood: #5a3217;
  --sun: #ffc93a;
  --sun-2: #f2a51e;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(60, 35, 10, .06), 0 10px 30px rgba(60, 35, 10, .10);
  --shadow-lg: 0 20px 60px rgba(30, 20, 5, .25);
  --display: "Baloo 2", ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110d;
    --surface: #1e1914;
    --surface-2: #29221a;
    --ink: #f4ecdf;
    --muted: #b9a996;
    --line: #362c21;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; letter-spacing: -.01em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font: 700 19px/1 var(--display); }
.brand:hover { text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.nav { display: flex; align-items: center; gap: 24px; font-size: 15px; font-weight: 600; }
.nav a { color: var(--muted); }
.nav a[aria-current="page"], .nav a:hover { color: var(--ink); text-decoration: none; }

/* ---------- Buttons ---------- */
.store-badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: #0b0b0c; color: #fff; border-radius: 14px; padding: 10px 20px 10px 16px;
  border: 1px solid rgba(255, 255, 255, .25);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.store-badge:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .3); }
.store-badge svg { width: 26px; height: 26px; fill: currentColor; }
.store-badge span { display: flex; flex-direction: column; line-height: 1.1; font-weight: 600; font-size: 19px; }
.store-badge small { font-size: 11px; font-weight: 500; opacity: .8; }
.store-badge.sm { padding: 6px 14px 6px 12px; border-radius: 11px; box-shadow: none; }
.store-badge.sm svg { width: 18px; height: 18px; }
.store-badge.sm span { font-size: 14px; }

.button {
  display: inline-block; font-weight: 700; padding: 13px 26px; border-radius: 14px;
  background: linear-gradient(180deg, #5dd39e, var(--brand)); color: #fff;
  box-shadow: 0 6px 16px rgba(47, 174, 114, .35);
}
.button:hover { text-decoration: none; filter: brightness(1.05); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    linear-gradient(180deg, rgba(11, 60, 70, .55) 0%, rgba(20, 90, 55, .25) 45%, rgba(0, 0, 0, 0) 70%),
    url("img/zemin.jpg") 0 0 / 220px 220px;
  padding: 56px 0 0;
}
.hero::after {
  /* soft vignette so the text stays readable over the grass */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 30%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .28) 100%);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1.25fr; align-items: center; gap: 36px; }
.hero-logo { width: 100%; max-width: 480px; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .35)); margin: 0 0 14px -8px; }
.hero .lead { font-size: clamp(18px, 2.2vw, 21px); margin: 0 0 26px; text-shadow: 0 2px 8px rgba(0, 0, 0, .45); max-width: 480px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600;
  background: rgba(0, 0, 0, .32); color: #fff; padding: 6px 12px; border-radius: 999px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

/* Landscape phone mock-up */
.device {
  position: relative; border-radius: 34px; padding: 12px;
  background: linear-gradient(145deg, #3b3f46, #15171a);
  box-shadow: var(--shadow-lg), inset 0 0 0 2px rgba(255, 255, 255, .08);
  transform: perspective(1400px) rotateY(-10deg) rotateX(4deg);
}
.device img { border-radius: 24px; width: 100%; aspect-ratio: 2518 / 1320; object-fit: cover; }

/* Rolling train along the bottom of the hero */
.rail {
  position: relative; z-index: 1; height: 96px; margin-top: 40px; overflow: hidden;
  background:
    linear-gradient(#cdd3d8, #cdd3d8) 0 62px / 100% 4px no-repeat,
    linear-gradient(#cdd3d8, #cdd3d8) 0 80px / 100% 4px no-repeat,
    repeating-linear-gradient(90deg, #7a5a3e 0 12px, transparent 12px 34px) 0 56px / 100% 34px no-repeat,
    linear-gradient(rgba(150, 140, 125, .9), rgba(120, 112, 100, .9)) 0 52px / 100% 42px no-repeat;
}
.train { position: absolute; bottom: 12px; left: 0; display: flex; align-items: flex-end; animation: roll 26s linear infinite; }
.train img { height: 58px; width: auto; }
.train > * { margin-right: -4px; }
.train .loco { height: 64px; transform: scaleX(-1); }
@keyframes roll { from { transform: translateX(-110%); } to { transform: translateX(110vw); } }

/* Number badge on the roof disc of a wagon picture, as in the game */
.w { position: relative; display: inline-block; flex: none; }
.w::after {
  content: attr(data-n); position: absolute; left: 50%; top: 21%; transform: translate(-50%, -50%);
  width: 34%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: #fff8ea; border: 2px solid var(--c); color: var(--c);
  font: 800 15px/1 var(--display);
}
.step .w::after { font-size: 14px; border-width: 1.5px; }

/* ---------- Stats band ---------- */
.stats { background: var(--wood); color: #ffe7a8; }
.stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding-top: 22px; padding-bottom: 22px; text-align: center; }
.stats strong { display: block; font: 800 34px/1.1 var(--display); color: #fff3cf; }
.stats span { font-size: 14px; font-weight: 600; opacity: .9; }

/* ---------- Sections ---------- */
section { padding: 84px 0; }
.eyebrow { display: block; text-align: center; font-weight: 800; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); margin-bottom: 8px; }
.section-title { text-align: center; font-size: clamp(30px, 4.4vw, 42px); margin: 0 0 12px; }
.section-sub { text-align: center; color: var(--muted); max-width: 600px; margin: 0 auto 48px; }

.steps { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); counter-reset: step; }
.step {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px 24px; box-shadow: var(--shadow);
}
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: -18px; left: 24px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font: 800 20px/1 var(--display); color: #4a3300;
  background: linear-gradient(180deg, var(--sun), var(--sun-2)); box-shadow: 0 4px 10px rgba(242, 165, 30, .45);
}
.step .art { height: 76px; display: flex; align-items: flex-end; justify-content: center; gap: 2px; margin: 8px 0 14px; }
.step .art img { height: 52px; width: auto; }
.step h3 { margin: 0 0 6px; font-size: 22px; }
.step p { margin: 0; color: var(--muted); font-size: 16px; }

/* World cards */
.worlds { display: grid; gap: 20px; grid-template-columns: repeat(4, 1fr); }
.world {
  position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 4;
  box-shadow: var(--shadow); color: #fff; isolation: isolate;
}
.world img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .5s ease; }
.world:hover img { transform: scale(1.05); }
.world::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, .55) 60%, rgba(0, 0, 0, .9) 100%);
}
.world .body { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 18px 20px; }
.world h3 { margin: 0 0 4px; font-size: 24px; text-shadow: 0 2px 6px rgba(0, 0, 0, .6); }
.world p { margin: 0 0 10px; font-size: 14px; line-height: 1.45; text-shadow: 0 1px 4px rgba(0, 0, 0, .8); }
.world .tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .22); backdrop-filter: blur(6px); }

/* Modes: three cards, then the line's stations as a route */
.worlds.three { grid-template-columns: repeat(3, 1fr); }
.route {
  list-style: none; margin: 34px auto 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 0;
  counter-reset: stop;
}
.route li {
  position: relative; font-weight: 700; font-size: 14px; padding: 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
}
.route li + li { margin-left: 26px; }
.route li + li::before {
  content: ""; position: absolute; left: -24px; top: 50%; width: 22px; height: 3px; margin-top: -1.5px;
  background: repeating-linear-gradient(90deg, var(--brand) 0 5px, transparent 5px 8px);
}

/* Behiç Dede */
.dede {
  display: grid; grid-template-columns: 220px 1fr; gap: 36px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 30px 36px; box-shadow: var(--shadow);
}
.dede img { width: 100%; height: auto; }
.dede .eyebrow { text-align: left; }
.dede h2 { margin: 0 0 6px; font-size: clamp(28px, 3.6vw, 38px); }
.dede .quote { font-style: italic; color: var(--muted); margin: 0 0 14px; font-size: 18px; }
.dede ul { margin: 0; padding-left: 20px; }
.dede li { margin: 6px 0; }

/* Daily puzzle callout */
.daily {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px;
  background: linear-gradient(135deg, #ffd65c, #f2a51e); color: #3d2a00;
  border-radius: 28px; padding: 32px 36px; box-shadow: 0 16px 40px rgba(242, 165, 30, .35);
}
.daily .cal {
  width: 88px; height: 88px; border-radius: 22px; background: #fff; display: grid; place-items: center;
  font: 800 36px/1 var(--display); color: #d98a10; box-shadow: 0 6px 14px rgba(0, 0, 0, .15);
}
.daily .cal small { display: block; font-size: 12px; letter-spacing: .08em; color: #a8660b; margin-top: -26px; }
.daily h2 { margin: 0 0 6px; font-size: 30px; }
.daily p { margin: 0; font-size: 16px; }
.daily .streak { font-size: 56px; line-height: 1; filter: drop-shadow(0 4px 8px rgba(160, 60, 0, .35)); }

/* Gallery */
.gallery {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(78%, 620px); gap: 18px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 20px 22px; margin: 0 -20px;
  scrollbar-width: thin;
}
.gallery figure { margin: 0; scroll-snap-align: center; }
.gallery img { border-radius: 18px; box-shadow: var(--shadow); aspect-ratio: 2518 / 1320; object-fit: cover; width: 100%; }
.gallery figcaption { text-align: center; color: var(--muted); font-size: 14px; font-weight: 600; margin-top: 10px; }

/* Features */
.features { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.feature { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.feature .ico { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--surface-2); }
.feature h3 { margin: 0 0 2px; font-size: 18px; font-family: inherit; font-weight: 700; letter-spacing: 0; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }

/* Final call to action */
.cta {
  text-align: center; color: #fff; border-radius: 32px; padding: 56px 24px;
  background: linear-gradient(180deg, rgba(11, 60, 70, .35), rgba(11, 60, 70, .6)), url("img/zemin.jpg") 0 0 / 220px 220px;
  box-shadow: var(--shadow-lg);
}
.cta img.icon { width: 104px; height: 104px; border-radius: 24px; margin: 0 auto 18px; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); }
.cta h2 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 38px); text-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.cta p { margin: 0 0 24px; text-shadow: 0 2px 6px rgba(0, 0, 0, .4); }

/* ---------- Document pages ---------- */
.page-hero {
  color: #fff; padding: 56px 0 48px; text-align: center;
  background: linear-gradient(180deg, rgba(11, 60, 70, .45), rgba(11, 60, 70, .65)), url("img/zemin.jpg") 0 0 / 220px 220px;
}
.page-hero h1 { margin: 0 0 6px; font-size: clamp(34px, 5vw, 46px); text-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
.page-hero p { margin: 0; opacity: .92; }
.doc { padding: 48px 0 80px; }
.doc h2 { font-size: 24px; margin: 38px 0 8px; }
.doc .summary {
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: var(--radius); padding: 20px 22px;
}
.doc .summary strong { color: var(--brand); }
.doc .steps { margin: 34px 0 10px; }

details {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 0 20px; margin-bottom: 12px; box-shadow: var(--shadow);
}
details summary { cursor: pointer; font-weight: 700; padding: 17px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--brand); font-size: 24px; line-height: 1; transition: transform .2s ease; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: 0 0 18px; color: var(--muted); }

.contact {
  margin-top: 44px; text-align: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 34px 24px; box-shadow: var(--shadow);
}
.contact h2 { margin-top: 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 30px 0 44px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.site-footer .brand { font-size: 16px; }
.site-footer .brand img { width: 28px; height: 28px; border-radius: 7px; }
.site-footer nav { display: flex; gap: 18px; }
.site-footer a { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-logo { margin: 0 auto 12px; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .hero-meta { justify-content: center; }
  .device { transform: none; max-width: 640px; margin: 8px auto 0; }
  .worlds { grid-template-columns: repeat(2, 1fr); }
  .worlds.three { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .route { gap: 8px; }
  .route li + li { margin-left: 0; }
  .route li + li::before { display: none; }
  .dede { grid-template-columns: 160px 1fr; gap: 24px; padding: 24px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .daily { grid-template-columns: auto 1fr; }
  .daily .streak { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav a.hide-sm { display: none; }
  .nav { gap: 16px; }
  .site-header .brand span { display: none; }
  section { padding: 64px 0; }
  .steps, .features { grid-template-columns: 1fr; }
  .steps { gap: 30px; }
  .stats .wrap { grid-template-columns: repeat(2, 1fr); row-gap: 18px; }
  .daily { grid-template-columns: 1fr; text-align: center; padding: 28px 22px; }
  .daily .cal { margin: 0 auto; }
  .dede { grid-template-columns: 1fr; text-align: center; }
  .dede img { width: 160px; margin: 0 auto; }
  .dede .eyebrow { text-align: center; }
  .dede ul { text-align: left; }
  .daily .streak { justify-self: center; }
  .device { padding: 8px; border-radius: 24px; }
  .device img { border-radius: 17px; }
  .train img { height: 46px; } .train .loco { height: 50px; }
  .train .w::after { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .train { animation: none; left: 50%; transform: translateX(-50%); }
  .world img, .store-badge { transition: none; }
  html { scroll-behavior: auto; }
}
