/* DungeonFlux landing page */

:root {
  --night: #0a1426;
  --deep: #0e1b33;
  --river: #16294a;
  --panel: rgba(16, 30, 56, 0.72);
  --gold: #e0b061;
  --gold-hi: #f4d99f;
  --gold-dim: #9c7a3f;
  --rule: rgba(224, 176, 97, 0.34);
  --rule-soft: rgba(224, 176, 97, 0.16);
  --flux: #8ccbe8;
  --flux-deep: #4f9cc4;
  --text: #ebe4d4;
  --muted: #b0b9ca;
  --ember: #f08a3c;

  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --body: "Source Serif 4", "Iowan Old Style", Georgia, serif;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(72px, 10vw, 136px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--night);
  background-image:
    radial-gradient(1200px 700px at 78% -10%, rgba(79, 156, 196, 0.16), transparent 60%),
    radial-gradient(900px 600px at 10% 110%, rgba(224, 176, 97, 0.08), transparent 60%),
    linear-gradient(180deg, #0c1830 0%, var(--night) 40%, #08101f 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--body);
  font-size: clamp(17px, 0.3vw + 16px, 19px);
  line-height: 1.62;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--gold-hi); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #fff3d6; }

:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 3px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--gold); color: var(--night); padding: 10px 16px;
  font-weight: 600; text-decoration: none; border-radius: 2px;
}
.skip:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  color: var(--gold-hi);
  text-wrap: balance;
}

p { margin: 0 0 1em; }

.flux {
  color: var(--flux);
  background: linear-gradient(180deg, #d6f0ff 0%, var(--flux) 45%, var(--flux-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Weather: rain and drifting fog ---------- */

.weather {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  overflow: hidden;
}
.weather::before {
  content: ""; position: absolute; inset: -20% -10%;
  background-image:
    repeating-linear-gradient(104deg, transparent 0 22px, rgba(170, 205, 235, 0.07) 22px 23px, transparent 23px 61px),
    repeating-linear-gradient(101deg, transparent 0 37px, rgba(170, 205, 235, 0.05) 37px 38px, transparent 38px 97px);
  background-size: 100% 180px, 100% 260px;
  animation: rain 0.9s linear infinite;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.25) 70%, transparent);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.25) 70%, transparent);
}
.weather::after {
  content: ""; position: absolute; left: -30%; right: -30%; bottom: -10%; height: 55%;
  background:
    radial-gradient(40% 60% at 30% 70%, rgba(120, 150, 190, 0.10), transparent 70%),
    radial-gradient(35% 50% at 70% 80%, rgba(120, 150, 190, 0.08), transparent 70%);
  animation: fog 38s ease-in-out infinite alternate;
}
@keyframes rain { to { background-position: -30px 180px, -40px 260px; } }
@keyframes fog { to { transform: translateX(12%); } }

.site-header, main, .site-footer { position: relative; z-index: 1; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(9, 18, 34, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
.bar {
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 700; font-size: 1.15rem;
  color: var(--gold-hi); text-decoration: none; letter-spacing: 0.02em;
}
.brand-die { width: 26px; height: 26px; color: var(--gold); }

.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: clamp(14px, 2vw, 28px);
}
.site-nav a {
  color: var(--text); text-decoration: none; font-size: 0.95rem; white-space: nowrap;
  padding: 6px 0; border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--gold-hi); border-bottom-color: var(--rule); }
.site-nav .nav-gh {
  border: 1px solid var(--rule); padding: 6px 14px; border-radius: 2px;
}
.site-nav .nav-gh:hover { border-color: var(--gold); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px; padding: 0;
  background: transparent; border: 1px solid var(--rule); border-radius: 2px;
  color: var(--gold-hi); cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle-lines, .nav-toggle-lines::before, .nav-toggle-lines::after {
  display: block; width: 20px; height: 1.5px; background: currentColor; position: relative;
  transition: transform .2s ease, background-color .2s ease;
}
.nav-toggle-lines::before, .nav-toggle-lines::after { content: ""; position: absolute; left: 0; }
.nav-toggle-lines::before { top: -6px; }
.nav-toggle-lines::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-lines { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-lines::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-lines::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 980px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; top: 64px; left: 0; right: 0;
    background: rgba(9, 18, 34, 0.97);
    border-bottom: 1px solid var(--rule);
    display: none;
  }
  .site-nav.open { display: block; }
  .no-js .nav-toggle { display: none; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 16px; }
  .site-nav a { display: block; padding: 12px 0; border-bottom: 1px solid var(--rule-soft); font-size: 1.05rem; }
  .site-nav .nav-gh { border: 0; border-bottom: 1px solid var(--rule-soft); padding: 12px 0; }
}

