:root {
  --black: #070707;
  --mud: #13110d;
  --mud-2: #1c1914;
  --line: rgba(217, 195, 154, .14);
  --khaki: #d9c39a;
  --paper: #e9e1cf;
  --muted: #8f8676;
  --flare: #ff8a2a;
  --flare-hot: #ffb15c;
  --blood: #b3261e;
  --stencil: "Big Shoulders Stencil Display", Impact, sans-serif;
  --display: "Big Shoulders Display", Impact, sans-serif;
  --type: "Courier Prime", "Courier New", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--black);
  color: var(--paper);
  font-family: var(--type);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: var(--flare); color: var(--black); }

/* film grain over everything */
.grain {
  position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: .09;
  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='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .6s steps(4) infinite;
}
@keyframes grain { 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-1%, -2%); } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: 2px; text-transform: uppercase;
  padding: 14px 28px; text-decoration: none; border: 1px solid transparent; transition: all .2s;
}
.btn-flare { background: var(--flare); color: var(--black); box-shadow: 0 0 0 0 rgba(255, 138, 42, .5); }
.btn-flare:hover { background: var(--flare-hot); box-shadow: 0 0 40px rgba(255, 138, 42, .45); }
.btn-ghost { background: transparent; border-color: rgba(233, 225, 207, .35); color: var(--paper); }
.btn-ghost:hover { border-color: var(--paper); background: rgba(233, 225, 207, .06); }
.btn-sm { padding: 9px 18px; font-size: 15px; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 32px; transition: background .3s, padding .3s;
}
.nav.scrolled { background: rgba(7, 7, 7, .88); backdrop-filter: blur(6px); padding: 12px 32px; border-bottom: 1px solid var(--line); }
.nav-brand { font-family: var(--stencil); font-weight: 900; font-size: 26px; letter-spacing: 2px; text-decoration: none; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { font-family: var(--display); font-weight: 700; letter-spacing: 2px; text-transform: uppercase; font-size: 15px; text-decoration: none; color: var(--khaki); opacity: .8; }
.nav-links a:hover { opacity: 1; color: var(--flare-hot); }

/* ---------- hero ---------- */
.hero { position: relative; height: 100vh; min-height: 640px; overflow: hidden; display: flex; align-items: center; }
.hero-media { position: absolute; inset: 0; }
#sky { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.trench { position: absolute; left: 0; right: 0; bottom: 0; height: 62%; pointer-events: none; }
.trench svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 -1.5px 0 rgba(255, 138, 42, .45)) drop-shadow(0 -6px 14px rgba(255, 120, 40, .12)); }
/* the two rats on the bicycle, riding along the top of the trench (SVG user units) */
/* --ride-from / --ride-to / --ride-time are set in app.js from the visible part of the scene,
   so the bike leaves the right edge and immediately re-enters on the left, at a steady speed. */
