/* Thessyra: a game in development, built in the open.
   Design read: indie MMORPG dev site for players who follow games while they're made;
   dark graphite with one ember accent; Cabinet Grotesk display, Satoshi body, JetBrains Mono for build facts.
   Dials: variance 8, motion 6, density 4.
   Shape rule: 6px radius on every surface; status tags are the only pills.
   Accent rule: ember only, used for actions, "now" state, and emphasis. */

:root{
  --bg: #0c0d0b;
  --surface: #141612;
  --surface-2: #1b1e19;
  --line: rgba(233,229,218,0.10);
  --line-strong: rgba(233,229,218,0.18);
  --text: #e9e5da;
  --muted: #a3a093;
  --accent: #e2672f;
  --accent-hover: #ee7a45;
  --on-accent: #150b06;
  --shadow: rgba(0,0,0,0.55);
  --grain: 0.06;

  --font-display: 'Cabinet Grotesk', 'Satoshi', system-ui, sans-serif;
  --font-body: 'Satoshi', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;

  --r: 6px;
  --ease: cubic-bezier(.16,1,.3,1);
  --max: 1280px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(88px, 11vw, 160px);

  /* layers */
  --z-content: 1;
  --z-grain: 5;
  --z-nav: 10;
  --z-skip: 20;

  color-scheme: dark light;
}

@media (prefers-color-scheme: light){
  :root{
    --bg: #edede8;
    --surface: #e3e3dc;
    --surface-2: #d8d8d0;
    --line: rgba(21,23,20,0.12);
    --line-strong: rgba(21,23,20,0.22);
    --text: #151714;
    --muted: #55574f;
    --accent: #b04818;
    --accent-hover: #c2531f;
    --on-accent: #fbf7f2;
    --shadow: rgba(40,40,30,0.22);
    --grain: 0.04;
  }
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce){ html{ scroll-behavior: auto; } }

