:root {
  color-scheme: dark;
  --night: #0b0d0c;
  --panel: #131a16;
  --paper: #eee6d8;
  --text: #cec8bc;
  --muted: #aba79b;
  --line: rgba(238, 230, 216, .16);
  --gold: #d6b474;
  --rust: #d58760;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; background: var(--night); }
body { margin: 0; min-height: 100vh; position: relative; isolation: isolate; color: var(--paper); background: var(--night); font-family: "DM Sans", sans-serif; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("serpent-engraving.png") center / cover no-repeat;
  mix-blend-mode: screen;
  opacity: .12;
}
a { color: inherit; text-underline-offset: .25em; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
.shell { position: relative; z-index: 1; width: min(1420px, calc(100% - 64px)); margin: auto; }
.skip { position: absolute; z-index: 10; top: 1rem; left: 1rem; padding: .8rem 1rem; background: var(--paper); color: var(--night); transform: translateY(-160%); }
.skip:focus { transform: none; }
.top { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font: 500 .875rem/1.4 "DM Mono", monospace; letter-spacing: .12em; text-transform: uppercase; }
.brand img { width: 34px; height: 34px; object-fit: cover; border-radius: 50%; border: 1px solid var(--gold); }
.back { font-size: .875rem; color: var(--muted); text-decoration: none; }
.back:hover, .contents a:hover { color: var(--gold); }
.section-bar { padding: 27px 0 23px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.eyebrow, .section-number, .meta, .contents-label { font: 400 .8125rem/1.5 "DM Mono", monospace; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow { margin: 0; color: var(--rust); }
.section-number { color: var(--muted); }
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); border: 1px solid var(--line); background: linear-gradient(130deg, rgba(24, 35, 27, .86), rgba(16, 22, 18, .82) 67%); }
.hero-copy { padding: clamp(28px, 4vw, 64px); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.hero-copy .meta { color: var(--gold); margin: 0 0 24px; }
h1 { font: 500 clamp(3rem, 5.9vw, 6rem)/1.07 "Playfair Display", serif; letter-spacing: -.055em; margin: 0 0 28px; overflow-wrap: anywhere; }
.lead { max-width: 41ch; font: 400 clamp(1.125rem, 1.6vw, 1.375rem)/1.7 "Playfair Display", serif; color: var(--text); margin: 0; }
.hero-art { margin: 0; min-width: 0; border-left: 1px solid var(--line); display: flex; flex-direction: column; background: #e9e6df; color: #333a33; }
.hero-art img { display: block; width: 100%; height: clamp(290px, 36vw, 490px); object-fit: contain; padding: 20px; }
.hero-art figcaption { padding: 12px 24px 18px; font-size: .8125rem; line-height: 1.6; border-top: 1px solid rgba(20, 30, 20, .16); }
.hero-art figcaption a { text-decoration-color: #8b8c7e; }
.reading { display: grid; grid-template-columns: 245px minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); padding: 56px 0 80px; }
.contents { position: sticky; top: 28px; align-self: start; padding-right: 28px; }
.contents-label { color: var(--gold); margin: 0 0 20px; }
.contents ol { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.contents li { border-bottom: 1px solid var(--line); }
.contents a { display: flex; align-items: baseline; gap: 15px; padding: 16px 0; color: var(--text); font-size: .9375rem; line-height: 1.6; text-decoration: none; }
.contents a span { color: var(--muted); font: .8125rem "DM Mono", monospace; }
.contents .contents-subentry a { padding: 10px 0 10px 20px; color: var(--gold); }
.article { max-width: 920px; min-width: 0; }
.chapter { border-bottom: 1px solid var(--line); padding: 0 0 36px; margin-bottom: 36px; }
.chapter:last-of-type { margin-bottom: 0; }
.chapter-label { display: flex; align-items: center; gap: 15px; color: var(--gold); margin: 0 0 14px; font: .8125rem/1.5 "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.chapter-label::after { content: ""; width: 42px; height: 1px; background: var(--gold); opacity: .6; }
h2 { font: 500 clamp(1.9rem, 3vw, 2.8rem)/1.2 "Playfair Display", serif; letter-spacing: -.035em; margin: 0 0 20px; }
.chapter p { font-size: 1.0625rem; line-height: 1.9; color: var(--text); max-width: 76ch; margin: 0 0 18px; }
.chapter p:last-child { margin-bottom: 0; }
.chapter em { color: var(--paper); }
.ragnarok-art { margin: 28px 0 32px; border: 1px solid var(--line); background: #171512; }
.ragnarok-art img { display: block; width: 100%; height: auto; }
.figures { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; margin-top: 28px; }
.figure { border-top: 1px solid var(--line); padding: 22px 0 5px; }
.figure h3 { font: 500 1.625rem/1.2 "Playfair Display", serif; color: var(--paper); margin: 0 0 10px; }
.figure p { font-size: 1rem; line-height: 1.85; }
.deity-profile { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(180px,.75fr) minmax(0,1.25fr); align-items: start; gap: 30px; border-top: 1px solid var(--line); padding: 32px 0; }
.deity-portrait { margin: 0; min-width: 0; }
.deity-portrait img { display: block; width: 100%; height: auto; filter: drop-shadow(0 14px 28px rgba(0,0,0,.26)); }
.deity-copy { min-width: 0; }
.deity-kicker { color: var(--gold); font: .8125rem/1.5 "DM Mono",monospace; letter-spacing: .09em; text-transform: uppercase; }
.deity-copy h3 { margin: 12px 0 22px; font: 500 clamp(2.75rem,5vw,4.5rem)/1 "Playfair Display",serif; letter-spacing: -.04em; }
.deity-copy p { font-size: 1rem; line-height: 1.9; }
.sources { margin-top: 30px; color: var(--muted); }
.sources summary { width: fit-content; cursor: pointer; font-size: .875rem; padding: 8px 0; }
.sources ul { padding-left: 20px; font-size: .875rem; line-height: 1.85; max-width: 75ch; }
.sources li { margin-bottom: 12px; }
.foot { border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; padding: 28px 0; color: var(--muted); font-size: .8125rem; line-height: 1.6; }
.foot a { text-decoration: none; }
@media (max-width: 960px) {
  .shell { width: calc(100% - 40px); }
  .hero { grid-template-columns: 1.05fr .95fr; }
  .hero-copy { padding: 28px; }
  h1 { font-size: clamp(2.9rem, 6vw, 4rem); }
  .reading { grid-template-columns: 190px minmax(0, 1fr); gap: 28px; }
  .contents { padding-right: 0; }
  .figures { grid-template-columns: 1fr; }
  .deity-profile { grid-template-columns: 1fr; gap: 24px; }
  .deity-portrait { width: min(100%,320px); margin: 0 auto; }
}
@media (max-width: 680px) {
  body::before { background-position: 58% center; opacity: .09; }
  .shell { width: calc(100% - 32px); }
  .top { min-height: 68px; gap: 12px; }
  .brand { font-size: .8125rem; gap: 8px; }
  .brand img { width: 29px; height: 29px; }
  .back { font-size: .8125rem; }
  .section-bar { padding: 22px 0; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 32px 24px; }
  h1 { font-size: clamp(2.75rem, 11vw, 4rem); }
  .hero-art { border-left: 0; border-top: 1px solid var(--line); }
  .hero-art img { height: 310px; padding: 18px; }
  .reading { grid-template-columns: 1fr; gap: 38px; padding: 32px 0 48px; }
  .contents { position: static; }
  .contents ol { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
  .contents a { gap: 9px; font-size: .875rem; }
  .contents .contents-subentry a { padding: 16px 0; }
  .chapter p { font-size: 1rem; line-height: 1.85; }
  .foot { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
