/* ============================================================
   BL Guide — Beautiful Light community site
   Direction: a declassified field dossier laid over cinematic
   stills. The photography carries the design; the interface
   reads as printed intel on top of it.
   Palette pulled from the game's own briefing screen:
   highlighter yellow, oxide stamp red, cold graphite.
   Type: Archivo Black (display) / Archivo (body) /
   Martian Mono (stamps and data, small and wide).
============================================================ */

/* --- Tokens ------------------------------------------------ */
:root {
  /* Ground */
  --ground:      oklch(0.145 0.010 250);
  --ground-deep: oklch(0.100 0.010 250);
  --sheet:       oklch(0.205 0.010 250);
  --sheet-hi:    oklch(0.255 0.010 250);

  /* Edges */
  --edge:        oklch(0.305 0.012 250);
  --edge-soft:   oklch(0.235 0.010 250);

  /* Ink */
  --ink:         oklch(0.955 0.004 250);
  --ink-2:       oklch(0.760 0.008 250);
  --ink-3:       oklch(0.615 0.009 250);

  /* Marks */
  --mark:        oklch(0.870 0.185 103);
  --mark-deep:   oklch(0.760 0.170 103);
  --on-mark:     oklch(0.150 0.040 103);
  --stamp:       oklch(0.585 0.200 27);

  /* Type */
  --font-display: 'Archivo Black', 'Archivo', system-ui, sans-serif;
  --font-body:    'Archivo', system-ui, sans-serif;
  --font-data:    'Martian Mono', ui-monospace, monospace;

  /* Space */
  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.5rem;  --sp-6: 2rem;   --sp-7: 3rem;    --sp-8: 4rem;
  --sp-9: 6rem;
  --band: clamp(4rem, 9vw, 8rem);

  --wrap: 1240px;
  --nav-h: 62px;

  /* Depth */
  --z-sticky: 100;
  --z-overlay: 200;
  --z-modal: 300;

  --out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* height:auto keeps every photo on its own ratio, whatever the width/height attributes say */
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; }
::selection { background: var(--mark); color: var(--on-mark); }

/* --- Primitives -------------------------------------------- */
.shell { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.shell--wide { width: min(100% - 2.5rem, 1560px); }

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

.h1, .h2, .h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.h1 { font-size: clamp(2rem, 8.6vw, 5.4rem); }
.h2 { font-size: clamp(1.7rem, 6vw, 3.4rem); }
.h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); letter-spacing: -0.02em; }

.lede { font-size: clamp(1rem, 1.35vw, 1.1875rem); color: var(--ink-2); max-width: 62ch; }
.body-2 { color: var(--ink-2); max-width: 68ch; }

/* the dossier voice: small, wide, printed */
.data {
  font-family: var(--font-data);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1.5;
}
.data--mark { color: var(--mark); }
.data--stamp { color: var(--stamp); }
.data--ink { color: var(--ink-2); }

/* the classification stamp, used once */
.stamp {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border: 2px solid currentColor;
  background: color-mix(in oklch, var(--ground-deep) 72%, transparent);
  color: oklch(0.70 0.185 27);
  font-family: var(--font-data);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: rotate(-2.5deg);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-family: var(--font-data); font-size: 0.6875rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--edge);
  color: var(--ink);
  transition: background 0.25s var(--out), border-color 0.25s var(--out), color 0.25s var(--out);
}
.btn:hover { background: var(--sheet-hi); border-color: var(--ink-3); }
.btn--mark { background: var(--mark); border-color: var(--mark); color: var(--on-mark); }
.btn--mark:hover { background: var(--ink); border-color: var(--ink); color: var(--ground-deep); }

