/* CSIT Operations Range — ORCHID campaign design system
   Concept: each operation is a classified case file. Cinematic surveillance
   stills carry the boldness; the chrome stays a quiet intelligence dossier.
   Signature: the recurring orchid + the stamped OP reference. */

:root {
  --bg:     #07090d;
  --bg-2:   #0b0f15;
  --panel:  #0f141b;
  --panel-2:#141c26;
  --line:   #1c2734;
  --line-2: #27384a;
  --ink:    #dce5f1;
  --muted:  #8695aa;
  --faint:  #5a6a7e;
  --amber:  #f6ad55;
  --ok:     #5bd6a0;
  --danger: #f97583;
  --accent: #4fd1c5;            /* per-operation override via inline style */
  --accent-soft: color-mix(in srgb, var(--accent) 15%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 42%, transparent);
  --display: "Space Grotesk", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px 96px; }

/* ---- top bar ---------------------------------------------------------- */
.topbar {
  max-width: var(--maxw); margin: 0 auto; padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .mark {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  background: radial-gradient(120% 120% at 30% 20%, var(--accent-soft), transparent), var(--panel);
  border: 1px solid var(--accent-line);
  color: var(--accent); font-size: 19px; line-height: 1;
}
.brand .word { font-family: var(--mono); font-size: 12.5px; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--ink); font-weight: 500; }
.brand .word small { display: block; letter-spacing: 1.5px; font-size: 10.5px;
  color: var(--faint); margin-top: 2px; }
.tools { display: flex; align-items: center; gap: 10px; }
.pill-demo { font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--amber); border: 1px solid #f6ad5540;
  background: #f6ad5510; padding: 5px 9px; border-radius: 20px; }
.idchip { font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line); padding: 6px 11px; border-radius: 20px; }
.idchip b { color: var(--accent); font-weight: 500; }

/* ---- shared display type ---------------------------------------------- */
.eyebrow { font-family: var(--mono); font-size: 11.5px; letter-spacing: 3px;
  text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; }
.lede { color: var(--muted); font-size: 16.5px; max-width: 68ch; }
.lede b { color: var(--ink); font-weight: 600; }
.mono { font-family: var(--mono); font-size: .92em; }

/* ---- hub masthead ----------------------------------------------------- */
.masthead { padding: 40px 0 30px; border-bottom: 1px solid var(--line); }
.masthead h1 { font-size: clamp(38px, 6vw, 68px); line-height: 1.02; margin: 0 0 20px; }
.masthead h1 .thin { color: var(--muted); font-weight: 400; }
.masthead .lede { font-size: 17.5px; }
.masthead .lede .orchid { color: var(--accent); font-weight: 600; }
.statstrip { display: flex; flex-wrap: wrap; gap: 30px; margin-top: 28px; }
.stat { display: flex; flex-direction: column; gap: 3px; }
.stat .n { font-family: var(--display); font-size: 26px; font-weight: 600; }
.stat .n .accent { color: var(--accent); }
.stat .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--faint); }

/* ---- case-file gallery ------------------------------------------------ */
.sec-label { font-family: var(--mono); font-size: 11px; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--faint); margin: 46px 0 18px;
  display: flex; align-items: center; gap: 14px; }
.sec-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.files { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.file {
  --accent: #4fd1c5;
  position: relative; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; color: inherit;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.file:hover { transform: translateY(-3px); border-color: var(--accent-line);
  box-shadow: 0 18px 40px -24px color-mix(in srgb, var(--accent) 55%, black); }
.file .shot { position: relative; aspect-ratio: 16/9; overflow: hidden; }
.file .shot img { width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease; filter: saturate(1.05); }
.file:hover .shot img { transform: scale(1.04); }
.file .shot::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, color-mix(in srgb, var(--panel) 92%, transparent)); }
.stamp { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  padding: 5px 10px; border-radius: 6px; border: 1px solid var(--accent-line); color: var(--accent);
  background: color-mix(in srgb, var(--bg) 62%, transparent); backdrop-filter: blur(4px); }
.file .shot .stamp { position: absolute; z-index: 2; top: 14px; left: 14px; }
.file .status { position: absolute; z-index: 2; top: 14px; right: 14px; font-family: var(--mono);
  font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ok);
  background: #5bd6a018; border: 1px solid #5bd6a050; padding: 4px 9px; border-radius: 6px; }
.file .meta { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.file .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip { font-family: var(--mono); font-size: 10px; letter-spacing: 1.3px; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line);
  padding: 4px 9px; border-radius: 5px; }
.tier { font-family: var(--mono); font-size: 10px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--faint); }
.tier b { color: var(--muted); font-weight: 500; }
.file h3 { margin: 0; font-size: 22px; }
.file .brief { margin: 0; color: var(--muted); font-size: 14.5px; flex: 1; }
.file .open { font-family: var(--mono); font-size: 12.5px; letter-spacing: .5px; color: var(--accent);
  display: inline-flex; align-items: center; gap: 7px; margin-top: 2px; }
.file .open .arr { transition: transform .2s ease; }
.file:hover .open .arr { transform: translateX(4px); }

/* ---- badge wall ------------------------------------------------------- */
.badgewall { background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 24px; font-family: var(--mono); font-size: 13.5px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; }
.badgewall .earned { color: var(--ink); }
.badgewall .count { margin-left: auto; color: var(--accent); }