/* ---------- Frames: thin gold rules with corner ticks ---------- */

.frame {
  position: relative;
  margin: 0;
  padding: 10px;
  background: linear-gradient(180deg, rgba(20, 36, 66, 0.8), rgba(10, 20, 38, 0.9));
  border: 1px solid var(--rule);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}
.frame::before {
  content: ""; position: absolute; inset: 4px; pointer-events: none;
  border: 1px solid var(--rule-soft);
}
.frame::after {
  content: ""; position: absolute; inset: -1px; pointer-events: none;
  background:
    linear-gradient(var(--gold), var(--gold)) top left / 18px 1px,
    linear-gradient(var(--gold), var(--gold)) top left / 1px 18px,
    linear-gradient(var(--gold), var(--gold)) top right / 18px 1px,
    linear-gradient(var(--gold), var(--gold)) top right / 1px 18px,
    linear-gradient(var(--gold), var(--gold)) bottom left / 18px 1px,
    linear-gradient(var(--gold), var(--gold)) bottom left / 1px 18px,
    linear-gradient(var(--gold), var(--gold)) bottom right / 18px 1px,
    linear-gradient(var(--gold), var(--gold)) bottom right / 1px 18px;
  background-repeat: no-repeat;
}
.frame figcaption {
  font-size: 0.86rem; font-style: italic; color: var(--muted);
  padding: 10px 4px 2px; line-height: 1.45;
}
.zoom { display: block; cursor: zoom-in; }
.zoom img { transition: filter .25s ease; }
.zoom:hover img { filter: brightness(1.08); }

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

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  font-family: var(--display); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.04em;
  color: var(--gold-hi); text-decoration: none;
  border: 1px solid var(--rule);
  background: rgba(14, 27, 51, 0.7);
  border-radius: 2px;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.btn:hover { border-color: var(--gold); background: rgba(224, 176, 97, 0.1); color: #fff3d6; }
.btn svg { width: 17px; height: 17px; }
.btn-gold {
  color: #1c1406;
  background: linear-gradient(180deg, #f6dca3 0%, var(--gold) 55%, #b98a3d 100%);
  border-color: #f6dca3;
  box-shadow: 0 0 0 1px rgba(0,0,0,.35) inset, 0 8px 30px -8px rgba(240, 170, 70, 0.55);
}
.btn-gold:hover { color: #1c1406; background: linear-gradient(180deg, #fbe7ba 0%, #ebbf72 55%, #c49446 100%); }
.btn-quiet { border-color: transparent; background: transparent; }

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

.hero {
  position: relative;
  padding: clamp(40px, 7vw, 96px) 0 clamp(64px, 8vw, 112px);
  overflow: hidden;
}
.hero-glow {
  position: absolute; pointer-events: none;
  width: 720px; height: 720px; max-width: 120vw;
  left: -200px; top: -120px;
  background: radial-gradient(closest-side, rgba(240, 160, 70, 0.22), rgba(240, 160, 70, 0.06) 55%, transparent);
  animation: lantern 5.5s ease-in-out infinite;
}
@keyframes lantern {
  0%, 100% { opacity: 1; }
  42% { opacity: 0.82; }
  48% { opacity: 0.95; }
  70% { opacity: 0.86; }
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 13fr);
  gap: clamp(32px, 4.5vw, 64px);
  align-items: center;
}
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 22px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.9rem; color: var(--gold-hi);
  background: rgba(224, 176, 97, 0.07);
}
.badge svg { width: 18px; height: 18px; color: var(--ember); }
.wordmark {
  font-size: min(4.1rem, 5.3vw);
  white-space: nowrap;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, #fff1cc 0%, var(--gold-hi) 35%, var(--gold) 70%, #a9782f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 22px rgba(240, 160, 70, 0.25));
}
.wordmark .flux { filter: drop-shadow(0 0 18px rgba(140, 203, 232, 0.25)); }
.tagline {
  font-style: italic;
  font-size: clamp(1.3rem, 1.9vw, 1.65rem);
  color: var(--text);
  margin: 18px 0 16px;
  line-height: 1.3;
}
.lede { color: var(--muted); max-width: 34em; margin: 0; }
.hero-art { margin: 0; }
.hero-art img { width: 100%; }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { max-width: 640px; }
  .wordmark { font-size: min(4.1rem, 12vw); }
}

