/* Hallmark · macrostructure: Map / Diagram (one signal path organises the page) · pre-emit critique: P4 H4 E4 S4 R5 V4 */
/* Nerve Electronics: shared styles. Every color and font comes from the tokens in :root. */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 600;          /* the only weight the site uses; keeps the files small */
  font-stretch: 100% 112%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 600;
  font-stretch: 100% 112%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;

  /* Brand colors, measured from the logo files */
  --navy: #05112b;
  --blue: #123a91;
  --sky: #8cbeff;

  /* Neutrals, tinted toward the navy */
  --paper: #fbfcfe;
  --paper-2: #f1f4f8;
  --white: #ffffff;
  --ink: var(--navy);
  --ink-2: #4a5570;          /* 7.4:1 on paper */
  --ink-3: #646d83;          /* 5.1:1 on paper */
  --rule: #dde2ea;
  --rule-strong: #b9c1cf;
  --on-navy: #f2f5fa;
  --on-navy-2: #a9b4c8;      /* 9:1 on navy */
  --navy-rule: #26345a;
  --error: #b3261e;          /* 6.4:1 on paper */
  --header-bg: rgb(251 252 254 / 0.84);

  --font-display: "Archivo", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 4px;
  --rail-x: 0.6875rem;       /* x of the nerve/signal line inside its column */
  --wrap: 72rem;
  --gutter: clamp(1rem, 4.5vw, 3rem);
  --header-h: 3.5rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 48rem) {
  :root { --header-h: 4rem; }
}

/* Base */

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

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 600;
  font-stretch: 112%;
  text-wrap: balance;
  overflow-wrap: anywhere;
  min-width: 0;
}

/* Tracking tightens as size grows; leading tightens too (apple-design §15) */
h1 { font-size: clamp(2.125rem, 1.55rem + 2.3vw, 3.25rem); line-height: 1.05; letter-spacing: -0.028em; }
h2 { font-size: clamp(1.625rem, 1.35rem + 1.15vw, 2.25rem); line-height: 1.1; letter-spacing: -0.02em; }
h3 { font-size: 1.1875rem; line-height: 1.25; letter-spacing: -0.006em; }

p { margin: 0; text-wrap: pretty; }

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

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover { text-decoration-thickness: 2px; }

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

.on-navy :focus-visible { outline-color: var(--sky); }

::selection { background: var(--sky); color: var(--navy); }

.wrap {
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 20;
  padding: 0.625rem 1rem;
  border-radius: var(--radius);
  background: var(--navy);
  color: var(--on-navy);
  font: 600 0.9375rem/1 var(--font-display);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus { transform: none; }

/* Buttons: feedback on press, not on release (apple-design §1) */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.25rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--blue);
  color: var(--white);
  font: 600 0.9375rem/1 var(--font-display);
  font-stretch: 108%;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 160ms var(--ease-out), transform 100ms var(--ease-out);
}

.button:hover { background: var(--navy); }
.button:active { transform: scale(0.97); }

.button--small { min-height: 2.25rem; padding: 0 0.875rem; font-size: 0.875rem; }

.text-link {
  color: var(--ink);
  font: 600 0.9375rem/1 var(--font-display);
  font-stretch: 108%;
  text-decoration: none;
  white-space: nowrap;
  padding-block: 0.75rem;
}

.text-link:hover { color: var(--blue); }
.text-link span { display: inline-block; margin-left: 0.25rem; transition: transform 160ms var(--ease-out); }
.text-link:hover span { transform: translateY(2px); }

/* Header: a translucent layer the page scrolls under (apple-design §12) */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}

/* Scroll-edge line: appears only once content is underneath, instead of a permanent divider */
.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: var(--rule);
}

@supports (animation-timeline: scroll()) {
  .site-header::after {
    opacity: 0;
    animation: edge-in linear both;
    animation-timeline: scroll(root);
    animation-range: 0 3rem;
  }
}

@keyframes edge-in { to { opacity: 1; } }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
}

.brand { display: block; padding-block: 0.25rem; }
.brand img { width: auto; height: 1.875rem; }

