:root {
  --bg: #0b1018;
  --bg-2: #141c2a;
  --steel: #9aa7b8;
  --paper: #e8dcc8;
  --red: #c41e3a;
  --red-deep: #7a1022;
  --gold: #c9a227;
  --line: rgba(232, 220, 200, 0.18);
  --font-poster: "Russo One", "Oswald", "Arial Narrow", sans-serif;
  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-quote: "PT Serif", "Times New Roman", serif;
  --font-mono: "PT Mono", "Courier New", ui-monospace, monospace;
  --pad-x: clamp(0.85rem, 3.5vw, 4rem);
  --gap: clamp(0.65rem, 1.5vw, 0.9rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--paper);
  background: var(--bg);
  font-family: var(--font-display);
}

body {
  position: relative;
  overflow-x: hidden;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, #2a1520 0%, transparent 55%),
    radial-gradient(circle at 80% 20%, rgba(196, 30, 58, 0.18), transparent 35%),
    linear-gradient(180deg, #070a10 0%, #121a28 45%, #0b1018 100%);
}

.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(1px 1px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 80px 120px, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 200px 80px, #fff, transparent),
    radial-gradient(1px 1px at 320px 160px, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 420px 40px, #fff, transparent),
    radial-gradient(1px 1px at 520px 200px, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1.5px 1.5px at 640px 90px, #fff, transparent),
    radial-gradient(1px 1px at 760px 150px, rgba(255, 255, 255, 0.6), transparent);
  background-size: 820px 240px;
  opacity: 0.55;
  animation: drift 80s linear infinite;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 85%);
  pointer-events: none;
}

@keyframes drift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-240px);
  }
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 0.7fr);
  gap: clamp(1rem, 2.5vw, 1.75rem);
  align-items: start;
  padding: clamp(1.25rem, 3vw, 2.5rem) var(--pad-x) clamp(0.9rem, 2vw, 1.25rem);
  border-bottom: 3px solid var(--red);
}

.hero-brand {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.hero-visual {
  margin: 0;
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: stretch;
  position: relative;
  z-index: 0;
}

.hero-visual img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: clamp(7rem, 18vw, 11rem);
  max-height: clamp(9rem, 22vw, 13rem);
  object-fit: cover;
  object-position: 18% 45%;
  border: 1px solid var(--line);
  border-top: 3px solid var(--red);
  filter: saturate(0.85) contrast(1.05);
}