/* ---------- Sections ---------- */

.section { padding: var(--section-y) 0; position: relative; }
.section + .section::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(560px, 70%); height: 1px;
  background: linear-gradient(90deg, transparent, var(--rule), transparent);
}
.section-head { max-width: 760px; margin: 0 0 clamp(36px, 5vw, 60px); }
.section-head h2 { font-size: clamp(2rem, 3.6vw, 3rem); margin-bottom: 18px; }
.section-intro { color: var(--muted); font-size: 1.06em; margin: 0; max-width: 40em; }

h3 { font-size: clamp(1.15rem, 1.5vw, 1.35rem); }

/* ---------- The bet: two-column ledger ---------- */

.ledger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  border: 1px solid var(--rule);
  background: var(--panel);
}
.ledger-col { padding: clamp(24px, 4vw, 44px); }
.ledger-col h3 { margin-bottom: 18px; font-size: clamp(1.3rem, 2vw, 1.6rem); }
.ledger-col:first-child h3 { color: var(--flux); }
.ledger-col ul { list-style: none; margin: 0; padding: 0; }
.ledger-col li {
  padding: 12px 0 12px 22px; position: relative;
  border-top: 1px solid var(--rule-soft);
}
.ledger-col li::before {
  content: ""; position: absolute; left: 2px; top: 1.28em;
  width: 7px; height: 7px; transform: rotate(45deg);
  border: 1px solid var(--gold);
}
.ledger-col:first-child li::before { border-color: var(--flux); }
.ledger-seal {
  display: flex; align-items: center; justify-content: center;
  padding: 0 8px;
  background: linear-gradient(90deg, transparent calc(50% - 0.5px), var(--rule) calc(50% - 0.5px), var(--rule) calc(50% + 0.5px), transparent calc(50% + 0.5px));
}
.ledger-seal svg {
  width: 64px; height: 64px; color: var(--gold);
  background: var(--deep); padding: 6px;
}
.ledger-foot {
  margin: 22px 0 0; text-align: center;
  font-family: var(--display); font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--gold-hi);
}

@media (max-width: 760px) {
  .ledger { grid-template-columns: minmax(0, 1fr); }
  .ledger-seal {
    padding: 0; height: 64px;
    background: linear-gradient(180deg, transparent calc(50% - 0.5px), var(--rule) calc(50% - 0.5px), var(--rule) calc(50% + 0.5px), transparent calc(50% + 0.5px));
  }
  .ledger-foot { text-align: left; }
}

/* ---------- Session moments ---------- */

.moment {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  margin-bottom: clamp(56px, 8vw, 96px);
}
.moment-flip .moment-text { order: 2; }
.moment-text h3 { margin-bottom: 10px; }
.moment-text p { color: var(--text); max-width: 32em; }
.moment-text p + h3 { margin-top: 28px; }
.moment-wide { grid-template-columns: minmax(0, 1fr); }
.moment-wide .moment-text { max-width: 720px; }
.phone-pair {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.5vw, 28px);
}
.sound {
  border-left: 1px solid var(--gold);
  padding: 4px 0 4px 24px; max-width: 720px;
}
.sound h3 { margin-bottom: 8px; }
.sound p { margin: 0; }

