/* Red Protocol: home / briefing page */

main { position: relative; z-index: 1; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px var(--gutter-r) 120px var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 48px;
}

.hero-copy { display: grid; gap: 22px; justify-items: start; min-width: 0; }
.hero-copy > * { animation: rise 0.8s var(--ease) both; }
.hero-copy > *:nth-child(2) { animation-delay: 0.08s; }
.hero-copy > *:nth-child(3) { animation-delay: 0.18s; }
.hero-copy > *:nth-child(4) { animation-delay: 0.24s; }
.hero-copy > *:nth-child(5) { animation-delay: 0.3s; }
.hero-copy > *:nth-child(6) { animation-delay: 0.38s; }

.hero-title { font-size: clamp(3rem, 8vw, 7.2rem); }

/* PROTOCOL is ~5.24em wide at 0.82em: size the title from its column so it never overflows */
@supports (font-size: 1cqi) {
  .hero-copy { container-type: inline-size; }
  .hero-title { font-size: min(8.6rem, 18.6cqi); }
}
.hero-title .rp-red { font-size: 1em; }
.hero-title .rp-silver { font-size: 0.82em; letter-spacing: 0.01em; }

.noted {
  margin: 0;
  font-size: clamp(0.82rem, 1.6vw, 1rem);
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text);
}

.verse { margin: 0; line-height: 2.1; font-size: 0.7rem; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

.hero-art {
  position: relative;
  margin: 0;
  justify-self: center;
  width: min(100%, 440px);
  animation: rise 1s var(--ease) 0.2s both;
}

.poster {
  display: block;
  position: relative;
  transform: rotate(2.2deg);
  border: 1px solid rgba(255, 60, 60, 0.25);
  box-shadow:
    0 0 0 6px #0c0707,
    0 0 0 7px rgba(255, 60, 60, 0.18),
    0 30px 80px -20px rgba(0, 0, 0, 0.9),
    0 0 90px -10px rgba(255, 20, 20, 0.35);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}

.poster:hover { transform: rotate(0.6deg) scale(1.01); }

.poster img { display: block; width: 100%; height: auto; }

.poster::after {
  /* tape strip */
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 110px;
  height: 28px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(217, 199, 163, 0.55);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(1px);
}

/* ---------- countdown ---------- */

.countdown {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px var(--gutter-r) 24px var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 40px;
}

.cd-block { display: grid; justify-items: center; gap: 14px; text-align: center; }

.cd-digits { display: flex; align-items: flex-start; gap: clamp(8px, 2.4vw, 22px); }
.cd-unit { display: grid; gap: 6px; justify-items: center; min-width: 2.6ch; }

.cd-num {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 7vw, 4rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--silver-1);
  text-shadow: 0 0 22px rgba(255, 40, 40, 0.35);
}

.cd-sep {
  font-family: var(--f-display);
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1;
  color: var(--red);
  animation: flicker 2s steps(1) infinite;
}

.cd-cap { font-size: 0.62rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--dim); }
.cd-status { margin: 0; font-size: 0.82rem; color: var(--muted); }
.is-live .cd-num, .is-done .cd-num { color: var(--red-hot); }

/* ---------- envelope ---------- */

.briefing {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px var(--gutter-r) 40px var(--gutter);
  display: grid;
  justify-items: center;
}

.envelope {
  position: relative;
  width: min(100%, 760px);
  padding: 44px clamp(22px, 5vw, 56px) 36px;
  display: grid;
  gap: 28px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E"),
    linear-gradient(170deg, #1b1414 0%, #120c0c 60%, #0d0909 100%);
  border: 1px solid #2a1c1c;
  border-radius: 3px;
  box-shadow:
    0 40px 80px -30px rgba(0, 0, 0, 0.9),
    0 18px 60px -18px rgba(255, 20, 20, 0.45),
    0 2px 0 0 rgba(255, 40, 40, 0.65);
  transform: rotate(-1.2deg);
  overflow: hidden;
}

.env-flap {
  position: absolute;
  inset: 0 0 auto 0;
  height: 52%;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.18));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.env-head { position: relative; text-align: center; display: grid; gap: 10px; justify-items: center; }

