/* ============================================================
   Indyr landing page
   Tokens mirror the Indyr design system (tokens.json).
   Structure: navy hero with the mesh animation, light points
   and contact sections, navy footer with the RSMS family links.
   ============================================================ */

:root {
  /* colour */
  --paper: #EFF4FB;
  --card: #FBFDFF;
  --ink: #0B1D33;
  --ink-2: #33506F;
  --edge: #1E6FE0;
  --signal: #C27A0E;          /* amber on light grounds: graphics and large text only */
  --navy: #0B1D33;
  --on-navy: #EFF4FB;
  --on-navy-2: #A9BCD3;
  --edge-on-navy: #5B9BFF;
  --signal-bright: #F2A93B;   /* amber on navy */
  --muted-on-navy: #33506F;
  --line: rgba(11, 29, 51, 0.12);
  --line-on-navy: rgba(239, 244, 251, 0.14);

  /* type */
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "Space Grotesk", -apple-system, system-ui, sans-serif;

  /* spacing and radius */
  --space-2: 8px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --radius-sm: 8px;
  --radius-lg: 20px;
}

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

html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

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

.wrap { max-width: 1160px; margin: 0 auto; padding-inline: var(--space-8); }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--signal-bright); outline-offset: 3px; border-radius: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 22px;
  font-family: var(--sans); font-size: 16px; font-weight: 600;
  text-decoration: none; border-radius: var(--radius-sm);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
/* Navy text on amber passes contrast in both the hero and the light sections */
.btn-signal { background: var(--signal-bright); color: var(--navy); }
.btn-signal:hover { background: #F7BE63; }
.btn-ghost { border: 1px solid var(--line-on-navy); color: var(--on-navy); }
.btn-ghost:hover { border-color: var(--on-navy-2); }

/* ============================================================
   HERO
   ============================================================ */
.hero { background: var(--navy); color: var(--on-navy); padding-bottom: var(--space-12); }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--space-6); padding-bottom: var(--space-6);
}
.nav-logo img { height: 44px; width: auto; }

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--space-12);
  align-items: center;
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

.hero h1 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(34px, 4.2vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 14ch;
}

.lead {
  margin-top: var(--space-6);
  margin-bottom: var(--space-8);
  max-width: 42ch;
  color: var(--on-navy-2);
  font-size: 18px;
}

/* ---------- mesh animation ---------- */
.demo { margin: 0; }

.mesh {
  width: 100%; height: auto;
  border: 1px solid var(--line-on-navy);
  border-radius: var(--radius-lg);
  background: #0E2440;
}

.grid-dot { fill: var(--edge-on-navy); opacity: .18; }

.edge { stroke: var(--edge-on-navy); stroke-width: 2; stroke-linecap: round; opacity: .45; transition: opacity .4s ease, stroke .4s ease; }
.edge.jammed { stroke: var(--on-navy-2); opacity: .7; stroke-dasharray: 2 6; animation: flicker .35s steps(2) infinite; }
.edge.retune { stroke: var(--signal-bright); opacity: .9; }

@keyframes flicker { 50% { opacity: .2; } }

.trail { stroke: var(--signal-bright); stroke-width: 3.5; stroke-linecap: round; transition: opacity .8s ease; }
.trail.back { stroke: var(--on-navy); stroke-width: 2.5; stroke-dasharray: 1 7; }
.trail.fade { opacity: 0; }

