:root {
  --ink: #07090f;
  --ink-2: #10151f;
  --navy: #161d2c;
  --paper: #f3ece3;
  --paper-dim: rgba(243, 236, 227, 0.64);
  --fog: #8e97a8;
  --red: #c41e3a;
  --red-2: #8a1026;
  --brass: #c9a56a;
  --amber: #e8c36a;
  --green: #7dce9a;
  --line: rgba(243, 236, 227, 0.1);
  --serif: "Bodoni Moda", "Didot", serif;
  --sans: "Figtree", "Helvetica Neue", sans-serif;
  --mono: "Share Tech Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--ink); }
body {
  font-family: var(--sans);
  color: var(--paper);
  background: var(--ink);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

/* ── gate / login ───────────────────────────────────────── */
.is-gate { overflow: hidden; }
.gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  padding: 2.2rem 3rem 2rem;
  position: relative;
  isolation: isolate;
}
.gate__sky {
  position: absolute;
  inset: -20%;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 80% 10%, rgba(196, 30, 58, 0.28), transparent 55%),
    radial-gradient(700px 400px at 10% 90%, rgba(201, 165, 106, 0.12), transparent 60%),
    linear-gradient(165deg, #0b1018 0%, #07090f 45%, #12060a 100%);
}
.gate__sky::after {
  content: "JU";
  position: absolute;
  right: 4%;
  top: 8%;
  font-family: var(--serif);
  font-size: clamp(8rem, 22vw, 18rem);
  letter-spacing: -0.08em;
  color: rgba(243, 236, 227, 0.035);
  font-style: italic;
}
.gate__meta {
  position: absolute;
  top: 1.6rem;
  left: 3rem;
  right: 3rem;
  display: flex;
  gap: 1.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fog);
}
.gate__copy {
  align-self: end;
  max-width: 38rem;
  padding-bottom: 3rem;
  animation: rise 1.1s ease both;
}
.kicker {
  font-family: var(--mono);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--brass);
  margin: 0 0 1rem;
}
.gate h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(4.2rem, 9vw, 8.4rem);
  line-height: 0.86;
  margin: 0 0 1.4rem;
  letter-spacing: -0.03em;
}
.gate h1 span { display: block; font-style: italic; opacity: 0.9; }
.gate h1 em {
  font-style: italic;
  color: var(--red);
  display: block;
}
.lede {
  color: var(--paper-dim);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 34rem;
  margin: 0 0 2rem;
}
.cta {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  background: var(--red);
  color: var(--paper);
  border: 0;
  padding: 1rem 1.4rem 0.95rem;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.2s ease;
  box-shadow: 8px 8px 0 #3a0a14;
}
.cta span, .cta { font-weight: 600; letter-spacing: 0.02em; }
.cta small {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
  font-weight: 400;
}
.cta:hover { transform: translate(-2px, -2px); background: #d32543; }
.cta--compact {
  flex-direction: row;
  align-items: center;
  padding: 0.85rem 1.15rem;
  box-shadow: 5px 5px 0 #3a0a14;
  height: fit-content;
}

.gate__board {
  align-self: center;
  justify-self: end;
  width: min(420px, 100%);
  background: #0a0c11;
  border: 1px solid rgba(201, 165, 106, 0.28);
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  animation: rise 1.2s 0.15s ease both;
}
.gate__board header,
.fids__head {
  display: flex;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  font-family: var(--mono);
  letter-spacing: 0.2em;
  font-size: 0.68rem;
  color: var(--amber);
  border-bottom: 1px solid rgba(232, 195, 106, 0.2);
  background: linear-gradient(#141820, #0d1016);
}
.gate__board ol { list-style: none; margin: 0; padding: 0.4rem 0; }
.gate__board li {
  display: grid;
  grid-template-columns: 4.6rem 1fr auto;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  font-family: var(--mono);
  color: var(--amber);
  font-size: 0.92rem;
}
.gate__board li:nth-child(odd) { background: rgba(255,255,255,0.03); }
.gate__board i { color: var(--green); font-style: normal; font-size: 0.72rem; letter-spacing: 0.14em; }
.gate__board li:nth-child(4) i { color: var(--amber); }
.gate__foot {
  position: absolute;
  bottom: 1.2rem;
  left: 3rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fog);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ── app shell ──────────────────────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.rail {
  border-right: 1px solid var(--line);
  padding: 1.4rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(196,30,58,0.08), transparent 28%),
    var(--ink-2);
}
.brand {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 1.8rem;
}
.brand em {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  display: block;
  line-height: 1;
}
.brand small {
  color: var(--fog);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.nav { display: flex; flex-direction: column; gap: 0.15rem; }
.nav a {
  padding: 0.45rem 0.55rem;
  color: var(--fog);
  font-size: 0.92rem;
  border-left: 2px solid transparent;
}
.nav a:hover { color: var(--paper); }
.nav a.is-on {
  color: var(--paper);
  border-left-color: var(--red);
  background: rgba(196, 30, 58, 0.12);
}
.nav i {
  display: inline-flex;
  min-width: 1.2rem;
  margin-left: 0.35rem;
  background: var(--red);
  color: #fff;
  font-style: normal;
  font-size: 0.68rem;
  padding: 0.05rem 0.3rem;
  font-family: var(--mono);
}
.rail__foot { margin-top: auto; padding-top: 1.4rem; }
.who {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.6rem;
}
.who strong { display: block; font-size: 0.88rem; }
.who small { color: var(--fog); }
.linkish {
  background: none;
  border: 0;
  color: var(--fog);
  cursor: pointer;
  padding: 0;
  font-size: 0.8rem;
}
.linkish:hover { color: var(--red); }

.canvas {
  padding: 2rem 2.4rem 4.5rem;
  position: relative;
  max-width: 1180px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: 2rem;
  animation: rise 0.7s ease both;
}
.hero h1, .section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 0.95;
  margin: 0 0 0.6rem;
}
.hero h1 em { color: var(--red); font-style: italic; }
.hero__tools { display: flex; gap: 0.7rem; align-items: center; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  margin-bottom: 2rem;
}
.stats article {
  border: 1px solid var(--line);
  padding: 1rem 1.1rem 0.9rem;
  background: rgba(255,255,255,0.02);
}
.stats small, .facts small {
  display: block;
  font-family: var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.65rem;
  color: var(--fog);
  margin-bottom: 0.45rem;
}
.stats strong { font-family: var(--serif); font-size: 2rem; font-weight: 500; }

/* ── FIDS board ─────────────────────────────────────────── */
.fids {
  border: 1px solid rgba(201, 165, 106, 0.25);
  background: #090b10;
  box-shadow: inset 0 0 80px rgba(196, 30, 58, 0.06);
}
.fids__list { list-style: none; margin: 0; padding: 0; }
.fids__list a {
  display: grid;
  grid-template-columns: 3.4rem 4.4rem 1fr auto auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.78rem 1.1rem;
  font-family: var(--mono);
  color: var(--amber);
  border-top: 1px solid rgba(232, 195, 106, 0.08);
}
.fids__list li:nth-child(odd) a { background: rgba(255,255,255,0.025); }
.fids__list a:hover { background: rgba(196, 30, 58, 0.12); }
.fids__route { letter-spacing: 0.12em; }
.fids__meta { color: var(--fog); font-size: 0.8rem; }
.fids--full .fids__list a { grid-template-columns: 3.4rem 5rem 1fr 5rem auto; }

.pill {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  padding: 0.22rem 0.45rem;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.pill--clear { color: var(--green); }
.pill--live { color: var(--amber); }
.pill--hold { color: #d98a4a; animation: pulse 1.6s ease infinite; }
.pill--archive { color: var(--fog); }
@keyframes pulse {
  50% { opacity: 0.45; }
}

.more { text-align: right; padding: 0.8rem 1.1rem; }
.more a { font-family: var(--mono); letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.75rem; color: var(--brass); }
.empty {
  padding: 2rem 1.2rem;
  color: var(--fog);
  font-style: italic;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin-bottom: 1.6rem;
}
.facts article {
  border-top: 1px solid var(--line);
  padding: 0.8rem 0;
}
.facts b { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; }

.btn {
  display: inline-flex;
  align-items: center;
  background: var(--paper);
  color: var(--ink);
  border: 0;
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-weight: 600;
}
.btn--ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line);
}
.btn:hover { filter: brightness(1.06); }

.panel {
  border: 1px solid var(--line);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.6rem;
  background: rgba(255,255,255,0.02);
}
.panel--cta { border-color: rgba(196, 30, 58, 0.45); background: rgba(196, 30, 58, 0.08); }
.panel--warn { border-color: rgba(201, 165, 106, 0.4); }
.panel h2 { font-family: var(--serif); font-weight: 500; margin: 0 0 0.5rem; }
.dossier {
  min-width: 220px;
  border-left: 1px solid var(--line);
  padding-left: 1.4rem;
}
.dossier p { display: flex; justify-content: space-between; gap: 1rem; margin: 0.35rem 0; color: var(--fog); }
.dossier b { color: var(--paper); }

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.9rem;
}
.card {
  border: 1px solid var(--line);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: rgba(255,255,255,0.02);
}
.card h3 { font-family: var(--serif); font-weight: 500; margin: 0; font-size: 1.4rem; }
.card--row { flex-direction: row; justify-content: space-between; align-items: center; }
.card__cover { height: 110px; object-fit: cover; margin: -1.1rem -1.1rem 0.3rem; width: calc(100% + 2.2rem); }
.muted { color: var(--fog); }
.stack { margin-top: 2.2rem; }
.section-title { font-size: 1.8rem; }