.eyebrow {
  margin: 0 0 0.6rem;
  letter-spacing: 0.18em;
  font-size: clamp(0.68rem, 1.6vw, 0.86rem);
  color: var(--gold);
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-poster);
  font-size: clamp(2.4rem, 6.2vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  font-weight: 400;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.tagline {
  margin: 0.85rem 0 0;
  max-width: 36rem;
  font-family: var(--font-quote);
  font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  line-height: 1.35;
  color: var(--steel);
}

.hero-status {
  text-align: right;
  justify-self: end;
}

.stamp {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.85rem;
  border: 2px solid var(--red);
  color: var(--red);
  font-family: var(--font-poster);
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: rotate(-6deg);
  background: rgba(196, 30, 58, 0.08);
}

.link-state {
  margin: 0.2rem 0;
  font-family: var(--font-mono);
  font-size: clamp(0.92rem, 2vw, 1.14rem);
  color: var(--steel);
  overflow-wrap: anywhere;
  max-width: 16rem;
  line-height: 1.35;
}

.link-state.is-down {
  color: #e8b4bc;
}

.quote-banner {
  padding: clamp(1rem, 2.5vw, 1.55rem) var(--pad-x);
  background: linear-gradient(90deg, var(--red-deep), #3a0f18 55%, transparent);
  border-bottom: 1px solid var(--line);
  min-height: auto;
}

.quote-banner blockquote {
  margin: 0;
  font-family: var(--font-quote);
  font-size: clamp(1.15rem, 3.2vw, 2.28rem);
  font-style: italic;
  font-weight: 400;
  max-width: 56rem;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.quote-banner cite {
  display: block;
  margin-top: 0.65rem;
  font-family: var(--font-display);
  font-style: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: clamp(0.75rem, 1.8vw, 0.9rem);
  color: var(--gold);
}

main {
  padding: clamp(1rem, 2.5vw, 1.75rem) var(--pad-x) clamp(2rem, 4vw, 3rem);
}

.telemetry {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}

.gauge {
  padding: clamp(0.75rem, 1.5vw, 1rem);
  background: rgba(20, 28, 42, 0.92);
  border: 1px solid var(--line);
  border-top: 3px solid var(--red);
  min-height: 0;
  min-width: 0;
}

.gauge h2 {
  margin: 0;
  font-size: clamp(0.72rem, 1.5vw, 0.94rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel);
  font-weight: 500;
}

.gauge .value {
  margin: 0.55rem 0 0.7rem;
  font-family: var(--font-mono);
  font-size: clamp(1.55rem, 3.5vw, 2.4rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.gauge .value small {
  margin-left: 0.25rem;
  font-size: clamp(0.8rem, 1.6vw, 1.02rem);
  color: var(--steel);
}

.gauge .value-split {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
}

.gauge .value-side {
  font-size: 0.58em;
  color: var(--gold);
  white-space: nowrap;
  text-align: right;
}

.gauge .value-side small {
  margin-left: 0.2rem;
  font-size: 0.55em;
  letter-spacing: 0.04em;
}

.bar {
  height: 4px;
  background: rgba(232, 220, 200, 0.12);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red), var(--gold));
  transition: width 0.6s ease;
}

.gauge .meta {
  margin: 0.55rem 0 0;
  font-size: clamp(0.68rem, 1.4vw, 0.82rem);
  letter-spacing: 0.06em;
  color: rgba(154, 167, 184, 0.85);
  text-transform: uppercase;
}

.infographics {
  margin-top: clamp(0.9rem, 2vw, 1.4rem);
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.3fr) minmax(0, 0.95fr);
  gap: var(--gap);
  align-items: stretch;
}

.station-status .panel-note {
  margin: 0.45rem 0;
}

.panel {
  padding: clamp(0.85rem, 1.8vw, 1.2rem);
  background: rgba(11, 16, 24, 0.85);
  border: 1px solid var(--line);
  min-width: 0;
}

.panel h2 {
  margin: 0 0 0.85rem;
  font-size: clamp(0.85rem, 1.8vw, 1.08rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}

.orbit-svg,
.sky-svg {
  width: 100%;
  max-width: 420px;
  height: auto;
  display: block;
  margin-inline: auto;
}

.sky-ring {
  fill: none;
  stroke: rgba(232, 220, 200, 0.2);
  stroke-width: 1;
}

.sky-axis {
  stroke: rgba(232, 220, 200, 0.18);
  stroke-width: 1;
}

.sky-label {
  fill: var(--steel);
  font-size: 11px;
  font-family: var(--font-mono);
}

.sky-sat {
  stroke-width: 1;
}

.sky-sat-gps {
  fill: var(--gold);
  stroke: #8a7018;
}

.sky-sat-glo {
  fill: var(--red);
  stroke: var(--red-deep);
}

.sky-sat-sbas {
  fill: var(--steel);
  stroke: #6a7788;
}

.sky-sat-other {
  fill: #5a9e8a;
  stroke: #2f5f50;
}

.sky-sat-label {
  fill: var(--paper);
  font-size: 9px;
  font-family: var(--font-mono);
}

.sky-star {
  fill: #e8dcc8;
  stroke: rgba(201, 162, 39, 0.7);
  stroke-width: 0.8;
  opacity: 0.9;
}

.sky-star-label {
  fill: rgba(232, 220, 200, 0.75);
  font-size: 9px;
  font-family: var(--font-quote);
  font-style: italic;
}

.sky-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  margin: 0.55rem 0 0;
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 1.4vw, 0.8rem);
  color: var(--steel);
}

.sky-legend .leg.gps {
  color: var(--gold);
}
.sky-legend .leg.glo {
  color: var(--red);
}
.sky-legend .leg.sbas {
  color: var(--steel);
}
.sky-legend .leg.other {
  color: #5a9e8a;
}
.sky-legend .leg.star {
  color: var(--paper);
}

.orbit-path {
  fill: none;
  stroke: rgba(201, 162, 39, 0.45);
  stroke-width: 1.5;
  stroke-dasharray: 4 6;
}

.earth {
  fill: #2f5f78;
  stroke: var(--paper);
  stroke-width: 1;
}

.sat {
  fill: var(--red);
}

.panel-note {
  margin: 0.75rem 0 0;
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 1.6vw, 0.94rem);
  color: var(--steel);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.panel.manifesto a,
.footer a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.panel.manifesto a:hover,
.footer a:hover {
  color: var(--paper);
}

.chart-panel {
  display: flex;
  flex-direction: column;
}

.chart-panel canvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 640 / 220;
  display: block;
  background: rgba(255, 255, 255, 0.02);
}

