/*
 * tezzvo.com — shared stylesheet. No build step; hand-authored.
 * Palette + type are the "Night Desk" tokens from the Topper10 app
 * (src/theme/tokens.ts, ADR 0009). A prefers-color-scheme:light block maps
 * the same roles onto "Day Desk" so the site is readable in bright light.
 */

:root {
  /* Night Desk — the default */
  --ground: #0a0e1a;
  --surface: #141a2c;
  --raised: #1e2740;
  --line: #2c3654;
  --ink: #f4f6fc;
  --body: #c9d1e6;
  --muted: #98a3c2;
  --indigo: #6c7cff;
  --indigo-hi: #8a97ff;
  --indigo-lo: #5c6cf5;
  --gold: #ffc85c;
  --focus: #8a97ff;
  --on-accent: #0a0e1a;

  --maxw: 68rem;
  --measure: 68ch;
  --pad: clamp(1.25rem, 5vw, 2.75rem);
  --gap: clamp(3.5rem, 9vw, 6.5rem);

  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body:
    system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:
    ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    /* Day Desk */
    --ground: #f6f2e9;
    --surface: #ffffff;
    --raised: #fbf7ec;
    --line: #e4dcc8;
    --ink: #1a2238;
    --body: #3b4260;
    --muted: #5c6684;
    --indigo: #4453d8;
    --indigo-hi: #4453d8;
    --indigo-lo: #3a48c0;
    --gold: #b4801b;
    --focus: #4453d8;
    --on-accent: #ffffff;
    color-scheme: light;
  }
}

/* Space Grotesk — self-hosted from the copy bundled with the app
   (@expo-google-fonts/space-grotesk, OFL). No CDN, no network dependency. */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("space-grotesk-500.ttf") format("truetype");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("space-grotesk-700.ttf") format("truetype");
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Themed browser surfaces */
::selection {
  background: color-mix(in srgb, var(--indigo) 38%, transparent);
  color: var(--ink);
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 3px;
}
* {
  scrollbar-color: var(--line) transparent;
}

a {
  color: var(--ink);
  text-decoration-color: color-mix(in srgb, var(--indigo) 60%, transparent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-color: var(--indigo);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}

p {
  margin: 0 0 1.1em;
  max-width: var(--measure);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

img,
svg {
  max-width: 100%;
}

/* ---- Layout primitives ---- */

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.section {
  padding-block: var(--gap);
  border-top: 1px solid var(--line);
}

.section__title {
  font-size: clamp(1.4rem, 3.4vw, 2rem);
  margin-bottom: 1.75rem;
}

/* ---- Site header ---- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.masthead__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.16em;
  color: var(--ink);
  text-decoration: none;
}
.brand__crumb {
  color: var(--muted);
  letter-spacing: 0.16em;
}
.brand__mark {
  display: block;
  width: 20px;
  height: 20px;
  flex: none;
}
.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 3vw, 1.9rem);
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding-block: 0.35rem;
  border-bottom: 2px solid transparent;
}
.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--gold);
}
@media (max-width: 30rem) {
  .masthead__row {
    gap: 0.75rem;
  }
  .brand {
    font-size: 0.95rem;
    letter-spacing: 0.1em;
  }
  .brand__crumb {
    display: none;
  }
  .nav {
    gap: 0.85rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
  }
}

/* ---- Hero ---- */

.hero {
  padding-block: clamp(4rem, 12vw, 8rem) var(--gap);
  position: relative;
  overflow: hidden;
}
.hero__grid {
  display: grid;
  gap: clamp(2rem, 6vw, 4rem);
  grid-template-columns: 1fr;
  align-items: end;
}
@media (min-width: 60rem) {
  .hero__grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  }
}
.hero h1 {
  font-size: clamp(2.6rem, 7.5vw, 4.75rem);
  letter-spacing: -0.03em;
}
.hero__lede {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--body);
  margin-top: 1.5rem;
}
.hero__figure {
  display: none;
}
@media (min-width: 60rem) {
  .hero__figure {
    display: block;
    justify-self: end;
    width: min(19rem, 40vw);
    opacity: 0.92;
  }
}
.hero__figure svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Topper10 monogram above the game-page hero heading */
.hero__figure-inline {
  display: block;
  width: clamp(4.5rem, 12vw, 6.5rem);
  height: auto;
  margin-bottom: 1.5rem;
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.15;
  letter-spacing: 0.01em;
  padding: 0.85rem 1.4rem;
  border-radius: 14px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  transition:
    transform 0.12s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}
@media (prefers-reduced-motion: reduce) {
  .btn {
    transition:
      background-color 0.2s ease,
      border-color 0.2s ease;
  }
}
.btn:active {
  transform: translateY(1px);
}
.btn--primary {
  background: linear-gradient(180deg, var(--indigo-hi), var(--indigo-lo));
  color: var(--on-accent);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--indigo-hi) 60%, transparent)
    inset;
}
.btn--primary:hover {
  background: linear-gradient(180deg, var(--indigo-hi), var(--indigo));
}
.btn--ghost {
  border-color: var(--line);
  color: var(--ink);
}
.btn--ghost:hover {
  border-color: var(--indigo);
}
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  background: var(--raised);
  color: var(--muted);
  border-color: var(--line);
  box-shadow: none;
}
.btn:disabled:active {
  transform: none;
}
.btn__glyph {
  width: 16px;
  height: 16px;
  flex: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.25rem;
  align-items: center;
}
.btn-row .note {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---- Meta strip (facts under the game hero) ---- */

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  margin-top: 2rem;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.facts li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.facts li + li::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
}