/* ---- operation landing hero ------------------------------------------ */
.opnav { max-width: var(--maxw); margin: 0 auto; padding: 4px 24px 0; }
.back { font-family: var(--mono); font-size: 12.5px; letter-spacing: .5px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px; }
.back:hover { color: var(--accent); }

.hero { position: relative; margin: 18px auto 0; max-width: var(--maxw); padding: 0 24px; }
.hero-frame { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--line-2);
  min-height: 380px; display: flex; align-items: flex-end; }
.hero-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero-frame::after { content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--bg) 92%, transparent) 0%, transparent 55%),
    linear-gradient(0deg, color-mix(in srgb, var(--bg) 95%, transparent) 6%, transparent 60%); }
.hero-inner { position: relative; z-index: 2; padding: 40px 42px; max-width: 760px; }
.hero-inner .stamp { display: inline-block; margin-bottom: 18px; }
.hero-inner h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.04; margin: 0 0 16px;
  text-shadow: 0 2px 30px rgba(0,0,0,.6); }
.hero-inner .row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- dossier body ----------------------------------------------------- */
.dossier { max-width: 780px; margin: 0 auto; padding-top: 36px; }
.brief { color: var(--muted); font-size: 16.5px; border-left: 2px solid var(--accent-line);
  padding-left: 20px; margin: 0 0 8px; }
.brief b { color: var(--ink); font-weight: 600; }
.section-h { font-family: var(--mono); font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--faint); margin: 40px 0 14px; display: flex; align-items: center; gap: 14px; }
.section-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.note { font-size: 13.5px; color: var(--muted); margin: 14px 0 0; }

.artifacts { display: flex; flex-wrap: wrap; gap: 11px; }
.artifacts a { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 13px;
  background: var(--panel-2); border: 1px solid var(--line-2); padding: 11px 15px; border-radius: 9px; color: var(--ink); }
.artifacts a:hover { border-color: var(--accent); color: var(--accent); }

/* hint drop-downs */
details { border: 1px solid var(--line); border-radius: 11px; margin: 9px 0; background: var(--panel);
  overflow: hidden; transition: border-color .15s ease; }
details[open] { border-color: var(--line-2); }
details > summary { cursor: pointer; padding: 13px 16px; font-weight: 600; font-size: 14.5px;
  font-family: var(--sans); list-style: none; user-select: none; display: flex; align-items: center; gap: 11px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "\25B8"; color: var(--accent); font-size: 12px; transition: transform .15s ease; }
details[open] > summary::before { transform: rotate(90deg); }
details .body { padding: 0 16px 15px 40px; color: var(--muted); font-size: 14.5px; }
details .body b { color: var(--ink); font-weight: 600; }

/* submit */
.submit-row { display: flex; gap: 11px; flex-wrap: wrap; }
.submit-row input { flex: 1; min-width: 220px; font-family: var(--mono); font-size: 14px;
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--ink); padding: 13px 15px; border-radius: 10px; }
.submit-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn { font-family: var(--sans); font-weight: 600; font-size: 14px; border: 1px solid var(--accent-line);
  color: var(--accent); background: var(--accent-soft); padding: 13px 22px; border-radius: 10px; cursor: pointer;
  transition: background .15s ease; }
.btn:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); }
.btn.primary { background: var(--accent); color: #06121a; border-color: var(--accent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 82%, white); }
.result { margin-top: 14px; font-family: var(--mono); font-size: 14px; min-height: 20px; }
.result.ok { color: var(--ok); }
.result.err { color: var(--danger); }

/* ---- mole interrogation terminal -------------------------------------- */
.chat { display: flex; flex-direction: column; height: 460px; border: 1px solid var(--line-2);
  border-radius: 14px; overflow: hidden; }
.chat .log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 11px; background: var(--bg-2); }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 13px; font-size: 14px; white-space: pre-wrap; line-height: 1.5; }
.msg.user { align-self: flex-end; background: var(--accent); color: #06121a; border-bottom-right-radius: 4px; }
.msg.ava { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line-2); border-bottom-left-radius: 4px; }
.msg.sys { align-self: center; color: var(--faint); font-family: var(--mono); font-size: 11.5px; letter-spacing: .5px; }
.chat .inrow { display: flex; gap: 9px; padding: 13px; border-top: 1px solid var(--line-2); background: var(--panel); }
.chat .inrow input { flex: 1; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--ink);
  padding: 12px 14px; border-radius: 10px; font-size: 14px; font-family: var(--sans); }
.chat .inrow input:focus { outline: none; border-color: var(--accent); }

/* ---- footer ----------------------------------------------------------- */
footer { max-width: var(--maxw); margin: 70px auto 0; padding: 22px 24px 0; border-top: 1px solid var(--line);
  color: var(--faint); font-size: 12.5px; font-family: var(--mono); letter-spacing: .3px; line-height: 1.8; }

/* ---- responsive ------------------------------------------------------- */
@media (max-width: 820px) {
  .files { grid-template-columns: 1fr; }
  .hero-inner { padding: 30px 26px; }
  .statstrip { gap: 22px; }
}

/* ---- accessibility ---------------------------------------------------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto; }
  .file:hover { transform: none; }
  .file:hover .shot img { transform: none; }
}