.manifesto ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--steel);
  font-family: var(--font-quote);
  font-size: clamp(1rem, 2vw, 1.26rem);
  line-height: 1.45;
}

.manifesto li + li {
  margin-top: 0.35rem;
}

.red-line {
  margin: 1.1rem 0 0;
  padding-top: 0.8rem;
  border-top: 1px solid var(--red);
  font-family: var(--font-quote);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--paper);
}

.footer {
  padding: clamp(1rem, 2.5vw, 1.5rem) var(--pad-x) clamp(1.5rem, 3vw, 2.5rem);
  border-top: 1px solid var(--line);
  color: var(--steel);
  font-size: clamp(0.85rem, 1.8vw, 1.02rem);
  line-height: 1.45;
}

.footer p {
  margin: 0 0 0.45rem;
  overflow-wrap: break-word;
}

.footer code {
  font-family: var(--font-mono);
  color: var(--gold);
}

.config-hint {
  opacity: 0.8;
}

/* ---- Планшет / узкий: картинка под заголовком, без наезда ---- */
@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand status"
      "visual visual";
    align-items: start;
  }

  .hero-brand {
    grid-area: brand;
  }

  .hero-status {
    grid-area: status;
    text-align: right;
    justify-self: end;
  }

  .hero-visual {
    grid-area: visual;
  }

  .hero-visual img {
    max-height: clamp(8rem, 28vw, 12rem);
    min-height: 7.5rem;
    object-position: 25% 40%;
  }

  .stamp {
    transform: rotate(-4deg);
    margin-bottom: 0;
  }

  .telemetry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .infographics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .infographics .chart-panel {
    grid-column: 1 / -1;
  }
}

/* ---- Планшет / узкий (старый брейкпоинт сливаем) ---- */
@media (max-width: 980px) {
  .stamp {
    transform: rotate(-4deg);
    margin-bottom: 0;
  }
}

/* ---- Телефон ---- */
@media (max-width: 640px) {
  .grid-overlay {
    background-size: 32px 32px;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "status"
      "visual";
    padding-top: 1.1rem;
  }

  .hero-status {
    text-align: left;
    justify-self: start;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 1rem;
  }

  .hero-visual img {
    max-height: 9.5rem;
    min-height: 6.5rem;
    object-position: 30% 42%;
  }

  .eyebrow {
    letter-spacing: 0.1em;
  }

  .hero-status {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .quote-banner {
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
  }

  .telemetry {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  .gauge {
    padding: 0.7rem 0.65rem 0.65rem;
  }

  .gauge .value {
    margin: 0.4rem 0 0.5rem;
  }

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

  .infographics .chart-panel {
    grid-column: auto;
  }

  .chart-panel canvas {
    min-height: 140px;
  }

  .manifesto ul {
    padding-left: 1rem;
  }
}

/* ---- Очень узкий ---- */
@media (max-width: 380px) {
  .telemetry {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 14vw, 3rem);
  }
}

/* ---- Альбомный телефон ---- */
@media (max-height: 480px) and (orientation: landscape) {
  .hero {
    grid-template-columns: 1.3fr 0.7fr;
    align-items: center;
    padding-top: 0.75rem;
    padding-bottom: 0.6rem;
  }

  .hero-status {
    text-align: right;
    justify-self: end;
    align-items: flex-end;
  }

  .quote-banner blockquote {
    font-size: clamp(1rem, 2.8vw, 1.35rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sky::after {
    animation: none;
  }

  .bar i {
    transition: none;
  }
}