/* --- Nav --------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: var(--z-sticky);
  height: var(--nav-h);
  background: color-mix(in oklch, var(--ground-deep) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--edge-soft);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.nav__logo { display: flex; align-items: center; gap: 0.55rem; }
.nav__mark {
  width: 12px; height: 12px; flex: none;
  background: var(--mark);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
/* echoes the game's own wordmark: light weight, wide tracking, all caps */
.nav__name {
  font-family: var(--font-body); font-weight: 500; font-size: 0.9375rem;
  letter-spacing: 0.24em; text-transform: uppercase;
}
.nav__suffix {
  font-family: var(--font-data); font-size: 0.5625rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-3); align-self: center;
}
.nav__links { display: flex; gap: 1.75rem; list-style: none; }
.nav__link {
  font-family: var(--font-data); font-size: 0.625rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-2); padding-block: 0.5rem; position: relative;
  transition: color 0.2s var(--out);
}
.nav__link:hover, .nav__link.is-active { color: var(--ink); }
.nav__link.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--mark);
}
.nav__toggle { display: none; width: 44px; height: 44px; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.nav__toggle span { display: block; width: 22px; height: 2px; background: var(--ink); transition: transform 0.3s var(--out), opacity 0.2s; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Hero -------------------------------------------------- */
.hero { position: relative; min-height: clamp(560px, 86vh, 900px); display: flex; align-items: flex-end; overflow: hidden; }
.hero__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 42%;
  filter: saturate(0.72) contrast(1.06) brightness(0.62);
  transform: scale(1.06);
  animation: drift 34s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: scale(1.06) translate3d(0, 0, 0); } to { transform: scale(1.12) translate3d(-1.4%, -1%, 0); } }
.hero__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, color-mix(in oklch, var(--ground-deep) 78%, transparent) 0%, transparent 32%),
    linear-gradient(0deg, var(--ground) 4%, color-mix(in oklch, var(--ground) 82%, transparent) 30%, transparent 66%);
}
.hero__inner { position: relative; padding-block: var(--sp-8) var(--sp-7); }
.hero__flag { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: var(--sp-5); }
.hero__title { margin-bottom: var(--sp-5); max-width: 18ch; }
.hero__title .mark { background: var(--mark); color: var(--on-mark); padding: 0 0.12em; white-space: nowrap; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hero__lede { margin-bottom: var(--sp-6); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* the vitals strip: the four things every visitor arrives asking */
.vitals {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--edge-soft);
  margin-top: var(--sp-7);
}
.vitals__cell { padding: var(--sp-4) var(--sp-4) 0 0; }
.vitals__cell + .vitals__cell { border-left: 1px solid var(--edge-soft); padding-left: var(--sp-4); }
.vitals__v { font-family: var(--font-display); font-size: clamp(1rem, 1.7vw, 1.375rem); letter-spacing: -0.02em; text-transform: uppercase; }
.vitals__k { margin-top: 0.2rem; }

/* --- Section frame ----------------------------------------- */
.band { padding-block: var(--band); }
.band--sheet { background: var(--ground-deep); }
.band__head { max-width: 70ch; margin-bottom: var(--sp-7); }
.band__head .h2 { margin-bottom: var(--sp-4); }

/* --- The loop: an actual ordered sequence, so it is numbered - */
.loop { display: grid; gap: 1px; background: var(--edge-soft); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.step { position: relative; background: var(--ground); display: flex; flex-direction: column; }
.step__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.step__media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.7) brightness(0.7); transition: transform 0.8s var(--out), filter 0.6s var(--out); }
.step:hover .step__media img { transform: scale(1.05); filter: saturate(0.85) brightness(0.86); }
.step__n {
  position: absolute; left: 0; top: 0; z-index: 1;
  background: var(--mark); color: var(--on-mark);
  font-family: var(--font-data); font-size: 0.625rem; font-weight: 700; letter-spacing: 0.1em;
  padding: 0.3rem 0.6rem;
}
.step__body { padding: var(--sp-5); flex: 1; }
.step__title { font-family: var(--font-display); font-size: 1.35rem; text-transform: uppercase; letter-spacing: -0.02em; }
.step__text { margin-top: var(--sp-3); color: var(--ink-2); font-size: 0.9375rem; }

/* --- Split: image beside dense text ------------------------- */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.split--flip .split__media { order: 2; }
.split__media { position: relative; }
.split__media img { width: 100%; filter: saturate(0.75) contrast(1.04) brightness(0.82); }
.split__cap {
  position: absolute; left: 0; bottom: 0;
  background: var(--ground-deep); padding: 0.4rem 0.7rem;
  max-width: 90%;
}
.split__list { list-style: none; margin-top: var(--sp-5); display: grid; gap: var(--sp-3); }
.split__list li { display: grid; grid-template-columns: 12px 1fr; gap: var(--sp-3); color: var(--ink-2); align-items: start; }
.split__list li::before { content: ''; width: 12px; height: 2px; background: var(--mark); margin-top: 0.72em; }

