/* Kreed, the studio. Same family as Rook's Quest: plum-black, bone and one ember; Fraunces for the
   story and headings, Instrument Sans for everything else. A dotted map of the region sits fixed
   behind the story and changes as the chapters scroll past. */
:root {
  color-scheme: dark;
  --ink-0: #0c0910;
  --ink: #15111b;
  --ink-2: #201a29;
  --bone: #efe7d5;
  --bone-2: #d8cdb6;
  --bone-dim: #a79d8c;
  --ember: #e4572e;
  --ember-2: #ff8a5e;
  --line: rgba(239, 231, 213, .14);
  --paper: #ece4d2;
  --paper-2: #e2d8c3;
  --on-paper: #1d1722;
  --on-paper-2: #5a5160;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 80px);
  --r: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --pop: cubic-bezier(.34, 1.56, .64, 1);
  --shadow: 0 24px 50px -26px rgba(0, 0, 0, .7);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { margin: 0; background: var(--ink-0); color: var(--bone); font: 400 clamp(1rem, .96rem + .18vw, 1.1rem)/1.62 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ember-2); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--ember); color: #fff; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--bone); color: var(--ink); padding: 8px 14px; border-radius: 999px; }
.skip:focus { left: 8px; }

/* ── Type ── */
h1, h2, h3 { margin: 0; font-family: var(--serif); font-optical-sizing: auto; font-weight: 500; letter-spacing: -0.022em; line-height: 1.04; text-wrap: balance; }
h2 { font-size: clamp(2.1rem, 4.4vw, 4rem); }
p { margin: 0; }
.display { font-size: clamp(3.3rem, 9.5vw, 9rem); line-height: .92; letter-spacing: -0.035em; }
.display em, h2 em { font-style: italic; color: var(--ember-2); }
.lead { font-size: clamp(1.05rem, 1rem + .3vw, 1.24rem); line-height: 1.58; color: rgba(239, 231, 213, .82); max-width: 40ch; }
.kicker { font: 600 .72rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: rgba(239, 231, 213, .62); }
.label { display: inline-flex; align-items: center; gap: 12px; font: 600 .72rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: rgba(239, 231, 213, .62); }
.label b { display: inline-flex; align-items: center; gap: 12px; font: italic 500 1.2rem/1 var(--serif); letter-spacing: 0; text-transform: none; color: var(--ember-2); }
.label b::after { content: ""; width: 34px; height: 1px; background: currentColor; opacity: .55; }