.bike-track { animation: ride var(--ride-time, 24s) linear infinite; animation-delay: -4s; }
@keyframes ride { from { transform: translateX(var(--ride-from, -220px)); } to { transform: translateX(var(--ride-to, 1620px)); } }
.bike-bob { animation: bob .36s ease-in-out infinite alternate; }
@keyframes bob { from { translate: 0 0; } to { translate: 0 -1.6px; } }
.trench .wheel { transform-box: view-box; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.trench .tail { transform-box: fill-box; transform-origin: right center; animation: tailwag .5s ease-in-out infinite alternate; }
@keyframes tailwag { to { transform: rotate(8deg); } }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, transparent 40%, rgba(0, 0, 0, .75) 100%), linear-gradient(180deg, rgba(0,0,0,.35), transparent 30%, transparent 70%, var(--black));
}
.letterbox { position: absolute; left: 0; right: 0; height: 5vh; background: #000; z-index: 3; }
.letterbox.top { top: 0; } .letterbox.bottom { bottom: 0; }

.hero-copy { position: relative; z-index: 4; padding: 0 6vw; max-width: 1240px; margin-top: -6vh; }
.title { white-space: nowrap; }
.dateline { font-family: var(--type); font-size: 14px; letter-spacing: 4px; color: var(--flare-hot); margin: 0 0 6px; }
.title {
  margin: 0; font-family: var(--stencil); font-weight: 900; line-height: .86; letter-spacing: 2px;
  font-size: clamp(72px, 11vw, 168px); color: var(--paper);
  text-shadow: 0 0 60px rgba(255, 138, 42, .25), 0 4px 0 rgba(0,0,0,.6);
}
.tagline { font-family: var(--display); font-weight: 500; font-size: clamp(22px, 3vw, 34px); letter-spacing: 1px; margin: 10px 0 28px; color: var(--khaki); }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.ca {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 22px; max-width: 100%;
  background: rgba(7, 7, 7, .6); border: 1px dashed rgba(217, 195, 154, .4); color: var(--paper);
  padding: 9px 14px; font-family: var(--type); font-size: 14px; text-align: left;
}
.ca:hover { border-color: var(--flare); }
.ca-label { color: var(--flare-hot); font-weight: 700; letter-spacing: 2px; flex: none; }
.ca-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ca-copy { flex: none; font-size: 12px; letter-spacing: 2px; color: var(--muted); }

.scroll-cue { position: absolute; bottom: calc(5vh + 22px); left: 50%; z-index: 4; width: 26px; height: 42px; border: 2px solid rgba(233,225,207,.5); border-radius: 14px; transform: translateX(-50%); }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; background: var(--paper); border-radius: 2px; animation: cue 1.8s infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- manifesto ---------- */
.manifesto { max-width: 1100px; margin: 0 auto; padding: 160px 6vw 140px; }
.dispatch { font-size: 13px; letter-spacing: 3px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 14px; margin: 0 0 60px; }
.lines p {
  font-family: var(--display); font-weight: 800; text-transform: uppercase; line-height: 1.02;
  font-size: clamp(38px, 6.4vw, 88px); margin: 0 0 28px; color: var(--paper);
  opacity: .08; transform: translateY(24px); filter: blur(4px); transition: opacity 1s, transform 1s, filter 1s;
}
.lines p.in { opacity: 1; transform: none; filter: none; }
.lines p:last-child { color: var(--flare); text-shadow: 0 0 40px rgba(255, 138, 42, .35); }
.signoff { font-size: 15px; color: var(--muted); margin-top: 50px; font-style: italic; }

/* ---------- sections ---------- */
.section { padding: 120px 6vw; max-width: 1400px; margin: 0 auto; }
.section-dark { max-width: none; background: linear-gradient(180deg, var(--black), var(--mud) 15%, var(--mud) 85%, var(--black)); }
.section-dark > * { max-width: 1400px; margin-left: auto; margin-right: auto; }
.section-head { margin-bottom: 48px; }
.kicker { font-size: 13px; letter-spacing: 4px; color: var(--flare-hot); margin: 0 0 4px; }
.section-head h2 { font-family: var(--stencil); font-weight: 900; font-size: clamp(56px, 8vw, 110px); line-height: .9; margin: 0; letter-spacing: 2px; }
.lead { color: var(--khaki); max-width: 560px; margin: 16px 0 0; }

/* media frames (shared) */
.frame { position: relative; overflow: hidden; background: #0b0b0b; }
.frame > svg, .frame > img, .frame > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s cubic-bezier(.2, .7, .2, 1); }
.frame::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 80px rgba(0,0,0,.7); }
.placeholder-tag {
  position: absolute; z-index: 2; left: 10px; bottom: 10px; font-size: 11px; letter-spacing: 1px;
  background: rgba(0,0,0,.65); color: var(--muted); padding: 2px 8px; border: 1px dashed rgba(143,134,118,.5);
}

/* unit */
.unit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.unit-card { border: 1px solid var(--line); background: var(--mud); display: flex; flex-direction: column; }
.unit-card .frame { aspect-ratio: 3 / 4; }
.unit-card:hover .frame > * { transform: scale(1.06); }
.unit-card:first-child { grid-column: span 2; grid-row: span 2; }
.unit-card:first-child .frame { aspect-ratio: auto; flex: 1; min-height: 420px; }
/* Real unit art: show the whole picture at the bottom of the tall card and let its night sky
   continue upward (colour per character in config.js), fading the top edge of the picture into it. */
