/* Mortal Shell II — unofficial guide
   Palette and type per design/DESIGN-BRIEF.md:
   bg #0b0a09 / #14110e · bone #e8e0d2 · muted #9a9083
   rust #b85a32 · moss #5d7a62 (verified) · gold #c9a227 (unverified) · line #2a241c */

:root {
  --bg: #0b0a09;
  --bg-raised: #14110e;
  --bone: #e8e0d2;
  --muted: #9a9083;
  --rust: #b85a32;
  --rust-bright: #d0693c;
  --moss: #5d7a62;
  --gold: #c9a227;
  --line: #2a241c;
  --radius: 8px;
  --serif: "Cormorant Garamond", "Libre Baskerville", Georgia, serif;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* faint wet-stone texture, no hero art wall */
  background-image:
    radial-gradient(ellipse 90% 40% at 50% -5%, rgba(184, 90, 50, 0.07), transparent),
    radial-gradient(ellipse 60% 50% at 85% 110%, rgba(93, 122, 98, 0.045), transparent);
  background-attachment: fixed;
}

a { color: var(--rust-bright); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ---------- top bar ---------- */

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(11, 10, 9, 0.92);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 58px;
}

.brand {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--bone);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--rust-bright); }
.brand .numeral { color: var(--rust); }

.nav { margin-left: auto; display: flex; gap: 4px; }

.nav a {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 6px;
}
.nav a:hover { color: var(--bone); text-decoration: none; background: var(--bg-raised); }
.nav a[aria-current="page"] { color: var(--rust-bright); }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--bone);
  font: inherit;
  padding: 6px 12px;
  cursor: pointer;
}

/* ---------- beacon divider (signature motif) ---------- */

.beacon-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--rust);
}
.beacon-rule::before, .beacon-rule::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}
.beacon-rule .gem {
  width: 7px; height: 7px;
  background: var(--rust);
  transform: rotate(45deg);
  flex: none;
}

/* ---------- hero ---------- */

.hero { padding: 72px 0 48px; }

/* homepage hero with official key art backdrop */
.hero-art {
  position: relative;
  overflow: hidden;
  padding: 110px 0 64px;
  border-bottom: 1px solid var(--line);
}
.hero-art .wrap { position: relative; z-index: 3; }
.hero-bg {
  position: absolute;
  inset: -4% -2%;
  background: url("../img/hero-bg.jpg") right 34% / cover no-repeat;
  animation: hero-drift 28s ease-in-out infinite alternate;
  z-index: 1;
}
@keyframes hero-drift {
  from { transform: scale(1) translateX(0); }
  to   { transform: scale(1.07) translateX(-1.5%); }
}
.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(11, 10, 9, 0.96) 0%, rgba(11, 10, 9, 0.87) 34%, rgba(11, 10, 9, 0.55) 62%, rgba(11, 10, 9, 0.35) 100%),
    linear-gradient(180deg, rgba(11, 10, 9, 0.55) 0%, rgba(11, 10, 9, 0) 30%, rgba(11, 10, 9, 0.1) 62%, var(--bg) 100%);
}
#embers {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.hero-credit {
  position: absolute;
  right: 16px;
  bottom: 10px;
  z-index: 3;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: rgba(154, 144, 131, 0.7);
}
.hero-art .stats {
  background: rgba(20, 17, 14, 0.82);
  backdrop-filter: blur(4px);
}

/* entrance for hero content */
.hero-art .eyebrow, .hero-art h1, .hero-art .lede,
.hero-art .official-line, .hero-art .btn-row, .hero-art .stats {
  animation: rise-in 0.7s ease-out both;
}
.hero-art h1 { animation-delay: 0.08s; }
.hero-art .lede { animation-delay: 0.16s; }
.hero-art .official-line { animation-delay: 0.24s; }
.hero-art .btn-row { animation-delay: 0.32s; }
.hero-art .stats { animation-delay: 0.42s; }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* scroll reveal (activated only when JS adds .js to <html>) */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.js .reveal.visible { opacity: 1; transform: none; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rust);
  margin: 0 0 14px;
}

h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
  margin: 0 0 18px;
  max-width: 21ch;
}

.hero .lede, .lede {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 62ch;
  margin: 0 0 26px;
}

.lede strong { color: var(--bone); font-weight: 500; }

.official-line {
  border-left: 2px solid var(--rust);
  padding: 4px 0 4px 16px;
  margin: 0 0 28px;
  max-width: 60ch;
}
.official-line p {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-style: italic;
  margin: 0 0 6px;
  color: var(--bone);
}
.official-line cite {
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }

.btn {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 22px;
  border-radius: 6px;
  border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--rust); color: #16100c; }
.btn-primary:hover { background: var(--rust-bright); }
.btn-ghost { border-color: var(--line); color: var(--bone); }
.btn-ghost:hover { border-color: var(--rust); color: var(--rust-bright); }

/* stat strip */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  overflow: hidden;
}
.stat { padding: 18px 20px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: none; }
.stat .value {
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--bone);
  display: block;
}
.stat .label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- sections ---------- */

.section { padding: 48px 0; }
.section + .section { border-top: 1px solid var(--line); }

h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.15;
  margin: 0 0 12px;
}

h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.3rem;
  margin: 34px 0 10px;
}

.section-intro { color: var(--muted); max-width: 68ch; margin: 0 0 28px; }

/* ---------- cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
a.card {
  color: var(--bone);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
a.card:hover {
  text-decoration: none;
  border-color: var(--rust);
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(184, 90, 50, 0.25);
}
a.card:hover .card-title { color: var(--rust-bright); }

.card-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
}
.card p { margin: 0; font-size: 0.9rem; color: var(--muted); }
.card .go {
  margin-top: auto;
  padding-top: 10px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rust);
}

/* chips / badges */

