/* ==========================================================================
   Blackkonnect — marketing landing
   Palette is pure greyscale by brand mandate. Luminance carries state:
   a trace at rest is #252525, an energised trace is #aaaaaa, a packet is #fff.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;500;600;700&display=swap');

:root {
  --ink:    #000000;  /* page ground */
  --matte:  #161616;  /* raised surfaces */
  --trace:  #252525;  /* routes at rest */
  --edge:   #353535;  /* hairlines */
  --dim:    #666666;  /* secondary text */
  --signal: #aaaaaa;  /* energised route, primary label */
  --live:   #ffffff;  /* traffic, the mark, emphasis */

  --font-brand: 'Comfortaa', system-ui, sans-serif;
  --font-data: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --rail-h: 56px;
  --gutter: clamp(20px, 5vw, 72px);
  --section-y: clamp(88px, 13vh, 168px);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--rail-h) + 24px);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--live);
  font-family: var(--font-brand);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }

:focus-visible {
  outline: 1px solid var(--live);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--live);
  color: var(--ink);
  font-size: 12px;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* --- atmosphere ---------------------------------------------------------- */

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.atmosphere::before {
  /* a single slow breath of light behind the mark */
  content: '';
  position: absolute;
  left: 50%; top: 28%;
  width: min(140vw, 1200px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.02) 38%, transparent 68%);
  animation: breathe 14s ease-in-out infinite;
}

.atmosphere::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");
  opacity: 0.04;
  mix-blend-mode: screen;
}

@keyframes breathe {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.12); }
}

/* --- top rail ------------------------------------------------------------ */

.rail {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  height: var(--rail-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--gutter);
  border-bottom: 1px solid var(--trace);
  background: linear-gradient(to bottom, rgba(0,0,0,0.92), rgba(0,0,0,0.55));
  backdrop-filter: blur(8px);
}

.rail__mark {
  display: block;
  width: 17px;
  height: 22px;
  color: var(--live);
  opacity: 0;
}

.rail__status {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-data);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  opacity: 0;
}

.pip {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--live);
  animation: pip 2.4s ease-in-out infinite;
}

@keyframes pip {
  0%, 100% { opacity: 1;   box-shadow: 0 0 0 0 rgba(255,255,255,0.5); }
  50%      { opacity: 0.4; box-shadow: 0 0 0 5px rgba(255,255,255,0); }
}

/* --- shared ------------------------------------------------------------- */

main { position: relative; z-index: 1; }

.eyebrow {
  font-family: var(--font-data);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 20px;
}

/* --- hero ---------------------------------------------------------------- */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  padding: calc(var(--rail-h) + 40px) var(--gutter) 0;
  text-align: center;
}

.hero__inner {
  display: grid;
  justify-items: center;
  gap: clamp(28px, 5vh, 52px);
  max-width: 680px;
}

.logo {
  width: clamp(260px, 44vw, 560px);
  height: auto;
  display: block;
  overflow: visible;
}

.logo path {
  fill: var(--live);
  stroke: none;
}

/* pre-animation state, removed if JS never runs */
.logo.is-armed path {
  fill: transparent;
  stroke: var(--edge);
  stroke-width: 0.5;
  vector-effect: non-scaling-stroke;
}

.logo__sweep { opacity: 0; }

.hero__copy {
  display: grid;
  gap: 14px;
  opacity: 0;
}

.hero__line {
  margin: 0;
  font-size: clamp(19px, 2.5vw, 27px);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.hero__sub {
  margin: 0 auto;
  max-width: 52ch;
  font-size: clamp(13px, 1.5vw, 15px);
  font-weight: 300;
  color: var(--dim);
}

/* the trace leaving the hero — it is the same line the switchboard runs on */
.descender {
  position: relative;
  width: 1px;
  height: clamp(72px, 14vh, 140px);
  background: linear-gradient(to bottom, var(--trace), var(--edge));
  transform: scaleY(0);
  transform-origin: top;
}

.descender::after {
  content: '';
  position: absolute;
  left: -1px;
  width: 3px; height: 26px;
  border-radius: 2px;
  background: linear-gradient(to bottom, transparent, var(--live));
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.8));
  animation: descend 2.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes descend {
  0%      { top: -26px; opacity: 0; }
  15%     { opacity: 1; }
  85%     { opacity: 1; }
  100%    { top: 100%; opacity: 0; }
}

