@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Oswald:wght@400;600&family=Share+Tech+Mono&display=swap');

:root {
  --bg: #121211;
  --bg-alt: #1d1c19;
  --accent: #e6882f;
  --accent-soft: rgba(230, 136, 47, 0.4);
  --accent-strong: #ffb347;
  --text: #f6f1e1;
  --text-muted: rgba(246, 241, 225, 0.66);
  --panel: rgba(32, 31, 28, 0.85);
  --panel-border: rgba(255, 161, 71, 0.3);
  --noise: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/></filter><rect width="200" height="200" filter="url(%23n)" opacity="0.16"/></svg>');
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(214, 119, 43, 0.25), transparent 40%),
              radial-gradient(circle at bottom right, rgba(103, 80, 50, 0.35), transparent 35%),
              var(--bg);
  color: var(--text);
  font-family: 'Oswald', 'Share Tech Mono', system-ui, sans-serif;
  letter-spacing: 0.04em;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--noise);
  mix-blend-mode: soft-light;
  pointer-events: none;
  opacity: 0.35;
  z-index: 1;
}

.scanline {
  position: fixed;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.12) 0%, transparent 2%);
  background-size: 100% 3px;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0.35;
  z-index: 2;
}

.shell {
  position: relative;
  z-index: 3;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  border-bottom: 1px solid rgba(230, 136, 47, 0.25);
  padding-bottom: 1rem;
  text-transform: uppercase;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.2em;
}

.logo__icon {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(230, 136, 47, 0.35));
}

.logo__outline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
  opacity: 0.8;
}

.logo__mark {
  fill: var(--accent);
  opacity: 0.9;
}

.nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  transition: color 0.2s ease;
}

.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.4rem;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

.nav a:hover {
  color: var(--text);
}

.nav a:hover::after {
  transform: scaleX(1);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr);
  gap: 3rem;
  align-items: stretch;
}

.hero--compact {
  grid-template-columns: minmax(0, 1fr);
  padding: 2rem clamp(0rem, 4vw, 1.5rem);
}

.hero--compact .hero__copy {
  max-width: 640px;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.kicker {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--accent-strong);
  letter-spacing: 0.35em;
}

.glitch {
  font-size: clamp(2.8rem, 7vw, 4.5rem);
  text-transform: uppercase;
  position: relative;
  display: inline-block;
  animation: glitch 3.5s infinite;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  clip-path: inset(0);
  opacity: 0.75;
}

.glitch::before {
  color: rgba(255, 120, 47, 0.7);
  animation: glitchTop 2.6s infinite;
}

.glitch::after {
  color: rgba(110, 220, 180, 0.7);
  animation: glitchBottom 2s infinite;
}

@keyframes glitch {
  0%, 100% { transform: translate3d(0,0,0); }
  5% { transform: translate3d(2px, -1px, 0); }
  7% { transform: translate3d(-1px, 2px, 0); }
  9% { transform: translate3d(3px, 1px, 0); }
  12% { transform: translate3d(-2px, -1px, 0); }
}

@keyframes glitchTop {
  0%, 100% { transform: translate(0); clip-path: inset(0 0 40% 0); }
  20% { transform: translate(-4px, -3px); clip-path: inset(0 0 62% 0); }
  40% { transform: translate(4px, 3px); clip-path: inset(0 0 45% 0); }
  60% { transform: translate(-2px, 2px); clip-path: inset(0 0 58% 0); }
  80% { transform: translate(2px, -2px); clip-path: inset(0 0 37% 0); }
}

@keyframes glitchBottom {
  0%, 100% { transform: translate(0); clip-path: inset(60% 0 0 0); }
  20% { transform: translate(2px, 2px); clip-path: inset(35% 0 0 0); }
  40% { transform: translate(-3px, -2px); clip-path: inset(50% 0 0 0); }
  60% { transform: translate(3px, 2px); clip-path: inset(40% 0 0 0); }
  80% { transform: translate(-2px, -1px); clip-path: inset(55% 0 0 0); }
}

.lede {
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 1rem;
  max-width: 38ch;
}

.hero__cta {
  display: flex;
  gap: 1rem;
}

