/* Daysaga website. One stylesheet, no build step, no JavaScript, no external requests.
   Look: cream parchment, space instead of plates, restrained gold hairlines, large Alegreya headlines,
   the game's real art framed by space. Dark mode is warm and follows the system setting. */

@font-face { font-family: "Alegreya"; src: url("../fonts/alegreya-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("../fonts/alegreya-800.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: light dark;
  --bg: #F6EEDC;            /* cream parchment ground */
  --bg-soft: #EFE4CB;       /* a quiet step down, for the phone stage and table heads */
  --ink: #2A1B0F;
  --ink-muted: #5F4D3A;     /* 6.6 : 1 on the ground */
  --gold: #B8862F;          /* hairlines and small marks only */
  --gold-text: #7E500D;     /* gold as text, 5.9 : 1 on the ground */
  --hair: rgba(126, 80, 13, 0.24);
  --hair-strong: rgba(126, 80, 13, 0.42);
  --link: #3C5F2C;          /* 6.4 : 1 on the ground */
  --seal: #9C3326;
  --on-scene: #FFF6E3;
  --panel: #22160C;         /* the one accent panel (Premium) */
  --panel-ink: #F6EAD2;
  --panel-muted: #D3BF9D;
  --panel-gold: #E2B65A;
  --panel-hair: rgba(226, 182, 90, 0.34);
  --phone: #1B130C;
  --shadow: 0 30px 60px -28px rgba(74, 46, 22, 0.42);
  --wrap: 1120px;
  --gutter: 20px;
  --space: clamp(88px, 12vw, 168px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #19110B;
    --bg-soft: #22180F;
    --ink: #F2E7D0;
    --ink-muted: #CDBA9C;   /* 9.7 : 1 */
    --gold: #C99A45;
    --gold-text: #E2B866;   /* 9.5 : 1 */
    --hair: rgba(226, 184, 102, 0.2);
    --hair-strong: rgba(226, 184, 102, 0.38);
    --link: #B9D98F;        /* 11 : 1 */
    --seal: #E07A63;
    --panel: #2A1D12;
    --panel-hair: rgba(226, 182, 90, 0.4);
    --phone: #0D0906;
    --shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.65 "Space Grotesk", system-ui, sans-serif;
  font-variant-numeric: tabular-nums; overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: "Alegreya", Georgia, serif; font-weight: 800; margin: 0; line-height: 1.05; letter-spacing: -0.01em; word-spacing: 0.08em; font-variant-numeric: lining-nums; }
h3 { font-weight: 700; font-size: 1.375rem; line-height: 1.2; letter-spacing: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; background: var(--bg); color: var(--ink); border: 1px solid var(--hair-strong); border-radius: 8px; }
.skip:focus { top: 12px; }
.muted { color: var(--ink-muted); }

/* ---------- header ---------- */
.top { position: absolute; inset: 0 0 auto; z-index: 20; color: var(--on-scene); border-bottom: 1px solid transparent; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font: 800 1.3125rem/1 "Alegreya", Georgia, serif; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; }
.lang { color: inherit; text-decoration: none; font-size: 0.9375rem; padding: 12px 2px; border-bottom: 1px solid transparent; }
.lang:hover { border-bottom-color: currentColor; }
/* over the hero the header is transparent; once the page scrolls it settles on the ground with a hairline */
@supports (animation-timeline: scroll()) {
  .top { position: fixed; animation: settle linear both; animation-timeline: scroll(root); animation-range: 40px 160px; }
  @keyframes settle {
    to { color: var(--ink); background: color-mix(in srgb, var(--bg) 90%, transparent); border-bottom-color: var(--hair); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  }
}
.top.plain { position: sticky; top: 0; color: var(--ink); background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom-color: var(--hair); animation: none; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* ---------- hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; height: 640px; background: #2B1A2E; color: var(--on-scene); }
.hero-scene img { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 58% 50%; }
.hero::before { /* legibility: a dusk veil from the top on phones, from the left on wide screens */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(34, 16, 26, 0.62) 0%, rgba(34, 16, 26, 0.18) 46%, transparent 62%),
    linear-gradient(0deg, rgba(20, 12, 8, 0.4), transparent 26%);
}
.hero-copy { position: relative; padding-top: 92px; max-width: 34rem; animation: rise 900ms cubic-bezier(.2, .7, .2, 1) both; }
.hero h1 { font-size: clamp(4rem, 13vw, 8.5rem); letter-spacing: -0.03em; line-height: 0.9; text-shadow: 0 2px 24px rgba(30, 12, 20, 0.35); }
.promise { margin-top: 14px; font: 700 clamp(1.375rem, 3.4vw, 2rem)/1.2 "Alegreya", Georgia, serif; }
.lede { margin-top: 12px; max-width: 30rem; color: rgba(255, 246, 227, 0.88); font-size: 1rem; }
.hero .store-badge { margin-top: 22px; }
.hero-cast { position: absolute; z-index: 1; bottom: 12px; right: 10px; display: flex; align-items: flex-end; pointer-events: none; }
.hero-cast img { width: 78px; filter: drop-shadow(0 10px 8px rgba(10, 5, 2, 0.45)); }
.hero-cast img + img { margin-left: -16px; }
.hero-cast .pet { width: 54px; margin-left: -12px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* Apple's official badge (assets/badges/), shown as Apple ships it: no recolouring, no hover effect, no scaling of
   one axis. 48 px high (Apple's onscreen minimum is 40 px); a clear space of a quarter of its height (12 px) stays
   free of text and images on every side (README, Badge rules). */
.store-badge { display: inline-block; vertical-align: top; line-height: 0; border-radius: 8px; }
.store-badge img, .closing .store-badge img { width: auto; height: 48px; margin: 0; }
.store-badge:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

/* ---------- sections ---------- */
.section { padding-block: var(--space) 0; }
.section h2 { font-size: clamp(2.5rem, 6.4vw, 4.25rem); max-width: 18ch; }
.section .sub { margin-top: 22px; max-width: 34rem; color: var(--ink-muted); font-size: 1.1875rem; line-height: 1.6; }
.rule { height: 1px; border: 0; margin: 0; background: linear-gradient(90deg, transparent, var(--hair-strong) 18%, var(--hair-strong) 82%, transparent); }
.split { display: grid; gap: 56px; align-items: center; }

/* phones: the app's own screens in a thin dark bezel */
.phone { position: relative; width: 248px; padding: 7px; border-radius: 38px; background: var(--phone); box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.phone img { width: 100%; border-radius: 31px; }

/* how it works */
.steps { margin-top: 48px; display: grid; gap: 30px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 48px 1fr; gap: 4px 16px; }
.steps li::before { counter-increment: step; content: counter(step); grid-row: span 2; font: 800 2.25rem/1 "Alegreya", Georgia, serif; color: var(--gold-text); font-variant-numeric: lining-nums; }
.steps p { color: var(--ink-muted); }
.how-art { display: flex; justify-content: center; padding: 56px 0; border-radius: 28px; background: radial-gradient(60% 60% at 50% 45%, rgba(226, 182, 90, 0.22), transparent 70%); }
.daily { margin-top: 88px; display: grid; gap: 32px; padding-top: 40px; border-top: 1px solid var(--hair); }
.daily li { align-content: start; display: grid; grid-template-columns: 36px 1fr; gap: 2px 14px; }
.daily img { grid-row: span 2; width: 36px; height: 36px; }
.daily h3 { font-size: 1.25rem; }
.daily p { color: var(--ink-muted); font-size: 1rem; }

/* classes */
.classes { margin-top: 56px; display: grid; gap: 8px; }
.classes li { align-content: start; display: grid; grid-template-columns: 116px 1fr; gap: 18px; align-items: end; padding: 20px 0; border-top: 1px solid var(--hair); }
.classes li:first-child { border-top: 0; }
.classes img { width: 116px; }
.classes h3 { font-size: 1.75rem; color: var(--cls); }
.classes q { display: block; margin-top: 6px; color: var(--ink-muted); quotes: "“" "”"; }
.perk { margin-top: 10px; font-size: 0.9375rem; }
.perk b { color: var(--gold-text); }
.guardian { --cls: #9C3326; } .sage { --cls: #2B4C80; } .bard { --cls: #94591C; } .mage { --cls: #276E64; } .elf { --cls: #4F5E26; }
@media (prefers-color-scheme: dark) {
  .guardian { --cls: #EE9A84; } .sage { --cls: #9FBCEB; } .bard { --cls: #E8B577; } .mage { --cls: #85CFC2; } .elf { --cls: #C1D287; }
}

/* scene frames: the art at its own size or smaller, never stretched */
.scene-frame { position: relative; width: 100%; }
.scene-frame > img { width: 100%; border-radius: 6px; box-shadow: var(--shadow); }
.scene-frame .phone { position: absolute; width: 150px; padding: 5px; border-radius: 26px; right: -8px; bottom: -36px; }
.scene-frame .phone img { border-radius: 21px; }
.road-frame { max-width: 448px; }
.hall-frame { max-width: 512px; }

.regions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 8px; counter-reset: region; }
.regions li { padding: 5px 14px; border: 1px solid var(--hair-strong); border-radius: 999px; font-size: 0.9375rem; }
.points { margin-top: 44px; display: grid; gap: 26px; }
.points p, .trio p { margin-top: 6px; color: var(--ink-muted); }
.trio { margin-top: 44px; display: grid; gap: 30px; }
.tiers { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.tiers li { padding: 3px 12px; border: 1px solid var(--hair-strong); border-radius: 999px; font-size: 0.875rem; }
.guilds { margin-top: 12px; display: grid; gap: 4px; color: var(--ink-muted); }
.guilds b { color: var(--ink); }

/* guide */
.guide-fig { justify-self: center; width: min(240px, 60vw); }
.guide-fig img { filter: drop-shadow(0 18px 18px rgba(74, 46, 22, 0.25)); }

/* ---------- premium: the one accent panel ---------- */
.premium { padding-top: var(--space); }
.gold-band { position: relative; isolation: isolate; overflow: hidden; display: flex; justify-content: center; background: #2A1A0F; }
/* the room at its own 900 px or smaller, centred; a blurred, dimmed copy of it fills the band on wider screens */
.gold-band::before { content: ""; position: absolute; inset: -60px; z-index: -1; background: url("../img/scene-hero-room.webp") center / cover; filter: blur(48px) brightness(0.55); }
.gold-band .room { width: 100%; max-width: 900px; height: auto; }
.gold-band .cast { position: absolute; left: 50%; bottom: 5%; transform: translateX(-50%); display: flex; align-items: flex-end; }
.gold-band .cast img { width: 84px; filter: drop-shadow(0 12px 10px rgba(10, 5, 2, 0.5)); }
.gold-band .cast .pet { width: 64px; margin-left: -8px; }
.accent {
  position: relative; margin-top: 24px; padding: 40px 24px; border-radius: 22px;
  background: var(--panel); color: var(--panel-ink);
  box-shadow: 0 40px 80px -40px rgba(34, 22, 12, 0.7), inset 0 0 0 1px var(--panel-hair);
}
.accent::before { content: ""; position: absolute; inset: 8px; border-radius: 16px; border: 1px solid rgba(226, 182, 90, 0.16); pointer-events: none; }
.accent h2 { font-size: clamp(2.5rem, 6.4vw, 4.25rem); color: var(--panel-gold); }
.accent .sub { margin-top: 18px; color: var(--panel-muted); max-width: 32rem; font-size: 1.125rem; }
.accent-grid { display: grid; gap: 40px; }
.perks { display: grid; gap: 18px; }
.perks li { align-content: start; display: grid; grid-template-columns: 30px 1fr; gap: 14px; align-items: start; }
.perks img { width: 30px; height: 30px; }
.perks small { display: block; color: var(--panel-muted); font-size: 0.875rem; }


/* ---------- closing ---------- */
.closing { padding-block: var(--space); text-align: center; }
.closing img { width: 88px; margin: 0 auto 26px; }
.closing h2 { margin-inline: auto; max-width: 16ch; }
.closing p { margin: 18px auto 30px; max-width: 30rem; color: var(--ink-muted); font-size: 1.125rem; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--hair); padding-block: 48px 40px; font-size: 0.9375rem; }
.foot .wrap { display: grid; gap: 32px; }
.foot .brand { color: var(--ink); }
.foot-line { margin-top: 10px; color: var(--ink-muted); }
.foot h2 { font: 700 1rem/1.3 "Space Grotesk", sans-serif; letter-spacing: 0; color: var(--ink); margin-bottom: 8px; }
.foot ul { display: grid; gap: 2px; }
.foot a:not(.brand) { color: var(--ink-muted); text-decoration: none; display: inline-block; padding: 5px 0; }
.foot a:not(.brand):hover, .foot a[aria-current] { color: var(--ink); text-decoration: underline; }
.copy { color: var(--ink-muted); grid-column: 1 / -1; padding-top: 22px; border-top: 1px solid var(--hair); font-size: 0.875rem; }
.copy.tm { margin-top: -22px; padding-top: 0; border-top: 0; font-size: 0.8125rem; }

/* ---------- legal pages ---------- */
.doc { padding-block: 56px 96px; }
.doc .wrap { max-width: calc(760px + 2 * var(--gutter)); }
.doc h1 { font-size: clamp(2.5rem, 7vw, 3.75rem); }
.doc .meta { margin-top: 14px; color: var(--ink-muted); font-size: 0.9375rem; }
.doc .intro { margin-top: 26px; font-size: 1.1875rem; color: var(--ink); }
.toc { margin-top: 40px; padding: 22px 0; border-block: 1px solid var(--hair); }
.toc h2 { font: 700 1rem/1.3 "Space Grotesk", sans-serif; letter-spacing: 0; }
.toc ol { margin-top: 10px; columns: 2 220px; column-gap: 32px; list-style: decimal; padding-left: 1.4em; color: var(--ink-muted); font-size: 0.9375rem; }
.toc li { break-inside: avoid; padding: 2px 0; }
.doc article > h2 { margin-top: 52px; font-size: 1.75rem; line-height: 1.15; scroll-margin-top: 90px; }
.doc article > h3 { margin-top: 26px; font-size: 1.25rem; }
.doc article p, .doc article li { color: var(--ink-muted); }
.doc article p + p { margin-top: 12px; }
.doc article h2 + p, .doc article h3 + p, .doc article h2 + ul, .doc article h2 + ol, .doc article h3 + ul, .doc article h2 + .table-wrap { margin-top: 14px; }
.doc article strong { color: var(--ink); }
.doc article ul, .doc article ol.list { margin-top: 12px; padding-left: 1.25em; display: grid; gap: 8px; }
.doc article ul { list-style: disc; }
.doc article ol.list { list-style: decimal; }
.doc article ul li::marker, .doc article ol.list li::marker { color: var(--gold); }
.doc article ul + p, .doc article .table-wrap + p, .doc article ol + p { margin-top: 14px; }
.facts { margin-top: 14px; display: grid; gap: 0; border-top: 1px solid var(--hair); }
.facts div { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--hair); }
.facts dt { font-weight: 700; color: var(--ink); }
.facts dd { margin: 0; color: var(--ink-muted); }
.table-wrap { margin-top: 14px; overflow-x: auto; border-top: 1px solid var(--hair-strong); }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--hair); }
th { font-weight: 700; color: var(--ink); }
td { color: var(--ink-muted); }
td:first-child { color: var(--ink); font-weight: 700; min-width: 8.5rem; }
.steps-list { counter-reset: s; }
.callout { margin-top: 18px; padding: 18px 20px; border-left: 2px solid var(--gold); background: var(--bg-soft); border-radius: 0 10px 10px 0; color: var(--ink); }
/* phones: wide legal tables become one card per row, each cell under its column name */
@media (max-width: 699px) {
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 12px 0; border-bottom: 1px solid var(--hair); }
  table.stack td { padding: 4px 0; border: 0; min-width: 0; }
  table.stack td:not(:first-child)::before { content: attr(data-label); display: block; font-size: 0.8125rem; font-weight: 700; color: var(--gold-text); }
}

/* ---------- wider screens ---------- */
@media (min-width: 700px) {
  :root { --gutter: 32px; }
  .hero { height: min(780px, 100svh); min-height: 640px; }
  .hero::before {
    background: linear-gradient(90deg, rgba(34, 16, 26, 0.6) 0%, rgba(34, 16, 26, 0.28) 38%, transparent 60%),
      linear-gradient(0deg, rgba(20, 12, 8, 0.35), transparent 22%);
  }
  .hero-scene img { object-position: 50% 50%; }
  .hero-copy { padding-top: clamp(150px, 20vh, 200px); }
  .hero-cast { right: 9%; bottom: 5%; }
  .hero-cast img { width: 150px; }
  .hero-cast img + img { margin-left: -30px; }
  .hero-cast .pet { width: 100px; margin-left: -20px; }
  .daily { grid-template-columns: repeat(3, 1fr); gap: 40px; }
  .classes { grid-template-columns: repeat(5, 1fr); gap: 24px; }
  .classes li { grid-template-columns: 1fr; align-items: start; padding: 0; border: 0; }
  .classes img { width: 100%; max-width: 190px; margin-bottom: 8px; }
  .gold-band .room { -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
  .gold-band .cast img { width: 150px; }
  .gold-band .cast .pet { width: 108px; }
  .accent { margin-top: -56px; padding: 56px 64px 64px; }
  .gold-band .cast { bottom: 76px; }
  .accent-grid { grid-template-columns: 1fr 1fr; gap: 56px 72px; }
  .accent-grid .perks { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; gap: 22px 56px; }
  .scene-frame .phone { width: 190px; right: -40px; bottom: -48px; border-radius: 32px; padding: 6px; }
  .hall-frame .phone { right: auto; left: -40px; }
  .scene-frame .phone img { border-radius: 26px; }
  .foot .wrap { grid-template-columns: 2fr 1fr 1fr; }
  .facts div { grid-template-columns: 14rem 1fr; gap: 16px; }
}
@media (min-width: 980px) {
  .split { grid-template-columns: 1fr 1fr; gap: 88px; }
  .split.flip > :first-child { order: 2; }
  .how .split { grid-template-columns: 1.15fr 0.85fr; }
  .guide .split { grid-template-columns: 0.7fr 1.3fr; }
  .guide-fig { width: 270px; }
  .points { grid-template-columns: 1fr; }
}
/* very wide screens: the wide scenes stay at their own 2048 px and fade into the band */
@media (min-width: 2049px) {
  .hero-scene img { width: 2048px; left: 50%; transform: translateX(-50%); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  @supports (animation-timeline: scroll()) { .top { position: absolute; } }
}
.closing h2 { font-size: clamp(2.5rem, 6.4vw, 4.25rem); }
/* team invite page (join/): the code is the hero of the page */
.closing.invite h1 { margin-inline: auto; font-size: clamp(2.5rem, 7vw, 3.75rem); }
.closing .invite-code { margin: 20px auto 0; font: 800 clamp(3rem, 14vw, 4.75rem)/1.1 "Alegreya", Georgia, serif; letter-spacing: 0.14em; color: var(--seal); font-variant-numeric: lining-nums; }
.closing .invite-step { margin-bottom: 6px; color: var(--ink); }
.closing .invite-en { margin-top: 0; font-size: 1rem; }
.closing .invite-note { margin: 32px auto 12px; font-size: 1rem; }
.doc article ul.plain { list-style: none; padding-left: 0; }