/* --- Raid composition: one bar, drawn to scale --------------- */
.comp { display: grid; grid-template-columns: 3fr 1fr; gap: var(--sp-3); }
.comp__side { display: flex; flex-direction: column; gap: var(--sp-3); }
.comp__cells { display: flex; gap: 6px; height: clamp(88px, 11vw, 128px); }
.comp__squad { flex: 1; display: flex; gap: 3px; padding: 5px; background: var(--sheet); border: 1px solid var(--edge); }
.comp__op { flex: 1; background: var(--ink-3); }
.comp__side--anomaly .comp__squad { background: oklch(0.24 0.055 27); border-color: oklch(0.40 0.11 27); }
.comp__side--anomaly .comp__op { background: oklch(0.62 0.185 27); }
.comp__key { display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; }
.comp__n { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: -0.03em; line-height: 1; }
.comp__n--anomaly { color: oklch(0.70 0.185 27); }
.roster__note { margin-top: var(--sp-6); }

/* --- Roadmap: two columns, one shipped, one promised --------- */
.phases { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--edge-soft); border: 1px solid var(--edge-soft); }
.phase { background: var(--ground); padding: var(--sp-6); }
.phase--later { background: var(--ground-deep); }
.phase__h { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); padding-bottom: var(--sp-4); border-bottom: 1px solid var(--edge-soft); }
.phase__list { list-style: none; margin-top: var(--sp-5); display: grid; gap: var(--sp-4); }
.phase__list li { display: grid; grid-template-columns: 16px 1fr; gap: var(--sp-3); color: var(--ink-2); font-size: 0.9375rem; }
.phase__list li::before { content: '+'; font-family: var(--font-data); font-size: 0.75rem; color: var(--mark); line-height: 1.5; }
.phase--later .phase__list li::before { content: '?'; color: var(--ink-3); }

/* --- Spec table --------------------------------------------- */
.spec { width: 100%; border-collapse: collapse; text-align: left; }
.spec caption { text-align: left; padding-bottom: var(--sp-4); }
.spec th, .spec td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--edge-soft); }
.spec thead th { background: var(--sheet); font-family: var(--font-data); font-size: 0.625rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; }
.spec tbody th { font-weight: 500; color: var(--ink-2); width: 24%; }
.spec td { font-family: var(--font-data); font-size: 0.75rem; color: var(--ink); }
.spec tbody tr:hover td, .spec tbody tr:hover th { background: var(--sheet); }

/* --- The redaction: what has not been disclosed -------------- */
.redact { display: grid; gap: 1px; background: var(--edge-soft); border: 1px solid var(--edge-soft); }
.redact__row { background: var(--sheet); display: grid; grid-template-columns: 1fr minmax(140px, 30%); gap: var(--sp-5); align-items: center; padding: var(--sp-4) var(--sp-5); }
.redact__q { color: var(--ink); }
.redact__bar {
  position: relative; height: 1.35rem;
  background: oklch(0.06 0 0);
  border: 1px solid oklch(0.30 0.01 250 / 0.55);
}
.redact__bar span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.redact__foot { margin-top: var(--sp-5); }

/* --- Gallery ------------------------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-3); }
.gallery figure { position: relative; overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; filter: saturate(0.7) brightness(0.78); transition: transform 0.9s var(--out), filter 0.5s var(--out); }
.gallery figure:hover img { transform: scale(1.06); filter: saturate(0.9) brightness(0.95); }
.gallery figcaption { position: absolute; left: 0; bottom: 0; background: var(--ground-deep); padding: 0.35rem 0.6rem; }

/* --- News ---------------------------------------------------- */
.feed { display: grid; gap: 1px; background: var(--edge-soft); border-block: 1px solid var(--edge-soft); }
.entry {
  display: grid; grid-template-columns: minmax(120px, 14%) 1fr minmax(90px, 10%);
  gap: var(--sp-5); align-items: baseline;
  background: var(--ground); padding: var(--sp-5);
  transition: background 0.2s var(--out);
}
.entry:hover { background: var(--sheet); }
.entry__title { font-family: var(--font-display); font-size: clamp(1.1rem, 1.8vw, 1.5rem); text-transform: uppercase; letter-spacing: -0.02em; }
.entry__desc { margin-top: var(--sp-3); color: var(--ink-2); font-size: 0.9375rem; max-width: 70ch; }
.entry__go { text-align: right; }
.empty { background: var(--ground); padding: var(--sp-8) var(--sp-5); text-align: center; }
.empty__t { font-family: var(--font-display); font-size: 1.5rem; text-transform: uppercase; letter-spacing: -0.02em; }
.empty__p { margin-top: var(--sp-3); color: var(--ink-2); }

