/* ==========================================================================
   Downhill Supreme — site styles
   Palette taken from the game: sky blue, snowy greys, low-poly greens,
   chunky black-outlined wood and lime-green lettering.
   ========================================================================== */

:root {
  --sky-1: #2aa9f0;
  --sky-2: #59cffd;
  --sky-pale: #e3f5ff;
  --grass-1: #6aa11f;
  --grass-2: #4d7a10;
  --grass-3: #3c600c;
  --lime: #a6f907;
  --lime-2: #7cc614;
  --lime-3: #4f8a07;
  --wood: #6b4a2f;
  --wood-light: #87613f;
  --wood-dark: #4a3220;
  --ink: #1d130c;
  --red: #ef1f52;
  --red-dark: #a3123a;
  --text: #2c2219;
  --text-soft: #5a4a3c;
  --paper: #fbf6ec;

  --font-display: "Luckiest Guy", "Mouse Memoirs", Impact, system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 14px;
  --outline: 3px solid var(--ink);
  --shadow: 0 6px 0 var(--ink);
  --max: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }

.sr-only, .hp {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--lime); color: var(--ink); padding: 8px 14px; border: var(--outline); border-radius: 8px; font-weight: 800; }
.skip:focus { left: 8px; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

.container { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.container--narrow { width: min(100% - 2 * var(--gutter), 860px); }

/* ---------- Shared: wood texture ---------- */
.wood, .nav__plank, .sign__title, .btn--wood, .feature, .board, .footer {
  background-color: var(--wood);
  background-image:
    repeating-linear-gradient(176deg, rgba(255,255,255,.035) 0 2px, transparent 2px 14px),
    repeating-linear-gradient(183deg, rgba(0,0,0,.08) 0 1px, transparent 1px 22px),
    linear-gradient(180deg, var(--wood-light), var(--wood) 30%, var(--wood-dark));
}

/* ---------- Display text with chunky outline ---------- */
.display, .sign__title, .hero__title, .feature h3, .stats b, .btn {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: .02em;
  paint-order: stroke fill;
}

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--lime-2);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 52px; padding: .55em 1.4em .4em;
  font-size: 1.35rem; line-height: 1; color: #fff; text-decoration: none;
  -webkit-text-stroke: 5px var(--ink);
  border: var(--outline); border-radius: 999px; cursor: pointer;
  box-shadow: 0 5px 0 var(--ink), inset 0 -6px 0 rgba(0,0,0,.18), inset 0 4px 0 rgba(255,255,255,.35);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 7px 0 var(--ink), inset 0 -6px 0 rgba(0,0,0,.18), inset 0 4px 0 rgba(255,255,255,.35); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink), inset 0 -3px 0 rgba(0,0,0,.18); }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }
.btn--green { background: linear-gradient(180deg, #c3ff3c, var(--lime-2) 55%, var(--lime-3)); }
.btn--wood { color: var(--lime); }
.btn--sm { white-space: nowrap; min-height: 42px; font-size: 1.15rem; padding: .5em 1.1em .35em; }
.btn--icon { width: 52px; min-height: 52px; padding: 0; flex: none; }
.btn--icon svg { width: 26px; height: 26px; -webkit-text-stroke: 0; }

/* ---------- Navigation plank ---------- */
.nav { position: sticky; top: 0; z-index: 50; }
.nav__plank {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px max(var(--gutter), calc((100% - var(--max)) / 2));
  border-bottom: var(--outline);
  box-shadow: 0 5px 0 rgba(0,0,0,.25);
}
/* The brand box keeps the plank's height; the larger logo hangs over its bottom edge like a sign. */
.nav__brand { position: relative; display: block; flex: none; width: 270px; height: 52px; }
.nav__brand img {
  position: absolute; left: 0; top: -8px; width: 270px; max-width: none;
  filter: drop-shadow(0 4px 0 rgba(0,0,0,.3));
  transition: transform .15s ease;
}
.nav__brand:hover img { transform: rotate(-2deg) scale(1.03); }
.nav__menu { display: flex; align-items: center; gap: clamp(6px, 1.6vw, 22px); }
.nav__menu a:not(.btn) {
  font-family: var(--font-display); font-size: 1.45rem; letter-spacing: .03em; color: #fff; text-decoration: none;
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; padding: 6px 8px 2px;
  transition: color .15s;
}
.nav__menu a:not(.btn):hover, .nav__menu a.is-active { color: var(--lime); }
.nav__toggle { display: none; }

@media (max-width: 920px) {
  .nav__brand { width: 170px; height: 46px; }
  .nav__brand img { width: 170px; top: -4px; }
  .nav__toggle {
    display: grid; place-content: center; gap: 5px; width: 50px; height: 46px;
    background: var(--lime-2); border: var(--outline); border-radius: 12px; box-shadow: 0 4px 0 var(--ink); cursor: pointer;
  }
  .nav__toggle span { display: block; width: 24px; height: 4px; border-radius: 3px; background: var(--ink); transition: transform .2s, opacity .2s; }
  .nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
  .nav__menu {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--wood-dark); border-bottom: var(--outline);
    padding: 8px var(--gutter) 18px;
    transform-origin: top; transform: scaleY(0); opacity: 0; visibility: hidden;
    transition: transform .2s ease, opacity .2s ease, visibility .2s;
  }
  .nav__menu.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav__menu a:not(.btn) { padding: 12px 4px 8px; border-bottom: 2px dashed rgba(255,255,255,.12); font-size: 1.6rem; }
  .nav__menu .btn { margin-top: 14px; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; padding: clamp(36px, 7vw, 90px) 0 140px; min-height: min(86vh, 760px); display: flex; align-items: center; }
.hero__scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.clouds { animation: drift 60s linear infinite alternate; }
@keyframes drift { to { transform: translateX(60px); } }

.hero__inner {
  width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto;
  display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: clamp(24px, 5vw, 64px);
}
.hero__head { display: flex; align-items: center; gap: clamp(14px, 2.5vw, 24px); margin-bottom: clamp(14px, 2.5vw, 22px); }
.hero__icon {
  flex: none; width: clamp(84px, 11vw, 132px); aspect-ratio: 1; border-radius: 22%;
  border: var(--outline); box-shadow: 0 6px 0 var(--ink);
  transform: rotate(-4deg); transition: transform .2s ease;
}
.hero__icon:hover { transform: rotate(0) scale(1.04); }
.hero__title {
  margin: 0; font-size: clamp(2.5rem, 5.6vw, 4.4rem); line-height: .95; white-space: nowrap; color: #fff;
  -webkit-text-stroke: clamp(8px, 1.4vw, 12px) var(--ink);
  text-shadow: 0 6px 0 var(--ink);
}
.hero__title span { color: var(--lime); }
.hero__lead {
  margin: 0 0 1.5em; max-width: 34ch; font-weight: 700; font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: #10324a;
  background: rgba(255,255,255,.75); border: var(--outline); border-radius: var(--radius); padding: .8em 1em; box-shadow: 0 4px 0 rgba(0,0,0,.25);
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.appstore {
  display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 20px 8px 16px;
  background: #000; color: #fff; text-decoration: none; border-radius: 14px; border: 3px solid #000;
  box-shadow: 0 5px 0 rgba(0,0,0,.35); transition: transform .12s;
}
.appstore:hover { transform: translateY(-2px); }
.appstore svg { width: 28px; height: 28px; }
.appstore span { display: flex; flex-direction: column; font-weight: 800; font-size: 1.35rem; line-height: 1.05; letter-spacing: -.01em; }
.appstore small { font-size: .68rem; font-weight: 700; letter-spacing: .02em; }

.hero__media { display: flex; flex-direction: column; align-items: center; gap: clamp(22px, 3vw, 32px); }
.hero__shot { margin: 0; width: 100%; transform: rotate(2deg); }

/* framed screenshots (like the game's wooden photo frames) */
.frame {
  position: relative; display: block; padding: 12px; border-radius: 18px;
  background: linear-gradient(180deg, var(--wood-light), var(--wood-dark));
  border: var(--outline); box-shadow: var(--shadow);
}
.frame img { border: 3px solid var(--ink); border-radius: 8px; width: 100%; aspect-ratio: 2000 / 923; object-fit: cover; }

/* fence + boardwalk at bottom of hero: the game's original handrail tile, repeated sideways */
.fence {
  position: absolute; left: 0; right: 0; bottom: 0; height: 115px; pointer-events: none;
  background: url("../assets/img/handrail.png") left bottom / auto 115px repeat-x;
}

@media (max-width: 860px) {
  .hero { padding-bottom: 145px; min-height: 0; }
  .hero__inner { grid-template-columns: 1fr; text-align: left; }
  .hero__shot { transform: rotate(1.2deg); max-width: 560px; }
}

/* ---------- Sections ---------- */
.section { position: relative; padding: clamp(56px, 9vw, 104px) 0; }
#about, #media { background: linear-gradient(180deg, var(--sky-pale), #f4fbff); }
.section--grass {
  background:
    radial-gradient(1200px 260px at 50% 0, rgba(255,255,255,.12), transparent 70%),
    linear-gradient(180deg, var(--grass-1), var(--grass-2) 60%, var(--grass-3));
  border-top: var(--outline); border-bottom: var(--outline);
}
.section--dirt {
  background:
    repeating-linear-gradient(135deg, rgba(0,0,0,.05) 0 10px, transparent 10px 24px),
    linear-gradient(180deg, #8a6b4b, #6d5038);
  border-top: var(--outline);
}

/* hanging wooden sign for section titles */
.sign { display: flex; justify-content: center; margin-bottom: clamp(28px, 5vw, 48px); }
.sign__title {
  position: relative; margin: 0; padding: .45em 1.2em .3em;
  font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1; color: var(--lime); text-align: center;
  -webkit-text-stroke: 7px var(--ink);
  border: var(--outline); border-radius: 10px 14px 10px 12px; box-shadow: var(--shadow);
  transform: rotate(-1.2deg);
}
.sign__title::before, .sign__title::after { /* nails */
  content: ""; position: absolute; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #c8c8c8, #5c5c5c); border: 2px solid var(--ink);
}
.sign__title::before { left: 12px; } .sign__title::after { right: 12px; }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(24px, 5vw, 56px); align-items: center; }
.about__text { margin: 0; font-size: clamp(1.1rem, 1.8vw, 1.3rem); font-weight: 600; color: var(--text); }
.about__text strong { display: block; margin-top: .5em; font-size: 1.3em; line-height: 1.25; font-weight: 800; color: var(--red); }
.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.stats__new { position: relative; }
.stats__new::after { /* little "NEW" sticker */
  content: "New!"; position: absolute; top: -12px; right: -8px; padding: 4px 10px 2px;
  font: 400 .95rem/1 var(--font-display); color: #fff; letter-spacing: .03em;
  background: var(--red); border: 3px solid var(--ink); border-radius: 999px; transform: rotate(8deg);
  box-shadow: 0 3px 0 var(--ink);
}
.stats li {
  display: flex; flex-direction: column; align-items: center; text-align: center; padding: 16px 8px 12px;
  background: #fff; border: var(--outline); border-radius: var(--radius); box-shadow: var(--shadow);
}
.stats b { font-size: clamp(2.4rem, 5vw, 3.2rem); line-height: 1; color: var(--lime); -webkit-text-stroke: 7px var(--ink); }
.stats span { font-weight: 800; font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); margin-top: 4px; }
@media (max-width: 760px) { .about__grid { grid-template-columns: 1fr; } }

/* ---------- Features ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: clamp(18px, 3vw, 28px); }
.feature {
  position: relative; padding: 26px 24px 24px; color: #f5ead9;
  border: var(--outline); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .18s ease;
}
.feature:hover { transform: translateY(-4px) rotate(-.4deg); }
.feature__icon {
  width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 14px;
  background: linear-gradient(180deg, #c3ff3c, var(--lime-2) 60%, var(--lime-3));
  border: var(--outline); border-radius: 50%; box-shadow: 0 4px 0 var(--ink), inset 0 3px 0 rgba(255,255,255,.4);
}
.feature__icon svg { width: 34px; height: 34px; fill: none; stroke: var(--ink); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { margin: 0 0 .3em; font-size: 1.6rem; line-height: 1.1; color: var(--lime); -webkit-text-stroke: 5px var(--ink); }
.feature p { margin: 0; font-weight: 600; }
.feature--wide {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: auto 1fr; gap: 6px 24px; align-items: start;
  padding: clamp(24px, 4vw, 36px);
}
.feature--wide:hover { transform: translateY(-4px); }
.feature--wide .feature__icon { width: 84px; height: 84px; margin: 0; }
.feature--wide .feature__icon svg { width: 44px; height: 44px; }
.feature--wide h3 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.feature--wide p { max-width: 70ch; }
.perks { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.perks li {
  padding: 12px 14px; font-weight: 600; font-size: .98rem; line-height: 1.45;
  background: rgba(0,0,0,.22); border: 2px solid rgba(0,0,0,.35); border-radius: 12px;
}
.perks b { display: block; color: var(--lime); font-weight: 800; }
@media (max-width: 560px) {
  .feature--wide { grid-template-columns: 1fr; }
  .feature--wide .feature__icon { width: 64px; height: 64px; margin-bottom: 8px; }
  .feature--wide .feature__icon svg { width: 34px; height: 34px; }
}
.note {
  margin: clamp(28px, 4vw, 40px) auto 0; max-width: 640px; text-align: center; font-weight: 800; color: #fff;
  background: rgba(0,0,0,.22); border: 2px dashed rgba(255,255,255,.45); border-radius: 999px; padding: .6em 1.2em;
}

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: clamp(16px, 2.5vw, 26px); }
.frame--thumb { padding: 8px; transition: transform .18s ease; }
.frame--thumb:nth-child(3n+1) { transform: rotate(-1deg); }
.frame--thumb:nth-child(3n+2) { transform: rotate(.8deg); }
.frame--thumb:hover, .frame--thumb:focus-visible { transform: scale(1.03) rotate(0); z-index: 1; }

/* ---------- Lightbox ---------- */
.lightbox { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100%; height: 100%; }
.lightbox::backdrop { background: rgba(10, 20, 30, .85); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: min(94vw, 1136px); max-height: 86vh; width: auto; border: 4px solid var(--ink); border-radius: 12px; box-shadow: 0 8px 0 var(--ink); }
.lightbox__btn {
  position: fixed; width: 52px; height: 52px; display: grid; place-items: center; padding: 0 0 4px;
  font: 400 2.2rem/1 var(--font-display); color: var(--ink); cursor: pointer;
  background: linear-gradient(180deg, #c3ff3c, var(--lime-2)); border: var(--outline); border-radius: 50%; box-shadow: 0 4px 0 var(--ink);
}
.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 12px; top: 50%; transform: translateY(-50%); }

/* ---------- Contact form ---------- */
.board {
  position: relative; padding: clamp(18px, 4vw, 36px); color: #fff;
  border: var(--outline); border-radius: 18px; box-shadow: 0 8px 0 var(--ink);
}
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 24px; padding: 6px; border: var(--outline); border-radius: 999px; background: rgba(0,0,0,.3); }
.tab { position: relative; cursor: pointer; }
.tab input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tab span {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 48px; padding: .4em .6em .2em;
  font-family: var(--font-display); font-size: clamp(1rem, 2.6vw, 1.35rem); line-height: 1.05; color: #e9dcc9;
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; border-radius: 999px; border: 3px solid transparent; transition: background .15s, color .15s;
}
.tab:hover span { color: #fff; }
.tab input:checked + span { color: #fff; background: linear-gradient(180deg, #c3ff3c, var(--lime-2) 55%, var(--lime-3)); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.tab input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 2px; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label { font-weight: 800; font-size: .95rem; letter-spacing: .03em; text-transform: uppercase; color: #f6ead6; }
.field input, .field textarea {
  width: 100%; font: 600 1rem/1.4 var(--font-body); color: var(--text);
  background: var(--paper); border: var(--outline); border-radius: 12px; padding: 12px 14px;
  box-shadow: inset 0 3px 0 rgba(0,0,0,.1);
  transition: box-shadow .15s, border-color .15s;
}
.field textarea { resize: vertical; min-height: 150px; }
.field input:focus, .field textarea:focus { outline: none; box-shadow: 0 0 0 4px var(--lime), inset 0 3px 0 rgba(0,0,0,.1); }
.field.has-error input, .field.has-error textarea { border-color: var(--red); box-shadow: 0 0 0 4px rgba(239,31,82,.55); }
.field__error { font-size: .88rem; font-weight: 800; color: #ffd0dc; }

.captcha__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.captcha__img { width: 180px; height: 60px; background: var(--paper); border: var(--outline); border-radius: 12px; }
.captcha__row input { flex: 1 1 140px; width: 100%; min-width: 0; font-family: var(--font-display); font-size: 1.5rem; letter-spacing: .2em; text-transform: uppercase; padding-top: 14px; }

.form__footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 26px; }
.form__status { margin: 0; flex: 1 1 240px; font-weight: 800; min-height: 1.6em; }
.form__status.is-error { color: #ffd0dc; }
.form__status.is-ok {
  color: var(--ink); background: var(--lime); border: var(--outline); border-radius: 12px; padding: .5em .9em; box-shadow: 0 4px 0 var(--ink);
}

@media (max-width: 640px) {
  .fields { grid-template-columns: 1fr; }
  .form__footer .btn { width: 100%; }
}

/* ---------- Footer ---------- */
.footer { color: #f5ead9; border-top: var(--outline); padding: 36px 0 28px; text-align: center; }
.footer__inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.footer__logo { width: 170px; }
.footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; }
.footer__links a {
  font-family: var(--font-display); font-size: 1.25rem; color: #fff; text-decoration: none;
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill;
}
.footer__links a:hover { color: var(--lime); }
.footer__copy { margin: 0; font-size: .85rem; font-weight: 700; opacity: .85; }

/* ---------- Terms page ---------- */
.page { padding: clamp(40px, 7vw, 80px) 0; background: linear-gradient(180deg, var(--sky-pale), #f4fbff); }
.legal {
  background: #fff; border: var(--outline); border-radius: 18px; box-shadow: var(--shadow);
  padding: clamp(20px, 5vw, 48px); font-size: 1rem; color: var(--text);
}
.legal h2 { font-family: var(--font-display); font-weight: 400; color: var(--lime-3); font-size: 1.5rem; margin: 1.6em 0 .4em; letter-spacing: .02em; }
.legal h2:first-child { margin-top: 0; }
.legal p { margin: 0 0 1em; }