.env-title {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  background: linear-gradient(180deg, #fff, #b9b2ae);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.env-title .red {
  background: linear-gradient(180deg, #ff6a5c, #d8121b);
  -webkit-background-clip: text;
  background-clip: text;
}

.env-noted { font-size: 0.66rem; }

.env-seal { --size: 92px; position: relative; justify-self: center; margin-block: -4px; }

.env-details {
  position: relative;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}

.detail {
  display: grid;
  grid-template-columns: 26px 1fr;
  column-gap: 12px;
  row-gap: 2px;
  align-items: start;
  min-width: 0;
}

.detail-icon {
  grid-row: span 2;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  fill: none;
  stroke: var(--red-hot);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail dt { font-size: 0.64rem; }

.detail dd {
  margin: 0;
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.35;
  color: var(--text);
  overflow-wrap: anywhere;
}

.map-link {
  display: block;
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red-hot);
  text-decoration: none;
}

.map-link:hover { text-decoration: underline; }

.env-foot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.env-only { margin: 0; font-size: 0.62rem; }

/* ---------- assignments ---------- */

.assignments {
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px var(--gutter-r) 40px var(--gutter);
}

.section-head { display: grid; gap: 12px; margin-bottom: 36px; }

.section-title {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.05;
}

.assign-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.dossier {
  padding: 34px 26px 30px;
  display: grid;
  gap: 10px;
  transform: rotate(-2.5deg);
  margin-top: 10px;
}

.dossier-line { margin: 0; font-size: 1.02rem; letter-spacing: 0.04em; text-transform: uppercase; }
.dossier-line b { font-weight: 400; color: #8a1b12; }

.dossier-stamp {
  justify-self: end;
  margin-top: 14px;
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(170, 20, 20, 0.75);
  border: 2px solid rgba(170, 20, 20, 0.6);
  padding: 4px 8px;
  transform: rotate(-8deg);
  mix-blend-mode: multiply;
}

.dossier-clip {
  position: absolute;
  top: -12px;
  left: 28px;
  width: 16px;
  height: 46px;
  border: 3px solid #8e8a86;
  border-radius: 9px;
  border-bottom-color: transparent;
}

.files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.files > li { display: grid; }

.file {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  align-content: start;
  gap: 10px;
  padding: 22px 20px 20px;
  min-height: 250px;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.file-no { font-size: 0.78rem; color: var(--muted); }

.file-state {
  position: absolute;
  top: 18px;
  right: 16px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  padding: 3px 7px;
  border: 1px solid currentColor;
}

.file-title {
  margin: 4px 0 0;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.file-body { margin: 0; color: var(--muted); font-size: 0.9rem; display: grid; gap: 8px; align-content: start; }

.file-go {
  margin-top: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.file-open {
  border-color: var(--red-line);
  box-shadow: 0 0 0 1px rgba(255, 40, 40, 0.08), 0 20px 50px -24px rgba(255, 20, 20, 0.6);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
}

.file-open:hover { transform: translateY(-4px); border-color: var(--red-hot); box-shadow: 0 0 0 1px rgba(255, 40, 40, 0.2), 0 26px 60px -20px rgba(255, 20, 20, 0.75); }
.file-open .file-state { color: var(--red-hot); }
.file-open .file-go { color: var(--red-hot); }

.file-locked { opacity: 0.78; }
.file-locked .file-state { color: var(--dim); }
.file-locked .file-go { color: var(--dim); font-family: var(--f-type); letter-spacing: 0.04em; text-transform: none; font-weight: 400; font-size: 0.85rem; }
.file-locked .redact { display: block; height: 0.9em; }

/* ---------- footer ---------- */

.site-foot {
  max-width: 1200px;
  margin: 40px auto 0;
  padding: 48px var(--gutter-r) max(48px, env(safe-area-inset-bottom, 0px)) var(--gutter);
  display: grid;
  justify-items: end;
  gap: 18px;
  text-align: right;
}

.site-foot .label { margin: 0; line-height: 2; font-size: 0.68rem; }
.foot-mark { width: 30px; height: 28px; color: var(--red-deep); }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .assign-grid { grid-template-columns: 1fr; }
  .dossier { max-width: 360px; }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 36px; }
  .hero-art { width: min(82%, 360px); }
  .files { grid-template-columns: 1fr; }
  .file { min-height: 0; }
  .env-details { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero-cta { width: 100%; }
  .hero-cta .btn { flex: 1 1 100%; }
  .envelope { transform: none; }
}


/* ================= atmosphere additions ================= */

/* ---------- skyline behind the hero ---------- */

.skyline {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: -1;
  width: 100vw;
  height: 230px;
  transform: translateX(-50%);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 45%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 45%);
}

.skyline svg { display: block; width: 100%; height: 100%; }
.skyline .bld { fill: #0c0606; }
.skyline .bld-far { fill: #160909; }
.skyline .win { fill: #ff4a3d; }
.skyline .win.flick { animation: window 6s steps(1) infinite; }
.skyline .beacon { fill: var(--red-hot); animation: beacon 2.4s ease-in-out infinite; }
.skyline::after {
  /* low red haze where the city meets the fog */
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 60%;
  background: linear-gradient(0deg, rgba(7, 5, 5, 0.95), rgba(120, 8, 12, 0.18) 60%, transparent);
}

@keyframes window { 0%, 62% { opacity: var(--o, 0.6); } 63%, 66% { opacity: 0.05; } 67%, 100% { opacity: var(--o, 0.6); } }
@keyframes beacon { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

/* ---------- CCTV viewfinder over the poster ---------- */

.hud {
  position: absolute;
  inset: 12px;
  pointer-events: none;
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 235, 230, 0.85);
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
}

.hud-clip { position: absolute; inset: 0; overflow: hidden; }

.hud-corner { position: absolute; width: 22px; height: 22px; border: 0 solid rgba(255, 235, 230, 0.75); }
.hud-corner.tl { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.hud-corner.tr { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.hud-corner.bl { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.hud-corner.br { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }

.hud-rec { position: absolute; top: -40px; left: -12px; display: flex; align-items: center; gap: 6px; font-weight: 700; }
.hud-rec::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-hot);
  box-shadow: 0 0 8px var(--red-hot);
  animation: rec 1.2s steps(1) infinite;
}

.hud-cam { position: absolute; top: -40px; right: -12px; color: var(--muted); }
.hud-loc { position: absolute; bottom: -40px; left: -12px; color: var(--muted); }
.hud-coord { position: absolute; bottom: -40px; right: -12px; color: var(--red-hot); }

.hud-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: -20%;
  height: 18%;
  background: linear-gradient(180deg, transparent, rgba(255, 60, 60, 0.12) 85%, rgba(255, 120, 110, 0.4) 100%);
  animation: scan 5.5s linear infinite;
}

.hud-cross {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(rgba(255, 235, 230, 0.6), rgba(255, 235, 230, 0.6)) center / 1px 100% no-repeat,
    linear-gradient(rgba(255, 235, 230, 0.6), rgba(255, 235, 230, 0.6)) center / 100% 1px no-repeat;
  opacity: 0.5;
}

@keyframes rec { 50% { opacity: 0; } }
@keyframes scan { to { top: 105%; } }

/* ---------- terminal ---------- */

.terminal {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  min-height: 230px;
  background: rgba(3, 2, 2, 0.85);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 0 40px rgba(255, 20, 20, 0.06), 0 20px 50px -30px rgba(255, 20, 20, 0.5);
  overflow: hidden;
}

.term-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
}

.term-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red-hot); box-shadow: 0 0 8px var(--red-hot); animation: rec 1.6s steps(1) infinite; }
.term-id { margin-left: auto; font-family: var(--f-mono); letter-spacing: 0.1em; color: var(--dim); }

.term-body {
  flex: 1;
  margin: 0;
  padding: 16px 18px;
  font-family: var(--f-mono);
  font-size: 0.86rem;
  line-height: 1.75;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: pre-wrap;
  color: #ff8f84;
  text-shadow: 0 0 8px rgba(255, 40, 40, 0.45);
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 3px);
}

.term-body .cursor { display: inline-block; width: 0.6em; height: 1.05em; vertical-align: -0.15em; background: #ff8f84; animation: rec 0.9s steps(1) infinite; }
.term-body .ok { color: var(--ok); text-shadow: none; }

/* ---------- fingerprint on the envelope ---------- */

.env-print {
  position: absolute;
  right: 5%;
  top: 7%;
  width: 96px;
  height: 116px;
  color: rgba(224, 20, 30, 0.14);
  transform: rotate(18deg);
  pointer-events: none;
}

/* ---------- evidence board ---------- */

.assign-grid { position: relative; }

.strings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: visible;
  pointer-events: none;
}

.strings path {
  fill: none;
  stroke: #c3121a;
  stroke-width: 1.6;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.7));
}

.dossier, .files { position: relative; z-index: 1; }

.pin {
  position: absolute;
  z-index: 4;
  top: -7px;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff9a8c, #d4121c 50%, #6e070c);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.7), 0 0 10px rgba(255, 30, 30, 0.35);
}

.dossier .pin { left: auto; right: 34px; top: 12px; }

/* classified file: hover to try your luck */
.file-locked { overflow: hidden; }
.file-locked::after {
  content: "Access denied";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--red-hot);
  text-shadow: 0 0 12px var(--red-glow);
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.82) 0 2px, rgba(30, 4, 6, 0.82) 2px 4px);
  opacity: 0;
  transition: opacity 0.15s;
}

.file-locked:hover::after { opacity: 1; animation: denied 0.5s steps(2) 1; }
.file-locked:hover .redact { animation: jitter 0.3s steps(2) infinite; }

@keyframes denied { 0% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 100% { transform: none; } }
@keyframes jitter { 50% { transform: translateX(3px); opacity: 0.7; } }

@media (max-width: 1080px) {
  .strings { display: none; }
}

@media (max-width: 860px) {
  .countdown { grid-template-columns: 1fr; gap: 28px; padding-top: 40px; }
  .terminal { min-height: 210px; }
  .skyline { height: 170px; }
  .hero { padding-bottom: 90px; }
  .hud { font-size: 0.55rem; }
}