/* ── Buttons ── */
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; cursor: pointer; border: 0; border-radius: 999px; font: 600 .95rem/1 var(--sans); padding: 16px 26px; background: var(--bone); color: var(--ink); transition: transform .25s var(--pop), background .2s; }
.btn:hover { transform: translateY(-2px); background: #fff; }
.btn svg { width: 18px; height: 18px; }
.btn-ember { background: var(--ember); color: #fff; }
.btn-ember:hover { background: #ee6a40; }
.btn-ghost { background: transparent; color: var(--bone); box-shadow: inset 0 0 0 1.5px rgba(239, 231, 213, .45); }
.btn-ghost:hover { background: rgba(239, 231, 213, .1); }
.btn-link { display: inline-flex; align-items: center; gap: 8px; font: 600 .95rem/1 var(--sans); text-decoration: none; padding-bottom: 6px; border-bottom: 1.5px solid currentColor; transition: gap .25s var(--ease); }
.btn-link:hover { gap: 14px; }
.btn-link svg { width: 16px; height: 16px; }

/* ── Nav ── */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 40; display: flex; align-items: center; gap: 16px; padding: calc(env(safe-area-inset-top, 0px) + 16px) var(--gutter) 14px; transition: background .3s, box-shadow .3s; }
.nav.solid { background: rgba(12, 9, 16, .82); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; }
.brand .mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ember); transition: transform .35s var(--pop); }
.brand:hover .mark { transform: rotate(-12deg) scale(1.06); }
.brand .mark svg { width: 70%; height: 70%; fill: #fff7ea; }
.brand .word { font: 500 1.45rem/1 var(--serif); letter-spacing: -0.02em; }
.brand .sub { font: 600 .62rem/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--bone-dim); margin-top: 4px; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav-links a { font: 500 .92rem/1 var(--sans); text-decoration: none; padding: 10px 14px; border-radius: 999px; color: rgba(239, 231, 213, .85); transition: background .2s, color .2s; }
.nav-links a:hover { background: rgba(239, 231, 213, .08); color: #fff; }
.nav-links .pill { background: var(--bone); color: var(--ink); margin-left: 6px; font-weight: 600; }
.nav-links .pill:hover { background: #fff; color: var(--ink); }
@media (max-width: 760px) { .nav-links a:not(.pill) { display: none; } .brand .sub { display: none; } }

/* ── The map ── */
.map { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; transition: opacity .6s var(--ease); }
.map-fx { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(120% 90% at 60% 45%, transparent 50%, rgba(6, 4, 9, .55)); }
.map-labels { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.pin-label, .player-label { position: absolute; left: 0; top: 0; opacity: 0; transition: opacity .4s var(--ease); white-space: nowrap; will-change: transform; }
.pin-label { display: grid; gap: 3px; padding: 0 0 0 16px; border-left: 1px solid rgba(239, 231, 213, .5); text-shadow: 0 1px 12px rgba(0, 0, 0, .8); }
.pin-label b { font: italic 500 1.1rem/1 var(--serif); color: #fff; }
.pin-label span { font: 600 .66rem/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: rgba(239, 231, 213, .7); }
.player-label { font: 600 .7rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #fff; background: rgba(12, 9, 16, .7); padding: 5px 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(239, 231, 213, .3); }
.pin-label.on, .player-label.on { opacity: 1; }
.pin-label.flip { padding: 0 16px 0 0; border-left: 0; border-right: 1px solid rgba(239, 231, 213, .5); text-align: right; }
.no-map .map, .no-map .map-fx, .no-map .map-labels { display: none; }

/* ── Hero ── */
main { position: relative; z-index: 3; }
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: grid; align-content: center; padding: 120px var(--gutter) 120px; overflow: clip; }
.hero .copy { display: grid; gap: 24px; max-width: 60rem; justify-items: start; position: relative; }
.hero .display { font-size: clamp(3rem, 7vw, 7rem); }
.hero .lead { max-width: 36ch; }
.hero .copy::before { content: ""; position: absolute; inset: -20% -35% -25% -45%; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(10, 6, 14, .78), rgba(10, 6, 14, .45) 55%, rgba(10, 6, 14, 0)); }
.hero-foot { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 30px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font: 600 .7rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: rgba(239, 231, 213, .5); pointer-events: none; }
.cue { display: inline-flex; align-items: center; gap: 10px; color: rgba(239, 231, 213, .85); }
.cue i { width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; rotate: 45deg; translate: 0 -3px; animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 50% { translate: 0 2px; } }
@media (max-width: 720px) { .hero-foot span:first-child, .hero-foot span:last-child { display: none; } .hero-foot { justify-content: center; } }
/* On phones the map sits in the top half and the words below it, as in the chapters */
@media (max-width: 760px) { .hero { align-content: end; padding-bottom: 96px; } .hero .copy::before { inset: -14% -20% -10% -20%; } .display { font-size: clamp(3rem, 14vw, 4.2rem); } }

/* ── Story chapters over the map ── */
.chapter { position: relative; min-height: 115vh; display: grid; align-content: center; padding: 120px var(--gutter); }
.chapter::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(90deg, rgba(8, 5, 12, .86) 0%, rgba(8, 5, 12, .62) 32%, rgba(8, 5, 12, .14) 56%, rgba(8, 5, 12, 0) 70%); }
.tale { display: grid; gap: 18px; max-width: 32rem; text-shadow: 0 1px 18px rgba(4, 3, 8, .5); }
.tale h2 { color: #fff; }
.tale p:not(.label) { font: 400 clamp(1.06rem, 1rem + .3vw, 1.22rem)/1.64 var(--serif); font-optical-sizing: auto; color: rgba(239, 231, 213, .9); }
.tale .btn-link { color: var(--ember-2); }
@media (max-width: 760px) {
  .chapter { min-height: 100svh; align-content: end; padding-bottom: 80px; }
  .chapter::before { background: linear-gradient(0deg, rgba(8, 5, 12, .92) 0%, rgba(8, 5, 12, .74) 45%, rgba(8, 5, 12, 0) 75%); }
}

/* ── Paper sheets: games, workshop, team ── */
.sheet { position: relative; padding: clamp(90px, 11vw, 150px) var(--gutter); }
.sheet-head { display: grid; gap: 18px; margin-bottom: clamp(36px, 5vw, 64px); max-width: 1400px; margin-left: auto; margin-right: auto; }
.games { background: var(--paper); color: var(--on-paper); }
.games .label, .team .label { color: var(--on-paper-2); }
.games .label b, .team .label b { color: #b53d1a; }
.games h2, .team h2 { color: var(--on-paper); }
.team { background: var(--paper-2); color: var(--on-paper); }
/* Team intro: the headline on the left, the paragraph beside it */
.team .sheet-head { grid-template-columns: minmax(0, 1fr) minmax(0, 31rem); align-items: end; column-gap: clamp(32px, 6vw, 96px); }
.team .sheet-head .label { grid-column: 1 / -1; }
.team h2 { font-size: clamp(2.6rem, 6vw, 5.6rem); line-height: .95; letter-spacing: -0.03em; }
.team h2 em { color: #b53d1a; }
.team .lead { color: var(--on-paper-2); max-width: 34ch; padding-bottom: .4em; }
@media (max-width: 860px) { .team .sheet-head { grid-template-columns: minmax(0, 1fr); } .team .lead { padding-bottom: 0; } }

/* Rook's Quest feature card */
.game { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); max-width: 1400px; margin: 0 auto; text-decoration: none; color: var(--bone); background: var(--ink); border-radius: calc(var(--r) + 6px); overflow: hidden; box-shadow: 0 40px 80px -40px rgba(29, 23, 34, .7); transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.game:hover { transform: translateY(-6px); box-shadow: 0 50px 90px -40px rgba(29, 23, 34, .85); }
.game-art { position: relative; overflow: hidden; min-height: 320px; }
.game-art img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 40%; transition: transform 1.2s var(--ease); }
.game:hover .game-art img { transform: scale(1.04); }
.game-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 74%, var(--ink)); }
.game-copy { display: grid; gap: 18px; align-content: center; justify-items: start; padding: clamp(28px, 4vw, 56px); }
.game-status { display: inline-flex; align-items: center; gap: 10px; font: 600 .72rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--bone-dim); }
.game-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 0 rgba(228, 87, 46, .6); animation: live 2s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 10px rgba(228, 87, 46, 0); } 100% { box-shadow: 0 0 0 0 rgba(228, 87, 46, 0); } }
.game-title { font: 500 clamp(2.6rem, 5vw, 4.6rem)/.95 var(--serif); letter-spacing: -0.03em; color: #fff; }
.game-title em { color: var(--ember-2); }
.game-line { font: 400 clamp(1.02rem, 1rem + .2vw, 1.15rem)/1.6 var(--serif); color: rgba(239, 231, 213, .86); max-width: 36ch; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span { font: 500 .8rem/1 var(--sans); padding: 8px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); color: var(--bone-2); }
.game .btn { margin-top: 6px; }
@media (max-width: 860px) { .game { grid-template-columns: minmax(0, 1fr); } .game-art { min-height: 0; aspect-ratio: 16 / 10; } .game-art::after { background: linear-gradient(180deg, transparent 60%, var(--ink)); } }

/* Workshop */
.workshop { max-width: 1400px; margin: clamp(70px, 9vw, 120px) auto 0; }
.ws-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 40px; margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px solid rgba(29, 23, 34, .14); }
.ws-head h3 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); color: var(--on-paper); }
.ws-head p { color: var(--on-paper-2); max-width: 44ch; }
.ws-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .ws-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ws-grid { grid-template-columns: minmax(0, 1fr); } }
.ws-grid a { display: grid; gap: 8px; align-content: start; height: 100%; padding: 20px 20px 22px; border-radius: var(--r); text-decoration: none; background: rgba(255, 255, 255, .45); box-shadow: inset 0 0 0 1px rgba(29, 23, 34, .1); color: var(--on-paper-2); transition: transform .3s var(--pop), background .25s, box-shadow .25s; }
.ws-grid a:hover { transform: translateY(-4px); background: #fff; box-shadow: inset 0 0 0 1px rgba(29, 23, 34, .14), 0 20px 40px -26px rgba(29, 23, 34, .5); }
.ws-grid .who { font: 600 .66rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: #b53d1a; }
.ws-grid b { font: 500 1.2rem/1.15 var(--serif); color: var(--on-paper); }
.ws-grid .tech { margin-top: 6px; font: 500 .78rem/1 var(--sans); color: var(--on-paper-2); opacity: .8; }

/* Team */
.players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 3vw, 40px); max-width: 1400px; margin: 0 auto; }
@media (max-width: 860px) { .players { grid-template-columns: minmax(0, 1fr); } }
.player { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(18px, 2.4vw, 32px); align-items: center; padding: 14px; border-radius: calc(var(--r) + 4px); background: var(--paper); box-shadow: 0 30px 60px -40px rgba(29, 23, 34, .6); }
@media (max-width: 520px) { .player { grid-template-columns: minmax(0, 1fr); } .photo { max-width: 240px; } .player-copy { padding: 4px 8px 8px; } }
.photo { position: relative; aspect-ratio: 4 / 5; border-radius: var(--r); overflow: hidden; background: var(--ink); }
.photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05) brightness(.95); transition: filter .6s var(--ease), transform .8s var(--ease); }
.photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(228, 87, 46, .35)); mix-blend-mode: multiply; transition: opacity .6s var(--ease); }
.player:hover .photo img { filter: none; transform: scale(1.03); }
.player:hover .photo::after { opacity: 0; }
.player-copy { display: grid; gap: 10px; padding: 8px 10px 8px 0; }
.player-copy .where { font: 600 .68rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: #b53d1a; }
.player-copy h3 { font-size: clamp(1.8rem, 3vw, 2.5rem); color: var(--on-paper); }
.player-copy .role { font: italic 400 1.08rem/1.3 var(--serif); color: var(--on-paper-2); }
.player-copy p:not(.where):not(.role):not(.links) { color: var(--on-paper-2); line-height: 1.6; }
.links { display: flex; gap: 18px; margin-top: 6px; }
.links a { font: 600 .9rem/1 var(--sans); text-decoration: none; color: var(--on-paper); padding-bottom: 5px; border-bottom: 1.5px solid rgba(29, 23, 34, .35); transition: border-color .2s, color .2s; }
.links a:hover { color: #b53d1a; border-color: #b53d1a; }

/* Close */
.gg { position: relative; padding: clamp(110px, 14vw, 190px) var(--gutter); display: grid; gap: 26px; justify-items: start; background: radial-gradient(80% 120% at 85% 100%, rgba(228, 87, 46, .22), transparent 60%), var(--ink-0); overflow: hidden; }
.gg .display { font-size: clamp(2.8rem, 7.5vw, 7rem); max-width: 12ch; }
.footer { position: relative; z-index: 3; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 30px; padding: 28px var(--gutter) 40px; font-size: .86rem; color: var(--bone-dim); background: var(--ink-0); border-top: 1px solid var(--line); }
.footer b { color: var(--bone); font-weight: 600; }
.footer a { color: var(--bone); }

/* ── Reveal ── */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; } .reveal.d3 { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .cue i, .game-status i { animation: none; }
  .game, .game-art img, .photo img, .btn, .ws-grid a { transition: none; }
}
