/* RemoteMedia landing page
   Palette: cool paper and navy ink. The four signal colours appear only where they
   mean something: on pipeline nodes and in the colour key. */
:root {
  --paper: #f4f6f8;
  --paper-tint: #e9edf2;
  --ink: #172033;
  --muted: #566176;
  --line: #d3d9e2;

  --audio: #e3a13a;    /* amber, like a VU meter */
  --model: #6e56cf;    /* violet */
  --video: #1d8a9c;    /* teal */
  --network: #d24f6e;  /* rose */

  --focus: #6e56cf;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  /* Type scale: 1.25 ratio from a 17px base */
  --step-0: 1.0625rem;
  --step-1: 1.33rem;
  --step-2: 1.66rem;
  --step-3: clamp(1.9rem, 3.2vw, 2.6rem);
  --step-4: clamp(2.5rem, 6.4vw, 5rem);

  --measure: 64ch;
  --gap: clamp(1.25rem, 3vw, 2.5rem);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display);
  line-height: 1.08;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); font-weight: 750; letter-spacing: -0.025em; max-width: 19ch; }
h2 { font-size: var(--step-3); font-weight: 700; letter-spacing: -0.015em; max-width: 24ch; }
h3 { font-size: var(--step-1); font-weight: 650; letter-spacing: -0.005em; }

p { margin: 0 0 1em; max-width: var(--measure); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

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

code, pre { font-family: var(--mono); }

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

.skip {
  position: absolute; left: 1rem; top: -3rem; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 0.5rem 1rem;
}
.skip:focus { top: 1rem; }

.wrap { width: min(1120px, 100% - 2 * var(--gap)); margin-inline: auto; }
.wrap-wide { width: min(1320px, 100% - 2 * var(--gap)); margin-inline: auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0.7rem 1.4rem;
  background: var(--ink); color: var(--paper);
  border: 2px solid var(--ink); border-radius: 6px;
  font: 700 var(--step-0) / 1 var(--body);
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: #26324b; border-color: #26324b; }
.btn-quiet { background: transparent; color: var(--ink); }
.btn-quiet:hover { background: var(--paper-tint); border-color: var(--ink); }
.btn-small { min-height: 2.5rem; padding: 0.5rem 1rem; font-size: 0.95rem; white-space: nowrap; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 2rem; min-height: 4rem; }
.wordmark {
  font-family: var(--display); font-weight: 800; font-size: 1.3rem;
  letter-spacing: -0.02em; text-decoration: none;
}
.nav { display: flex; gap: 1.5rem; list-style: none; margin: 0 0 0 auto; padding: 0; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); text-decoration: underline; }

/* Hero */
.hero { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3rem, 7vw, 5rem); }
.lede { font-size: var(--step-1); line-height: 1.45; color: var(--muted); max-width: 52ch; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

/* The pipeline figure: the one bold element on the page */
.path-figure { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.path {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 0.75rem;
}
.path li {
  position: relative;
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 0 0 0.25rem;
  min-width: 0;
}
.path .bar {
  display: block; height: 0.5rem; margin-bottom: 0.6rem;
  border-radius: 1px;
  background: var(--kind);
  transform-origin: left center;
  animation: signal 520ms cubic-bezier(.2,.7,.2,1) both;
  animation-delay: calc(var(--i) * 150ms + 250ms);
}
/* Connector: a thin line through the gap between bars */
.path li + li::before {
  content: ""; position: absolute; top: 0.21rem; left: -0.75rem;
  width: 0.75rem; height: 2px; background: var(--line);
}
.path strong { font-family: var(--display); font-weight: 650; font-size: 1.02rem; line-height: 1.15; }
.path .role { color: var(--muted); font-size: 0.9rem; line-height: 1.3; }
.path code {
  font-size: 0.72rem; color: var(--muted);
  overflow-wrap: anywhere; margin-top: 0.15rem;
}

[data-kind="audio"]   { --kind: var(--audio); }
[data-kind="model"]   { --kind: var(--model); }
[data-kind="video"]   { --kind: var(--video); }
[data-kind="network"] { --kind: var(--network); }

@keyframes signal {
  from { transform: scaleX(0); opacity: 0.3; }
  to   { transform: scaleX(1); opacity: 1; }
}

.path-figure figcaption {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem;
  margin-top: 1.75rem; padding-top: 1rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.95rem;
}
.legend { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.45rem; }
.legend span::before {
  content: ""; width: 0.9rem; height: 0.5rem; background: var(--kind); border-radius: 1px;
}

/* Sections */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); border-top: 1px solid var(--line); }
.section-tint { background: var(--paper-tint); }
.intro { color: var(--muted); font-size: 1.12rem; margin-bottom: 2.5rem; }

