/* ═══════════════════════════════════════════
   DINOSOFT GAMES, Stylesheet
   Every colour comes from the logo: the dino's teal (darkened into the ground),
   its cream, and its orange. Square corners everywhere, like the triangle.
   ═══════════════════════════════════════════ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Colour roles */
  --bg:        #0F2329;   /* ground: the dino's teal, taken down to near night */
  --bg-deep:   #0B1B20;   /* one step down: the tools field */
  --surface:   #163039;   /* one step up: studio field, modal */
  --surface-2: #1D3B45;   /* two steps up: hover on panels */
  --ink:       #F1E6D8;   /* text: the logo's cream */
  --muted:     #A3B5B6;   /* secondary text on the ground */
  --accent:    #F47A20;   /* the logo's orange: primary action only */
  --accent-hi: #FF8C38;
  --signal:    #3FB3C9;   /* status and focus: the dino's teal */
  --sun:       #FDBA5A;   /* the logo's light orange, used as a card field */
  --paper-muted: #4A5A5E; /* secondary text on the cream contact field */
  --paper-field: #E6D9C8; /* inputs on the cream field */
  --paper-focus: #FFF8EE;
  --paper-error: #8A2E00;
  --deep-teal:   #24505C; /* the fourth tool card */
  --ember-ink: #C24F00;   /* accent as text on cream (large type only) */

  /* Type: five steps */
  --font: 'TikTok Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --step-small:   0.875rem;                                  /* 14 */
  --step-body:    clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem); /* 17–19 */
  --step-lead:    clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);   /* 20–26 */
  --step-head:    clamp(2rem, 1.3rem + 3.2vw, 4rem);          /* 32–64 */
  --step-display: clamp(2.75rem, 1.2rem + 4.4vw, 4.5rem);     /* 44–72 */

  /* Space */
  --margin:  clamp(16px, 2.2vw, 32px);
  --gutter:  clamp(16px, 1.7vw, 24px);
  --section: clamp(96px, 10vw, 160px);
  --bar-h:   72px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: smooth;
  scrollbar-color: #2C5562 var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  caret-color: var(--accent);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

::selection { background: var(--accent); color: var(--bg); }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }

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

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ── Layout ──────────────────────────────── */

.wrap {
  padding-left: var(--margin);
  padding-right: var(--margin);
}

h1, h2, h3 {
  font-weight: 800;
  line-height: 1;
  text-wrap: balance;
}

h2 {
  font-size: var(--step-head);
  font-stretch: 125%;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}

/* ── Buttons ─────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 26px;
  background: var(--accent);
  color: var(--bg);
  font-size: var(--step-body);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.btn:hover  { background: var(--accent-hi); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: progress; }

.btn--ink { background: var(--bg); color: var(--ink); }
.btn--ink:hover { background: var(--surface-2); }

.btn--quiet { background: var(--ink); color: var(--bg); }
.btn--quiet:hover { background: var(--paper-focus); }

/* ── Bar (navigation) ────────────────────── */

.bar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 20;
  height: var(--bar-h);
}

.bar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--margin);
}

.bar__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: var(--step-body);
  font-weight: 800;
  font-stretch: 125%;
  text-transform: uppercase;
  text-decoration: none;
}
.bar__mark { width: 40px; height: auto; }

.bar__nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.bar__link {
  font-size: var(--step-body);
  font-weight: 500;
  padding: 6px 0;
  text-decoration: underline 2px transparent;
  text-underline-offset: 6px;
  transition: text-decoration-color 180ms;
}
.bar__link:hover { text-decoration-color: currentColor; }

.lang-toggle { display: inline-flex; gap: 2px; margin-left: 4px; }
.lang-btn {
  min-width: 40px;
  min-height: 36px;
  font-size: var(--step-small);
  font-weight: 600;
  color: var(--muted);
  transition: color 160ms, background-color 160ms;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn[aria-pressed="true"] { color: var(--bg); background: var(--ink); }

.bar__menu { display: none; font-size: var(--step-body); font-weight: 600; min-height: 44px; padding: 0 4px; }

/* ── Hero ────────────────────────────────── */

/* Default (no script, or reduced motion): the logo, then the picture below it. */
.hero { position: relative; }

.hero__stage { position: relative; }

.hero__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 100svh;
  padding: var(--bar-h) var(--margin) 48px;
  text-align: center;
}
.hero__logo { width: min(340px, 56vw); height: auto; }
.hero__title {
  font-size: var(--step-display);
  font-stretch: 150%;
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.hero__lede { font-size: var(--step-lead); color: var(--muted); }

.hero__window { position: relative; }
.hero__img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

/* Scroll-driven version: the logo fades while a triangle (the logo's) opens
   onto the picture. main.js writes the clip-path and the progress variables. */
.hero.is-live { height: 200svh; }
.hero.is-live .hero__stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.hero.is-live .hero__window { position: absolute; inset: 0; opacity: var(--reveal, 0); will-change: clip-path; }
.hero.is-live .hero__img { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
.hero.is-live .hero__text {
  position: absolute;
  inset: 0;
  z-index: 2;
  min-height: 0;
  pointer-events: none;
  opacity: clamp(0, calc(1 - var(--p, 0) * 3.2), 1);
  transform: scale(calc(1 - var(--p, 0) * 0.12));
}

/* ── Key art ─────────────────────────────── */

.game { padding: var(--section) 0; }
.game__title { font-size: var(--step-head); margin-bottom: clamp(32px, 4vw, 56px); }
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 460px));
  gap: var(--gutter);
}
.game-card { display: flex; flex-direction: column; gap: 14px; }
.game-card__cover { width: 100%; aspect-ratio: 1232 / 706; object-fit: cover; }
.game-card__title { font-size: var(--step-lead); font-weight: 700; line-height: 1.1; margin-top: 6px; }
.game-card__desc { line-height: 1.45; flex: 1; }
.game-card__btn { width: 100%; }

