/* ============================================================
   BROADCOM — THE INVISIBLE BACKBONE
   dark substrate · luminous trace · signal-propagation motion
   ============================================================ */

:root {
  --bg: #050507;
  --bg-2: #0a0a0e;
  --panel: #0b0b10;
  --ink: #e8e6e1;
  --ink-dim: #9a989e;
  --faint: #5b5960;
  --red: #e31837;
  --red-soft: #ff4d63;
  --amber: #ffb35c;
  --copper: #c97b4a;
  --line: rgba(232, 230, 225, 0.08);
  --line-strong: rgba(232, 230, 225, 0.16);
  --display: "Space Grotesk", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(20px, 5vw, 48px);
}

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

html, body { overflow-x: clip; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--red); color: #fff; }

.mono { font-family: var(--mono); }

a { color: inherit; text-decoration: none; }

a:focus-visible, button:focus-visible {
  outline: 1px solid var(--red);
  outline-offset: 4px;
}

img, svg { display: block; max-width: 100%; }

/* ---------------- header ---------------- */

.site-head {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 58px;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 7, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-glyph { width: 17px; height: 17px; }
.brand-word { width: 104px; height: auto; opacity: 0.92; }
.brand:hover .brand-glyph { filter: drop-shadow(0 0 6px rgba(227, 24, 55, 0.8)); }

.site-nav {
  display: flex;
  gap: 26px;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-nav a {
  position: relative;
  color: var(--ink-dim);
  padding: 4px 0;
  transition: color 0.25s;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 1px;
  background: var(--red);
  transition: right 0.35s var(--ease-out);
}

.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { right: 0; }

.head-tag {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--faint);
  white-space: nowrap;
}

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

.hero { height: 175vh; position: relative; }

.hero-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

#signal-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-copy {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(88px, 14vh, 150px);
  max-width: min(92vw, 1060px);
  will-change: opacity;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--red-soft);
  margin-bottom: 22px;
}

.eyebrow .tick {
  width: 7px; height: 7px;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
  animation: tick-blink 1.6s steps(2, jump-none) infinite;
}

@keyframes tick-blink { 50% { opacity: 0.25; box-shadow: none; } }

.hero-title {
  font-size: clamp(3rem, 9.5vw, 8rem);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero-sub {
  margin-top: 26px;
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  font-weight: 300;
  color: var(--ink-dim);
  line-height: 1.65;
}

.hero-coord {
  position: absolute;
  top: 84px;
  right: var(--gutter);
  font-size: 10px;
  letter-spacing: 0.14em;
  line-height: 1.9;
  color: var(--faint);
  text-align: right;
}

.scroll-cue {
  position: absolute;
  right: var(--gutter);
  bottom: 34px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
}

.cue-line {
  width: 56px; height: 1px;
  background: var(--line-strong);
  position: relative;
  overflow: hidden;
}

.cue-line::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 18px;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: cue-run 2.2s var(--ease-out) infinite;
}

@keyframes cue-run {
  0% { transform: translateX(-20px); }
  70%, 100% { transform: translateX(60px); }
}

/* ---------------- sections common ---------------- */

.section {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(90px, 13vw, 170px) var(--gutter) 0;
}

.sec-head { max-width: 760px; }

.sec-index {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--red-soft);
  margin-bottom: 18px;
}

.sec-title {
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.028em;
}

.sec-rule {
  height: 1px;
  margin: 30px 0;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--red) 0%, var(--amber) 34%, var(--line) 70%, transparent 100%);
  transition: transform 1.3s var(--ease-out) 0.15s;
  position: relative;
}

.sec-rule::before {
  content: "";
  position: absolute;
  left: 0; top: -2.5px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
}

.sec-head.in .sec-rule { transform: scaleX(1); }

.sec-lede {
  max-width: 620px;
  color: var(--ink-dim);
  font-size: clamp(0.98rem, 1.3vw, 1.08rem);
}

/* reveal primitives (hidden states only when JS is active) */

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

.js .reveal-item.in { opacity: 1; transform: none; }

.js .lock-in .ch {
  display: inline-block;
  opacity: 0;
  filter: blur(7px);
  transform: translateY(0.12em);
  transition:
    opacity 0.55s var(--ease-out),
    filter 0.55s var(--ease-out),
    transform 0.55s var(--ease-out);
  transition-delay: calc(var(--i) * 26ms);
}

