/* ============================================================
   СЕИЗМОСТ — Национална сеизмична служба
   Palette: near-black control room + seismic amber
   Type: Unbounded (display) / IBM Plex Sans (text) / IBM Plex Mono (data)
   ============================================================ */

:root {
  --bg: #0b0c0e;
  --bg-raise: #101216;
  --line: rgba(232, 228, 220, 0.09);
  --line-strong: rgba(232, 228, 220, 0.18);
  --text: #e8e4dc;
  --text-dim: #98937f;
  --text-faint: #85816f;
  --amber: #f0a43c;
  --amber-dim: rgba(240, 164, 60, 0.55);
  --amber-glow: rgba(240, 164, 60, 0.14);
  --font-display: "Unbounded", sans-serif;
  --font-text: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* film grain — keeps the big black planes from reading flat */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.05;
  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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--amber); color: #0b0c0e; }

/* ---------- Header ---------- */

.site-head {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 2rem;
  height: 64px;
  background: rgba(11, 12, 14, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 28px;
  height: 28px;
  color: var(--amber);
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
}

.brand-sub {
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.site-nav { display: flex; gap: 1.75rem; }

.site-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.25s var(--ease-soft);
}

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

.head-live {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.clock {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--amber);
  border: 1px solid rgba(240, 164, 60, 0.35);
  border-radius: 2px;
  padding: 0.3rem 0.7rem;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse 2.4s var(--ease-soft) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(240, 164, 60, 0.4); }
  50% { opacity: 0.65; box-shadow: 0 0 0 4px rgba(240, 164, 60, 0); }
}

/* ---------- Hero ---------- */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: 64px;
  position: relative;
}

.hero-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 4.5rem 2rem 3rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 3.5rem;
  align-items: stretch;
}

.hero-copy {
  min-width: 0;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1.5rem;
}

h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.7rem, 3.6vw, 2.9rem);
  line-height: 1.14;
  letter-spacing: 0.01em;
  max-width: 14ch;
}

.lede {
  margin-top: 1.75rem;
  max-width: 46ch;
  font-size: clamp(0.95rem, 1.15vw, 1.05rem);
  color: var(--text-dim);
}

.hero-scope {
  display: flex;
  flex-direction: column;
  min-height: 380px;
  padding-left: 2rem;
  border-left: 1px solid var(--line-strong);
}

.hero-scope-meta {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 1.1rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.hero-scope-meta .scope-channel {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  line-height: 1.7;
  color: var(--text-dim);
}

.hero-scope-meta .scope-hint {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  line-height: 1.5;
  color: var(--text-faint);
  text-align: right;
  max-width: 44%;
}

.readouts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 3.5rem;
}

.readout {
  background: var(--bg);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.readout-label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.readout-value {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.readout-value.accent { color: var(--amber); }

/* ---------- Seismograph scope ---------- */

#drum {
  display: block;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  cursor: crosshair;
}

/* ---------- Sections ---------- */

.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 9rem 2rem 0;
}

.section:last-of-type { padding-bottom: 9rem; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  border-top: 1px solid var(--line-strong);
  padding-top: 1.25rem;
  margin-bottom: 2.5rem;
}

.section-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--amber);
  letter-spacing: 0.1em;
}

h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
  letter-spacing: 0.01em;
}

.section-lede {
  max-width: 66ch;
  color: var(--text-dim);
  margin-bottom: 3rem;
}

/* ---------- Doctrine ---------- */

.doctrine {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 4rem;
}

.doctrine-copy p {
  max-width: 62ch;
  margin-bottom: 1.5rem;
}

.doctrine-copy p:last-child { margin-bottom: 0; }

.doctrine-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  align-self: start;
}

.stat {
  background: var(--bg);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-value {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.6rem;
  color: var(--amber);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-dim);
}