/* device types: phone (outlined), Indyr node (square), existing radio (diamond), local server */
.node { fill: var(--on-navy); }
.node.server { fill: var(--on-navy); }
.node.phone { fill: #0E2440; stroke: var(--on-navy); stroke-width: 2.5; }

.halo {
  fill: none; stroke: var(--signal-bright); stroke-width: 2; opacity: 0;
  transform-box: fill-box; transform-origin: center;
}
.halo.holding { animation: hold 1s ease-in-out infinite; }
.halo.delivered { animation: deliver 1.2s ease-out forwards; }
.halo.working { stroke: var(--on-navy); stroke-dasharray: 4 6; opacity: .9; animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes hold {
  0%, 100% { opacity: .25; transform: scale(1); }
  50% { opacity: .8; transform: scale(1.35); }
}
@keyframes deliver {
  0% { opacity: .9; transform: scale(1); }
  100% { opacity: 0; transform: scale(2.6); }
}

/* the packet is a sealed square while encrypted: amber on the way out, light on the way back */
.packet { fill: var(--signal-bright); opacity: 0; }
.packet.back { fill: var(--on-navy); }

/* jammer: marker plus interference rings */
.jammer-mark { fill: none; stroke: var(--on-navy-2); stroke-width: 2; stroke-linejoin: round; opacity: 0; transition: opacity .4s ease; }
.jam-ring {
  fill: none; stroke: var(--on-navy-2); stroke-width: 1.5; stroke-dasharray: 3 5; opacity: 0;
  transform-box: fill-box; transform-origin: center;
}
.jam-on .jammer-mark { opacity: 1; }
.jam-on .jam-ring { animation: jam 1.6s linear infinite; }
.jam-on .jam-ring:nth-child(2) { animation-delay: .53s; }
.jam-on .jam-ring:nth-child(3) { animation-delay: 1.06s; }
@keyframes jam {
  0% { opacity: .7; transform: scale(.25); }
  100% { opacity: 0; transform: scale(1); }
}

/* spectrum strip: one bar per channel */
.slot { fill: var(--edge-on-navy); opacity: .3; transition: y .12s linear, height .12s linear; }
.slot.active { fill: var(--signal-bright); opacity: 1; }
.slot.noise { fill: var(--on-navy-2); opacity: .75; }
.spectrum-label { font-family: var(--mono); font-size: 12px; fill: var(--on-navy-2); }

.legend-shape { fill: var(--on-navy-2); }
.legend-shape.phone { fill: none; stroke: var(--on-navy-2); stroke-width: 1.8; }
.legend-text { font-family: var(--mono); font-size: 12px; fill: var(--on-navy-2); }

.node-label { font-family: var(--mono); font-size: 13px; fill: var(--on-navy-2); }

.demo-caption {
  display: flex; align-items: center; gap: 10px;
  margin-top: var(--space-4);
  min-height: 28px;
  font-size: 15px;
  color: var(--on-navy-2);
}
.caption-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--signal-bright); }
#caption { transition: opacity .3s ease; }
#caption.swap { opacity: 0; }

/* ============================================================
   POINTS
   ============================================================ */
.points {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-8);
  padding-top: 88px;
  padding-bottom: 88px;
}

.point { border-top: 1px solid var(--line); padding-top: var(--space-6); }

.point-icon { width: 48px; height: 32px; margin-bottom: var(--space-6); }
.i-edge { fill: none; stroke: var(--edge); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-down { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2 5; }
.i-node { fill: var(--ink); }
.i-signal { fill: var(--signal); }
.i-halo { fill: none; stroke: var(--signal); stroke-width: 1.5; opacity: .5; }
.i-bar { fill: var(--edge); opacity: .55; }
.i-bar-off { fill: var(--ink-2); opacity: .5; }

.point h2 { font-size: 19px; font-weight: 600; line-height: 1.3; margin-bottom: var(--space-2); }
.point p { color: var(--ink-2); font-size: 16px; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact { padding-bottom: 104px; }
.contact h2 {
  font-family: var(--mono); font-weight: 500;
  font-size: clamp(26px, 3vw, 36px); line-height: 1.15; letter-spacing: -0.02em;
  max-width: 22ch;
}
.contact p { margin-top: var(--space-4); margin-bottom: var(--space-8); max-width: 52ch; color: var(--ink-2); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--navy); color: var(--on-navy-2); }

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-8) var(--space-12);
  padding-top: 64px;
  padding-bottom: var(--space-8);
}

.footer-brand { display: flex; align-items: center; gap: var(--space-4); font-size: 15px; }

.family { display: flex; gap: var(--space-12); }
.family-link {
  display: flex; flex-direction: column; gap: 10px;
  text-decoration: none; opacity: .9; transition: opacity .2s ease;
}
.family-link:hover { opacity: 1; }
.family-role { font-size: 13px; color: var(--on-navy-2); }
.family-link img { height: 32px; width: auto; }

.footer-base {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--space-6);
  border-top: 1px solid var(--line-on-navy);
  font-size: 14px;
}
.linkedin { display: inline-flex; padding: 12px; margin: -12px; }
.linkedin svg { fill: var(--on-navy-2); transition: fill .2s ease; }
.linkedin:hover svg { fill: var(--on-navy); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: var(--space-8); }
  .points { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 64px; padding-bottom: 64px; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .wrap { padding-inline: 20px; }
  .nav-logo img { height: 34px; }
  .node-label { font-size: 22px; }
  .legend-text, .spectrum-label { font-size: 18px; }
  .points { grid-template-columns: 1fr; gap: var(--space-6); }
  .family { gap: var(--space-8); }
  .footer-base { flex-direction: column-reverse; align-items: flex-start; gap: var(--space-4); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .halo.holding, .halo.delivered, .halo.working, .edge.jammed, .jam-on .jam-ring { animation: none; }
  .jam-on .jam-ring { opacity: .5; }
}