/* ── Studio ──────────────────────────────── */

.studio { padding: var(--section) 0; background: var(--surface); }

.studio__row {
  display: grid;
  grid-template-columns: minmax(0, 34fr) minmax(0, 56fr) minmax(0, 10fr);
  gap: var(--gutter);
}
.studio__row--record { margin-top: 120px; align-items: baseline; }

.studio__facts h2 {
  font-size: var(--step-lead);
  font-stretch: 125%;
  margin-bottom: 28px;
}
.studio__facts dl { display: grid; gap: 20px; max-width: 240px; }
.studio__facts dt { font-size: var(--step-small); color: var(--muted); }
.studio__facts dd { font-weight: 500; }

.studio__statement {
  font-size: var(--step-lead);
  line-height: 1.35;
  max-width: 44ch;
}

.studio__word {
  font-size: var(--step-small);
  font-weight: 600;
  color: var(--muted);
}
.studio__list { display: grid; gap: 10px; max-width: 584px; }
.studio__list li {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}
.studio__list span:last-child { color: var(--muted); }
.studio__list button { text-align: left; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.studio__list button:hover { color: var(--accent-hi); }

/* ── FAQ (question index, one answer) ────── */

.faq { padding: var(--section) 0; }

.faq__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 1fr) minmax(0, 6fr);
}
.faq__list { grid-column: 1; }
.faq__pane { grid-column: 3; }

.faq__heading {
  font-size: var(--step-body);
  font-stretch: 100%;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  margin-bottom: 18px;
}
.faq-item + .faq-item { margin-top: 6px; }

.faq-q {
  display: flex;
  align-items: baseline;
  gap: 14px;
  width: 100%;
  min-height: 44px;
  padding: 8px 0;
  text-align: left;
  color: var(--muted);
  transition: color 150ms;
}
.faq-dot {
  flex: none;
  width: 8px; height: 8px;
  background: currentColor;
  transform: translateY(-2px);
}
.faq-q:hover, .faq-item.is-active .faq-q { color: var(--ink); }
.faq-item.is-active .faq-dot { background: var(--accent); }

.faq-a { display: none; }
.faq-a p { padding: 4px 0 16px 22px; }

.faq__pane p {
  position: sticky;
  top: 120px;
  font-size: var(--step-lead);
  line-height: 1.3;
  max-width: 30ch;
  transition: opacity 150ms linear;
}
.faq__pane p.is-swapping { opacity: 0; }

/* ── Contact (inverse field) ─────────────── */

.contact {
  padding: clamp(64px, 9vw, 120px) 0;
  background: var(--ink);
  color: var(--bg);
}
.contact ::selection { background: var(--bg); color: var(--ink); }

.contact__top {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 1fr) minmax(0, 6fr);
}
.contact__heading {
  grid-column: 1;
  font-size: var(--step-lead);
  font-weight: 500;
  font-stretch: 100%;
  line-height: 1.3;
  text-transform: none;
  letter-spacing: 0;
  max-width: 24ch;
}
.contact__form-col { grid-column: 3; }

.contact-form { display: grid; gap: 12px; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  font: inherit;
  font-size: var(--step-body);
  color: var(--bg);
  background: var(--paper-field);
  border: 2px solid transparent;
  border-radius: 0;
  transition: border-color 150ms, background-color 150ms;
}
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form ::placeholder { color: var(--paper-muted); opacity: 1; }
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--bg); background: var(--paper-focus); }
.contact-form [aria-invalid="true"] { border-color: var(--ember-ink); }
.contact-form .btn { justify-self: start; margin-top: 8px; }

.form-note { font-weight: 500; }
.form-note--error { color: var(--paper-error); margin-top: 16px; }
.form-note a { font-weight: 700; }


/* ── Footer (one quiet line) ─────────────── */

.footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: var(--gutter);
  padding: 30svh var(--margin) 30px;
  font-size: var(--step-small);
  color: var(--muted);
}
.footer__links { display: flex; gap: 24px; }
.footer__links a, .footer__legal a { color: var(--ink); text-decoration: none; }
.footer__links a:hover, .footer__legal a:hover { text-decoration: underline; }
.footer__legal { justify-self: end; display: flex; gap: 24px; }

