:root {
  --ink: #1c1a17;
  --concrete: #141210;
  --concrete-2: #1d1b18;
  --khaki: #c9a24a;
  --khaki-dim: #8d7436;
  --paper: #ece3cf;
  --paper-2: #e2d6bc;
  --manila: #d9b979;
  --red: #b3261e;
  --red-ink: #9a1f19;
  --green: #4f6b3a;
  --grey: #7b756a;
  --sev-1: #8a8578;
  --sev0: #a9a294;
  --sev1: #c99a2e;
  --sev2: #c4622a;
  --sev3: #b3261e;
  --sev4: #6e0f0b;
  --stencil: "Big Shoulders Stencil Display", Impact, sans-serif;
  --type: "Special Elite", "Courier New", monospace;
  --mono: "Courier Prime", "Courier New", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--concrete);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.55;
}
a { color: var(--khaki); }
button { font: inherit; cursor: pointer; }
code { font-family: var(--mono); background: rgba(0,0,0,.08); padding: 0 .25em; }

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Hero */
.hero {
  position: relative; min-height: 100vh; overflow: hidden;
  display: grid; place-items: center; text-align: center;
  background:
    radial-gradient(ellipse 60% 45% at 50% 38%, rgba(255,226,150,.16), transparent 70%),
    linear-gradient(#0d0c0b, var(--concrete) 60%, #1a1712);
}
.bars {
  position: absolute; inset: -10% 0 0 0;
  background: repeating-linear-gradient(90deg, transparent 0 7.5vw, #050505 7.5vw calc(7.5vw + 14px), #2a2621 calc(7.5vw + 14px) calc(7.5vw + 16px), transparent calc(7.5vw + 16px) 9vw);
  opacity: .85;
  transform: translateY(-100%);
  animation: slam 1.1s cubic-bezier(.6,0,.3,1) .35s forwards;
}
.bars::after {
  content: ""; position: absolute; left: 0; right: 0; top: 22%; height: 16px;
  background: linear-gradient(#2a2621, #050505);
}
@keyframes slam { 80% { transform: translateY(1.5%); } 100% { transform: translateY(0); } }
.hero-inner { position: relative; z-index: 2; padding: 2rem 1.25rem; max-width: 900px; }
.kicker { font-family: var(--type); color: var(--khaki); letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; margin: 0 0 .5rem; }
h1 {
  font-family: var(--stencil); font-weight: 800; margin: 0;
  font-size: clamp(4rem, 15vw, 11rem); line-height: .9; letter-spacing: .04em;
  color: var(--khaki);
  text-shadow: 0 0 40px rgba(201,162,74,.25), 0 6px 0 #000;
  animation: flicker 5s infinite steps(1);
}
@keyframes flicker { 0%, 100% { opacity: 1; } 47% { opacity: 1; } 48% { opacity: .55; } 49% { opacity: 1; } 76% { opacity: .8; } 77% { opacity: 1; } }
.lede { font-family: var(--type); font-size: clamp(1.05rem, 2.3vw, 1.35rem); max-width: 40ch; margin: 1.2rem auto 2rem; min-height: 4.7em; }
.lede .caret { display: inline-block; width: .55em; background: var(--paper); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.stamp {
  display: inline-block; font-family: var(--stencil); font-weight: 800; text-transform: uppercase;
  color: var(--red); border: 4px solid var(--red); padding: .25rem .9rem; line-height: 1.05;
  transform: rotate(-7deg); mix-blend-mode: screen; letter-spacing: .06em;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 2.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.stamp-hero { font-size: 1.6rem; opacity: 0; animation: stampin .35s ease-out 1.7s forwards; }
.stamp-hero span { font-size: 1.05rem; }
@keyframes stampin { 0% { opacity: 0; transform: scale(2.4) rotate(-7deg); } 100% { opacity: .95; transform: scale(1) rotate(-7deg); } }
.enter {
  display: block; width: max-content; margin: 2.4rem auto 0; padding: .7rem 1.6rem;
  font-family: var(--stencil); font-size: 1.3rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--concrete); background: var(--khaki); text-decoration: none; border: 2px solid #000;
  box-shadow: 4px 4px 0 #000;
}
.enter:hover { background: var(--paper); }
.height-chart {
  position: absolute; right: 2vw; top: 10%; bottom: 10%; width: 64px; z-index: 1;
  display: flex; flex-direction: column; justify-content: space-between;
  border-left: 2px solid rgba(236,227,207,.18); font-size: .75rem; color: rgba(236,227,207,.3);
}
.height-chart span { border-top: 2px solid rgba(236,227,207,.2); padding-left: 6px; }

.repo-line {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: block; padding: .55rem 1rem; text-align: center; text-decoration: none;
  font-family: var(--type); font-size: .85rem; color: var(--paper);
  background: rgba(10,9,8,.82); border-bottom: 1px solid var(--khaki-dim);
}
.repo-line b { color: var(--khaki); font-weight: 400; text-decoration: underline; text-underline-offset: 3px; }
.repo-line:hover b { color: var(--paper); }
.repo-tag { font-family: var(--stencil); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--concrete); background: var(--khaki); padding: 0 .45rem; margin-right: .5rem; }

/* Summary sheet */
main { position: relative; }
.sheet {
  position: relative; max-width: 980px; margin: -4rem auto 4rem; padding: 2.5rem clamp(1.2rem, 4vw, 3.5rem) 2rem;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 30px 60px rgba(0,0,0,.6), inset 0 0 80px rgba(120,90,40,.18);
  transform: rotate(-.4deg); z-index: 3;
}
.sheet::before { content: ""; position: absolute; top: -14px; left: 48%; width: 90px; height: 28px; background: rgba(230,220,190,.75); transform: rotate(3deg); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.sheet-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: .5rem; margin-bottom: 1.2rem; }
.tag { font-family: var(--type); text-transform: uppercase; font-size: .78rem; letter-spacing: .1em; }
.tag-r { color: var(--grey); }
.sheet h2 { font-family: var(--stencil); font-size: clamp(2rem, 5vw, 3rem); line-height: 1; margin: 0 0 .8rem; letter-spacing: .02em; }
.briefs { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.4rem 0; }
.brief { margin: 0; padding: 1rem 1.1rem; font-family: var(--type); font-size: .95rem; border: 1.5px dashed var(--ink); background: var(--paper-2); }
.brief.coached { border-color: var(--red-ink); }
.brief-label { display: block; font-family: var(--mono); font-weight: 700; text-transform: uppercase; font-size: .75rem; letter-spacing: .1em; margin-bottom: .4rem; }
.brief.coached .brief-label { color: var(--red-ink); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--ink); border: 1px solid var(--ink); margin: 1.6rem 0 1.2rem; }
.stat { background: var(--paper); padding: 1rem; }
.stat h3 { margin: 0 0 .5rem; font-family: var(--type); font-weight: 400; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--grey); }
.stat .big { font-family: var(--stencil); font-weight: 800; font-size: 2.6rem; line-height: 1; }
.stat .big small { font-size: 1.1rem; color: var(--grey); }
.stat p { margin: .4rem 0 0; font-size: .85rem; }
.fine { font-size: .82rem; color: #4a453d; margin: 0; }

/* Files */
.files { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem 4rem; }
.files-head h2 { font-family: var(--stencil); font-size: 3rem; margin: 0; color: var(--khaki); letter-spacing: .05em; }
.files-head p { margin: .2rem 0 1.5rem; color: #b8ae9b; }
.filters { display: flex; flex-wrap: wrap; gap: .8rem 1.6rem; margin-bottom: 1rem; position: sticky; top: 0; z-index: 10; background: rgba(20,18,16,.94); padding: .8rem 0; backdrop-filter: blur(4px); border-bottom: 1px solid #2c2822; }
.fgroup { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.flabel { font-family: var(--type); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--khaki-dim); margin-right: .3rem; }
.fgroup button { background: transparent; color: var(--paper); border: 1px solid #4a443a; padding: .25rem .65rem; font-size: .85rem; }
.fgroup button:hover { border-color: var(--khaki); }
.fgroup button.on { background: var(--khaki); color: var(--concrete); border-color: var(--khaki); }
.study-note { color: #b8ae9b; font-size: .9rem; min-height: 1.4em; max-width: 80ch; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.4rem 1.1rem; margin-top: 1rem; }

.folder {
  position: relative; display: block; text-decoration: none; color: var(--ink);
  background: var(--manila); padding: 1.6rem .9rem .8rem; min-height: 175px;
  box-shadow: 0 6px 14px rgba(0,0,0,.45), inset 0 0 30px rgba(120,80,20,.25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.folder::before { content: ""; position: absolute; top: -12px; left: 0; width: 42%; height: 14px; background: var(--manila); clip-path: polygon(0 100%, 8% 0, 92% 0, 100% 100%); }
.folder:hover, .folder:focus-visible { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 14px 24px rgba(0,0,0,.55), inset 0 0 30px rgba(120,80,20,.25); outline: none; }
.folder.neutral { background: #cdb98c; }
.folder.neutral::before { background: #cdb98c; }
.folder .fno { font-family: var(--type); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #5b4a28; }
.folder .ftitle { font-family: var(--stencil); font-weight: 800; font-size: 1.7rem; line-height: 1; margin: .15rem 0 .4rem; }
.folder .fmeta { font-size: .78rem; color: #4a3d22; }
.folder .spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-top: .7rem; border-bottom: 1px solid rgba(0,0,0,.35); }
.folder .spark i { flex: 1; background: rgba(28,26,23,.55); min-height: 2px; }
.folder .spark i.hot { background: var(--red); }
.folder .fstats { display: flex; justify-content: space-between; font-size: .75rem; margin-top: .35rem; color: #3b3220; }
.folder .stamp { position: absolute; right: .5rem; top: 1rem; font-size: 1.05rem; mix-blend-mode: multiply; border-width: 3px; }
.empty { color: #b8ae9b; font-family: var(--type); }

.foot { max-width: 980px; margin: 0 auto; padding: 2rem 1.25rem 4rem; color: #8f8778; font-size: .85rem; border-top: 1px solid #2c2822; }
.foot code { background: #26221d; }

/* Reader */
.reader { position: fixed; inset: 0; z-index: 40; background: #0f0e0c; display: flex; flex-direction: column; }
.reader[hidden] { display: none; }
.reader-bar { display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; background: #0a0908; border-bottom: 2px solid var(--khaki-dim); }
.back { font-family: var(--stencil); font-size: 1.15rem; text-decoration: none; letter-spacing: .06em; white-space: nowrap; }
.reader-title { flex: 1; font-family: var(--type); font-size: .9rem; color: #c9bfa9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-tools button { background: transparent; color: var(--khaki); border: 1px solid var(--khaki-dim); padding: .3rem .8rem; font-size: .85rem; white-space: nowrap; }
.reader-tools button.on { background: var(--khaki); color: var(--concrete); }
.reader-body { flex: 1; overflow: auto; display: grid; grid-template-columns: 1fr; gap: 0; }
.reader-body.split { grid-template-columns: 1fr 1fr; }
.reader-body.split .file { border-right: 2px dashed #3a352c; }

.file { padding: 1.5rem clamp(.8rem, 3vw, 2.2rem) 5rem; min-width: 0; }
.file-head { background: var(--paper); color: var(--ink); padding: 1.3rem 1.4rem; position: relative; box-shadow: inset 0 0 60px rgba(120,90,40,.2); }
.file-head h2 { font-family: var(--stencil); font-size: 2.2rem; margin: 0; line-height: 1; }
.file-head .sub { font-family: var(--type); font-size: .82rem; color: #5b5346; margin-top: .3rem; }
.file-head .stamp { position: absolute; right: 1rem; top: 1rem; mix-blend-mode: multiply; font-size: 1.2rem; }
.file-head .twin-link { font-size: .82rem; }
.cast { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: 1rem; }
.card { border: 1px solid #8b8170; padding: .55rem .6rem; font-size: .78rem; line-height: 1.35; background: var(--paper-2); }
.card b { display: block; font-family: var(--type); font-weight: 400; font-size: .95rem; }
.card .role { font-size: .65rem; letter-spacing: .12em; text-transform: uppercase; color: var(--grey); }
.card.guard { border-top: 4px solid var(--khaki-dim); }
.card.prisoner { border-top: 4px solid var(--ink); }
.card .num { float: right; font-family: var(--stencil); font-weight: 800; font-size: 1.4rem; line-height: 1; color: var(--ink); }

.heat { margin: 1.2rem 0 .3rem; }
.heat-grid { display: grid; grid-template-columns: 5.5rem repeat(24, 1fr); gap: 2px; font-size: .68rem; align-items: center; }
.heat-grid .hl { color: #a59b87; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: .3rem; }
.heat-grid .cell { height: 16px; background: #26231f; cursor: pointer; border: 0; padding: 0; }
.heat-grid .cell:hover { outline: 1px solid var(--paper); }
.heat-grid .dayhead { text-align: center; color: #847a68; font-family: var(--type); }
.legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .7rem; color: #a59b87; margin-top: .4rem; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: .3rem; vertical-align: -1px; }

.days { display: flex; gap: .3rem; margin: 1.2rem 0 0; position: sticky; top: 0; background: #0f0e0c; padding: .5rem 0; z-index: 3; flex-wrap: wrap; }
.days button { background: #1d1b18; color: var(--paper); border: 1px solid #3a352c; padding: .3rem .8rem; font-family: var(--stencil); font-size: 1rem; letter-spacing: .05em; }
.days button.on { background: var(--paper); color: var(--ink); }
.days button .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-left: .35rem; vertical-align: 2px; }

.phase { margin-top: 1.4rem; }
.phase-h { font-family: var(--type); text-transform: uppercase; font-size: .78rem; letter-spacing: .14em; color: var(--khaki); border-bottom: 1px solid #3a352c; padding-bottom: .25rem; margin-bottom: .5rem; }
.phase.night .phase-h { color: #8ea0c2; }
.line { display: grid; grid-template-columns: 9.5rem 1fr; gap: .8rem; padding: .3rem 0; font-size: .92rem; border-bottom: 1px dotted #26231f; }
.who { color: #b8ae9b; font-size: .82rem; padding-top: .1rem; overflow-wrap: anywhere; }
.line.g .who { color: var(--khaki); }
.act { display: inline-block; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; padding: 0 .4rem; margin-right: .45rem; color: #111; font-weight: 700; vertical-align: 1px; }
.act.sv-1 { background: #6f8f58; }
.act.sv0 { background: var(--sev0); }
.act.sv1 { background: var(--sev1); }
.act.sv2 { background: var(--sev2); color: #fff; }
.act.sv3 { background: var(--sev3); color: #fff; }
.act.sv4 { background: var(--sev4); color: #fff; }
.act.p { background: #3a352c; color: #d9cfbb; }
.act.p.res { background: #6a4b8c; color: #fff; }
.act.bad { background: transparent; border: 1px dashed #7b756a; color: #9a9384; }
.tgt { color: #9a9384; font-size: .8rem; }
.say { color: var(--paper); }
.line.quiet { opacity: .55; font-size: .82rem; padding: .1rem 0; }
.line.harsh { background: linear-gradient(90deg, rgba(179,38,30,.16), transparent 70%); }
.event { margin: .6rem 0; padding: .8rem 1rem; border: 2px solid var(--red); color: #f2c9c4; font-family: var(--type); background: rgba(179,38,30,.1); }
.event b { color: var(--red); font-family: var(--stencil); letter-spacing: .08em; font-size: 1.05rem; display: block; }

.diaries { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; margin-top: .6rem; }
.diary {
  background: #f3edd9; color: #222; padding: .7rem .9rem .8rem 1.6rem; font-family: var(--type); font-size: .88rem; line-height: 1.5;
  background-image: linear-gradient(90deg, transparent 1.1rem, rgba(200,60,60,.45) 1.1rem 1.18rem, transparent 1.18rem), repeating-linear-gradient(transparent 0 1.28rem, rgba(70,110,170,.25) 1.28rem 1.33rem);
  box-shadow: 0 3px 8px rgba(0,0,0,.4); transform: rotate(var(--r, 0deg));
}
.diary .dwho { font-family: var(--mono); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: #57503f; }
.meters { margin-top: .5rem; font-family: var(--mono); font-size: .7rem; color: #57503f; display: grid; gap: .15rem; }
.meter { display: grid; grid-template-columns: 7.5rem 1fr 1rem; align-items: center; gap: .4rem; }
.meter .bar { height: 6px; background: rgba(0,0,0,.12); position: relative; }
.meter .bar i { position: absolute; inset: 0 auto 0 0; background: #57503f; }

.board { margin-top: .6rem; border: 1px solid #5a5244; padding: .8rem 1rem; background: #191714; }
.board-h { font-family: var(--stencil); letter-spacing: .08em; font-size: 1.2rem; color: var(--khaki); margin-bottom: .3rem; }
.board .q { color: #a59b87; font-style: italic; font-size: .85rem; margin-bottom: .5rem; }
.board .ans { padding: .35rem 0; border-top: 1px dotted #3a352c; }
.verdict { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; padding: 0 .4rem; margin-left: .4rem; border: 1px solid currentColor; }
.verdict.stay { color: #a59b87; }
.verdict.go { color: #e07a6c; }

.debrief { margin-top: 1rem; background: var(--paper); color: var(--ink); padding: 1rem 1.2rem; }
.debrief-h { font-family: var(--stencil); font-size: 1.6rem; margin: 0 0 .5rem; }
.debrief .person { padding: .7rem 0; border-top: 1px solid #b7ab92; }
.debrief .person b { font-family: var(--type); font-weight: 400; }
.debrief dl { margin: .3rem 0 0; display: grid; grid-template-columns: 11rem 1fr; gap: .25rem .8rem; font-size: .86rem; }
.debrief dt { color: var(--grey); }
.debrief dd { margin: 0; }
.debrief mark { background: rgba(179,38,30,.2); color: inherit; padding: 0 .1rem; }

.loading { font-family: var(--type); color: #a59b87; padding: 3rem 1rem; }

@media (max-width: 900px) {
  .reader-body.split { grid-template-columns: 1fr; }
  .reader-body.split .file { border-right: 0; border-bottom: 2px dashed #3a352c; }
}
@media (max-width: 680px) {
  .briefs, .stats { grid-template-columns: 1fr; }
  .cast { grid-template-columns: 1fr 1fr; }
  .file-head .stamp { position: static; display: inline-block; margin-top: .6rem; }
  .file-head h2 { font-size: 1.8rem; }
  .card { font-size: .72rem; }
  .line { grid-template-columns: 1fr; gap: 0; }
  .heat-grid { grid-template-columns: 4rem repeat(24, 1fr); }
  .height-chart { display: none; }
  .repo-line { font-size: .72rem; }
  .repo-tag { display: none; }
  .debrief dl { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .bars { animation: none; transform: none; }
  h1 { animation: none; }
  .stamp-hero { animation: none; opacity: .95; }
}