body{
  margin: 0; min-height: 100dvh; overflow-x: hidden;
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 18px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::after{
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: var(--z-grain);
  opacity: var(--grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
body.menu-open{ overflow: hidden; }

img{ max-width: 100%; display: block; }
a{ color: inherit; }
:focus-visible{ outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip{ position: absolute; left: 16px; top: -60px; z-index: var(--z-skip); background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: var(--r); text-decoration: none; font-weight: 500; }
.skip:focus{ top: 12px; }

.container{ width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); position: relative; z-index: var(--z-content); }
.prose{ max-width: 68ch; }
.prose p{ margin: 0 0 1.1em; text-wrap: pretty; }
.prose p:last-child{ margin-bottom: 0; }

h1, h2, h3{ font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.02; margin: 0; text-wrap: balance; }
h2{ font-size: clamp(36px, 5vw, 64px); }
h3{ font-size: clamp(22px, 2vw, 28px); font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
.lede{ font-size: clamp(19px, 1.6vw, 22px); line-height: 1.5; color: var(--muted); max-width: 52ch; margin: 0; }
.muted{ color: var(--muted); }
.mono{ font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.02em; }

/* ---------- Nav ---------- */
.nav{ position: sticky; top: 0; z-index: var(--z-nav); background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav .container{ display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 68px; }
.brand{ display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: -0.01em; position: relative; z-index: 2; }
.brand img{ width: 30px; height: 30px; border-radius: 4px; }
.nav-links{ display: flex; align-items: center; gap: 30px; }
.nav-links a{ text-decoration: none; font-size: 15px; font-weight: 500; color: var(--muted); transition: color .25s var(--ease); }
.nav-links a:hover, .nav-links a[aria-current="page"]{ color: var(--text); }
.nav-links a[aria-current="page"]{ box-shadow: inset 0 -2px 0 var(--accent); padding-bottom: 4px; }

.menu-toggle{ display: none; position: relative; z-index: 2; width: 44px; height: 44px; border: 0; background: transparent; color: var(--text); cursor: pointer; padding: 0; }
.menu-toggle span{ position: absolute; left: 11px; width: 22px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .45s var(--ease), opacity .3s var(--ease); }
.menu-toggle span:nth-child(1){ top: 16px; } .menu-toggle span:nth-child(2){ top: 21px; } .menu-toggle span:nth-child(3){ top: 26px; }
body.menu-open .menu-toggle span:nth-child(1){ transform: translateY(5px) rotate(45deg); }
body.menu-open .menu-toggle span:nth-child(2){ opacity: 0; }
body.menu-open .menu-toggle span:nth-child(3){ transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 820px){
  .menu-toggle{ display: block; }
  /* The nav's backdrop-filter makes it the containing block for fixed children, so size the sheet to the viewport explicitly. */
  .nav-links{ position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh; z-index: 1; flex-direction: column; align-items: flex-start; justify-content: center; gap: 22px; padding: 0 var(--gutter); background: var(--bg); opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility 0s linear .35s; }
  body.menu-open .nav-links{ opacity: 1; visibility: visible; transition: opacity .35s var(--ease); }
  .nav-links a{ font-family: var(--font-display); font-weight: 800; font-size: 42px; color: var(--text); transform: translateY(24px); opacity: 0; transition: transform .6s var(--ease), opacity .6s var(--ease); }
  body.menu-open .nav-links a{ transform: none; opacity: 1; }
  body.menu-open .nav-links a:nth-child(2){ transition-delay: .05s; }
  body.menu-open .nav-links a:nth-child(3){ transition-delay: .1s; }
  body.menu-open .nav-links a:nth-child(4){ transition-delay: .15s; }
  .nav-links a[aria-current="page"]{ box-shadow: none; color: var(--accent); }
}

/* ---------- Buttons ---------- */
.btn{ display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; text-decoration: none; font-weight: 500; font-size: 16px; padding: 13px 20px; border-radius: var(--r); transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .2s var(--ease); }
.btn i{ font-size: 18px; transition: transform .35s var(--ease); }
.btn:hover i{ transform: translate(2px,-2px); }
.btn:active{ transform: scale(.98); }
.btn-primary{ background: var(--accent); color: var(--on-accent); }
.btn-primary:hover{ background: var(--accent-hover); }
.btn-ghost{ border: 1px solid var(--line-strong); color: var(--text); background: color-mix(in srgb, var(--bg) 40%, transparent); }
.btn-ghost:hover{ border-color: var(--text); }
.link{ text-decoration: none; font-weight: 500; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.link:hover{ color: var(--accent-hover); }
.link i{ transition: transform .3s var(--ease); }
.link:hover i{ transform: translateX(3px); }

/* ---------- Status tags (real state only) ---------- */
.tag{ display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .03em; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; justify-self: start; align-self: flex-start; }
.tag::before{ content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.tag.built{ color: var(--text); }
.tag.now{ color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.tag.proto{ color: var(--text); }
.tag.proto::before{ background: transparent; border: 1.5px solid currentColor; width: 7px; height: 7px; }
.tag.designed::before{ background: transparent; border: 1.5px dashed currentColor; width: 7px; height: 7px; }

/* ---------- Hero ---------- */
.hero{ position: relative; min-height: calc(100dvh - 68px); display: flex; align-items: flex-end; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-art{ position: absolute; inset: 0; z-index: 0; }
.hero-art img{ width: 100%; height: 100%; object-fit: cover; object-position: 65% 50%; }
.hero-art::after{ content: ""; position: absolute; inset: 0; background:
  linear-gradient(90deg, color-mix(in srgb, var(--bg) 90%, transparent) 0%, color-mix(in srgb, var(--bg) 50%, transparent) 40%, transparent 70%),
  linear-gradient(0deg, var(--bg) 0%, transparent 40%); }
.hero .container{ padding-top: 96px; padding-bottom: clamp(48px, 8vw, 96px); }
.hero .tag{ margin-bottom: 24px; background: color-mix(in srgb, var(--bg) 55%, transparent); }
.hero h1{ font-size: clamp(50px, 7.6vw, 112px); max-width: 10ch; margin-bottom: 24px; letter-spacing: -0.035em; line-height: .95; }
.hero .lede{ color: var(--text); opacity: .88; max-width: 42ch; }
.hero-actions{ display: flex; gap: 12px; flex-wrap: wrap; margin-top: 34px; }
.art-note{ position: absolute; right: var(--gutter); bottom: 18px; z-index: 1; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
@media (max-width: 720px){
  .hero{ min-height: auto; }
  .hero-art::after{ background: linear-gradient(0deg, var(--bg) 12%, color-mix(in srgb, var(--bg) 70%, transparent) 55%, color-mix(in srgb, var(--bg) 25%, transparent)); }
  .hero .container{ padding-top: 240px; }
  .art-note{ top: 84px; bottom: auto; }
}

/* ---------- Sections ---------- */
.section{ padding: var(--section) 0; border-bottom: 1px solid var(--line); }
.section-head{ margin-bottom: clamp(40px, 5vw, 64px); display: grid; gap: 18px; }

/* Build status bento: exactly four cells */
.bento{ display: grid; grid-template-columns: 1.4fr 1fr 1fr; grid-auto-flow: dense; gap: 16px; }
.cell{ position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(24px, 3vw, 36px); display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 250px; }
.cell.feature{ grid-row: span 2; justify-content: flex-end; min-height: 540px; padding: 0; text-decoration: none; }
.cell.feature img{ position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.cell.feature:hover img{ transform: scale(1.04); }
.cell.feature::after{ content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10,11,9,.96) 12%, rgba(10,11,9,.55) 52%, rgba(10,11,9,.05)); }
.cell.feature .inner{ position: relative; z-index: 1; padding: clamp(24px, 3vw, 36px); color: #ece8dd; display: grid; gap: 14px; }
.cell.feature .inner p{ color: #cfcbbf; margin: 0; max-width: 46ch; }
.cell.feature .inner .link{ color: #f08a5b; }
.cell.wide{ grid-column: span 2; background: color-mix(in srgb, var(--accent) 13%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.cell .big{ font-family: var(--font-display); font-weight: 800; font-size: clamp(60px, 6.4vw, 96px); line-height: .88; letter-spacing: -0.04em; }
.cell .big small{ font-size: .34em; letter-spacing: 0; font-weight: 700; color: var(--muted); margin-left: 8px; }
.cell p{ margin: 0; color: var(--muted); }
.cell.pattern{ background-image: repeating-linear-gradient(135deg, transparent 0 14px, var(--line) 14px 15px); }
@media (max-width: 960px){
  .bento{ grid-template-columns: 1fr 1fr; }
  .cell.feature{ grid-column: span 2; grid-row: auto; min-height: 440px; }
}
@media (max-width: 640px){
  .bento{ grid-template-columns: 1fr; }
  .cell.feature, .cell.wide{ grid-column: auto; }
}

/* Pillars: title held on the left, pillars pass on the right */
.hold{ display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.hold .side{ position: sticky; top: 108px; display: grid; gap: 22px; }
.legend{ display: flex; flex-wrap: wrap; gap: 8px; }
.pillars{ list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pillars li{ display: grid; grid-template-columns: 1fr auto; gap: 12px 24px; align-items: center; padding: 32px 0; border-bottom: 1px solid var(--line); }
.pillars li p{ grid-column: 1 / -1; margin: 0; color: var(--muted); max-width: 60ch; }
.pillars figure{ grid-column: 1 / -1; margin: 12px 0 0; }
.pillars figure .frame{ border-radius: var(--r); overflow: hidden; }
.pillars figure img{ width: 100%; aspect-ratio: 16/9; object-fit: cover; transition: transform 1.2s var(--ease); }
.pillars figure:hover img{ transform: scale(1.03); }
.pillars figcaption{ margin-top: 10px; color: var(--muted); }
@media (max-width: 900px){ .hold{ grid-template-columns: 1fr; } .hold .side{ position: static; } }

/* Statement band */
.statement{ font-family: var(--font-display); font-weight: 800; font-size: clamp(38px, 5.8vw, 88px); line-height: 1; letter-spacing: -0.03em; max-width: 17ch; margin: 0 0 44px; text-wrap: balance; }
.statement .w{ transition: opacity .7s var(--ease); }
.js-words .statement .w{ opacity: .14; }
.js-words .statement.lit .w{ opacity: 1; transition-delay: calc(var(--i) * 55ms); }
.statement em{ font-style: normal; color: var(--accent); }
.split-media{ display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
@media (max-width: 900px){ .split-media{ grid-template-columns: 1fr; } }

/* Framed shot */
.shot{ margin: 0; }
.shot .frame{ border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.shot img{ width: 100%; height: auto; transition: transform 1.2s var(--ease); }
.shot:hover img{ transform: scale(1.03); }
.shot figcaption{ margin-top: 10px; color: var(--muted); font-size: 14px; max-width: 60ch; }

/* Road: horizontal track */
.road{ list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.road li{ position: relative; padding: 26px 0 0; border-top: 2px solid var(--line-strong); display: grid; gap: 12px; align-content: start; }
.road li.done{ border-top-color: var(--text); }
.road li.now{ border-top-color: var(--accent); }
.road li p{ margin: 0; color: var(--muted); }
@media (max-width: 900px){ .road{ grid-template-columns: 1fr 1fr; row-gap: 36px; } }
@media (max-width: 560px){ .road{ grid-template-columns: 1fr; } }

/* Writing list */
.posts{ list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.posts li{ border-bottom: 1px solid var(--line); }
.posts a{ display: grid; grid-template-columns: 170px 1fr auto; gap: 24px; align-items: baseline; padding: 28px 0; text-decoration: none; transition: transform .45s var(--ease); }
.posts a:hover{ transform: translateX(8px); }
.posts a:hover h3{ color: var(--accent); }
.posts h3{ transition: color .25s var(--ease); }
.posts p{ margin: 6px 0 0; color: var(--muted); max-width: 60ch; }
.posts i{ font-size: 22px; color: var(--muted); }
@media (max-width: 720px){ .posts a{ grid-template-columns: 1fr; gap: 6px; } .posts i{ display: none; } }

/* Closing call */
.closing{ padding: var(--section) 0; }
.closing .container{ display: grid; gap: 30px; justify-items: start; }
.closing h2{ font-size: clamp(52px, 9.4vw, 144px); letter-spacing: -0.045em; line-height: .9; max-width: 11ch; }

footer.site{ border-top: 1px solid var(--line); padding: 36px 0 44px; }
footer.site .container{ display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
footer.site nav{ display: flex; gap: 22px; flex-wrap: wrap; }
footer.site a{ text-decoration: none; color: var(--muted); font-size: 15px; }
footer.site a:hover{ color: var(--text); }
footer.site .mono{ color: var(--muted); }

/* ---------- Inner pages ---------- */
.page-head{ padding: clamp(72px, 10vw, 136px) 0 clamp(48px, 6vw, 80px); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.page-head h1{ font-size: clamp(56px, 8.6vw, 128px); letter-spacing: -0.045em; line-height: .92; margin: 20px 0 24px; }
.page-head .art{ position: absolute; inset: 0; z-index: 0; }
.page-head .art img{ width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; }
.page-head .art::after{ content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 18%, color-mix(in srgb, var(--bg) 65%, transparent) 58%, color-mix(in srgb, var(--bg) 30%, transparent)), linear-gradient(0deg, var(--bg), transparent 55%); }

/* Devlog: date column + article */
.entry{ display: grid; grid-template-columns: 220px 1fr; gap: clamp(24px, 5vw, 72px); padding: clamp(64px, 8vw, 112px) 0; border-bottom: 1px solid var(--line); }
.entry .meta{ position: sticky; top: 108px; align-self: start; display: grid; gap: 10px; }
.entry h2{ font-size: clamp(34px, 4.4vw, 58px); margin-bottom: 20px; }
.entry .lede{ margin: 0 0 28px; }
.entry .shot{ margin: 36px 0; }
.note{ margin-top: 30px; padding: 20px 22px; border-radius: var(--r); background: var(--surface); border-left: 3px solid var(--accent); color: var(--muted); font-size: 16px; max-width: 68ch; }
@media (max-width: 860px){ .entry{ grid-template-columns: 1fr; } .entry .meta{ position: static; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } }

/* Roadmap page */
.stages{ list-style: none; margin: 0; padding: 0; }
.stage{ display: grid; grid-template-columns: 220px 1fr; gap: clamp(24px, 5vw, 72px); padding: clamp(56px, 7vw, 96px) 0; border-bottom: 1px solid var(--line); }
.stage .meta{ display: grid; gap: 12px; align-content: start; }
.stage h2{ font-size: clamp(34px, 4.4vw, 58px); margin-bottom: 18px; }
.checks{ display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 34px 0 0; }
.checks > div{ background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; }
.checks dt{ font-family: var(--font-display); font-weight: 700; font-size: 20px; margin-bottom: 8px; }
.checks dd{ margin: 0; color: var(--muted); font-size: 16px; }
@media (max-width: 860px){ .stage{ grid-template-columns: 1fr; } .checks{ grid-template-columns: 1fr; } }

/* Codex */
.codex-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; }
.codex-grid > div{ background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; }
.codex-grid h3{ margin-bottom: 10px; }
.codex-grid p{ margin: 0; color: var(--muted); }
.codex-grid.three{ grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px){ .codex-grid, .codex-grid.three{ grid-template-columns: 1fr; } }
blockquote.pull{ margin: 48px 0 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 2.6vw, 34px); line-height: 1.2; letter-spacing: -0.01em; max-width: 32ch; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference){
  .hero .tag, .hero h1, .hero .lede, .hero-actions, .page-head .container > *{ animation: rise 1s var(--ease) both; }
  .hero h1, .page-head h1{ animation-delay: .08s; }
  .hero .lede, .page-head .lede{ animation-delay: .18s; }
  .hero-actions{ animation-delay: .28s; }
  .hero-art img, .page-head .art img{ animation: settle 2.6s var(--ease) both; }
  .js .reveal{ opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
  .js .reveal.in{ opacity: 1; transform: none; }
  .tag.now::before{ animation: pulse 2.2s ease-out infinite; }
}
@keyframes rise{ from{ opacity: 0; transform: translateY(22px); } to{ opacity: 1; transform: none; } }
@keyframes settle{ from{ transform: scale(1.08); } to{ transform: scale(1); } }
@keyframes pulse{ 0%{ box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 100%{ box-shadow: 0 0 0 8px transparent; } }