.crew-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.7rem;
}
.crew-grid li, .who {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}
.crew-grid--lg li {
  border: 1px solid var(--line);
  padding: 0.8rem;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--navy);
}
.avatar--fallback {
  display: grid;
  place-items: center;
  font-family: var(--serif);
  background: var(--red);
}

.ach-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}
.ach {
  display: flex;
  gap: 0.9rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  opacity: 0.45;
}
.ach.is-on { opacity: 1; border-color: rgba(201, 165, 106, 0.4); }
.ach strong { display: block; font-family: var(--serif); font-size: 1.2rem; }
.bar {
  display: block;
  height: 3px;
  background: var(--line);
  margin-top: 0.5rem;
}
.bar i { display: block; height: 100%; background: var(--red); }

.ladder { list-style: none; margin: 0; padding: 0; }
.ladder li {
  display: grid;
  grid-template-columns: 2.4rem 1fr auto;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.ladder em { font-family: var(--mono); color: var(--fog); font-style: normal; }
.ladder.is-ours, .ladder li.is-ours {
  background: rgba(196, 30, 58, 0.12);
  padding-left: 0.6rem;
  padding-right: 0.6rem;
}
.ladder b { font-family: var(--mono); color: var(--amber); }

.notes { list-style: none; margin: 0; padding: 0; }
.notes li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}
.notes li.is-unread { border-left: 2px solid var(--red); padding-left: 0.8rem; }
.notes small { color: var(--fog); font-family: var(--mono); font-size: 0.72rem; }