@media (max-width: 900px) {
  .moment { grid-template-columns: minmax(0, 1fr); }
  .moment-flip .moment-text { order: 0; }
  .phone-pair { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Demo ---------- */

.clock {
  display: flex;
  border: 1px solid var(--rule);
  margin-bottom: clamp(32px, 5vw, 52px);
  background: var(--panel);
}
.clock span {
  flex: var(--s) 1 0;
  min-width: 0;
  padding: 14px 8px 12px;
  font-family: var(--display); font-size: 0.78rem; letter-spacing: 0.03em;
  color: var(--muted);
  text-align: center;
  border-right: 1px solid var(--rule-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  position: relative;
}
.clock span:last-child { border-right: 0; }
.clock span::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  opacity: 0.55;
}
.clock span:nth-child(4)::after, .clock span:nth-child(6)::after { opacity: 1; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); }
.clock span:nth-child(4), .clock span:nth-child(6) { color: var(--gold-hi); }

.beats { list-style: none; margin: 0; padding: 0; position: relative; }
.beats::before {
  content: ""; position: absolute; top: 12px; bottom: 12px;
  left: 96px; width: 1px;
  background: linear-gradient(180deg, var(--rule), var(--gold) 50%, var(--rule));
}
.beat {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 0 40px;
  padding: 0 0 34px;
  position: relative;
}
.beat::before {
  content: ""; position: absolute; left: 91px; top: 10px;
  width: 11px; height: 11px; transform: rotate(45deg);
  background: var(--night); border: 1px solid var(--gold);
}
.beat-key::before { background: var(--gold); box-shadow: 0 0 14px rgba(240, 170, 70, 0.7); }
.beat-time {
  margin: 0; padding-right: 20px; text-align: right;
  font-family: var(--display); font-weight: 600; font-size: 1.15rem;
  color: var(--gold); font-variant-numeric: tabular-nums;
}
.beat h3 { margin-bottom: 6px; }
.beat p { max-width: 42em; margin: 0; }
.beat-key > div {
  background: var(--panel);
  border: 1px solid var(--rule);
  padding: 20px 24px;
  margin-top: -8px;
}
.roll {
  font-weight: 600; color: var(--gold-hi);
  white-space: nowrap;
  border-bottom: 1px solid var(--rule);
}
.failsafe {
  margin: 12px 0 0 136px;
  max-width: 720px;
  padding: 20px 24px;
  border: 1px dashed var(--rule);
}
.failsafe h3 { margin-bottom: 8px; color: var(--flux); }
.failsafe p { margin: 0; color: var(--muted); }

@media (max-width: 900px) {
  .clock { display: none; }
}
@media (max-width: 640px) {
  .beats::before { left: 5px; }
  .beat { grid-template-columns: minmax(0, 1fr); padding-left: 32px; }
  .beat::before { left: 0; top: 6px; }
  .beat-time { text-align: left; padding: 0; font-size: 1rem; margin-bottom: 2px; }
  .beat-key > div { margin-top: 4px; padding: 16px 18px; }
  .roll { white-space: normal; }
  .failsafe { margin-left: 0; }
}

/* ---------- Why it holds together ---------- */

.tenets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.tenet {
  background: linear-gradient(180deg, #0f1f3b, #0b172c);
  padding: clamp(24px, 3.4vw, 40px);
}
.tenet h3 { margin-bottom: 12px; }
.tenet p { margin: 0; color: var(--muted); }

@media (max-width: 760px) {
  .tenets { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- How it's built ---------- */

.stack { display: grid; gap: 0; }
.tier {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  border: 1px solid var(--rule);
  background: var(--panel);
}
.tier-name {
  padding: 22px 20px;
  font-size: 1.05rem;
  border-right: 1px solid var(--rule);
  display: flex; align-items: center;
  background: rgba(224, 176, 97, 0.05);
}
.tier-cells {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tier-cells-models { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cell {
  padding: 20px 22px;
  border-left: 1px solid var(--rule-soft);
}
.cell:first-child { border-left: 0; }
.cell h4 { font-size: 1rem; margin-bottom: 8px; color: var(--gold-hi); }
.cell p { margin: 0; font-size: 0.93rem; color: var(--muted); line-height: 1.55; }
.cell-engine {
  background: rgba(224, 176, 97, 0.08);
  box-shadow: inset 0 0 0 1px var(--gold);
}
.cell-engine h4 { color: #fff1cc; }
.tier-core { border-color: var(--gold); }

.wire {
  position: relative;
  margin: 0 0 0 135px;
  padding: 26px 0 26px 40px;
  max-width: 720px;
}
.wire::before {
  content: ""; position: absolute; left: 14px; top: 0; bottom: 0; width: 1px;
  background: repeating-linear-gradient(180deg, var(--gold) 0 6px, transparent 6px 11px);
}
.wire::after {
  content: ""; position: absolute; left: 10px; bottom: 2px;
  border: 4.5px solid transparent; border-top: 7px solid var(--gold); border-bottom: 0;
}
.wire p { margin: 0; font-size: 0.95rem; color: var(--muted); }
.wire strong { color: var(--flux); font-weight: 600; }
.rules-note { margin: 28px 0 0; color: var(--muted); font-size: 0.95rem; }

@media (max-width: 1060px) {
  .tier-cells-models { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tier-cells-models .cell:nth-child(3) { border-left: 0; }
  .tier-cells-models .cell:nth-child(n+3) { border-top: 1px solid var(--rule-soft); }
}
@media (max-width: 820px) {
  .tier { grid-template-columns: minmax(0, 1fr); }
  .wire { margin-left: 8px; }
  .tier-name { border-right: 0; border-bottom: 1px solid var(--rule); padding: 14px 20px; }
}
@media (max-width: 620px) {
  .tier-cells, .tier-cells-models { grid-template-columns: minmax(0, 1fr); }
  .cell, .tier-cells-models .cell:nth-child(3) { border-left: 0; border-top: 1px solid var(--rule-soft); }
  .cell:first-child { border-top: 0; }
}

/* ---------- After ---------- */

.after-art { margin-bottom: clamp(32px, 5vw, 52px); }
.after-art img { width: 100%; }
.roadmap {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 48px);
}
.roadmap article { border-top: 1px solid var(--gold); padding-top: 18px; }
.roadmap h3 { margin-bottom: 10px; }
.roadmap p { margin: 0; color: var(--muted); }

@media (max-width: 760px) {
  .roadmap { grid-template-columns: minmax(0, 1fr); }
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  background: rgba(6, 12, 24, 0.85);
  padding: clamp(40px, 6vw, 64px) 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.footer-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: clamp(28px, 5vw, 64px);
}
.footer-mark {
  font-family: var(--display); font-weight: 700; font-size: 1.5rem;
  color: var(--gold-hi); margin-bottom: 12px;
}
.site-footer a { color: var(--gold-hi); overflow-wrap: anywhere; }
.legal p { font-size: 0.84rem; line-height: 1.6; }

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Lightbox ---------- */

.lightbox {
  width: min(96vw, 1500px);
  max-height: 94vh;
  padding: 12px;
  border: 1px solid var(--gold);
  background: var(--deep);
  color: var(--text);
}
.lightbox::backdrop { background: rgba(3, 7, 15, 0.88); }
.lightbox img { width: 100%; height: auto; max-height: calc(94vh - 90px); object-fit: contain; }
.lightbox-caption { margin: 10px 4px 0; font-style: italic; color: var(--muted); font-size: 0.92rem; }
.lightbox form { position: absolute; top: 18px; right: 18px; margin: 0; }
.lightbox-close {
  width: 40px; height: 40px;
  font-size: 1.6rem; line-height: 1;
  color: var(--gold-hi); background: rgba(9, 18, 34, 0.85);
  border: 1px solid var(--rule); border-radius: 2px; cursor: pointer;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .weather::before, .weather::after, .hero-glow { animation: none; }
  *, *::before, *::after { transition: none !important; }
}

/* Devlog */
.devlog { padding-top: clamp(120px, 14vw, 170px); }
.devlog-wrap { max-width: calc(860px + 2 * var(--gutter)); }
.devlog-meta { font-family: var(--display); letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; color: var(--gold); margin: 0 0 14px; }
.devlog-title { font-size: clamp(2rem, 4.4vw, 3.2rem); line-height: 1.12; margin: 0 0 20px; color: var(--gold-hi); }
.devlog h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin: 56px 0 16px; color: var(--gold-hi); }
.devlog p, .devlog li { font-size: 1.06rem; line-height: 1.7; }
.devlog p { margin: 0 0 16px; }
.devlog code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; color: var(--flux); background: rgba(140, 203, 232, .08); padding: 1px 5px; border-radius: 3px; }
.devlog-steps, .devlog-list { padding-left: 1.3em; margin: 0 0 16px; }
.devlog-steps li, .devlog-list li { margin: 0 0 12px; }
.devlog-steps strong { color: var(--gold-hi); }
.devlog-table-wrap { overflow-x: auto; margin: 8px 0 20px; border: 1px solid var(--rule); background: var(--panel); }
.devlog-table { width: 100%; border-collapse: collapse; font-size: .96rem; min-width: 560px; }
.devlog-table th, .devlog-table td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--rule-soft); }
.devlog-table th { font-family: var(--display); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); border-bottom-color: var(--rule); }
.devlog-table td:first-child { color: var(--gold-hi); white-space: nowrap; }
.devlog-table tr:last-child td { border-bottom: 0; }
.devlog-scores td:nth-child(2) { font-family: var(--display); color: var(--flux); white-space: nowrap; }
.devlog-next { margin-top: 48px; padding: 18px 20px; border-left: 2px solid var(--gold); background: var(--panel); color: var(--muted); }
.site-nav a[aria-current="page"] { color: var(--gold-hi); }

/* Devlog timeline */
.devlog-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 36px; }
.devlog-filters[hidden] { display: none; }
.chip { font: 600 .8rem/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: transparent; border: 1px solid var(--rule); padding: 9px 14px; border-radius: 999px; cursor: pointer; }
.chip:hover { color: var(--gold-hi); border-color: var(--gold-dim); }
.chip:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.chip.is-on { color: var(--night); background: var(--gold); border-color: var(--gold); }
.chip-n { opacity: .7; font-size: .9em; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 28px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--gold), var(--gold-dim) 60%, transparent); }
.entry { position: relative; margin: 0 0 22px; padding: 18px 20px 6px; background: var(--panel); border: 1px solid var(--rule-soft); scroll-margin-top: 96px; }
.entry[hidden] { display: none; }
.entry::before { content: ""; position: absolute; left: -27px; top: 22px; width: 12px; height: 12px; border-radius: 50%; background: var(--night); border: 2px solid var(--gold); box-shadow: 0 0 10px rgba(224, 176, 97, .5); }
.entry:target { border-color: var(--gold); }
.entry-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 8px; font-size: .85rem; color: var(--muted); }
.entry-head time { font-family: var(--display); letter-spacing: .06em; color: var(--gold); }
.kind { font: 600 .7rem/1 var(--display); letter-spacing: .1em; text-transform: uppercase; padding: 5px 8px; border: 1px solid currentColor; border-radius: 3px; }
.entry[data-kind="process"] .kind { color: var(--flux); }
.entry[data-kind="issue"] .kind { color: var(--ember); }
.entry[data-kind="discovery"] .kind { color: #9fd9a4; }
.entry[data-kind="decision"] .kind { color: var(--gold-hi); }
.entry[data-kind="milestone"] .kind { color: #d6a8ff; }
.entry[data-kind="issue"]::before { border-color: var(--ember); }
.entry[data-kind="discovery"]::before { border-color: #9fd9a4; }
.entry[data-kind="process"]::before { border-color: var(--flux); }
.entry[data-kind="milestone"]::before { border-color: #d6a8ff; }
.who { font-style: italic; }
.devlog .entry-title { font-size: clamp(1.1rem, 1.9vw, 1.35rem); margin: 0 0 10px; line-height: 1.3; }
.entry-title a { color: var(--gold-hi); text-decoration: none; }
.entry-title a:hover, .entry-title a:focus-visible { text-decoration: underline; }
.devlog .entry p { font-size: 1rem; line-height: 1.65; }
@media (max-width: 560px) {
  .timeline { padding-left: 20px; }
  .timeline::before { left: 3px; }
  .entry { padding: 14px 14px 4px; }
  .entry::before { left: -23px; }
}

/* Gallery call-to-action on the home page */
.cta-gallery {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  margin: 0 0 clamp(56px, 8vw, 96px);
  padding: 18px 22px;
  border: 1px solid var(--rule);
  background: var(--panel);
}
.cta-gallery p { margin: 0; color: var(--muted); max-width: 40em; }