.frame.sky-fit { background: linear-gradient(180deg, #08090c 0%, color-mix(in srgb, var(--sky) 60%, #08090c) 45%, var(--sky) 100%); }
.frame.sky-fit > img {
  top: auto; bottom: 0; height: auto; object-fit: initial; transform-origin: center bottom;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
}
.unit-info { padding: 16px 18px 20px; }
.unit-role { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--flare-hot); }
.unit-name { font-family: var(--display); font-weight: 800; font-size: 28px; text-transform: uppercase; line-height: 1.1; margin: 2px 0 6px; }
.unit-card:first-child .unit-name { font-size: 40px; }
.unit-bio { font-size: 14px; color: var(--khaki); margin: 0; }


/* photos */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 240px; gap: 14px; }
.photo { position: relative; border: 0; padding: 0; background: none; color: inherit; }
.photo .frame { position: absolute; inset: 0; }
.photo:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.photo:hover .frame > * { transform: scale(1.05); }
/* pictures with their own black surround (e.g. the scope view): show all of it on black */
.frame.fit-whole { background: #040404; }
.frame.fit-whole > img { object-fit: contain; }
.photo-cap {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 30px 14px 12px; text-align: left; font-size: 13px; letter-spacing: 1px;
  background: linear-gradient(transparent, rgba(0,0,0,.85)); color: var(--khaki); opacity: 0; transition: opacity .3s;
}
.photo:hover .photo-cap { opacity: 1; }


/* enlist: build-your-rat profile picture generator */
.recruit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; align-items: start; }
.recruit-preview { position: sticky; top: 90px; }
.pfp-frame { aspect-ratio: 1; border: 1px solid var(--line); background: #0b0b0b; box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 6px rgba(255,138,42,.05); }
.pfp-frame svg { display: block; width: 100%; height: 100%; }
.pfp-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.pfp-actions .btn { flex: 1 1 160px; justify-content: center; }
.pfp-share { margin-top: 14px; background: none; border: 0; padding: 0; color: var(--flare-hot); font-family: var(--type); font-size: 14px; letter-spacing: 1px; text-decoration: underline; text-underline-offset: 4px; }
.pfp-share:hover { color: var(--paper); }
.pfp-orders { font-size: 13px; color: var(--muted); margin: 10px 0 0; letter-spacing: 1px; }
.recruit-controls { display: grid; gap: 22px; }
.pfp-group { border-top: 1px solid var(--line); padding-top: 14px; }
.pfp-group-title { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: 2px; text-transform: uppercase; color: var(--khaki); margin-bottom: 10px; }
.pfp-options { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: transparent; color: var(--paper); border: 1px solid rgba(233,225,207,.25);
  padding: 7px 13px; font-family: var(--type); font-size: 13px; letter-spacing: .5px; transition: all .15s;
}
.chip:hover { border-color: var(--paper); }
.chip.on { background: var(--flare); border-color: var(--flare); color: var(--black); font-weight: 700; }
.swatch {
  width: 38px; height: 38px; border-radius: 50%; padding: 0; background: var(--c);
  border: 2px solid rgba(233,225,207,.2); box-shadow: inset 0 0 0 3px rgba(0,0,0,.35); transition: transform .15s;
}
.swatch:hover { transform: scale(1.1); }
.swatch.on { border-color: var(--flare); box-shadow: 0 0 0 3px var(--black), 0 0 0 5px var(--flare); }
.pfp-input {
  margin-top: 10px; width: 100%; background: #0b0b0b; color: var(--paper); border: 1px solid var(--line);
  padding: 10px 12px; font-family: var(--type); font-size: 15px; letter-spacing: 1px; text-transform: uppercase;
}
.pfp-input:focus { outline: none; border-color: var(--flare); }

/* footer */
.token-strip { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; margin: 22px 0 6px; }
.token-strip .ca { margin-top: 0; }
.token-item { font-family: var(--display); font-weight: 800; letter-spacing: 2px; color: var(--khaki); }
.footer { border-top: 1px solid var(--line); padding: 60px 6vw 70px; text-align: center; }
.footer-brand { font-family: var(--stencil); font-weight: 900; font-size: clamp(60px, 12vw, 160px); line-height: .9; color: #1a1712; letter-spacing: 4px; }
.socials { display: flex; justify-content: center; gap: 28px; margin: 18px 0; }
.socials a { font-family: var(--display); font-weight: 700; letter-spacing: 2px; text-transform: uppercase; text-decoration: none; color: var(--khaki); }
.socials a:hover { color: var(--flare-hot); }
.disclaimer { max-width: 620px; margin: 0 auto; font-size: 12px; color: var(--muted); }

/* lightbox & toast */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.94); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px 20px; }
.lightbox-body { width: min(1200px, 100%); max-height: 80vh; display: flex; justify-content: center; }
.lightbox-body img, .lightbox-body video { max-width: 100%; max-height: 80vh; display: block; }
.lightbox-caption { color: var(--khaki); letter-spacing: 2px; margin-top: 14px; }
.lightbox-close { position: absolute; top: 18px; right: 22px; background: none; border: 0; color: var(--paper); font-size: 28px; }
.toast {
  position: fixed; z-index: 95; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--paper); color: var(--black); font-weight: 700; padding: 10px 18px; letter-spacing: 1px; transition: all .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .9s, transform .9s; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .recruit { grid-template-columns: 1fr; gap: 28px; }
  .recruit-preview { position: static; max-width: 520px; width: 100%; margin: 0 auto; }
}
@media (max-width: 1100px) {
  .unit-grid { grid-template-columns: repeat(2, 1fr); }
  .unit-card:first-child { grid-column: span 2; grid-row: auto; }
  .unit-card:first-child .frame { flex: none; height: auto; min-height: 0; aspect-ratio: 4 / 5; }
  .nav-links { display: none; }
}
@media (max-width: 720px) {
  .nav, .nav.scrolled { padding: 12px 16px; }
  .nav-brand { font-size: 22px; }
  .hero-copy { padding: 0 16px; margin-top: -18vh; }
  .section { padding: 90px 16px; }
  .manifesto { padding: 110px 16px 90px; }
  .photo-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 160px; }
  .photo:nth-child(6) { grid-column: span 2; }
  .trench { height: 52%; }
  .unit-card:first-child .unit-name { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .lines p, .reveal { transition: none; opacity: 1; transform: none; filter: none; }
}