.drop { max-width: 640px; }
.drop__zone {
  display: grid;
  place-items: center;
  min-height: 240px;
  border: 1px dashed rgba(243, 236, 227, 0.28);
  margin-bottom: 1.1rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
}
.drop__zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop__hint { text-align: center; pointer-events: none; }
.drop__hint b { display: block; font-family: var(--serif); font-size: 1.6rem; font-weight: 500; }
.drop__preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}
.drop.is-hot .drop__zone { border-color: var(--red); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 720px;
}
.form-grid label, .appeal label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--fog);
}
.span-2 { grid-column: span 2; }
input[type="text"], textarea {
  background: #0c1018;
  border: 1px solid var(--line);
  padding: 0.65rem 0.7rem;
  color: var(--paper);
}
.check { flex-direction: row !important; align-items: center; gap: 0.55rem; }
.split-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.4rem;
  align-items: start;
  margin: 1.4rem 0;
}
.appeal textarea { min-height: 90px; width: 100%; }
.gate-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0 1.1rem;
}
.gate-picks label {
  border: 1px solid var(--line);
  padding: 0.5rem 0.7rem;
  font-family: var(--mono);
  cursor: pointer;
}
.gate-picks label.is-taken { opacity: 0.35; cursor: not-allowed; }
.gate-picks input { accent-color: var(--red); }
.rules {
  white-space: pre-wrap;
  font-family: var(--sans);
  color: var(--paper-dim);
  margin: 0;
}
.row-btns { display: flex; gap: 0.4rem; }

.toasts {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  display: grid;
  gap: 0.4rem;
}
.toast {
  margin: 0;
  padding: 0.75rem 1rem;
  background: var(--navy);
  border: 1px solid var(--line);
  max-width: 22rem;
  animation: rise 0.4s ease both;
}
.toast--ok { border-color: var(--green); }
.toast--err { border-color: var(--red); }

.api-bar {
  position: sticky;
  bottom: 0;
  margin: 2.4rem -2.4rem -4.5rem;
  padding: 0.55rem 2.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  align-items: center;
  background: rgba(7, 9, 15, 0.92);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--fog);
}
.api-bar__k { color: var(--brass); letter-spacing: 0.18em; text-transform: uppercase; margin-right: 0.4rem; }
.api-bar code {
  border: 1px solid var(--line);
  padding: 0.15rem 0.35rem;
  color: var(--paper-dim);
}

@media (max-width: 900px) {
  .gate {
    grid-template-columns: 1fr;
    padding: 5rem 1.3rem 2rem;
  }
  .gate__board { display: none; }
  .gate__meta, .gate__foot { left: 1.3rem; right: 1.3rem; }
  .shell { grid-template-columns: 1fr; }
  .rail {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.6rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav { flex-direction: row; flex-wrap: wrap; flex: 1; }
  .rail__foot { width: 100%; display: flex; justify-content: space-between; padding-top: 0.4rem; }
  .canvas { padding: 1.4rem 1.1rem 5rem; }
  .stats, .facts, .form-grid { grid-template-columns: 1fr 1fr; }
  .hero { flex-direction: column; align-items: flex-start; }
  .fids__list a, .fids--full .fids__list a {
    grid-template-columns: 3rem 1fr auto;
  }
  .fids__meta { display: none; }
  .split-actions { grid-template-columns: 1fr; }
  .api-bar { margin: 2rem -1.1rem -5rem; padding: 0.5rem 1.1rem; }
}
