:root {
  --ink: #17201e;
  --muted: #65706c;
  --paper: #f3efe5;
  --paper-light: #fbf9f3;
  --pine: #142b2b;
  --pine-light: #1d3b39;
  --ochre: #b66536;
  --ochre-dark: #874426;
  --line: #c9c2b4;
  --white: #fffdf7;
  --serif: Iowan Old Style, Palatino Linotype, Book Antiqua, Palatino, Georgia, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); line-height: 1.6; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--ochre-dark); }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 50; padding: .7rem 1rem; background: var(--white); color: var(--ink); }
.skip-link:focus { top: 1rem; }

.masthead { min-height: 94vh; color: var(--white); background: var(--pine); overflow: hidden; position: relative; }
.masthead::before { content: ""; position: absolute; inset: 0; opacity: .22; background: radial-gradient(circle at 82% 19%, transparent 0 9%, #aac2b9 9.2% 9.5%, transparent 9.7% 17%, #aac2b9 17.2% 17.5%, transparent 17.7%), linear-gradient(135deg, transparent 0 67%, #36524e 67.2% 68%, transparent 68.2%); }
.masthead::after { content: "GREYWATER"; position: absolute; right: -1.5rem; bottom: -7rem; color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.08); font: 900 clamp(8rem, 20vw, 21rem)/1 var(--sans); letter-spacing: -.08em; }
.topbar { width: min(1280px, calc(100% - 3rem)); margin: auto; padding: 1.5rem 0; display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 2; border-bottom: 1px solid rgba(255,255,255,.25); }
.wordmark { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; text-decoration: none; }
.toplinks { display: flex; gap: 1.5rem; }
.toplinks a { color: var(--white); text-decoration: none; font-size: .76rem; text-transform: uppercase; letter-spacing: .13em; }
.toplinks a:hover { color: #e5b48f; }
.review-nav-button { display: inline-flex; align-items: center; gap: .45rem; margin: 0; padding: 0; color: var(--white); background: none; border: 0; cursor: pointer; font: inherit; font-size: .76rem; letter-spacing: .13em; text-transform: uppercase; }
.review-nav-button:hover { color: #e5b48f; }
.review-nav-button span { min-width: 1.45rem; height: 1.45rem; display: inline-grid; place-items: center; padding: 0 .35rem; color: var(--pine); background: #e5b48f; border-radius: 1rem; font-size: .64rem; font-weight: 900; letter-spacing: 0; }
.hero { width: min(1180px, calc(100% - 3rem)); margin: auto; padding: clamp(5rem, 12vh, 8rem) 0 4rem; position: relative; z-index: 1; }
.eyebrow, .kicker, .turn-number, .aside-label, .formula-label { margin: 0 0 1rem; font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow, .aside-label { color: #e4a878; }
.hero h1 { max-width: 900px; margin: 0; font: 500 clamp(4.2rem, 10vw, 9.3rem)/.82 var(--serif); letter-spacing: -.065em; }
.hero h1 em { color: #e5b48f; font-weight: 400; }
.dek { max-width: 690px; margin: 2rem 0; color: #d7dfda; font: 1.2rem/1.6 var(--serif); }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.button { padding: .9rem 1.2rem; border: 1px solid rgba(255,255,255,.35); text-decoration: none; font-size: .78rem; font-weight: 800; letter-spacing: .05em; }
.button.primary { background: #e1a476; color: var(--pine); border-color: #e1a476; }
.button.primary:hover { background: var(--white); color: var(--pine); }
.button.secondary { color: var(--white); }
.button.secondary:hover { border-color: var(--white); color: var(--white); }
.campaign-facts { max-width: 980px; margin: 4.5rem 0 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(255,255,255,.28); }
.campaign-facts div { padding: 1.1rem 1rem 0 0; }
.campaign-facts dt { font-size: .62rem; text-transform: uppercase; letter-spacing: .14em; color: #92aaa3; }
.campaign-facts dd { margin: .25rem 0 0; font-family: var(--serif); }

main > section, .chronicle-layout { width: min(1240px, calc(100% - 3rem)); margin-inline: auto; }
.ruled { padding: 6rem 0; border-bottom: 1px solid var(--line); }
.orientation { display: grid; grid-template-columns: .85fr 1.15fr; gap: 6rem; }
.orientation h2, .section-heading h2 { margin: 0; font: 500 clamp(2.6rem, 5vw, 5rem)/.95 var(--serif); letter-spacing: -.045em; }
.orientation-copy { font-family: var(--serif); font-size: 1.15rem; }
.orientation-copy p:first-child { margin-top: 0; }
.kicker { color: var(--ochre-dark); }

.cast { padding: 7rem 0; }
.section-heading { display: grid; grid-template-columns: .65fr 1.35fr; gap: 3rem; align-items: end; margin-bottom: 3rem; }
.section-heading .kicker { align-self: start; }
.section-heading.compact { display: block; max-width: 830px; }
.section-heading.compact > p:last-child { color: var(--muted); max-width: 650px; }
.cast-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.clan-card { min-height: 380px; padding: 1.7rem; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: rgba(255,255,255,.18); }
.clan-card:last-child { border-right: 0; }
.clan-card .card-number { margin: 0 0 auto; color: var(--muted); font-size: .7rem; letter-spacing: .1em; }
.clan-card h3 { margin: 2rem 0 0; font: 600 2rem/1 var(--serif); }
.clan-card .role { margin: .35rem 0 1.2rem; color: var(--ochre-dark); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.clan-card > p:not(.role):not(.card-number) { color: #4b5552; font-family: var(--serif); }
.clan-card a { margin-top: auto; font-size: .74rem; font-weight: 800; }
.ridgeford { box-shadow: inset 0 4px #486c69; }
.hazelstead { box-shadow: inset 0 4px #8b7a42; }
.claybank { box-shadow: inset 0 4px #a85d3b; }
.merehaven { box-shadow: inset 0 4px #48617e; }

.scoring-primer { padding-top: 1rem; }
.formula-card { padding: 2.4rem; color: var(--white); background: var(--pine); display: grid; grid-template-columns: .6fr 1.2fr 1fr; gap: 2rem; align-items: center; }
.formula-label { color: #d8a177; }
.formula { margin: 0; font: 500 clamp(1.5rem, 3vw, 2.5rem)/1.2 var(--serif); }
.formula-card > p:last-child { color: #cfdbd5; font-size: .85rem; }
.dimensions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 1px; background: var(--line); }
.dimensions div { display: grid; grid-template-columns: 2.3rem 1fr; gap: .8rem; padding: 1.2rem; background: var(--paper-light); }
.dimensions b { width: 2.1rem; height: 2.1rem; display: grid; place-items: center; color: var(--white); background: var(--ochre-dark); border-radius: 50%; font-family: var(--serif); }
.dimensions strong, .dimensions span { display: block; }
.dimensions strong { font-family: var(--serif); font-size: 1.05rem; }
.dimensions span { color: var(--muted); font-size: .76rem; line-height: 1.4; }
.guardrail { margin: 1.5rem 0 0; color: var(--muted); font-family: var(--serif); }

.chronicle-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: clamp(2rem, 6vw, 7rem); padding-top: 6rem; }
.turn-rail { position: sticky; top: 1.5rem; align-self: start; padding-top: 1rem; }
.turn-rail > p { margin: 0 0 1rem; color: var(--muted); font-size: .65rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.turn-rail ol { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.turn-rail a { display: flex; gap: .7rem; padding: .7rem 0; color: var(--muted); border-bottom: 1px solid var(--line); font-size: .72rem; text-decoration: none; }
.turn-rail a span { font-family: var(--serif); color: var(--ochre-dark); }
.turn-rail a.active { color: var(--ink); font-weight: 800; }
.turn { padding: 1rem 0 8rem; scroll-margin-top: 1rem; border-bottom: 1px solid var(--line); }
.turn + .turn { padding-top: 7rem; }
.turn-header { margin-bottom: 2.6rem; }
.turn-number { color: var(--ochre-dark); }
.turn-header h2 { max-width: 800px; margin: 0; font: 500 clamp(3.5rem, 7vw, 7rem)/.88 var(--serif); letter-spacing: -.055em; }
.season { color: var(--muted); font-size: .8rem; letter-spacing: .08em; }
.narrative { max-width: 770px; font: 1.18rem/1.75 var(--serif); }
.narrative .dropcap::first-letter { float: left; margin: .12em .12em 0 0; color: var(--ochre-dark); font-size: 4.5em; line-height: .7; }
.gm-aside { margin: 3rem 0; padding: 2rem 2.2rem; border-left: 5px solid var(--ochre); background: #ead9c5; }
.gm-aside h3, .mechanics h3 { margin: 0 0 .6rem; font: 600 1.75rem/1.1 var(--serif); }
.gm-aside p:last-child { margin-bottom: 0; }
.gm-aside .aside-label { color: var(--ochre-dark); }
.rule-reveal { color: var(--white); background: var(--ochre-dark); border-left-color: var(--pine); }
.rule-reveal .aside-label { color: #f0c9aa; }
.mechanics { margin: 3rem 0; padding: 2rem; color: var(--white); background: var(--pine); }
.mechanics-head { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: end; margin-bottom: 1.5rem; }
.mechanics-head > p { color: #aebfba; font-size: .78rem; }
.score-table { border-top: 1px solid rgba(255,255,255,.25); }
.score-row { display: grid; grid-template-columns: 1fr 2fr .7fr .7fr; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid rgba(255,255,255,.16); font-size: .78rem; }
.score-row span:nth-child(2) { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.score-row.labels { color: #9fb2ad; font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; }
.mechanics-note { margin: 1.5rem 0 0; color: #d5dfdb; font-family: var(--serif); }
.turn-files { margin-top: 3rem; }
.turn-files h3 { font: 600 1.7rem/1 var(--serif); }
.file-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.file-pair { padding: 1rem; border: 1px solid var(--line); background: var(--paper-light); }
.file-pair p { margin: 0 0 .6rem; font: 600 1.05rem var(--serif); }
.file-pair div { display: flex; gap: .6rem; }
.file-pair a, .gm-source-links a, .source-shelf a { font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.gm-source-links { display: flex; flex-wrap: wrap; gap: 1.1rem; padding-top: 1rem; }

.postmortem { width: 100%; max-width: none; padding: 7rem max(1.5rem, calc((100% - 1240px)/2)); color: var(--white); background: var(--pine); }
.section-heading.inverse .kicker { color: #e5b48f; }
.findings { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid rgba(255,255,255,.2); }
.findings article { min-height: 260px; padding: 1.5rem; border-right: 1px solid rgba(255,255,255,.2); border-bottom: 1px solid rgba(255,255,255,.2); }
.findings article:nth-child(3n) { border-right: 0; }
.findings span { color: #e3aa7f; font-size: .62rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.findings h3 { margin: 1.7rem 0 .6rem; font: 600 1.5rem/1.1 var(--serif); }
.findings p { color: #b9c8c3; font-size: .84rem; }
.source-shelf { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 2rem; }
.source-shelf a { color: var(--white); }

.archive { padding: 7rem 0; }
.archive-controls { display: flex; justify-content: space-between; gap: 1rem; margin: 2rem 0; }
.filter-group { display: flex; flex-wrap: wrap; gap: .4rem; }
.filter-group button { padding: .55rem .8rem; color: var(--muted); background: transparent; border: 1px solid var(--line); cursor: pointer; font: 700 .68rem var(--sans); }
.filter-group button:hover, .filter-group button.active { color: var(--white); background: var(--pine); border-color: var(--pine); }
.archive-list { border-top: 1px solid var(--line); }
.archive-item { display: grid; grid-template-columns: 140px 1fr 130px 60px; gap: 1rem; align-items: center; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.archive-item[hidden] { display: none; }
.archive-item .doc-turn, .archive-item .doc-type { color: var(--muted); font-size: .62rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.archive-item .doc-name { font-family: var(--serif); font-size: 1.05rem; }
.archive-item a { justify-self: end; font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.integrity-note { max-width: 760px; margin-top: 2rem; color: var(--muted); font-family: var(--serif); }

footer { padding: 2rem max(1.5rem, calc((100% - 1240px)/2)); display: flex; justify-content: space-between; align-items: center; color: #b9c8c3; background: #0c1d1d; }
footer p { margin: 0; font-size: .7rem; }
footer .wordmark { color: var(--white); font-size: 1rem; }
footer a { color: var(--white); font-size: .7rem; }

::highlight(gm-annotations) { color: inherit; background: rgba(229, 180, 143, .62); text-decoration: underline solid var(--ochre-dark) 2px; }

.selection-comment-button { position: absolute; z-index: 80; padding: .55rem .75rem; color: var(--white); background: var(--ochre-dark); border: 1px solid rgba(255,255,255,.6); box-shadow: 0 8px 24px rgba(12,29,29,.25); cursor: pointer; font: 800 .68rem var(--sans); letter-spacing: .04em; }
.selection-comment-button:hover { background: var(--pine); }
.selection-comment-button.touch-edge-action { position: fixed; left: 50% !important; right: auto !important; z-index: 88; width: calc(100% - 2rem); max-width: 390px; min-height: 48px; padding: .8rem 1rem; transform: translateX(-50%); border: 2px solid rgba(255,255,255,.72); box-shadow: 0 10px 30px rgba(12,29,29,.32); touch-action: manipulation; -webkit-tap-highlight-color: transparent; font-size: .78rem; }
.selection-comment-button.touch-edge-top { top: 4.75rem !important; bottom: auto !important; top: calc(4.75rem + env(safe-area-inset-top, 0px)) !important; }
.selection-comment-button.touch-edge-bottom { top: auto !important; bottom: 5.5rem !important; bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)) !important; }

.review-scrim { position: fixed; inset: 0; z-index: 89; background: rgba(12,29,29,.34); }
.review-panel { position: fixed; inset: 0 0 0 auto; z-index: 90; width: min(440px, 100vw); color: var(--ink); background: var(--paper-light); border-left: 1px solid var(--line); box-shadow: -16px 0 42px rgba(12,29,29,.22); transform: translateX(105%); transition: transform .22s ease; }
.review-panel.open { transform: translateX(0); }
.review-panel-header { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.4rem 1.5rem; color: var(--white); background: var(--pine); }
.review-panel-header .aside-label { margin: 0 0 .25rem; }
.review-panel-header h2 { margin: 0; font: 600 2rem/1 var(--serif); }
.review-icon-button { width: 2.3rem; height: 2.3rem; flex: 0 0 auto; color: var(--white); background: transparent; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; cursor: pointer; font: 300 1.8rem/1 var(--sans); }
.review-icon-button:hover { background: rgba(255,255,255,.12); }
.review-panel-body { height: calc(100vh - 112px); overflow-y: auto; padding: 1.35rem 1.5rem 3rem; }
.review-intro { margin: 0 0 1.2rem; color: var(--muted); font: .95rem/1.55 var(--serif); }
.review-field { display: block; }
.review-field > span { display: block; margin-bottom: .35rem; color: var(--muted); font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.review-field input, .review-field textarea { width: 100%; padding: .7rem .75rem; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 0; font: .86rem/1.45 var(--sans); }
.review-field textarea { resize: vertical; min-height: 112px; }
.review-field input:focus, .review-field textarea:focus { outline: 2px solid var(--ochre); outline-offset: 1px; }
.review-actions, .review-composer-actions { display: flex; gap: .55rem; margin-top: .8rem; }
.review-button { padding: .65rem .8rem; color: var(--pine); background: transparent; border: 1px solid var(--pine); cursor: pointer; font: 800 .68rem var(--sans); letter-spacing: .03em; }
.review-button:hover:not(:disabled), .review-button.primary { color: var(--white); background: var(--pine); }
.review-button.primary:hover:not(:disabled) { background: var(--ochre-dark); border-color: var(--ochre-dark); }
.review-button:disabled { opacity: .4; cursor: not-allowed; }
.review-composer { margin: 1rem 0; padding: 1rem; background: #eee3d4; border-left: 4px solid var(--ochre); }
.review-composer blockquote { max-height: 130px; overflow: auto; margin: 0 0 .9rem; padding: .65rem .75rem; color: #4b5552; background: rgba(255,255,255,.52); border-left: 2px solid var(--ochre-dark); font: italic .85rem/1.45 var(--serif); }
.review-composer-actions { justify-content: flex-end; }
.review-status { min-height: 1.4rem; margin: 1rem 0; color: var(--muted); font-size: .7rem; }
.review-status[data-type="success"] { color: #3f695d; }
.review-status[data-type="error"] { color: #9a3f2a; font-weight: 700; }
.review-list-header { display: flex; align-items: end; justify-content: space-between; gap: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.review-list-header h3 { margin: 0; font: 600 1.25rem var(--serif); }
.review-list-header h3 span { color: var(--ochre-dark); }
.review-list-header > div { display: flex; align-items: center; gap: .6rem; }
.review-list-header label { color: var(--muted); font-size: .62rem; white-space: nowrap; }
.review-text-button, .review-comment-actions button { padding: 0; color: var(--ochre-dark); background: none; border: 0; cursor: pointer; font: 800 .62rem var(--sans); text-decoration: underline; text-underline-offset: .2em; }
.review-list { margin: 1rem 0 0; padding: 0; list-style: none; }
.review-comment { margin: 0; padding: 1rem 0; border-top: 1px solid var(--line); }
.review-comment:first-child { border-top: 0; }
.review-comment.resolved { opacity: .58; }
.review-comment-meta { display: flex; justify-content: space-between; gap: 1rem; margin: 0 0 .45rem; color: var(--muted); font-size: .63rem; }
.review-comment-meta strong { color: var(--ink); font-size: .7rem; }
.review-comment-quote { width: 100%; max-height: 82px; overflow: hidden; display: -webkit-box; margin: 0 0 .6rem; padding: .55rem .7rem; color: #5a5148; background: #eee3d4; border: 0; border-left: 3px solid var(--ochre); cursor: pointer; text-align: left; -webkit-box-orient: vertical; -webkit-line-clamp: 3; font: italic .78rem/1.45 var(--serif); }
.review-comment-quote:hover { background: #ead9c5; }
.review-comment-body { margin: 0 0 .6rem; white-space: pre-wrap; font-size: .8rem; line-height: 1.55; }
.review-comment-actions { display: flex; gap: .8rem; }
.review-replies { margin: .9rem 0 0 .65rem; padding: 0 0 0 .9rem; list-style: none; border-left: 2px solid #d7b994; }
.review-reply { padding: .8rem 0 .2rem; border-top: 1px solid rgba(30, 49, 45, .14); }
.review-reply:first-child { border-top: 0; }
.review-reply .review-comment-meta { margin-bottom: .3rem; }
.review-reply .review-comment-body { margin-bottom: .2rem; }
.review-empty { margin: 1rem 0; color: var(--muted); font: italic .86rem/1.5 var(--serif); }
.review-empty[hidden], .review-composer[hidden], .review-scrim[hidden], .selection-comment-button[hidden] { display: none; }

@media (max-width: 900px) {
  .campaign-facts { grid-template-columns: repeat(2, 1fr); }
  .orientation, .section-heading { grid-template-columns: 1fr; gap: 1.5rem; }
  .cast-grid { grid-template-columns: repeat(2, 1fr); }
  .clan-card:nth-child(2) { border-right: 0; }
  .formula-card { grid-template-columns: 1fr; }
  .dimensions { grid-template-columns: repeat(2, 1fr); }
  .chronicle-layout { grid-template-columns: 1fr; }
  .turn-rail { display: none; }
  .findings { grid-template-columns: repeat(2, 1fr); }
  .findings article:nth-child(3n) { border-right: 1px solid rgba(255,255,255,.2); }
  .findings article:nth-child(2n) { border-right: 0; }
}

@media (max-width: 620px) {
  .toplinks a { display: none; }
  .toplinks { gap: 0; }
  .review-nav-button { display: inline-flex; }
  .hero h1 { font-size: 4rem; }
  .campaign-facts, .cast-grid, .dimensions, .file-grid, .findings { grid-template-columns: 1fr; }
  .clan-card { border-right: 0; border-bottom: 1px solid var(--line); }
  .mechanics-head { grid-template-columns: 1fr; }
  .score-row { grid-template-columns: 1fr 1.7fr .7fr; gap: .5rem; }
  .score-row span:last-child { display: none; }
  .archive-controls { display: block; }
  .filter-group + .filter-group { margin-top: .6rem; }
  .archive-item { grid-template-columns: 90px 1fr 50px; }
  .archive-item .doc-type { display: none; }
  .review-panel { width: 100vw; }
  .review-list-header { align-items: start; }
  .review-list-header > div { align-items: flex-end; flex-direction: column; }
  footer { align-items: end; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .review-panel { transition: none; } }
@media print {
  .topbar, .hero-actions, .turn-rail, .archive-controls, footer, .review-panel, .review-scrim, .selection-comment-button { display: none; }
  .masthead { min-height: auto; padding-bottom: 2rem; }
  .chronicle-layout { display: block; }
  .turn { break-before: page; }
  .mechanics, .postmortem { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