/* ---- Games list (publisher page) ---- */

.game-card {
  display: grid;
  gap: clamp(1.25rem, 4vw, 2.25rem);
  grid-template-columns: 1fr;
  align-items: start;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  transition:
    border-color 0.2s ease,
    transform 0.16s ease;
}
@media (prefers-reduced-motion: reduce) {
  .game-card {
    transition: border-color 0.2s ease;
  }
}
.game-card:hover {
  border-color: var(--indigo);
  transform: translateY(-2px);
}
@media (min-width: 44rem) {
  .game-card {
    grid-template-columns: 6.5rem 1fr;
  }
}
.game-card__mark {
  width: 6.5rem;
  height: 6.5rem;
}
.game-card h3 {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}
.game-card__tag {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0.4rem 0 0;
}
.game-card p {
  margin-block: 0.75rem 1.25rem;
}
.game-card p.game-card__tag {
  margin-block: 0.4rem 0;
}
.workshop-note {
  margin-top: 1.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---- Editorial definition list (how it plays) ---- */

.spec {
  display: grid;
  gap: 0;
}
.spec__row {
  display: grid;
  gap: 0.35rem 2.5rem;
  padding-block: 1.6rem;
  border-top: 1px solid var(--line);
  grid-template-columns: 1fr;
}
.spec__row:last-child {
  border-bottom: 1px solid var(--line);
}
@media (min-width: 48rem) {
  .spec__row {
    grid-template-columns: 14rem 1fr;
  }
}
.spec__term {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.spec__def {
  margin: 0;
  max-width: var(--measure);
}

/* ---- Screenshot placeholder slots ---- */

.shots {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.shot {
  aspect-ratio: 9 / 16;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 10px,
    color-mix(in srgb, var(--line) 30%, transparent) 10px,
    color-mix(in srgb, var(--line) 30%, transparent) 11px
  );
  display: grid;
  place-content: center;
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
}

/* ---- FAQ ---- */

.faq {
  border-top: 1px solid var(--line);
}
.faq details {
  border-bottom: 1px solid var(--line);
}
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.4rem 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary .faq__sign {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--indigo);
  transition: transform 0.2s ease;
}
@media (prefers-reduced-motion: reduce) {
  .faq summary .faq__sign {
    transition: none;
  }
}
.faq details[open] summary .faq__sign {
  transform: rotate(45deg);
}
.faq details > div {
  padding-bottom: 1.5rem;
}
.faq details p:last-child {
  margin-bottom: 0;
}

/* ---- Prose (privacy / terms) ---- */

.doc {
  padding-block: var(--gap);
}
.doc__inner {
  max-width: 46rem;
  margin-inline: auto;
}
.doc h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  margin-bottom: 0.75rem;
}
.doc h2 {
  font-size: 1.35rem;
  margin-top: 2.75rem;
  margin-bottom: 0.9rem;
}
.doc h3 {
  font-size: 1.05rem;
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
}
.doc ul,
.doc ol {
  max-width: var(--measure);
  padding-left: 1.25rem;
}
.doc li {
  margin-bottom: 0.5rem;
}
.doc__meta {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin-bottom: 2rem;
}
.doc__table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.doc table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}
.doc th,
.doc td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.doc th {
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.doc tr:last-child td {
  border-bottom: 0;
}
.tbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  padding: 0.05em 0.4em;
  border-radius: 4px;
  white-space: nowrap;
}

.callout {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 1.1rem 1.3rem;
  margin: 1.75rem 0;
  font-size: 0.95rem;
}
.callout strong {
  color: var(--ink);
  font-family: var(--font-display);
}

/* ---- Footer ---- */

.foot {
  border-top: 1px solid var(--line);
  padding-block: 3rem 4rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.foot__row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
}
.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.foot a {
  color: var(--muted);
  text-decoration: none;
}
.foot a:hover {
  color: var(--ink);
}
.foot__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ink);
}

/* ---- Skip link ---- */

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--indigo);
  color: var(--on-accent);
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 0.16s ease;
  z-index: 20;
}
.skip:focus {
  transform: translateY(0);
}

/* ---- Load-in: staggered draw of the studio mark bars ---- */

@media (prefers-reduced-motion: no-preference) {
  .bars-anim .bar {
    transform-origin: left center;
    animation: bar-draw 0.5s cubic-bezier(0.2, 0, 0, 1) both;
  }
  .bars-anim .bar:nth-child(2) {
    animation-delay: 0.06s;
  }
  .bars-anim .bar:nth-child(3) {
    animation-delay: 0.12s;
  }
  .bars-anim .bar:nth-child(4) {
    animation-delay: 0.18s;
  }
  @keyframes bar-draw {
    from {
      transform: scaleX(0);
    }
    to {
      transform: scaleX(1);
    }
  }
}
