/* Section-level components: hero, live dashboard, service cards, metrics,
   intel, testimonials, contact. Keyframes live at the bottom. */

/* ---- Generic panel ---------------------------------------------------- */

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 60px;
  align-items: center;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--teal);
  border: 1px solid var(--teal-line);
  padding: 7px 14px;
  margin-bottom: 34px;
}

.badge--accent {
  color: var(--accent);
  border-color: var(--accent-line);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  animation: blink 1.6s infinite;
}

.hero__title {
  font-weight: 700;
  font-size: clamp(38px, 4.6vw, 78px);
  line-height: 0.98;
  margin-bottom: 26px;
}

.hero__title-muted {
  color: var(--dim);
}

/* Marker-pen underline behind the last word. */
.mark {
  position: relative;
  display: inline-block;
}

.mark::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 8px;
  background: var(--accent);
  opacity: 0.85;
  z-index: -1;
}

.hero__lead {
  font-size: 17px;
  line-height: 1.65;
  color: var(--dim);
  max-width: 520px;
  margin-bottom: 40px;
}

.hero__lead strong {
  color: var(--fg);
  font-weight: inherit;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}

.hero__stats {
  margin-top: clamp(36px, 5vw, 64px);
  max-width: 560px;
}

.stat {
  padding: 18px 20px;
}

.stat__value {
  font-family: var(--font-display);
  font-size: 26px;
}

.stat__unit {
  color: var(--accent);
}

.stat__label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--dim);
  margin-top: 6px;
}

/* ---- Live threat panel ------------------------------------------------ */

.console {
  position: relative;
}

.console__glow {
  position: absolute;
  inset: -14% -8%;
  background: radial-gradient(circle at 60% 40%, rgba(255, 31, 31, 0.16), transparent 62%);
  filter: blur(30px);
  pointer-events: none;
}

.console__body {
  position: relative;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 22px;
}

.console__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--dim);
  margin-bottom: 18px;
}

.clock {
  color: var(--teal);
}

.map {
  position: relative;
  height: 340px;
  border: 1px solid var(--line);
  background-color: rgba(255, 255, 255, 0.015);
  background-image: radial-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 14px 14px;
  overflow: hidden;
}

.map__sweep {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 90px;
  background: linear-gradient(90deg, transparent, rgba(47, 157, 148, 0.16), transparent);
  animation: sweep 5.5s linear infinite;
}

.map__caption {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

/* Pulsing hostile contact. */
.blip {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
}

.blip::before,
.blip::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.blip::before {
  inset: 0;
  border: 1px solid var(--accent);
  animation: pulse-ring 2.4s ease-out infinite;
}

.blip::after {
  inset: 3px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.node {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px rgba(47, 157, 148, 0.9);
}

.feed {
  margin-top: 16px;
  border: 1px solid var(--line);
  max-height: 150px;
  overflow: hidden;
}

.feed__row {
  display: grid;
  grid-template-columns: 64px 1fr 84px 78px;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
}

/* Russian event names are longer than the English ones; clip rather than let
   a row grow a second line and break the fixed feed height. */
.feed__type {
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed__status {
  color: var(--teal);
  text-align: right;
}

/* ---- Service cards ---------------------------------------------------- */

.service {
  position: relative;
  padding: 34px 28px 30px;
  transition: background 0.25s var(--ease);
}

.service:hover {
  background: rgba(255, 255, 255, 0.04);
}

.service__bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 0.35s var(--ease);
}

.service.is-open .service__bar {
  width: 100%;
}

/* The whole card head is the disclosure control. */
.service__toggle {
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

/* The toggle's children are spans (a <button> may not contain headings or
   block elements per the HTML content model), so they need laying out. */
.service__num,
.service__title,
.service__desc {
  display: block;
}

.service__num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--dim);
}

.service__glyph {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 22px 0 24px;
  background: rgba(255, 255, 255, 0.02);
}

.service__glyph i {
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  display: block;
}

.service__title {
  font-weight: 600;
  font-size: 20px;
  line-height: 1.15;
  margin-bottom: 12px;
  min-height: 46px;
}

.service__desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--dim);
  margin-bottom: 18px;
}