.js .lock-in.locked .ch { opacity: 1; filter: blur(0); transform: none; }

/* ---------------- silicon blocks ---------------- */

.silicon-block {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  gap: clamp(36px, 6vw, 84px);
  align-items: center;
  margin-top: clamp(72px, 10vw, 130px);
}

.block-figure {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: clamp(16px, 3vw, 36px);
}

.fig-cap {
  margin-top: 18px;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--faint);
}

.block-no {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--red-soft);
  margin-bottom: 16px;
}

.block-text h3 {
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin-bottom: 22px;
}

.block-text p { color: var(--ink-dim); margin-bottom: 16px; max-width: 52ch; }
.block-text p strong, .block-text b { color: var(--ink); font-weight: 500; }

.spec {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.spec div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
  transition: background 0.25s, padding-left 0.25s var(--ease-out);
}

.spec div:hover { background: rgba(227, 24, 55, 0.06); padding-left: 10px; }
.spec dt { color: var(--faint); }
.spec dd { color: var(--ink); text-align: right; }

/* switching — chip photograph emerging from darkness */

.block-switch .chip-img {
  width: 100%;
  height: auto;
  filter: saturate(0.8) brightness(0.38) contrast(1.18);
  -webkit-mask-image: radial-gradient(ellipse 74% 70% at 50% 50%, #000 50%, transparent 80%);
  mask-image: radial-gradient(ellipse 74% 70% at 50% 50%, #000 50%, transparent 80%);
}

.chip-notes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.chip-notes .note { opacity: 0; transform: translateY(4px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); transition-delay: var(--d, 0ms); }

.block-figure.in .chip-notes .note,
.block-figure:hover .chip-notes .note { opacity: 1; transform: none; }

.chip-notes path { stroke: var(--copper); stroke-width: 1; opacity: 0.85; }
.chip-notes circle { fill: var(--red); }
.chip-notes text {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  fill: var(--amber);
}
.chip-notes .note-sub { fill: var(--faint); font-size: 11px; }

/* connectivity — DWDM fiber diagram */

.fiber-svg { width: 100%; height: auto; }

.fiber-line { stroke: var(--copper); stroke-width: 1.4; opacity: 0.9; }

.wave {
  fill: none;
  stroke-width: 1.6;
  stroke-dasharray: 6 7;
  opacity: 0.95;
  animation: photon 1.1s linear infinite;
}

.w1 { stroke: #ff4d63; }
.w2 { stroke: #ff7a5c; animation-delay: -0.2s; }
.w3 { stroke: #ffb35c; animation-delay: -0.4s; }
.w4 { stroke: #ffd08a; animation-delay: -0.6s; }
.w5 { stroke: #e31837; animation-delay: -0.8s; }

@keyframes photon { to { stroke-dashoffset: -14; } }

.beam-pulse { animation: beam 3.4s linear infinite; }

@keyframes beam {
  0%   { transform: translateX(-100px); opacity: 0; }
  8%   { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateX(660px); opacity: 0; }
}

.fiber-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  fill: var(--faint);
}

/* custom accelerators — die grid */

.die-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
  aspect-ratio: 16 / 10;
}

.die {
  border: 1px solid var(--line);
  background: rgba(232, 230, 225, 0.025);
  transition: background 0.35s, border-color 0.35s, box-shadow 0.35s;
}

.die.hot {
  background: rgba(227, 24, 55, 0.32);
  border-color: var(--red);
  box-shadow: 0 0 14px rgba(227, 24, 55, 0.45), inset 0 0 6px rgba(255, 90, 110, 0.5);
}

.die.warm {
  background: rgba(255, 179, 92, 0.16);
  border-color: rgba(255, 179, 92, 0.55);
}

/* ---------------- software stack ---------------- */

.stack {
  margin-top: clamp(48px, 6vw, 72px);
  border: 1px solid var(--line);
  background: var(--panel);
}

.stack-layer {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: baseline;
  gap: 20px;
  padding: clamp(16px, 2.6vw, 26px) clamp(18px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s, transform 0.3s var(--ease-out);
}

.stack-layer:last-child { border-bottom: 0; }

.stack-layer:hover {
  background: rgba(227, 24, 55, 0.05);
  transform: translateX(6px);
}

.layer-no { font-size: 11px; color: var(--faint); letter-spacing: 0.12em; }

.layer-name {
  font-size: clamp(1.05rem, 2vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.layer-note { font-size: 10px; letter-spacing: 0.16em; color: var(--faint); text-align: right; }

.stack-layer.substrate {
  background: linear-gradient(90deg, rgba(227, 24, 55, 0.1), rgba(255, 179, 92, 0.04));
}

.stack-layer.substrate .layer-name { color: var(--amber); }
.stack-layer.substrate .layer-no { color: var(--red-soft); }

.stack-foot {
  margin-top: 18px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--faint);
}

/* ---------------- stats ---------------- */

.stats {
  margin-top: clamp(48px, 6vw, 80px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.stat {
  background: var(--bg);
  padding: clamp(28px, 4vw, 48px);
  position: relative;
  transition: background 0.35s;
}

.stat::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--red);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s var(--ease-out);
}

.stat:hover { background: var(--bg-2); }
.stat:hover::before { transform: scaleY(1); }

.stat-num {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-num .unit {
  font-size: 0.36em;
  color: var(--red-soft);
  margin-left: 0.35em;
  letter-spacing: 0.06em;
}

.stat-label {
  margin-top: 16px;
  color: var(--ink-dim);
  font-size: 0.95rem;
  max-width: 34ch;
}

.stat-src { color: var(--faint); }

/* ---------------- personalization ---------------- */

.path {
  position: relative;
  display: flex;
  margin-top: clamp(48px, 6vw, 80px);
  border: 1px solid var(--line);
  background: var(--panel);
  padding: clamp(22px, 3.4vw, 40px) 0;
}

.path-runner {
  position: absolute;
  top: calc(clamp(22px, 3.4vw, 40px) - 1px);
  left: 0;
  width: 64px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red-soft));
  box-shadow: 0 0 12px rgba(227, 24, 55, 0.7);
  animation: runner 7s linear infinite;
  pointer-events: none;
}

@keyframes runner {
  0%   { left: -70px; opacity: 0; }
  6%   { opacity: 1; }
  94%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.hop {
  flex: 1 1 0;
  position: relative;
  padding: 0 clamp(10px, 1.6vw, 22px);
  border-top: 1px solid var(--line-strong);
  margin-top: calc(-1 * clamp(22px, 3.4vw, 40px));
  padding-top: clamp(30px, 4vw, 52px);
  transition: background 0.3s;
}

.hop::before {
  content: "";
  position: absolute;
  top: -5px;
  left: clamp(10px, 1.6vw, 22px);
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1px solid var(--copper);
  background: var(--bg);
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.hop:hover { background: rgba(227, 24, 55, 0.05); }
.hop:hover::before {
  border-color: var(--red);
  background: var(--red);
  box-shadow: 0 0 12px rgba(227, 24, 55, 0.8);
}

.hop-k { font-size: 10px; letter-spacing: 0.18em; color: var(--red-soft); }
.hop-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(0.85rem, 1.15vw, 1rem);
  letter-spacing: 0.01em;
  margin: 8px 0 6px;
}

.hop-val {
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  line-height: 1.7;
  min-height: 2.6em;
  word-break: break-word;
}

.hop-conf {
  display: inline-block;
  margin-top: 10px;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  padding: 3px 8px;
  border: 1px solid;
}

.conf-local  { color: var(--amber); border-color: rgba(255, 179, 92, 0.5); }
.conf-certain{ color: var(--red-soft); border-color: rgba(227, 24, 55, 0.55); }
.conf-likely { color: var(--ink); border-color: var(--line-strong); }
.conf-stat   { color: var(--ink-dim); border-color: var(--line); }

.path-fallback { padding: 20px var(--gutter); color: var(--ink-dim); font-size: 11px; letter-spacing: 0.1em; }

.telemetry {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  font-size: 11px;
}

.tele-cell { background: var(--bg); padding: 14px 16px; }
.tele-k { display: block; color: var(--faint); font-size: 9.5px; letter-spacing: 0.18em; margin-bottom: 6px; }
.tele-v { color: var(--ink); letter-spacing: 0.04em; word-break: break-word; }
.tele-v.hot { color: var(--amber); }

/* ---------------- practice / culture ---------------- */

.manifesto { margin-top: clamp(44px, 6vw, 72px); max-width: 880px; }

.manifesto p {
  font-size: clamp(1.35rem, 3vw, 2.3rem);
  font-weight: 300;
  line-height: 1.32;
  letter-spacing: -0.015em;
  color: var(--ink-dim);
  margin-bottom: 0.7em;
}

.manifesto p::first-line { color: var(--ink); }

.manifesto-punch { color: var(--ink); }
.manifesto-punch::after { content: ""; display: inline-block; width: 0.45em; height: 0.45em; margin-left: 0.25em; background: var(--red); box-shadow: 0 0 12px rgba(227, 24, 55, 0.7); }

.lineage { margin-top: clamp(56px, 8vw, 96px); }

.lineage-head { font-size: 11px; letter-spacing: 0.2em; color: var(--red-soft); margin-bottom: 22px; }

.lineage-list { list-style: none; border-top: 1px solid var(--line); }

.lineage-list li {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 22px;
  align-items: baseline;
  padding: 15px 4px;
  border-bottom: 1px solid var(--line);
  transition: background 0.25s, padding-left 0.25s var(--ease-out);
}

.lineage-list li:hover { background: rgba(227, 24, 55, 0.05); padding-left: 14px; }

.yr { font-size: 13px; color: var(--amber); letter-spacing: 0.06em; }
.ev { color: var(--ink-dim); font-size: 0.98rem; }
li:hover .ev { color: var(--ink); }

.disciplines {
  margin-top: clamp(48px, 6vw, 72px);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.disciplines span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-dim);
  border: 1px solid var(--line-strong);
  padding: 9px 16px;
  transition: color 0.25s, border-color 0.25s, transform 0.25s var(--ease-out), box-shadow 0.25s;
  cursor: default;
}

.disciplines span:hover {
  color: var(--ink);
  border-color: var(--red);
  transform: translateY(-3px);
  box-shadow: 0 4px 18px rgba(227, 24, 55, 0.22);
}

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

.site-foot {
  margin-top: clamp(110px, 15vw, 200px);
  border-top: 1px solid var(--line);
  padding: clamp(48px, 7vw, 84px) var(--gutter) 56px;
  text-align: center;
}

.foot-word { width: clamp(160px, 22vw, 220px); height: auto; margin: 0 auto 26px; opacity: 0.94; }

.foot-line { font-size: 10.5px; letter-spacing: 0.26em; color: var(--ink-dim); margin-bottom: 18px; }

.foot-legal {
  max-width: 56ch;
  margin: 0 auto;
  font-size: 0.8rem;
  color: var(--faint);
  line-height: 1.7;
}

/* ---------------- responsive ---------------- */

@media (max-width: 900px) {
  .site-nav { display: none; }
  .head-tag { margin-left: auto; }

  .silicon-block { grid-template-columns: 1fr; gap: 34px; }
  .block-connect .block-figure { order: -1; }

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

  .path { flex-direction: column; padding: 0 clamp(20px, 5vw, 34px); }

  .path-runner {
    top: 0;
    left: calc(clamp(20px, 5vw, 34px) - 1px);
    width: 2px;
    height: 64px;
    background: linear-gradient(180deg, transparent, var(--red-soft));
    animation: runner-v 7s linear infinite;
  }

  @keyframes runner-v {
    0%   { top: -70px; opacity: 0; }
    6%   { opacity: 1; }
    94%  { opacity: 1; }
    100% { top: 100%; opacity: 0; }
  }

  .hop {
    border-top: 0;
    border-left: 1px solid var(--line-strong);
    margin-top: 0;
    margin-left: calc(-1 * clamp(20px, 5vw, 34px));
    padding: 18px 0 18px clamp(28px, 6vw, 44px);
  }

  .hop::before {
    top: 24px;
    left: -5px;
  }

  .hop-val { min-height: 0; }
}

@media (max-width: 480px) {
  .hero-copy { bottom: 108px; }
  .hero-coord { display: none; }
  .br-wide { display: none; }
  .stack-layer { grid-template-columns: 40px 1fr; }
  .layer-note { display: none; }
  .lineage-list li { grid-template-columns: 64px 1fr; gap: 14px; }
  .chip-notes text { font-size: 15px; }
}

/* ---------------- reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    transition-delay: 0s !important;
  }

  .js .reveal-item { opacity: 1; transform: none; }
  .js .lock-in .ch { opacity: 1; filter: none; transform: none; }
  .sec-rule { transform: scaleX(1); }
  .chip-notes .note { opacity: 1; transform: none; }
}