/* --- FAQ ----------------------------------------------------- */
.qa { border-block: 1px solid var(--edge-soft); }
.qa__item { border-bottom: 1px solid var(--edge-soft); }
.qa__item:last-child { border-bottom: 0; }
.qa__q {
  display: flex; justify-content: space-between; gap: var(--sp-5); align-items: center;
  padding: var(--sp-5) 0; cursor: pointer; list-style: none;
  font-family: var(--font-display); font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  text-transform: uppercase; letter-spacing: -0.02em;
  transition: color 0.2s var(--out);
}
.qa__q:hover { color: var(--mark); }
.qa__q::-webkit-details-marker { display: none; }
.qa__q::after { content: '+'; font-family: var(--font-data); font-size: 1rem; color: var(--ink-3); flex: none; }
.qa__item[open] .qa__q::after { content: '\2013'; color: var(--mark); }
.qa__a { padding-bottom: var(--sp-5); color: var(--ink-2); max-width: 72ch; }
.qa__a p + p { margin-top: var(--sp-4); }

/* --- Inline links inside running text -------------------------- */
.lede a, .body-2 a, .qa__a a, .vitals__k a, .redact__foot a {
  color: var(--ink);
  box-shadow: inset 0 -1px 0 var(--mark);
  transition: box-shadow 0.2s var(--out);
}
.lede a:hover, .body-2 a:hover, .qa__a a:hover, .vitals__k a:hover, .redact__foot a:hover {
  box-shadow: inset 0 -2px 0 var(--mark);
}

/* --- Footer --------------------------------------------------- */
.footer { background: var(--ground-deep); padding-block: var(--sp-7) var(--sp-6); border-top: 1px solid var(--edge-soft); }
.footer__top { display: flex; flex-wrap: wrap; gap: var(--sp-6); justify-content: space-between; align-items: flex-start; }
.footer__links { display: flex; flex-wrap: wrap; gap: var(--sp-5); }
.footer__links a { transition: color 0.2s var(--out); }
.footer__links a:hover { color: var(--mark); }
.footer__note { margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid var(--edge-soft); max-width: 84ch; }
.footer__note p + p { margin-top: var(--sp-2); }

/* --- Entrance choreography, hero only -------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .hero__flag, .hero__title, .hero__lede, .hero__actions, .vitals {
    animation: rise 0.9s var(--out) backwards;
  }
  .hero__flag { animation-delay: 0.05s; }
  .hero__title { animation-delay: 0.15s; }
  .hero__lede { animation-delay: 0.25s; }
  .hero__actions { animation-delay: 0.33s; }
  .vitals { animation-delay: 0.41s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* --- Responsive ------------------------------------------------ */
@media (max-width: 1000px) {
  .comp { grid-template-columns: 1fr; gap: var(--sp-5); }
  .comp__cells { height: 84px; }
  .split { grid-template-columns: 1fr; gap: var(--sp-6); }
  .split--flip .split__media { order: 0; }
  .phases { grid-template-columns: 1fr; }
  .vitals { grid-template-columns: repeat(2, 1fr); }
  .vitals__cell:nth-child(3) { border-left: 0; padding-left: 0; }
  .vitals__cell:nth-child(n+3) { border-top: 1px solid var(--edge-soft); margin-top: var(--sp-2); }
}
@media (max-width: 860px) {
  .nav__links {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; gap: 0;
    background: var(--ground-deep); border-bottom: 1px solid var(--edge);
    padding: 0 1.25rem var(--sp-5);
    transform: translateY(-130%); transition: transform 0.35s var(--out);
  }
  .nav__links.is-open { transform: translateY(0); }
  .nav__link { display: block; padding-block: var(--sp-4); border-bottom: 1px solid var(--edge-soft); }
  .nav__toggle { display: flex; }
  .entry { grid-template-columns: 1fr; gap: var(--sp-3); }
  .entry__go { text-align: left; }
  .redact__row { grid-template-columns: 1fr; gap: var(--sp-3); }
}
@media (max-width: 560px) {
  .comp__squad { padding: 3px; gap: 2px; }
  .vitals { grid-template-columns: 1fr; }
  .vitals__cell + .vitals__cell { border-left: 0; padding-left: 0; border-top: 1px solid var(--edge-soft); }
  .spec th, .spec td { padding: var(--sp-3) var(--sp-2); }
  .spec tbody th { width: 34%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .hero__img { transform: scale(1.02); }
}