/* Collapsed with max-height rather than [hidden] so the open/close animates.
   visibility:hidden keeps the collapsed copy out of the accessibility tree,
   and its transition is delayed so it only applies once the panel is shut. */
.service__detail {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  transition: max-height 0.4s var(--ease), opacity 0.3s var(--ease),
    visibility 0s linear 0.4s;
}

.service.is-open .service__detail {
  max-height: 320px;
  opacity: 1;
  visibility: visible;
  transition: max-height 0.4s var(--ease), opacity 0.3s var(--ease),
    visibility 0s linear 0s;
}

.service__points {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  list-style: none;
  padding-left: 0;
}

.service__points li {
  display: flex;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
  line-height: 1.5;
}

.service__points li::before {
  content: "\25B8";
  color: var(--accent);
}

.service__cta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--fg);
  margin-top: 20px;
}

/* ---- Metrics ---------------------------------------------------------- */

.command {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.command__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 26px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--dim);
}

.command__status {
  display: flex;
  gap: 18px;
}

.command__live {
  color: var(--teal);
}

.metric {
  padding: 34px 28px;
}

.metric__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 3.4vw, 54px);
  line-height: 1.05;
  margin: 14px 0 6px;
}

.metric__value small {
  font-size: 22px;
  color: var(--dim);
}

.metric__delta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--teal);
}

.metric__delta--muted {
  color: var(--dim);
}

.spark {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 64px;
  margin-top: 22px;
}

.spark span {
  flex: 1;
  background: linear-gradient(180deg, var(--accent), rgba(255, 31, 31, 0.18));
  transition: height 0.6s var(--ease);
}

.gauge {
  position: relative;
  width: 118px;
  height: 118px;
  margin: 16px auto 0;
}

.gauge__ring,
.gauge__arc {
  position: absolute;
  border-radius: 50%;
}

.gauge__ring {
  inset: 0;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  animation: spin 22s linear infinite;
}

.gauge__arc {
  inset: 14px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--accent);
  animation: spin 3.4s linear infinite;
}

.gauge__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 26px;
}

.bar__head {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
  margin-bottom: 6px;
}

.bar__track {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.bar__fill {
  height: 100%;
  background: var(--teal);
  transition: width 0.8s var(--ease);
}

.vector {
  display: grid;
  grid-template-columns: 132px 1fr 46px;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
}

.vector__name {
  color: var(--fg);
}

.vector__track {
  height: 6px;
  background: rgba(255, 255, 255, 0.07);
}

.vector__fill {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.8s var(--ease);
}

.vector__pct {
  text-align: right;
}

/* ---- Intel ------------------------------------------------------------ */

.intel {
  border: 1px solid var(--line);
  padding: clamp(28px, 4vw, 56px) clamp(24px, 3.5vw, 48px);
  background: var(--panel-solid);
}

.intel__title {
  font-weight: 700;
  font-size: clamp(26px, 2.6vw, 44px);
  line-height: 1.05;
  margin-bottom: 20px;
}

.intel__body {
  color: var(--dim);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 440px;
}

.fortress {
  position: relative;
  height: 320px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.fortress__grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(47, 157, 148, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 157, 148, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
}

.fortress__stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fortress__shape {
  position: relative;
  width: 190px;
  height: 190px;
  animation: floaty 6s ease-in-out infinite;
}

.fortress__shape span {
  position: absolute;
}

.fortress__shape span:nth-child(1) {
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  transform: rotate(45deg);
}

.fortress__shape span:nth-child(2) {
  inset: 26px;
  border: 1px solid rgba(255, 31, 31, 0.55);
  transform: rotate(45deg);
  box-shadow: 0 0 40px rgba(255, 31, 31, 0.25) inset;
}

.fortress__shape span:nth-child(3) {
  inset: 64px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.14), rgba(255, 31, 31, 0.35));
  transform: rotate(45deg);
  backdrop-filter: blur(4px);
}

.fortress__shape span:nth-child(4) {
  inset: -30px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  animation: spin 26s linear infinite;
}

.fortress__caption {
  position: absolute;
  left: 16px;
  top: 14px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--dim);
}

/* ---- Testimonials ----------------------------------------------------- */