@media (min-width: 48rem) {
  .brand img { height: 2.125rem; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1.25rem);
}

.lang { display: flex; }

.lang a {
  padding: 0.5rem 0.4375rem;
  color: var(--ink-3);
  font: 600 0.8125rem/1 var(--font-display);
  font-stretch: 112%;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.lang a:hover { color: var(--ink); }

.lang a[aria-current="true"] {
  color: var(--ink);
  text-decoration: underline 2px var(--blue);
  text-underline-offset: 0.45em;
}

@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  .site-header { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .site-header::after { opacity: 1; animation: none; background: var(--ink-3); }
}

/* Hero: text on the left; on the right a nerve that grows in, then fires when you come near its endings */

.hero-grid { display: grid; }

.hero-text { padding-top: clamp(3.25rem, 8vw, 6rem); }

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  color: var(--ink-2);
  font: 600 0.875rem/1.2 var(--font-display);
  font-stretch: 108%;
  letter-spacing: 0.01em;
}

.status::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--blue);
}

.hero h1 { max-width: 13ch; }

.lead {
  max-width: 34rem;
  margin-top: 1.25rem;
  color: var(--ink-2);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  line-height: 1.5;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.75rem;
  margin-top: 2rem;
}

/* The trunk sits on --rail-x so it lines up with the signal path in the story section below */
.nerve {
  position: relative;
  max-width: 26rem;
  margin-top: 2.5rem;
}

.nerve svg {
  width: calc(100% - var(--rail-x));
  height: auto;
  margin-left: var(--rail-x);
  overflow: visible;
}

/* Line weight tapers from trunk to endings: 2px (same as the story rail), 1.5px, 1.25px */
.nerve-branches path,
.nerve-core,
.nerve-twigs path {
  fill: none;
  stroke: var(--navy);
  stroke-width: 1.5px;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.nerve-core { stroke-width: 2px; }
.nerve-twigs path { stroke-width: 1.25px; }

.nerve-pulses path {
  fill: none;
  stroke: var(--sky);
  stroke-width: 4;
  stroke-linecap: round;
}

.nerve-tips circle {
  fill: var(--navy);
  transform-box: fill-box;
  transform-origin: center;
}

/* Beside the highest nerve ending (x 272, y 44 of the 560-unit drawing) */
.nerve-tag {
  position: absolute;
  top: 7.86%;
  left: calc(var(--rail-x) + (100% - var(--rail-x)) * 0.486);
  color: var(--blue);
  font: 600 0.9375rem/1 var(--font-display);
  font-stretch: 112%;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transform: translateY(-50%);
}

@media (min-width: 64rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 6rem;
  }

  .hero-text { align-self: center; padding-block: 4rem 5rem; }
  .nerve { align-self: end; max-width: none; margin-top: 2rem; }
  .nerve-tag { font-size: 1.0625rem; }
}

/* One orchestrated entrance: the nerve grows up from its trunk, then the slogan appears at its tip */
@media (prefers-reduced-motion: no-preference) {
  .nerve svg { animation: nerve-grow 1.5s cubic-bezier(0.33, 1, 0.68, 1) 0.1s both; }
  .nerve-tag { animation: tag-in 0.5s var(--ease-out) 1.2s both; }
}

@keyframes nerve-grow {
  from { clip-path: inset(100% -12px 0 -12px); }
  to { clip-path: inset(-12px -12px 0 -12px); }
}

@keyframes tag-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Story: the signal path. The fill follows your scroll 1:1 and reverses when you scroll back */

.story {
  --pad: clamp(5rem, 11vw, 9rem);
  background: var(--navy);
  color: var(--on-navy);
  padding-block: var(--pad);
}

.story-grid { display: grid; gap: 3.5rem; }

.story h2 { max-width: 17ch; }

.story-intro p {
  max-width: 32rem;
  margin-top: 1.25rem;
  color: var(--on-navy-2);
  font-size: 1.125rem;
}

.story-intro p + p { margin-top: 1rem; }