/* ── Modal ───────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--margin);
  background: rgba(6, 14, 17, 0.86);
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms linear, visibility 0s 220ms;
}
.modal-overlay.open { opacity: 1; visibility: visible; transition: opacity 220ms linear; }

.modal {
  position: relative;
  width: min(1040px, 100%);
  max-height: calc(100svh - var(--margin) * 2);
  overflow-y: auto;
  background: var(--surface);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45); /* taste-skill-ignore: dialog floats */
  transform: translateY(16px);
  transition: transform 320ms var(--ease-out);
}
.modal-overlay.open .modal { transform: none; }

.modal__close {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 3;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--bg);
}
.modal__close:hover { color: var(--accent-hi); }

.modal__content { padding: clamp(24px, 4vw, 48px); }

.modal__title {
  font-size: var(--step-head);
  max-width: 18ch;
  margin: 0 56px 12px 0;
}
.modal__tagline { font-size: var(--step-lead); line-height: 1.3; color: var(--muted); margin-bottom: 28px; }
.modal__description { line-height: 1.55; max-width: 68ch; margin: 28px 0; }
.modal__stores-label { font-size: var(--step-small); font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.modal__stores { display: flex; flex-wrap: wrap; gap: 12px; }
.modal__soon { font-weight: 500; padding: 16px 20px; background: var(--bg); display: inline-block; }

/* Gallery */
.gallery { position: relative; background: var(--bg); }
.gallery__slides { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.gallery__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 260ms linear;
}
.gallery__slide.active { opacity: 1; }
.gallery__slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery__placeholder { width: 100%; height: 100%; background: var(--surface-2); }

.gallery__arrow {
  position: absolute;
  top: 50%;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  transform: translateY(-50%);
  background: var(--bg);
  color: var(--ink);
}
.gallery__arrow:hover { color: var(--accent-hi); }
.gallery__arrow--prev { left: 0; }
.gallery__arrow--next { right: 0; }

.gallery__dots { display: flex; gap: 6px; padding-top: 12px; background: var(--surface); }
.gallery__dot { flex: 1; height: 28px; position: relative; }
.gallery__dot::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 12px;
  height: 4px;
  background: var(--surface-2);
  transition: background-color 160ms;
}
.gallery__dot:hover::after { background: var(--muted); }
.gallery__dot.active::after { background: var(--accent); }

/* ── Reveal (entrances) ──────────────────── */

.js .reveal > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 500ms linear, transform 700ms var(--ease-out);
}
.js .reveal.is-in > * { opacity: 1; transform: none; }
.js .reveal.is-in > :nth-child(2) { transition-delay: 80ms; }
.js .reveal.is-in > :nth-child(3) { transition-delay: 160ms; }

/* ── Tablet and phone ────────────────────── */

@media (max-width: 899px) {
  h2 { font-stretch: 112%; }

  .game__grid,
  .mop__grid,
  .faq__grid,
  .contact__top { grid-template-columns: minmax(0, 1fr); }
  .faq__list, .faq__pane, .contact__heading, .contact__form-col { grid-column: 1; }
  .contact__form-col { margin-top: 32px; }
  .studio__row { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .studio__statement { order: -1; }
  .studio__row--record { margin-top: 64px; gap: 16px; }
  .faq__pane { display: none; }
  .faq-item.is-active .faq-a { display: block; }

  /* Hero: name, then what it is, then the picture, then the action */
  .hero__text {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr auto auto auto;
    grid-template-areas: "." "title" "lede" "cta";
  }
  .hero__title { margin-bottom: 16px; }
  .hero__lede { font-size: max(1.125rem, var(--step-body)); }
  .hero__cta { justify-self: stretch; }
  .hero.is-live .hero__text {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas: "title" "lede" "." "cta";
    padding: calc(var(--bar-h) + 8px) var(--margin) 24px;
  }
  .hero.is-live .hero__lede { align-self: start; margin-bottom: 0; }
}

@media (max-width: 759px) {
  :root { --bar-h: 64px; }
  .bar__menu { display: block; }
  .bar__nav {
    position: absolute;
    top: var(--bar-h);
    left: 0; right: 0;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px var(--margin) 20px;
    background: var(--bg);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35); /* taste-skill-ignore: open menu floats */
  }
  .bar__nav.open { display: flex; }
  .bar__link { font-size: var(--step-lead); padding: 8px 0; }
  .lang-toggle { margin: 8px 0 0; }

  h2 { font-stretch: 100%; }
  .game__title { font-stretch: 85%; }
  .hero__title { font-size: 11vw; }

  .footer {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 20svh var(--margin) 24px;
  }
  .footer__links { flex-wrap: wrap; }
  .footer__legal { justify-self: start; }
}

/* ── Reduced motion ──────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
  .js .reveal > * { opacity: 1; transform: none; }
}