.btn {
  padding: 0.75rem 1.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  border: 1px solid var(--accent);
  color: var(--text);
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(230, 136, 47, 0.5), transparent);
  transform: translateX(-100%);
  transition: transform 0.35s ease;
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn--primary {
  background: var(--accent);
  color: #201911;
  box-shadow: 0 0 20px rgba(230, 136, 47, 0.45);
}

.btn--ghost {
  background: transparent;
  border-color: rgba(230, 136, 47, 0.6);
  color: var(--accent-strong);
}

.hero__panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  padding: 1.5rem;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.55);
}

.panel__title {
  font-family: 'Share Tech Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--accent);
}

.panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.panel__card {
  padding: 1rem;
  background: rgba(18, 18, 17, 0.85);
  border: 1px solid rgba(230, 136, 47, 0.25);
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.panel__metric {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.panel__value {
  font-size: 1.35rem;
  letter-spacing: 0.1em;
}

.panel__trend {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
}

.trend--rise {
  color: #6fee9a;
}

.trend--alert {
  color: #ff6a6a;
}

.trend--steady {
  color: #f4d06f;
}

.panel__footer {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: var(--text-muted);
  text-transform: uppercase;
}

section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

section > h2 {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 1.35rem;
  color: var(--accent-strong);
}

.intel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.intel--visualizer {
  gap: 2rem;
}

.intel--visualizer .intel__card {
  min-height: 180px;
}

.intel__card {
  background: rgba(20, 18, 16, 0.8);
  border: 1px solid rgba(230, 136, 47, 0.25);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: inset 0 0 20px rgba(255, 162, 74, 0.08);
  position: relative;
}

.intel__card::before {
  content: '';
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(230, 136, 47, 0.45);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(230, 136, 47, 0.7);
}

.intel__card h3 {
  font-size: 1.1rem;
  letter-spacing: 0.1em;
}

.intel__card p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.intel__tag {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--accent-strong);
}

.factions__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.faction {
  padding: 1.25rem;
  border: 1px dashed rgba(230, 136, 47, 0.4);
  border-radius: 0.85rem;
  background: rgba(16, 15, 13, 0.75);
  min-height: 160px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faction h3 {
  font-size: 1.05rem;
  letter-spacing: 0.15em;
}

.faction p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.missions__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.missions__list li {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 90px minmax(0, 1.5fr);
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(18, 16, 14, 0.8);
  border: 1px solid rgba(230, 136, 47, 0.25);
  border-radius: 0.9rem;
}

.missions__title {
  font-size: 1.05rem;
  letter-spacing: 0.12em;
}

.missions__status {
  justify-self: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.status--critical {
  background: rgba(255, 95, 95, 0.25);
  color: #ff7567;
}

.status--urgent {
  background: rgba(244, 208, 111, 0.2);
  color: #f4d06f;
}

.status--normal {
  background: rgba(111, 238, 154, 0.15);
  color: #6fee9a;
}

.missions__detail {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.18em;
}

.footer {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 2.5rem;
  padding: 2rem 2.5rem;
  background: rgba(12, 12, 11, 0.85);
  border: 1px solid rgba(230, 136, 47, 0.2);
  border-radius: 1.25rem;
}

.footer--centered {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  text-align: center;
}

.footer--centered .footer__comms {
  max-width: 480px;
}

.footer--centered .footer__form {
  display: none;
}

.footer__comms h2 {
  font-size: 1.15rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.footer__comms p {
  margin-top: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
}

.footer__form {
  display: grid;
  gap: 0.75rem;
}

.footer__form label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--accent-strong);
}

.footer__form input,
.footer__form textarea {
  background: rgba(22, 20, 18, 0.85);
  border: 1px solid rgba(230, 136, 47, 0.35);
  padding: 0.75rem;
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.08em;
  border-radius: 0.65rem;
}

.footer__form input:focus,
.footer__form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(230, 136, 47, 0.25);
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero__panel {
    order: -1;
  }

  .masthead {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 2.5rem 1.25rem 4rem;
  }

  .hero__cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .missions__list li {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .missions__status {
    justify-self: flex-start;
  }

  .footer {
    grid-template-columns: 1fr;
  }
}

/* === Decoder Utility Page === */
.decoder {
  display: grid;
  gap: 2.5rem;
  background: rgba(18, 18, 17, 0.9);
  border: 1px solid rgba(230, 136, 47, 0.25);
  border-radius: 1.5rem;
  padding: 2.5rem 2.75rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
}

.decoder__header {
  display: grid;
  gap: 0.75rem;
}

.decoder__header h1 {
  font-size: 2.15rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.decoder__console {
  display: grid;
  gap: 1rem;
}

.decoder__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--accent-strong);
}

.decoder__textarea {
  resize: vertical;
  min-height: 4.25rem;
  max-height: 6.5rem;
  background: linear-gradient(135deg, rgba(26, 24, 22, 0.9), rgba(33, 30, 26, 0.9));
  border: 1px solid rgba(230, 136, 47, 0.35);
  border-radius: 0.9rem;
  padding: 0.85rem 1.15rem;
  color: var(--text);
  font-family: 'JetBrains Mono', 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  line-height: 1.45;
  box-shadow: inset 0 0 0 1px rgba(246, 241, 225, 0.05), 0 18px 35px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.decoder__textarea:focus {
  outline: none;
  border-color: rgba(255, 167, 79, 0.8);
  box-shadow: inset 0 0 0 1px rgba(255, 167, 79, 0.3), 0 0 0 3px rgba(230, 136, 47, 0.2),
    0 28px 40px rgba(0, 0, 0, 0.35);
}

.decoder__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.decoder__hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
}

.decoder__output {
  display: grid;
  gap: 1.2rem;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(10, 9, 8, 0.92), rgba(14, 13, 12, 0.92));
  border: 1px solid rgba(230, 136, 47, 0.28);
  border-radius: 1.25rem;
  min-height: 13rem;
  box-shadow: inset 0 0 0 1px rgba(246, 241, 225, 0.04), 0 26px 40px rgba(0, 0, 0, 0.4);
}