@media (min-width: 64rem) {
  .story-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 6rem;
    align-items: start;
  }

  .story-intro {
    position: sticky;
    top: calc(var(--header-h) + 3rem);
  }
}

.path {
  --node: calc(2 * var(--rail-x));
  --rail: 2.75rem;
  position: relative;
  display: grid;
  gap: clamp(3rem, 7vw, 5.5rem);
  margin: 0;
  padding: 0 0 0 var(--rail);
  list-style: none;
  view-timeline-name: --signal;
  view-timeline-inset: 0;   /* default "auto" would subtract the header's scroll-padding */
}

.path::before,
.path::after {
  content: "";
  position: absolute;
  top: 0.75rem;
  bottom: 0.375rem;
  left: calc(var(--rail-x) - 1px);
  width: 2px;
}

.path::before { background: var(--navy-rule); }
.path::after { background: var(--sky); transform-origin: 50% 0; }

/* Side by side, the rail starts at the top of the section so it continues the hero's nerve */
@media (min-width: 64rem) {
  .path::before { top: calc(-1 * var(--pad)); }
}

.path-step {
  position: relative;
  view-timeline-name: --step;
  view-timeline-inset: 0;
}

.path-step::before {
  content: "";
  position: absolute;
  top: calc(0.75rem - var(--node) / 2);
  left: calc(-1 * var(--rail));
  width: var(--node);
  height: var(--node);
  border: 0.25rem solid var(--navy);
  border-radius: 50%;
  background: var(--sky);
}

.path-step h3 { color: var(--on-navy); }

.path-step p {
  max-width: 30rem;
  margin-top: 0.5rem;
  color: var(--on-navy-2);
}

.path-close {
  margin-top: clamp(3rem, 7vw, 5rem);
  padding-left: 2.75rem;
  color: var(--sky);
  font: 600 1.25rem/1.3 var(--font-display);
  font-stretch: 112%;
  letter-spacing: -0.01em;
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    /* Tip of the fill sits on a reading line 65% down the viewport */
    .path::after {
      animation: signal-fill linear both;
      animation-timeline: --signal;
      animation-range: cover 35vh cover calc(100% - 65vh);
    }

    .path-step::before {
      animation: node-on linear both;
      animation-timeline: --step;
      animation-range: cover calc(35vh + 0.25rem) cover calc(35vh + 1.25rem);
    }

    .path-step h3 {
      animation: step-on linear both;
      animation-timeline: --step;
      animation-range: cover calc(35vh + 0.25rem) cover calc(35vh + 1.25rem);
    }
  }
}

@keyframes signal-fill {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

@keyframes node-on {
  from { background: var(--navy-rule); }
  to { background: var(--sky); }
}

@keyframes step-on {
  from { color: var(--on-navy-2); }
  to { color: var(--on-navy); }
}

/* Sensors: what we're building, and the two facts that matter most, each with room to breathe */

.sensors { padding-block: clamp(5rem, 10vw, 8rem) clamp(4.5rem, 9vw, 7rem); }

.sensors h2 { max-width: 18ch; }

.sensors-text { max-width: 40rem; }

.sensors-text p {
  margin-top: 1.25rem;
  color: var(--ink-2);
}

.highlights {
  display: grid;
  gap: 2.5rem;
  margin: clamp(3rem, 7vw, 5rem) 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 48rem) {
  .highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5rem; }
}

.highlights li {
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

.highlights h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.highlights h3::before {
  content: "";
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--blue);
}

.highlights p {
  max-width: 26rem;
  margin-top: 0.875rem;
  color: var(--ink-2);
}

.highlights a { white-space: nowrap; }

/* Signup: the form is the call to action */

.signup {
  background: var(--paper-2);
  padding-block: clamp(4rem, 8vw, 6rem);
}

.signup-inner { max-width: 38rem; }

.signup-inner > p { margin-top: 1rem; color: var(--ink-2); }

.signup-form { margin-top: 2rem; }

.field-label {
  display: block;
  margin-bottom: 0.5rem;
  font: 600 0.875rem/1.2 var(--font-display);
  font-stretch: 108%;
}