/* ---------- the wall ---------- */
.pfp-wall-btn { width: 100%; justify-content: center; margin-top: 12px; }
.wall-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.wall-count { text-align: right; font-family: var(--stencil); font-weight: 900; line-height: .9; color: var(--flare); }
.wall-count span { display: block; font-size: clamp(56px, 7vw, 96px); text-shadow: 0 0 40px rgba(255, 138, 42, .3); }
.wall-count small { display: block; font-family: var(--type); font-weight: 400; font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: var(--khaki); margin-top: 6px; }
.wall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.wall-rat {
  position: relative; aspect-ratio: 1; padding: 0; border: 1px solid var(--line); background: #0b0b0b; overflow: hidden;
  container-type: inline-size; transition: transform .2s, border-color .2s, box-shadow .2s;
}
.wall-rat img { display: block; width: 100%; height: 100%; }
.wall-rat:hover, .wall-rat:focus-visible { transform: translateY(-3px) rotate(-1deg); border-color: var(--flare); box-shadow: 0 14px 30px rgba(0,0,0,.6); outline: none; z-index: 1; }
.wall-tag {
  position: absolute; left: 0; right: 0; bottom: 2.2%; text-align: center; pointer-events: none;
  font-family: var(--stencil); font-weight: 900; font-size: 8.4cqw; letter-spacing: .6cqw; color: var(--paper); line-height: 1;
}
.wall-you {
  position: absolute; top: 6px; left: 6px; background: var(--flare); color: var(--black);
  font-family: var(--display); font-weight: 800; font-size: 11px; letter-spacing: 2px; padding: 2px 7px;
}
.wall-wear {
  position: absolute; inset: auto 0 0 0; padding: 22px 6px 8px; font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  background: linear-gradient(transparent, rgba(0,0,0,.9)); color: var(--flare-hot); opacity: 0; transition: opacity .2s;
}
.wall-rat:hover .wall-wear, .wall-rat:focus-visible .wall-wear { opacity: 1; }
.wall-new { animation: pinned .7s cubic-bezier(.2, .9, .3, 1.3); border-color: var(--flare); }
@keyframes pinned { from { transform: scale(.4) rotate(-8deg); opacity: 0; } }
.wall-empty { text-align: center; color: var(--khaki); padding: 40px 0; letter-spacing: 1px; }
.wall-empty a { color: var(--flare-hot); }
.wall-more { display: flex; justify-content: center; margin-top: 28px; }
@media (max-width: 720px) {
  .wall-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .wall-count { text-align: left; }
  .wall-you { font-size: 9px; top: 3px; left: 3px; padding: 1px 4px; }
}
@media (prefers-reduced-motion: reduce) { .wall-new { animation: none; } }