.quotes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.quote {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 32px 28px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.quote:hover {
  border-color: rgba(255, 31, 31, 0.4);
  box-shadow: 0 0 44px rgba(255, 31, 31, 0.14);
  transform: translateY(-4px);
}

.quote__metric {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 18px;
}

.quote blockquote {
  margin: 0 0 26px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--fg);
  text-wrap: pretty;
}

.quote figcaption {
  display: flex;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.avatar {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0 4px,
    transparent 4px 8px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
}

.quote__name {
  font-size: 13px;
  line-height: 1.4;
}

.quote__role {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px;
}

.marquee {
  margin-top: 46px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 22px 0;
}

.marquee__track {
  display: flex;
  gap: 64px;
  width: max-content;
  animation: marquee 34s linear infinite;
  opacity: 0.42;
}

.marquee__track span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.18em;
  white-space: nowrap;
  filter: grayscale(1);
}

/* ---- Contact ---------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 20px;
  align-items: start;
}

.urgent {
  border: 1px solid var(--accent-line);
  background: linear-gradient(180deg, rgba(255, 31, 31, 0.1), rgba(255, 31, 31, 0.02));
  padding: 30px 26px;
}

.urgent__head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 16px;
}

.urgent__lead {
  font-size: 13px;
  line-height: 1.6;
  color: var(--dim);
  margin-bottom: 22px;
}

.urgent .field {
  background: rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 31, 31, 0.3);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hotline {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
  margin-top: 16px;
}

.enquiry {
  padding: 30px 28px;
}

.enquiry__label {
  margin-bottom: 22px;
}

.enquiry__submit {
  margin-top: 14px;
}

.enquiry__meta {
  margin-top: 26px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-grid .span-2 {
  grid-column: span 2;
}

.hq {
  padding: 20px 22px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--dim);
}

.hq__label {
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.minimap {
  position: relative;
  min-height: 150px;
  overflow: hidden;
}

.minimap__grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
}

.minimap__road-h {
  position: absolute;
  left: 0;
  right: 0;
  top: 44%;
  height: 2px;
  background: rgba(47, 157, 148, 0.35);
}

.minimap__road-v {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 38%;
  width: 2px;
  background: rgba(47, 157, 148, 0.25);
}

.minimap__pin {
  left: 38%;
  top: 44%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
}

.minimap__pin::before {
  animation: pulse-ring 2.6s ease-out infinite;
}

.minimap__pin::after {
  inset: 4px;
  box-shadow: none;
}

.minimap__coords {
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

/* ---- 404 -------------------------------------------------------------- */

.error-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.error-main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px var(--gutter);
  text-align: center;
}

.error-main__inner {
  max-width: 560px;
}

.error-code {
  font-weight: 700;
  font-size: clamp(64px, 10vw, 120px);
  line-height: 0.9;
  margin-bottom: 24px;
}

.error-lead {
  font-size: 16px;
  line-height: 1.65;
  color: var(--dim);
  margin-bottom: 40px;
}

.scanner {
  position: relative;
  height: 64px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  overflow: hidden;
  margin-bottom: 44px;
}

.scanner__beam {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 70px;
  background: linear-gradient(90deg, transparent, rgba(255, 31, 31, 0.18), transparent);
  animation: sweep 3.2s linear infinite;
}

.scanner__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--dim);
}

.error-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding: 24px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--faint);
}

/* ---- Keyframes -------------------------------------------------------- */

@keyframes pulse-ring {
  0% {
    transform: scale(0.4);
    opacity: 0.9;
  }
  100% {
    transform: scale(3.2);
    opacity: 0;
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

@keyframes sweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(400%);
  }
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

@keyframes spin {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* Honour the OS-level motion preference: the decorative loops stop, and
   js/effects.js separately declines to start the canvas and parallax. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .bg-rain {
    display: none;
  }
}

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

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

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

  .field-grid .span-2 {
    grid-column: span 1;
  }

  .feed__row {
    grid-template-columns: 58px 1fr 70px;
  }

  .feed__origin {
    display: none;
  }

  .vector {
    grid-template-columns: 96px 1fr 40px;
  }
}