.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--muted);
  align-self: flex-start;
}
.chip-start { border-color: var(--rust); color: var(--rust-bright); }
.chip-verified { border-color: rgba(93, 122, 98, 0.7); color: #8aa890; }
.chip-caution { border-color: rgba(201, 162, 39, 0.55); color: var(--gold); }

/* ---------- start path ---------- */

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 12px; }
.steps > li {
  counter-increment: step;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  padding: 16px 18px 16px 62px;
  position: relative;
}
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 18px;
  top: 16px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--rust);
}
.steps .step-title { font-weight: 600; display: block; margin-bottom: 2px; }
.steps p { margin: 0; font-size: 0.9rem; color: var(--muted); }

/* ---------- trailer ---------- */

.trailer-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 28px;
  align-items: center;
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raised);
  cursor: pointer;
  padding: 0;
  display: block;
  width: 100%;
}
.video-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, opacity 0.3s ease;
  opacity: 0.85;
}
.video-frame:hover img { transform: scale(1.03); opacity: 1; }
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: rgba(11, 10, 9, 0.72);
  border: 1px solid var(--rust);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.video-frame:hover .play-btn {
  background: var(--rust);
  transform: translate(-50%, -50%) scale(1.06);
}
.play-btn::after {
  content: "";
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent var(--bone);
  margin-left: 5px;
}
.video-note {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 10px;
}

.trailer-aside h3 { margin-top: 0; }
.trailer-aside p { color: var(--muted); font-size: 0.95rem; }
.trailer-links { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.trailer-links .btn { text-align: center; }
.trailer-links .yt-fallback {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-align: center;
  color: var(--muted);
}
.trailer-links .yt-fallback:hover { color: var(--rust-bright); }

@media (max-width: 860px) {
  .trailer-grid { grid-template-columns: 1fr; }
}

/* ---------- article pages ---------- */

.article { padding: 56px 0 24px; max-width: 820px; }

.crumbs {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--rust-bright); }

.meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 26px;
}

/* direct answer block */

.answer {
  border: 1px solid var(--line);
  border-left: 3px solid var(--moss);
  border-radius: var(--radius);
  background: var(--bg-raised);
  padding: 18px 20px;
  margin: 0 0 34px;
}
.answer .k {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8aa890;
  display: block;
  margin-bottom: 8px;
}
.answer p { margin: 0; }
.answer p + p { margin-top: 8px; }

/* notes */

.note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 0.92rem;
  background: var(--bg-raised);
}
.note .k {
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}
.note p { margin: 0; color: var(--muted); }
.note p + p { margin-top: 6px; }
.note-verified { border-left: 3px solid var(--moss); }
.note-verified .k { color: #8aa890; }
.note-caution { border-left: 3px solid var(--gold); }
.note-caution .k { color: var(--gold); }

/* tables */

.table-scroll { overflow-x: auto; margin: 20px 0; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
th {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  color: var(--muted);
  background: var(--bg-raised);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--bone);
}
tbody tr:nth-child(even) td { background: rgba(20, 17, 14, 0.7); }
tbody tr:last-child td { border-bottom: none; }
td .sub { display: block; font-size: 0.78rem; color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.82rem; }
.yes { color: #8aa890; }
.no { color: var(--muted); }

/* article text */

.article ol, .article ul { padding-left: 22px; }
.article li { margin: 8px 0; }
.article li::marker { color: var(--rust); font-family: var(--mono); font-size: 0.85em; }
.article p { color: var(--bone); }
.article p.dim, .dim { color: var(--muted); }

figure { margin: 26px 0; }
figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
figcaption {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 8px;
  font-family: var(--mono);
}

/* sources */

.sources { margin: 40px 0 0; }
.sources ul { list-style: none; padding: 0; margin: 12px 0 0; }
.sources li {
  border-top: 1px solid var(--line);
  padding: 10px 2px;
  font-size: 0.85rem;
  color: var(--muted);
}
.sources li a { display: inline; }
.sources .date { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }

/* related */

.related { margin-top: 44px; }

/* FAQ */

details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  margin: 10px 0;
}
summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; color: var(--rust); font-family: var(--mono); margin-right: 10px; }
details[open] summary::before { content: "–"; }
details .body { padding: 0 18px 16px 40px; color: var(--muted); font-size: 0.92rem; }
details .body p { margin: 0 0 8px; }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  margin-top: 56px;
  padding: 36px 0 48px;
  font-size: 0.82rem;
  color: var(--muted);
}
.footer .cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}
.footer h4 {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone);
  margin: 0 0 10px;
}
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin: 6px 0; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--rust-bright); }
.footer .legal { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 0.75rem; }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .footer .cols { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: none; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

@media (max-width: 720px) {
  .nav {
    display: none;
    position: absolute;
    top: 58px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px;
  }
  .nav.open { display: flex; }
  .nav-toggle { display: block; }
  .hero { padding: 48px 0 36px; }
  .card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .hero-art { padding: 72px 0 48px; }
  .hero-bg { background-position: 72% 30%; }
  .hero-veil {
    background:
      linear-gradient(180deg, rgba(11, 10, 9, 0.82) 0%, rgba(11, 10, 9, 0.72) 45%, var(--bg) 100%),
      linear-gradient(90deg, rgba(11, 10, 9, 0.5), rgba(11, 10, 9, 0.2));
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  #embers { display: none; }
}