/* Demo */
.demo { display: grid; grid-template-columns: 5fr 7fr; gap: var(--gap); align-items: start; }
.ticks { margin: 1.25rem 0 0; padding: 0; list-style: none; }
.ticks li { position: relative; padding-left: 1.5rem; margin-bottom: 0.6rem; max-width: 46ch; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 0.7rem; height: 2px; background: var(--ink);
}
.video { margin: 0; }
.video video {
  display: block; width: 100%; height: auto;
  background: var(--ink); border-radius: 6px;
}
.video figcaption, .code figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 0.6rem; }

/* Three-up text blocks (problem, places, offers) */
.trio, .places, .offers {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap);
}
.trio > div, .places > div, .offers > div { border-top: 2px solid var(--ink); padding-top: 1.1rem; }
.trio p, .places p, .offers p { color: var(--muted); }

/* Code */
.code-pair {
  display: grid; grid-template-columns: 7fr 5fr; gap: var(--gap);
  margin-top: clamp(2.5rem, 6vw, 4rem);
}
.code-stack { display: grid; gap: var(--gap); align-content: start; }
.code { margin: 0; }
.code figcaption { margin: 0 0 0.5rem; }
.code pre {
  margin: 0; padding: 1.1rem 1.25rem; overflow-x: auto;
  background: var(--ink); color: #e6ebf2;
  border-radius: 6px; font-size: 0.84rem; line-height: 1.6;
}

/* Measures */
.measures { width: 100%; border-collapse: collapse; font-size: 1.02rem; }
.measures th {
  text-align: left; font-weight: 700; color: var(--muted); font-size: 0.92rem;
  padding: 0 1rem 0.75rem 0; border-bottom: 2px solid var(--ink);
}
.measures td { padding: 1.1rem 1rem 1.1rem 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.measures td:first-child { max-width: 52ch; }
.measures td:last-child { white-space: nowrap; font-family: var(--display); font-size: 1.2rem; }
.measures strong { font-weight: 750; }
.measures .from { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--muted); }

/* Models */
.models { margin: 0; display: grid; gap: 0; }
.models > div {
  display: grid; grid-template-columns: 12rem 1fr; gap: 1.5rem;
  padding: 1rem 0; border-bottom: 1px solid var(--line);
}
.models dt { font-family: var(--display); font-weight: 650; }
.models dd { margin: 0; color: var(--muted); max-width: var(--measure); }

/* Founder */
.founder { display: grid; grid-template-columns: 5fr 7fr; gap: var(--gap); }
.links { display: flex; flex-wrap: wrap; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }

/* Access form */
.access { background: var(--ink); color: var(--paper); border-top: 0; }
.access a { color: var(--paper); }
.access-grid { display: grid; grid-template-columns: 5fr 7fr; gap: var(--gap); }
.access .aside { color: #b8c1d1; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.25rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field-full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: 0.95rem; }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 2px solid transparent; border-radius: 6px;
  padding: 0.7rem 0.8rem; min-height: 3rem;
}
.field textarea { resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: 3px solid #b9a9ff; outline-offset: 2px;
}
.field [aria-invalid="true"] { border-color: #ff8fa6; }
.access .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.access .btn:hover { background: #dfe5ee; border-color: #dfe5ee; }
.access .btn[disabled] { opacity: 0.6; cursor: progress; }
.access :focus-visible { outline-color: #b9a9ff; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.status { margin: 0; color: #dfe5ee; }
.status[data-state="error"] { color: #ffb3c2; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.site-footer { padding-block: 2rem; color: var(--muted); font-size: 0.95rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer-row p { margin: 0; }

/* Medium screens: the pipeline wraps into rows of three */
@media (max-width: 1000px) {
  .path { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 2rem; }
  .path li:nth-child(3n + 1)::before { display: none; }
  .code-pair { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav { display: none; }
  .header-row { justify-content: space-between; }
  .demo, .founder, .access-grid { grid-template-columns: 1fr; }
  .trio, .places, .offers { grid-template-columns: 1fr; }
  .models > div { grid-template-columns: 1fr; gap: 0.25rem; }
  .form { grid-template-columns: 1fr; }
  .measures td:last-child { white-space: normal; }

  /* Small screens: the pipeline becomes a vertical signal path */
  .path { grid-template-columns: 1fr; row-gap: 0; }
  .path li {
    display: grid; grid-template-columns: 0.5rem 1fr; column-gap: 1rem;
    padding: 0 0 1.1rem;
  }
  .path li > :not(.bar) { grid-column: 2; }
  .path .bar {
    grid-row: 1 / span 3; width: 0.5rem; height: auto; margin: 0;
    transform-origin: center top;
    animation-name: signal-down;
  }
  .path li + li::before, .path li:nth-child(3n + 1)::before { display: none; }
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .path .bar { animation: none; }
}
