/* ============================================================
   downtime — landing page
   aesthetic: night-shift console. hairlines, tabular numbers,
   colour only ever means state (the accent is the one exception).
   ============================================================ */

:root {
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "IBM Plex Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --bg: #0a0c0f;
  --bg-grid: rgba(255, 255, 255, 0.022);
  --panel: #101318;
  --panel-2: #151920;
  --panel-hi: #1a1f27;
  --line: #1e242d;
  --line-soft: #171c23;
  --tx: #e6eaf0;
  --tx-2: #9aa4b2;
  --tx-3: #7d8796;

  --accent: #5b8cff;
  --accent-solid: #2c6bff;
  --up: #2fbf78;
  --up-hi: #58e3a1;
  --degraded: #e0a127;
  --down: #e64e53;

  --r: 6px;
  --r-lg: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wrap: 1200px;
  --gut: clamp(18px, 5vw, 44px);
}

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  font-family: var(--sans);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--tx);
  font-size: 15px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* browser surfaces belong to the palette too */
::selection { background: rgba(91, 140, 255, 0.3); color: #fff; }
:root { accent-color: var(--accent-solid); caret-color: var(--accent); scrollbar-color: #2a323d transparent; }
::-webkit-scrollbar { width: 10px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #262d38; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #3a4553; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--accent-solid); color: #fff; padding: 10px 16px; border-radius: var(--r);
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 12, 15, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.topbar-in { display: flex; align-items: center; gap: 18px; height: 58px; }
.brand { display: flex; align-items: center; gap: 9px; margin-right: auto; min-width: 0; }
.brand img { border-radius: 7px; display: block; flex: none; }
.brand b { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }
.topnav { display: flex; gap: 20px; font-size: 12.5px; color: var(--tx-2); }
.topnav a { padding: 4px 0; transition: color 0.15s var(--ease); }
.topnav a:hover { color: var(--tx); }
@media (max-width: 860px) { .topnav { display: none; } }

/* icon-only link: the hit area is padded out to match the nav's optical height. */
.ghlink {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; margin-right: -7px; border-radius: var(--r);
  color: var(--tx-3); transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.ghlink svg { display: block; }
.ghlink:hover { color: var(--tx); background: var(--panel-hi); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; padding: 9px 15px; border-radius: var(--r);
  border: 1px solid var(--line); color: var(--tx);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent-solid); border-color: var(--accent-solid); color: #fff;
  box-shadow: 0 6px 22px -12px rgba(91, 140, 255, 0.9);
}
.btn-primary:hover { background: #3f78ff; }

/* ---------- state shapes ---------- */
.shape {
  --s: 9px;
  width: var(--s); height: var(--s); flex: none; display: inline-block;
  vertical-align: middle;
}
.shape.up { border-radius: 50%; background: var(--up); box-shadow: 0 0 10px -2px rgba(47, 191, 120, 0.85); }
.shape.down { background: var(--down); transform: rotate(45deg); box-shadow: 0 0 10px -2px rgba(230, 78, 83, 0.8); }
.shape.degraded { background: var(--degraded); border-radius: 1px; }

/* ---------- hero ---------- */
.hero { padding: clamp(56px, 9vw, 104px) 0 clamp(56px, 8vw, 104px); }
.hero-in {
  display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: clamp(28px, 5vw, 64px); align-items: center;
}
@media (max-width: 960px) { .hero-in { grid-template-columns: minmax(0, 1fr); } }

h1 {
  font-family: var(--mono);
  font-size: clamp(29px, 4.6vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.045em;
  font-weight: 600;
  text-wrap: balance;
}
h1 em { font-style: normal; color: var(--accent); }

.lede { margin-top: 22px; color: var(--tx-2); font-size: clamp(15px, 1.35vw, 17px); max-width: 56ch; text-wrap: pretty; }
.lede b { color: var(--tx); font-weight: 600; }

.cta-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* command strip */
.cmd {
  margin-top: 26px;
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 11px 11px 11px 13px;
  min-width: 0;
}
.cmd-prompt { color: var(--up); flex: none; font-size: 12.5px; }
.cmd code {
  font-size: 12.5px; color: var(--tx); flex: 1; min-width: 0;
  overflow-x: auto; white-space: nowrap; scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.copy {
  flex: none; font: inherit; font-family: var(--mono); font-size: 11px;
  color: var(--tx-3); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 5px; padding: 0 10px; min-height: 28px; cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.copy:hover { background: var(--panel-hi); color: var(--tx); border-color: #2a323d; }
.copy.done { color: var(--up); border-color: rgba(47, 191, 120, 0.4); }
.lit { color: var(--accent); }

/* hero visual */
.hero-vis { min-width: 0; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.9);
}
.console { overflow: hidden; }
.console-head {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2);
}
.ch-name { font-size: 12.5px; }
.ch-meta { margin-left: auto; font-size: 11px; color: var(--tx-3); }
.dot-live {
  width: 7px; height: 7px; border-radius: 50%; background: var(--up); flex: none;
  box-shadow: 0 0 0 0 rgba(47, 191, 120, 0.55);
  animation: live 2.4s var(--ease) infinite;
}
@keyframes live {
  0% { box-shadow: 0 0 0 0 rgba(47, 191, 120, 0.5); }
  60% { box-shadow: 0 0 0 8px rgba(47, 191, 120, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 191, 120, 0); }
}

.regions { list-style: none; }
.regions li {
  display: grid; grid-template-columns: 12px 74px minmax(0, 1fr) 62px;
  align-items: center; gap: 12px;
  padding: 13px 14px; border-bottom: 1px solid var(--line-soft);
}
.r-name { font-size: 12px; color: var(--tx-2); }
.r-val { font-size: 11.5px; text-align: right; color: var(--tx-2); }
.regions .is-down .r-val { color: var(--down); }
.bar { display: block; height: 4px; border-radius: 2px; background: var(--panel-hi); overflow: hidden; }
.bar i {
  display: block; height: 100%; width: var(--w); border-radius: 2px;
  background: linear-gradient(90deg, var(--up), var(--up-hi));
  transform-origin: left; animation: grow 0.9s var(--ease) 0.3s both;
}
.bar i.fail { background: repeating-linear-gradient(90deg, var(--down) 0 6px, transparent 6px 10px); }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.console-foot {
  display: flex; flex-wrap: wrap; gap: 8px 26px;
  padding: 13px 14px; background: var(--panel-2); border-top: 1px solid var(--line);
}
.verdict { display: flex; align-items: baseline; gap: 8px; }
.verdict .lbl { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tx-3); }
.verdict .val { font-size: 12px; }
.verdict .val.ok { color: var(--up); }

.vis-cap { margin-top: 10px; font-size: 10.5px; color: var(--tx-3); text-align: right; letter-spacing: 0.03em; }

/* ---------- sections ---------- */
.sect { padding: clamp(56px, 8vw, 108px) 0; border-top: 1px solid var(--line); scroll-margin-top: 58px; }
.sect.alt { background: rgba(16, 19, 24, 0.55); }

.sect-head { max-width: 46ch; }
.sect-head.wide { max-width: 62ch; }
.sect h2 {
  font-family: var(--mono); font-weight: 600;
  font-size: clamp(24px, 3.2vw, 36px); line-height: 1.12; letter-spacing: -0.04em;
  text-wrap: balance;
}
.sect-head p { margin-top: 16px; color: var(--tx-2); text-wrap: pretty; }
/* paragraph set beside the heading instead of under it */
.sect-body { color: var(--tx-2); text-wrap: pretty; max-width: 52ch; }

.two-col {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px); align-items: center;
}
.two-col .sect-head { max-width: 48ch; }
@media (max-width: 900px) {
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .two-col.reverse .vis-wrap { order: 2; }
  /* one column would blow the diagrams up past their own type scale. */
  .two-col .vis-wrap:has(> svg) { width: 100%; max-width: 480px; margin-inline: auto; }
}
.two-col.reverse .sect-head { order: 2; }
.two-col.reverse .vis-wrap { order: 1; }
@media (max-width: 900px) { .two-col.reverse .sect-head { order: 1; } }

/* svg visuals */
.vis-wrap { min-width: 0; }
.topo, .mesh { display: block; width: 100%; height: auto; }
.netbox rect { fill: rgba(21, 25, 32, 0.7); stroke: var(--line); stroke-width: 1; }
.netlabel text { fill: var(--tx-2); font-size: 11px; font-family: var(--mono); }
.netsub text { fill: var(--tx-3); font-size: 9.5px; font-family: var(--mono); letter-spacing: 0.08em; }
.agentdot circle { fill: var(--up); filter: drop-shadow(0 0 6px rgba(47, 191, 120, 0.7)); }
.wires path { fill: none; stroke: var(--line); stroke-width: 1.4; }
.pulses path {
  fill: none; stroke: url(#wire); stroke-width: 1.8; stroke-linecap: round;
  stroke-dasharray: 12 210; animation: flow 3.4s linear infinite;
}
.pulses path:nth-child(2) { animation-delay: 1.1s; }
.pulses path:nth-child(3) { animation-delay: 2.2s; }
@keyframes flow { from { stroke-dashoffset: 222; } to { stroke-dashoffset: 0; } }
.hub { fill: var(--panel-2); stroke: rgba(91, 140, 255, 0.45); stroke-width: 1.2; }
.hublabel { fill: var(--tx); font-size: 15px; font-family: var(--mono); letter-spacing: -0.02em; }
.meshline path { stroke: var(--line); stroke-width: 1.2; fill: none; }
/* pathLength normalises the dash to the edge, so every hop takes the same time */
.meshpulse path {
  fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round;
  stroke-dasharray: 6 94; stroke-dashoffset: 100; opacity: 0;
}
.meshpulse path.fire { animation: meshflow 900ms cubic-bezier(0.33, 0, 0.2, 1); }
@keyframes meshflow {
  0% { stroke-dashoffset: 100; opacity: 1; }
  85% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
.meshflash circle {
  fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0;
  transform-box: fill-box; transform-origin: center;
}
.meshflash circle.fire { animation: hubring 900ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes hubring {
  from { opacity: 0.5; transform: scale(1); }
  to { opacity: 0; transform: scale(1.75); }
}
.meshnode circle.fire { animation: hubglow 900ms ease-out; }
@keyframes hubglow {
  0% { stroke: var(--accent); filter: drop-shadow(0 0 9px rgba(91, 140, 255, 0.7)); }
  100% { stroke: rgba(91, 140, 255, 0.4); filter: none; }
}
.meshnode circle { fill: var(--panel-2); stroke: rgba(91, 140, 255, 0.4); stroke-width: 1.2; }
.meshtext text { fill: var(--tx-2); font-size: 11px; font-family: var(--mono); }

/* statement band — sits between the dial-out and mesh sections and frames both */
.stmt { border-top: 1px solid var(--line); padding: clamp(38px, 5vw, 62px) 0; }
.stmt-in { max-width: 64ch; }
.stmt h2 {
  font-family: var(--mono); font-weight: 600;
  font-size: clamp(18px, 2.2vw, 25px); line-height: 1.2; letter-spacing: -0.035em;
  text-wrap: balance;
}
.stmt p { margin-top: 12px; color: var(--tx-2); max-width: 58ch; text-wrap: pretty; }

/* outbox */
.outbox { overflow: hidden; }
.queue { list-style: none; }
.queue li {
  display: grid; grid-template-columns: 62px 12px minmax(0, 1fr) auto;
  align-items: center; gap: 12px;
  padding: 13px 14px; border-bottom: 1px solid var(--line-soft); font-size: 13px;
}
.queue li:last-child { border-bottom: 0; }
.q-t { font-size: 11px; color: var(--tx-3); }
.q-m { color: var(--tx-2); min-width: 0; }
.q-s { font-size: 10.5px; color: var(--tx-3); }
.queue .pend { background: rgba(91, 140, 255, 0.045); }
.queue .pend .q-s { color: var(--accent); }
@media (max-width: 460px) {
  .queue li { grid-template-columns: 12px minmax(0, 1fr); }
  .queue .q-t, .queue .q-s { display: none; }
}

/* alert channel marks — nominative, greyed, never louder than the panel above */
.chanrow { margin-top: clamp(34px, 4.5vw, 54px); }
.chans {
  list-style: none; display: flex; flex-wrap: wrap; align-items: flex-start;
  gap: 20px clamp(20px, 3.4vw, 38px);
  padding-top: 24px; border-top: 1px solid var(--line);
}
.chans li {
  display: flex; flex-direction: column; align-items: center; gap: 9px; width: 64px;
  color: var(--tx-3); opacity: 0.6;
  transition: opacity 0.15s var(--ease), color 0.15s var(--ease);
}
.chans li:hover { opacity: 1; color: var(--tx-2); }
.chans svg { display: block; }
.chans span { font-size: 9.5px; letter-spacing: 0.06em; line-height: 1.3; text-align: center; }

/* features */
.fgrid {
  margin-top: clamp(32px, 4vw, 52px);
  /* 12 cards — divisible by 3 and by 2, so every row stays closed. */
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
@media (max-width: 940px) and (min-width: 561px) {
  .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) { .fgrid { grid-template-columns: minmax(0, 1fr); } }
.fcard {
  padding: 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.fcard h3 { font-size: 13px; letter-spacing: -0.005em; color: var(--accent); font-weight: 600; text-wrap: balance; }
.fcard p { margin-top: 12px; color: var(--tx-2); font-size: 13.5px; text-wrap: pretty; }

/* steps */
.steps { list-style: none; margin-top: clamp(32px, 4vw, 52px); display: grid; gap: 14px; }
.step { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: start; }
.step-n {
  padding: 24px 0 24px 22px; font-size: 12px; color: var(--tx-3); letter-spacing: 0.1em;
}
.step-body { padding: 22px 22px 22px 0; min-width: 0; }
.step-body h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }
.step-body .cmd { margin-top: 14px; background: var(--bg); }
.step-note { margin-top: 10px; font-size: 11px; color: var(--tx-3); }
@media (max-width: 560px) {
  .step { grid-template-columns: minmax(0, 1fr); }
  .step-n { padding: 18px 18px 0; }
  .step-body { padding: 14px 18px 20px; }
}

/* closer */
.closer { border-top: 1px solid var(--line); padding: clamp(64px, 9vw, 120px) 0; text-align: center; }
.closer h2 {
  font-family: var(--mono); font-weight: 600;
  font-size: clamp(23px, 3.2vw, 36px); line-height: 1.14; letter-spacing: -0.04em;
  text-wrap: balance; max-width: 18em; margin-inline: auto;
}
.closer .cta-row { margin-top: 30px; }

/* footer */
.foot { border-top: 1px solid var(--line); background: var(--panel); }
.foot-in {
  display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center;
  justify-content: space-between;
  padding-block: 24px; font-size: 11.5px; color: var(--tx-3);
}
.foot a { color: var(--tx-2); transition: color 0.15s var(--ease); }
.foot a:hover { color: var(--accent); }