/* ---------- Stations table ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
}

.stations {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  min-width: 640px;
}

.stations th {
  text-align: left;
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

.stations td {
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background 0.5s var(--ease-soft);
}

.stations tbody tr:last-child td { border-bottom: none; }

.stations th.num, .stations td.num { text-align: right; }

.stations th .unit { text-transform: none; }

.stations .st-name { color: var(--text-dim); }

.stations .st-region { color: var(--text-faint); }

.stations tr.scanning td { background: var(--amber-glow); }

.st-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.st-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.st-status.ok { color: var(--text-dim); }

.st-status.warn { color: var(--amber); }

.st-trend { line-height: 0; }

.spark {
  width: 92px;
  height: 22px;
  display: inline-block;
  vertical-align: middle;
}

.table-note {
  margin-top: 1.5rem;
  max-width: 66ch;
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* ---------- Helicorder ---------- */

.helico-wrap {
  border: 1px solid var(--line);
  background: var(--bg-raise);
}

.helico-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line);
}

#helico {
  display: block;
  width: 100%;
  height: 560px;
}

/* ---------- Roles ---------- */

.roles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.role {
  background: var(--bg);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: background 0.35s var(--ease-soft);
}

.role:hover { background: var(--bg-raise); }

.role h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.role p {
  font-size: 0.92rem;
  color: var(--text-dim);
  flex: 1;
}

.role-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.apply {
  margin-top: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  padding: 2rem;
}

.apply p {
  color: var(--text-dim);
  max-width: 48ch;
}

.apply-btn {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--amber);
  text-decoration: none;
  border: 1px solid rgba(240, 164, 60, 0.4);
  padding: 0.85rem 1.5rem;
  white-space: nowrap;
  transition: background 0.3s var(--ease-soft), color 0.3s var(--ease-soft);
}

.apply-btn:hover {
  background: var(--amber);
  color: #0b0c0e;
}

/* ---------- Footer ---------- */

.site-foot {
  border-top: 1px solid var(--line-strong);
  background: var(--bg-raise);
}

.foot-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem 2rem;
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  flex-wrap: wrap;
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  max-width: 30ch;
  line-height: 1.5;
}

.foot-brand .brand-mark { width: 24px; height: 24px; }

.foot-cols {
  display: flex;
  gap: 4rem;
  flex-wrap: wrap;
}

.foot-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.foot-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.foot-disclaimer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 2rem 2rem;
  font-size: 0.76rem;
  color: var(--text-faint);
  border-top: 1px solid var(--line);
}

/* ---------- Reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .status-dot { animation: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .site-nav { display: none; }
  .hero-grid { grid-template-columns: 1fr; gap: 2.25rem; }
  h1 { max-width: none; }
  .hero-scope {
    min-height: 300px;
    padding-left: 0;
    padding-top: 1.5rem;
    border-left: none;
    border-top: 1px solid var(--line-strong);
  }
  .doctrine { grid-template-columns: 1fr; gap: 3rem; }
  .roles { grid-template-columns: 1fr; }
  .col-noise, .col-region, .col-trend { display: none; }
  .stations { min-width: 480px; }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .site-head { padding: 0 1.25rem; gap: 0.75rem; }
  .brand-sub { display: none; }
  .clock { display: none; }
  .hero-inner { padding: 3.5rem 1.25rem 2.5rem; }
  h1 br { display: none; }
  .col-sample { display: none; }
  .stations { min-width: 0; font-size: 0.78rem; }
  .stations th, .stations td { padding: 0.6rem 0.5rem; }
  .stations th:first-child, .stations td:first-child { padding-left: 0.75rem; }
  .st-status { font-size: 0.66rem; }
  .readouts { grid-template-columns: 1fr 1fr; margin-top: 2.25rem; }
  .hero-scope { min-height: 220px; }
  .hero-scope-meta { flex-direction: column; gap: 0.5rem; }
  .hero-scope-meta .scope-hint { text-align: left; max-width: none; }
  #drum { min-height: 190px; }
  .section { padding: 5.5rem 1.25rem 0; }
  .section:last-of-type { padding-bottom: 5.5rem; }
  #helico { height: 420px; }
  .apply { padding: 1.5rem 1.25rem; }
  .foot-main { padding: 2.5rem 1.25rem; gap: 2rem; }
  .foot-cols { gap: 2rem; }
  .foot-disclaimer { padding: 1rem 1.25rem 1.5rem; }
  .site-foot { margin-top: 5.5rem; }
}