.field-row { display: flex; gap: 0.5rem; }

.field-row input {
  flex: 1;
  min-width: 0;
  height: 2.75rem;
  padding: 0 0.875rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

.field-row input::placeholder { color: var(--ink-3); }

.field-row input:focus-visible {
  border-color: var(--blue);
  outline: 2px solid var(--blue);
  outline-offset: 0;
}

.field-row input:user-invalid { border-color: var(--error); }

.field-error {
  display: none;
  margin-top: 0.5rem;
  color: var(--error);
  font-size: 0.875rem;
}

.signup-form:has(input[type="email"]:user-invalid) .field-error { display: block; }

.consent {
  display: flex;
  gap: 0.625rem;
  margin-top: 1rem;
  color: var(--ink-2);
  font-size: 0.875rem;
  line-height: 1.45;
}

.consent input {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0.1rem 0 0;
  accent-color: var(--blue);
}

.form-note {
  margin-top: 0.75rem;
  color: var(--ink-3);
  font-size: 0.875rem;
}

.form-status {
  margin-top: 1rem;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.form-status:empty { display: none; }

.signup-form[data-state="error"] .form-status { color: var(--error); }

.signup-form[data-state="done"] > :not(.form-status) { display: none; }

.signup-form[data-state="done"] .form-status {
  margin-top: 0;
  color: var(--ink);
  font: 600 1.25rem/1.4 var(--font-display);
  font-stretch: 108%;
}

.button:disabled { cursor: progress; opacity: 0.7; }

/* Contact */

.contact { padding-block: clamp(4.5rem, 9vw, 7rem) clamp(2rem, 4vw, 3rem); }

.contact-grid { display: grid; gap: 2.5rem; }

@media (min-width: 64rem) {
  .contact-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 6rem;
    align-items: start;
  }
}

.contact-grid > div > p { margin-top: 1rem; max-width: 26rem; color: var(--ink-2); }

.contact-links {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.contact-links li {
  display: grid;
  grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
  padding-block: 1rem;
  border-bottom: 1px solid var(--rule);
}

.contact-label {
  color: var(--ink-3);
  font: 600 0.75rem/1.5 var(--font-display);
  font-stretch: 112%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-links a {
  justify-self: start;
  color: var(--ink);
  font: 600 clamp(1rem, 0.9rem + 0.6vw, 1.25rem)/1.3 var(--font-display);
  text-decoration: none;
  white-space: nowrap;
}

.contact-links a:hover { color: var(--blue); }

@media (max-width: 30rem) {
  .contact-links li { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; }
}

/* Footer: the page closes on the slogan */

.site-footer { padding-block: clamp(2.5rem, 5vw, 3.5rem) 2.5rem; }

.slogan {
  color: var(--blue);
  font: 600 clamp(2rem, 1.5rem + 2.4vw, 3rem)/1 var(--font-display);
  font-stretch: 112%;
  letter-spacing: -0.025em;
}

.colophon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--ink-2);
}

.colophon img { width: 2.75rem; height: 2.75rem; }

.colophon nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }

.colophon nav a { color: var(--ink-2); white-space: nowrap; padding-block: 0.375rem; }

.colophon nav a:hover { color: var(--ink); }

.fine {
  max-width: 46rem;
  margin-top: 1.25rem;
  color: var(--ink-3);
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* Legal pages */

.legal { padding-block: clamp(3.5rem, 8vw, 6rem) clamp(3rem, 7vw, 5rem); }

.legal-inner { max-width: 42rem; }

.legal h1 { font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem); }

.legal .updated {
  margin-top: 0.75rem;
  color: var(--ink-3);
  font-size: 0.9375rem;
}

.legal .summary {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 1.125rem;
}

.legal h2 {
  margin-top: 2.75rem;
  font-size: 1.375rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.legal p,
.legal ul { margin-top: 0.875rem; }

.legal ul { padding-left: 1.25rem; }

.legal li + li { margin-top: 0.5rem; }

.legal li::marker { color: var(--ink-3); }
