:root {
  --ink: #f0e3d2;
  --muted: #c2ae98;
  --gold: #aa9a79;
  --olive: #687233;
  --crimson: #d32b2f;
  --blood: #7f1d24;
  --wine: #3b2024;
  --deep: #170d10;
  --line: rgba(185, 164, 128, .42);
  --display: "Cinzel", Georgia, serif;
  --body: "Marcellus", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.72;
  background:
    linear-gradient(rgba(51, 25, 30, .92), rgba(35, 17, 21, .96)),
    url("assets/texture.webp") center / cover fixed,
    #2d171b;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: radial-gradient(circle at 20% 10%, rgba(255,255,255,.09) 0 1px, transparent 1.5px), radial-gradient(circle at 80% 60%, rgba(0,0,0,.16) 0 1px, transparent 1.5px);
  background-size: 9px 9px, 13px 13px;
  mix-blend-mode: soft-light;
  z-index: 10;
}
a { color: inherit; }
img { display: block; width: 100%; }
h1, h2, h3, .brand, .topnav, .section-kicker, .number, .eyebrow { font-family: var(--display); }
h1, h2, h3, p { margin-top: 0; }
h2 { font-size: clamp(2rem, 4.5vw, 4rem); line-height: 1.08; font-weight: 500; letter-spacing: -.03em; }
h3 { font-size: clamp(1.35rem, 2vw, 2rem); line-height: 1.25; font-weight: 600; }
p { color: #ddcfc0; }
mark { color: #ff5053; background: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.wrap { width: min(1180px, calc(100% - 2.5rem)); margin-inline: auto; }

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  height: 4.75rem;
  padding: 0 clamp(1.2rem, 4vw, 4.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(24, 12, 15, .8);
  box-shadow: 0 10px 35px rgba(0,0,0,.24);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; text-transform: uppercase; letter-spacing: .12em; font-size: .9rem; }
.brand-logo { width: 2.7rem; height: 2.7rem; object-fit: contain; filter: drop-shadow(0 0 8px rgba(216,196,170,.18)); }
.topnav { display: flex; gap: clamp(1rem, 2.5vw, 2.5rem); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; }
.topnav a { position: relative; color: var(--muted); text-decoration: none; transition: color .25s ease; }
.topnav a:hover, .topnav a.active { color: #fff3df; }
.topnav a.active { text-shadow: 0 0 16px rgba(211,43,47,.7); }
.menu-button, .mobile-nav { display: none; }

.hero {
  min-height: 100svh;
  padding: 8rem clamp(1.25rem, 6vw, 7rem) 4rem;
  display: grid;
  grid-template-columns: minmax(260px, .78fr) 1.22fr;
  align-items: center;
  gap: clamp(2.5rem, 6vw, 7rem);
  position: relative;
  overflow: hidden;
}
.hero-art, .hero-copy { position: relative; z-index: 1; }
.ornate-frame { padding: .75rem; border: 1px solid var(--gold); position: relative; background: rgba(10,7,8,.45); box-shadow: 0 22px 55px rgba(0,0,0,.38); }
.ornate-frame::before, .ornate-frame::after { content: "✦"; position: absolute; z-index: 2; color: var(--gold); font-size: 1.35rem; background: var(--wine); width: 2.4rem; height: 2.4rem; display: grid; place-items: center; transform: rotate(45deg); }
.ornate-frame::before { top: -.9rem; left: -.9rem; }
.ornate-frame::after { bottom: -.9rem; right: -.9rem; }
.hero-art .ornate-frame { max-width: 520px; margin-inline: auto; transform: rotate(-1.5deg); }
.hero-art img { aspect-ratio: .78; object-fit: cover; }
.eyebrow, .section-kicker { color: var(--gold); letter-spacing: .2em; text-transform: uppercase; font-size: .78rem; font-weight: 600; }
.flourish { display: block; color: var(--gold); font-size: 2.1rem; margin: 1.2rem 0 .6rem; }
h1 { margin: 0; color: #d8c4aa; text-transform: uppercase; font-size: clamp(3rem, 6.6vw, 7rem); line-height: .98; font-weight: 500; letter-spacing: -.04em; }
h1 em { color: #f1e4d2; font-size: .66em; font-style: normal; }
.authors { max-width: 42rem; margin: 1.6rem 0 0; color: var(--muted); font-family: var(--display); font-size: clamp(1rem, 2vw, 1.35rem); }
.hero-actions { display: flex; align-items: center; gap: 1.5rem; margin-top: 2.1rem; }
.primary-button { padding: .85rem 1.2rem; text-decoration: none; background: #811f27; border: 1px solid #b75859; font-family: var(--display); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; transition: transform .25s, background .25s; }
.primary-button:hover { transform: translateY(-2px); background: #9f2932; }
.text-link { color: var(--muted); text-underline-offset: .35rem; }

.contents { padding: 7rem 0 9rem; }
.contents > h2 { max-width: 40rem; margin: .7rem 0 2.5rem; }
.chapter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.chapter-grid a { min-height: 15rem; padding: 2rem 1.4rem; display: flex; flex-direction: column; gap: .75rem; text-decoration: none; background: linear-gradient(145deg, rgba(81,39,44,.7), rgba(35,18,22,.72)); box-shadow: 0 15px 35px rgba(0,0,0,.16); transition: background .25s, transform .25s; }
.chapter-grid a:hover { background: rgba(129,31,39,.18); transform: translateY(-4px); }
.chapter-grid span { color: var(--olive); font-family: var(--display); font-size: 1.35rem; font-weight: 700; }
.chapter-grid strong { margin-top: auto; font-family: var(--display); font-size: 1.2rem; text-transform: uppercase; }
.chapter-grid small { color: var(--muted); font-size: .9rem; line-height: 1.45; }

.chapter-banner { padding: 5rem clamp(1.25rem, 5vw, 5rem); margin-bottom: 7rem; position: relative; text-align: center; background: radial-gradient(circle at center, rgba(130,31,39,.25), transparent 72%); }
.chapter-banner::before, .chapter-banner::after { content: "❦"; position: absolute; top: 50%; color: var(--gold); font-size: 2rem; transform: translateY(-50%); }
.chapter-banner::before { left: 2rem; }
.chapter-banner::after { right: 2rem; transform: translateY(-50%) rotate(180deg); }
.chapter-banner > span { color: var(--olive); font-family: var(--display); text-transform: uppercase; letter-spacing: .25em; font-weight: 700; }
.chapter-banner h2 { margin: .75rem 0; }
.chapter-banner p { max-width: 48rem; margin: 0 auto; color: var(--muted); }
.number { color: var(--olive); font-size: clamp(3rem, 7vw, 6.5rem); line-height: .8; font-weight: 700; opacity: .9; }
.feature { display: grid; grid-template-columns: auto minmax(0, 1.25fr) minmax(270px, .75fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; margin-bottom: 8rem; }
.feature-copy h2 { margin: .65rem 0 1.75rem; }
.feature-copy p { max-width: 46rem; }
.compact img { min-height: 420px; object-fit: cover; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 8rem; }
.parchment-card { min-height: 30rem; padding: clamp(1.5rem, 4vw, 3.5rem); position: relative; background: linear-gradient(145deg, rgba(86,45,48,.72), rgba(38,20,24,.86)); box-shadow: 0 18px 42px rgba(0,0,0,.18); overflow: hidden; }
.parchment-card .number { position: absolute; right: 1.25rem; top: 1.25rem; opacity: .2; }
.parchment-card h3 { max-width: 25rem; margin: 1rem 0 1.5rem; }
blockquote { margin: 1.4rem 0 0; padding: 1rem 1.3rem; color: #f7e8d5; background: rgba(121,26,33,.18); font-family: var(--display); font-size: 1.05rem; }
blockquote span { display: block; margin-bottom: .35rem; color: var(--olive); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; }

.rules { display: grid; grid-template-columns: .7fr 1.3fr; gap: clamp(2rem, 6vw, 6rem); margin-bottom: 9rem; }
.rules-heading { position: sticky; top: 7rem; align-self: start; }
.rules-heading h2 { margin-top: .7rem; }
.oath-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; }
.oath-list li { display: grid; grid-template-columns: 3.5rem 1fr; gap: 1rem; padding: 1.15rem 1.25rem; color: #e6d7c6; background: rgba(54,27,31,.58); }
.oath-list span { color: var(--crimson); font-family: var(--display); font-weight: 600; }
.objectives { margin-bottom: 9rem; }
.objectives > h2 { margin: .65rem 0 2.5rem; }
.objective-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.objective-grid article { padding: 2.1rem; background: rgba(48,25,29,.95); }
.objective-grid span { color: var(--crimson); font-family: var(--display); font-size: 1.35rem; }
.objective-grid p { margin: .75rem 0 0; }

.hierarchy { display: grid; grid-template-columns: auto minmax(310px, .9fr) 1.1fr; align-items: center; gap: clamp(1.5rem, 4vw, 4rem); margin-bottom: 9rem; }
.rank-pyramid { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 32rem; filter: drop-shadow(0 26px 20px rgba(0,0,0,.34)); }
.pyramid-tier { height: 5.4rem; position: relative; background: linear-gradient(100deg, #241c1e 0 48%, #4d4042 49% 100%); box-shadow: inset 0 8px 0 rgba(216,196,170,.28); }
.pyramid-tier span { position: absolute; right: -.55rem; top: 50%; width: 2rem; height: 2rem; display: grid; place-items: center; color: #f4e9db; background: #625759; border-radius: 50%; font-family: var(--display); transform: translate(100%,-50%); }
.tier-1 { width: 30%; height: 7rem; clip-path: polygon(50% 0,100% 100%,0 100%); box-shadow: none; }
.tier-2 { width: 46%; clip-path: polygon(17% 0,83% 0,100% 100%,0 100%); }
.tier-3 { width: 63%; clip-path: polygon(14% 0,86% 0,100% 100%,0 100%); }
.tier-4 { width: 80%; clip-path: polygon(12% 0,88% 0,100% 100%,0 100%); }
.tier-5 { width: 98%; clip-path: polygon(10% 0,90% 0,100% 100%,0 100%); }
.rank-list { display: grid; gap: .65rem; }
.rank-list div { display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; padding: .9rem 1rem; background: rgba(53,27,31,.52); }
.rank-list b { color: var(--olive); font-family: var(--display); }
.rank-list span { color: var(--muted); }
.rank-list strong { display: block; color: var(--ink); font-family: var(--display); }
.equipment { margin-bottom: 9rem; }
.equipment > h2, .weapons > h2 { margin: .65rem 0 2.5rem; }
.equipment-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.equipment-grid article { padding: 1rem; background: rgba(35,18,22,.7); box-shadow: 0 16px 35px rgba(0,0,0,.15); }
.equipment-grid img { aspect-ratio: 1 / 1.08; object-fit: cover; filter: saturate(.85); }
.equipment-grid h3 { margin: 1.25rem 0 .5rem; }
.equipment-grid p { margin-bottom: .5rem; color: var(--muted); }
.weapons { margin-bottom: 9rem; }
.weapon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.weapon-grid article { padding: clamp(1.25rem, 3vw, 2.5rem); display: grid; grid-template-columns: minmax(120px, .7fr) 1.3fr; gap: 2rem; align-items: center; background: rgba(40,20,24,.65); }
.weapon-grid img { aspect-ratio: .72; object-fit: cover; }
.weapon-grid h3 { color: var(--gold); font-size: clamp(2rem, 4vw, 3.5rem); margin-bottom: .65rem; }

.mastery { display: grid; grid-template-columns: auto 1fr; gap: 1.5rem 3rem; margin-bottom: 8rem; }
.mastery h2 { margin: .65rem 0 1rem; }
.mastery-track { grid-column: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.mastery-track div { padding: 1.5rem; background: rgba(54,27,31,.58); }
.mastery-track span { display: block; color: var(--crimson); font-family: var(--display); font-size: 1.2rem; }
.mastery-track strong { display: block; margin-top: .5rem; font-weight: 400; }
.mastery .note { grid-column: 2; color: var(--muted); font-style: italic; }
.archives { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-bottom: 9rem; }
.archive { padding: 2rem; background: rgba(37,18,22,.72); box-shadow: 0 16px 36px rgba(0,0,0,.16); }
.archive .number { font-size: 3.25rem; margin-bottom: 1.5rem; }
.archive h3 { min-height: 5rem; margin: .8rem 0 1rem; }
.archive .summary { color: var(--ink); }
.details { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s ease; }
.details p { min-height: 0; overflow: hidden; margin: 0; color: var(--muted); }
.archive.open .details { grid-template-rows: 1fr; }
.archive.open .details p { margin-bottom: 1rem; }
.details-button { padding: .3rem 0; color: var(--gold); font: inherit; background: none; border: 0; cursor: pointer; }
.history { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem; margin-bottom: 9rem; }
.history-entry { padding: 1.5rem; background: linear-gradient(150deg, rgba(64,30,35,.5), rgba(31,15,18,.42)); }
.history-entry .number { margin-bottom: 1.5rem; }
.history-entry h2 { margin: .7rem 0 1.4rem; font-size: clamp(1.65rem, 3vw, 2.6rem); }
.sion { display: grid; grid-template-columns: auto 1.2fr .8fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: center; margin-bottom: 10rem; }
.sion h2 { margin: .7rem 0 1.5rem; }

footer { padding: 7rem 1.25rem; text-align: center; background: rgba(21,10,13,.72); }
footer h2 { margin: .25rem 0; text-transform: uppercase; }
footer p { margin: 0; color: var(--gold); font-family: var(--display); text-transform: uppercase; letter-spacing: .18em; }
footer small { display: block; margin: 2rem 0; color: var(--muted); }
footer a { color: var(--gold); text-underline-offset: .35rem; }
.to-top { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 70; width: 3rem; height: 3rem; color: var(--ink); background: rgba(97,29,34,.92); border: 1px solid var(--line); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(1rem); transition: .25s; }
.to-top.visible { opacity: 1; visibility: visible; transform: none; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (max-width: 960px) {
  .topnav { display: none; }
  .menu-button { display: flex; flex-direction: column; gap: 5px; width: 2.8rem; padding: .55rem; background: none; border: 1px solid var(--line); }
  .menu-button span:not(.sr-only) { width: 100%; height: 1px; background: var(--ink); transition: .25s; }
  .mobile-nav { display: grid; position: fixed; inset: 4.75rem 0 auto; z-index: 89; padding: 1.5rem; background: rgba(24,12,15,.97); box-shadow: 0 18px 35px rgba(0,0,0,.28); transform: translateY(-130%); transition: transform .3s ease; }
  .mobile-nav.open { transform: none; }
  .mobile-nav a { padding: 1rem .25rem; color: var(--muted); text-decoration: none; font-family: var(--display); }
  .hero { grid-template-columns: 1fr 1.15fr; gap: 2rem; }
  .chapter-grid { grid-template-columns: 1fr 1fr; }
  .feature { grid-template-columns: auto 1fr; }
  .feature-image { grid-column: 2; max-width: 520px; }
  .rules, .history { grid-template-columns: 1fr; }
  .rules-heading { position: static; }
  .equipment-grid, .archives { grid-template-columns: 1fr 1fr; }
  .hierarchy { grid-template-columns: auto 1fr; }
  .rank-pyramid { grid-row: span 2; }
  .rank-list { grid-column: 2; }
  .sion { grid-template-columns: auto 1fr; }
  .sion-art { grid-column: 2; max-width: 500px; }
}

@media (max-width: 680px) {
  body { font-size: 1rem; }
  .wrap { width: min(100% - 1.5rem, 1180px); }
  .brand span:last-child { font-size: .72rem; }
  .hero { min-height: auto; grid-template-columns: 1fr; padding-top: 7rem; text-align: center; }
  .hero-art { width: min(82vw, 420px); margin-inline: auto; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  h1 { font-size: clamp(2.65rem, 13vw, 4.4rem); }
  .hero-actions { flex-direction: column; }
  .contents { padding: 6rem 0; }
  .chapter-grid { grid-template-columns: 1fr; }
  .chapter-grid a { min-height: 11rem; }
  .chapter-banner { margin-bottom: 5rem; }
  .chapter-banner::before, .chapter-banner::after { display: none; }
  .feature, .two-columns, .hierarchy, .equipment-grid, .weapon-grid, .mastery, .archives, .history, .sion { grid-template-columns: 1fr; }
  .feature, .two-columns, .rules, .objectives, .hierarchy, .equipment, .weapons, .mastery, .archives, .history { margin-bottom: 6rem; }
  .feature .number, .hierarchy > .number, .mastery > .number, .sion > .number { font-size: 3.5rem; }
  .feature-image, .rank-list, .sion-art, .mastery-track, .mastery .note { grid-column: 1; }
  .compact img { min-height: 340px; }
  .objective-grid { grid-template-columns: 1fr; }
  .weapon-grid article { grid-template-columns: 130px 1fr; }
  .mastery-track { grid-template-columns: 1fr; }
  .parchment-card { min-height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