.decoder__output-header {
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.decoder__result {
  font-family: 'JetBrains Mono', 'Share Tech Mono', monospace;
  font-size: clamp(1.45rem, 3vw, 1.95rem);
  line-height: 1.7;
  letter-spacing: 0.08em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  outline: none;
  font-variant-ligatures: none;
}

.decoder__placeholder {
  color: var(--text-muted);
}

.token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  padding: 0.35rem 0.55rem;
  border-radius: 0.6rem;
  font-weight: 700;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 0 0 1px rgba(246, 241, 225, 0.12), 0 18px 28px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.08em;
  position: relative;
  isolation: isolate;
}

.token--upper {
  background: radial-gradient(circle at 20% 20%, rgba(164, 205, 255, 0.85), rgba(51, 118, 255, 0.85));
  color: #0c1632;
  border: 1px solid rgba(101, 161, 255, 0.7);
}

.token--lower {
  background: radial-gradient(circle at 20% 20%, rgba(255, 223, 186, 0.85), rgba(255, 138, 57, 0.85));
  color: #2f1506;
  border: 1px solid rgba(255, 177, 109, 0.7);
}

.token--digit {
  background: radial-gradient(circle at 20% 20%, rgba(208, 255, 236, 0.85), rgba(37, 189, 138, 0.85));
  color: #03281b;
  border: 1px solid rgba(80, 212, 164, 0.75);
}

.token--symbol {
  background: radial-gradient(circle at 20% 20%, rgba(255, 216, 246, 0.85), rgba(214, 77, 180, 0.85));
  color: #33061e;
  border: 1px solid rgba(226, 134, 206, 0.75);
}

.token--space {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(246, 241, 225, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.token--newline {
  flex-basis: 100%;
  justify-content: flex-start;
  min-width: 0;
  padding-inline: 0.55rem;
}

.token--tab {
  min-width: 3rem;
}

.decoder__legend {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.decoder__legend-title {
  text-transform: uppercase;
}

.decoder__legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
}

.decoder__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-transform: uppercase;
}

.decoder__legend-item span:last-child {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

.decoder__legend-item .token {
  font-size: 1rem;
  min-width: 1.8rem;
  padding: 0.2rem 0.4rem;
  box-shadow: inset 0 0 0 1px rgba(246, 241, 225, 0.08), 0 12px 18px rgba(0, 0, 0, 0.18);
}

@media (max-width: 720px) {
  .decoder {
    padding: 2rem 1.5rem;
  }

  .decoder__actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .decoder__hint {
    letter-spacing: 0.12em;
  }
}