/* --- switchboard --------------------------------------------------------- */

.switch {
  /* less room below: the board used to be followed by a readout line */
  padding: var(--section-y) var(--gutter) clamp(56px, 8vh, 104px);
}

.switch__head {
  max-width: 1200px;
  margin: 0 auto clamp(40px, 6vh, 72px);
}

.switch__title {
  margin: 0;
  max-width: 24ch;
  font-size: clamp(21px, 2.6vw, 30px);
  font-weight: 500;
  line-height: 1.35;
}

.board {
  max-width: 1200px;
  margin: 0 auto;
}

.board svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* routes */
.route {
  fill: none;
  stroke: var(--trace);
  stroke-width: 1;
  stroke-linecap: square;
  stroke-linejoin: miter;
  transition: stroke 420ms ease;
}
.route.is-hot { stroke: var(--signal); }

.trunk {
  fill: none;
  stroke: var(--edge);
  stroke-width: 2;
  stroke-linecap: square;
}

/* chips */
.chip-bg {
  fill: var(--matte);
  stroke: var(--trace);
  stroke-width: 1;
  transition: stroke 300ms ease, fill 300ms ease;
}
.chip-name {
  fill: var(--signal);
  font-family: var(--font-brand);
  font-size: 12px;
  font-weight: 500;
  transition: fill 300ms ease;
}
.chip-proto {
  fill: var(--dim);
  font-family: var(--font-data);
  font-size: 8.5px;
  letter-spacing: 0.1em;
}
.port-ring {
  fill: none;
  stroke: var(--edge);
  stroke-width: 1;
  transition: stroke 300ms ease;
}
.port-pin {
  fill: var(--dim);
  transition: fill 300ms ease;
}

.chip:hover .chip-bg { stroke: var(--signal); fill: #1c1c1c; }
.chip:hover .chip-name { fill: var(--live); }
.chip:hover .port-ring { stroke: var(--live); }
.chip:hover .port-pin { fill: var(--live); }

.chip.is-hit .chip-bg { stroke: var(--signal); }
.chip.is-hit .chip-name { fill: var(--live); }
.chip.is-hit .port-pin { fill: var(--live); }

.board-label {
  fill: var(--dim);
  font-family: var(--font-data);
  font-size: 9.5px;
  letter-spacing: 0.2em;
}

/* the core */
.core-body {
  fill: var(--matte);
  stroke: var(--edge);
  stroke-width: 1;
  transition: stroke 260ms ease;
}
.core.is-struck .core-body { stroke: var(--signal); }

.core-mark { color: var(--live); }

.core-ring {
  fill: none;
  stroke: var(--live);
  stroke-width: 1;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.core.is-struck .core-ring { animation: strike 620ms var(--ease-out); }

@keyframes strike {
  from { opacity: 0.5; transform: scale(1); }
  to   { opacity: 0;   transform: scale(1.3); }
}

/* traffic */
.packet {
  fill: var(--live);
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.9));
}

/* --- close --------------------------------------------------------------- */

.close {
  padding: var(--section-y) var(--gutter) clamp(64px, 9vh, 104px);
  display: grid;
  justify-items: center;
  gap: 32px;
  text-align: center;
  border-top: 1px solid var(--trace);
}

.close__title {
  margin: 0;
  max-width: 23ch;
  font-size: clamp(21px, 3vw, 32px);
  font-weight: 500;
  line-height: 1.3;
}

.cta {
  --pad: 15px 30px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: var(--pad);
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: transparent;
  color: var(--live);
  font-family: var(--font-brand);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: border-color 300ms ease, background 300ms ease, color 300ms ease;
}

.cta:hover, .cta:focus-visible {
  border-color: var(--live);
  background: var(--live);
  color: var(--ink);
}

.cta svg { transition: transform 300ms var(--ease-out); }
.cta:hover svg { transform: translateX(4px); }

/* --- footer -------------------------------------------------------------- */

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 22px var(--gutter);
  border-top: 1px solid var(--trace);
  font-family: var(--font-data);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.foot__mark { width: 15px; height: 19px; color: var(--dim); }

/* --- scroll reveal ------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }

/* --- motion off ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .atmosphere::before { animation: none; opacity: 0.8; }
  .pip { animation: none; }
  .descender::after { display: none; }
  .core.is-struck .core-ring { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
