/* Mesh Gate — product page.
   Committed to a single dark look rather than following the viewer's theme: it
   is the same surface as the DEVA gateway, and the feature videos are all
   screen-recordings of a dark 3D application. A light mode would fight them. */

:root {
  --bg:        #08090b;
  --bg-alt:    #0d0e11;
  --panel:     #121319;
  --line:      #1f212a;
  --line-soft: #171922;

  --ink:       #e9e9ee;
  --ink-mid:   #a4a5b0;
  --ink-dim:   #6f7080;

  --accent:    #3dd6ff;
  --accent-dim:#1c4d5e;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --wrap: 1120px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

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

/* Visible only once focused, so keyboard users can jump the long hero. */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  padding: .75rem 1.25rem;
  background: var(--accent);
  color: #041018;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { left: 0; }

/* ───────────────────────────  HERO  ─────────────────────────── */

.hero {
  position: relative;
  padding: clamp(4rem, 12vw, 8.5rem) 0 clamp(3.5rem, 8vw, 6rem);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

/* A single soft accent wash. Kept in a pseudo-element so it can sit behind the
   text without a stacking-context fight. */
.hero::before {
  content: "";
  position: absolute;
  top: -40%;
  left: 50%;
  width: min(1200px, 140vw);
  aspect-ratio: 1;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(61, 214, 255, .10), transparent 62%);
  pointer-events: none;
}

.hero .wrap { position: relative; }

.eyebrow {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .3em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color .2s ease;
}
.eyebrow:hover, .eyebrow:focus-visible { color: var(--accent); }

.hero__title {
  margin: 0;
  font-size: clamp(2.75rem, 9vw, 6rem);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.02;
}

.hero__lede {
  max-width: 22ch;
  margin: 1.5rem 0 0;
  font-size: clamp(1.25rem, 3.4vw, 2rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--accent);
}

.hero__sub {
  max-width: 62ch;
  margin: 1.75rem 0 0;
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  color: var(--ink-mid);
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: 1px;
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  padding: 0;
  list-style: none;
  background: var(--line-soft);   /* shows through the 1px grid gap as hairlines */
  border: 1px solid var(--line-soft);
}

.hero__stats li {
  padding: 1.5rem 1.4rem;
  background: var(--bg);
}

.stat__num {
  display: block;
  font-family: var(--mono);
  font-size: clamp(1.6rem, 3.6vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--ink);
}

.stat__unit {
  color: var(--accent);
  font-size: .62em;
  margin-left: .05em;
}

.stat__label {
  display: block;
  margin-top: .6rem;
  font-size: .8125rem;
  line-height: 1.4;
  color: var(--ink-dim);
}

.hero__status {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 1.75rem 0 0;
  font-size: .8125rem;
  color: var(--ink-dim);
}

.dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 214, 255, .16);
}

/* ───────────────────────────  SECTIONS  ─────────────────────────── */

.section {
  padding: clamp(3.5rem, 10vw, 7rem) 0;
  border-bottom: 1px solid var(--line);
}

.section--alt { background: var(--bg-alt); }

.kicker {
  margin: 0 0 .9rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.section__title {
  max-width: 24ch;
  margin: 0;
  font-size: clamp(1.75rem, 4.4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.15;
}

.section__lede {
  max-width: 66ch;
  margin: 1.25rem 0 0;
  color: var(--ink-mid);
  font-size: clamp(1rem, 1.5vw, 1.0625rem);
}

code {
  padding: .12em .4em;
  border-radius: 3px;
  background: var(--panel);
  color: var(--accent);
  font-family: var(--mono);
  font-size: .875em;
}

/* ───────────────────────────  DIAGRAM  ─────────────────────────── */

.diagram {
  margin: clamp(2.5rem, 6vw, 3.5rem) 0 0;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 4px;
}

/* The diagram is legible down to about 520px of layout width; below that it is
   scaled by the viewBox rather than reflowed, which keeps the topology intact. */
.diagram svg { display: block; width: 100%; height: auto; }

.d-box { fill: #171923; stroke: var(--line); stroke-width: 1; }
.d-box--wire { fill: #101c22; stroke: var(--accent-dim); }

.d-head {
  fill: var(--ink);
  font-family: var(--sans);
  font-size: 19px;
  font-weight: 600;
  text-anchor: middle;
}

.d-role {
  fill: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-anchor: middle;
}

.d-note {
  fill: var(--ink-dim);
  font-family: var(--sans);
  font-size: 12.5px;
  text-anchor: middle;
}

.d-line { stroke: var(--accent); stroke-width: 1.5; fill: none; }

.d-line--ghost {
  stroke: #5b5b66;
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
}

.d-flow {
  fill: var(--ink-dim);
  font-family: var(--mono);
  font-size: 10.5px;
  text-anchor: middle;
}

.d-ghost {
  fill: #5b5b66;
  font-family: var(--mono);
  font-size: 11px;
  text-anchor: middle;
}

/* ───────────────────────────  PIECES  ─────────────────────────── */

.pieces {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.piece {
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  background: var(--panel);
  border-radius: 0 0 4px 4px;
}

.piece h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.piece__meta {
  margin: .3rem 0 1rem;
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .06em;
}

.piece p:last-child {
  margin: 0;
  color: var(--ink-mid);
  font-size: .9375rem;
}

/* ───────────────────────────  FEATURES  ─────────────────────────── */

.features {
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 8vw, 5.5rem);
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(1.75rem, 5vw, 4rem);
}

/* Alternate sides so the eye zig-zags down the page instead of running in a
   single column of identical rows. */
.feature:nth-child(even) .feature__text { order: 2; }

.feature h3 {
  margin: 0 0 .9rem;
  font-size: clamp(1.375rem, 2.8vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.feature p {
  margin: 0 0 .9rem;
  color: var(--ink-mid);
  font-size: 1rem;
}

.feature strong { color: var(--ink); font-weight: 600; }
.feature em { color: var(--ink); font-style: italic; }

.feature__metric {
  display: inline-flex;
  align-items: baseline;
  gap: .5rem;
  margin: .4rem 0 0 !important;
  padding: .45rem .85rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  font-size: .8125rem !important;
  color: var(--ink-dim) !important;
}

.feature__metric span {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
}

.caveat {
  margin: 1rem 0 0 !important;
  padding-left: .9rem;
  border-left: 2px solid #5b4a2a;
  color: #b39a6a !important;
  font-size: .875rem !important;
}

/* ───────────────────────────  MEDIA / VIDEO  ─────────────────────────── */

.media {
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  overflow: hidden;
}

/* Reserving the aspect ratio up front means dropping a video in later cannot
   shift the layout — the slot is already the right size. */
.media::before {
  content: "";
  display: block;
  aspect-ratio: 16 / 9;
}

/* The placeholder state: a hairline grid, so an empty slot reads as deliberate
   rather than as a missing asset. It is never faded out — the video is opaque
   and simply paints over it, which needs no state toggle and cannot desync.
   The fade lives on the <video> instead. */
.media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(61, 214, 255, .05), rgba(61, 214, 255, .05)),
    repeating-linear-gradient(0deg,   var(--line-soft) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg,  var(--line-soft) 0 1px, transparent 1px 34px);
}

.media video {
  position: absolute;
  inset: 0;
  z-index: 1;                 /* above the placeholder grid, below the caption */
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--panel);   /* opaque, so the grid cannot show through */
  opacity: 0;
  transition: opacity .4s ease;
}

/* Set only once a frame has decoded. Until footage exists the sources 404, the
   video stays transparent, and the placeholder is what you see. */
.media.is-loaded video { opacity: 1; }

.media__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 1.5rem .9rem .7rem;
  background: linear-gradient(transparent, rgba(8, 9, 11, .92));
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .04em;
}

.media.is-loaded .media__cap { color: var(--ink-mid); }

@media (prefers-reduced-motion: reduce) {
  .media video { transition: none; }
}

/* ───────────────────────────  MEASURED TABLE  ─────────────────────────── */

.table-scroll {
  margin-top: clamp(2rem, 5vw, 3rem);
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.measure {
  width: 100%;
  min-width: 620px;      /* below this the three columns collide; scroll instead */
  border-collapse: collapse;
  font-size: .9375rem;
}

.measure thead th {
  padding: .9rem 1.1rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-align: left;
  text-transform: uppercase;
}

.measure tbody th,
.measure tbody td {
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.measure tbody tr:last-child th,
.measure tbody tr:last-child td { border-bottom: 0; }

.measure tbody th {
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

.measure tbody td { color: var(--ink-mid); }

.measure tbody td:last-child {
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: .8125rem;
  white-space: nowrap;
}

.measure b {
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 500;
}

.measure em { color: var(--ink); font-style: italic; }

.measure tbody tr:hover th,
.measure tbody tr:hover td { background: rgba(61, 214, 255, .03); }

.footnote {
  max-width: 70ch;
  margin: 1.5rem 0 0;
  padding-left: 1rem;
  border-left: 2px solid var(--line);
  color: var(--ink-dim);
  font-size: .875rem;
}

/* ───────────────────────────  LIMITS  ─────────────────────────── */

.limits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr));
  gap: 1.5rem;
  margin-top: clamp(2rem, 5vw, 3rem);
}

.limit {
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
}

.limit h3 {
  margin: 0 0 1rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.limit ul { margin: 0; padding: 0; list-style: none; }

.limit li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: .8rem;
  color: var(--ink-mid);
  font-size: .9375rem;
  line-height: 1.55;
}

.limit li:last-child { margin-bottom: 0; }

/* An en dash rather than a bullet: these are exclusions, and a bullet list of
   negatives reads like a feature list at a glance. */
.limit li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--ink-dim);
}

/* ───────────────────────────  NEXT  ─────────────────────────── */

.next {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: clamp(2rem, 5vw, 3.5rem);
  margin-top: clamp(2rem, 5vw, 3rem);
}

.next__head {
  margin: 0 0 1.25rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--line);
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: -.005em;
  color: var(--ink);
}

.next__list { margin: 0; padding: 0; list-style: none; }

.next__list li {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: 1rem;
  color: var(--ink-mid);
  font-size: .9375rem;
  line-height: 1.6;
}

.next__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 6px;
  height: 6px;
  border: 1px solid var(--accent);
  border-radius: 50%;
}

.next__list b { color: var(--ink); font-weight: 600; }

/* ───────────────────────────  LEARNED  ─────────────────────────── */

.learned {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr));
  gap: 1.5rem;
  margin-top: clamp(2rem, 5vw, 3rem);
}

.lesson {
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
}

.lesson__n {
  display: block;
  margin-bottom: 1rem;
  color: var(--accent-dim);
  font-family: var(--mono);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1;
}

.lesson h3 {
  margin: 0 0 .8rem;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.01em;
}

.lesson p {
  margin: 0;
  color: var(--ink-mid);
  font-size: .9375rem;
}

.lesson em { color: var(--ink); font-style: italic; }

/* ───────────────────────────  FOOTER  ─────────────────────────── */

.footer { padding: clamp(2.5rem, 6vw, 4rem) 0; }

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.footer__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.footer__note {
  margin: 0;
  color: var(--ink-dim);
  font-size: .875rem;
}

.footer__back {
  margin-left: auto;
  padding: .6rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink-mid);
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .14em;
  text-decoration: none;
  text-transform: uppercase;
  transition: border-color .2s ease, color .2s ease;
}

.footer__back:hover,
.footer__back:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

/* ───────────────────────────  RESPONSIVE  ─────────────────────────── */

@media (max-width: 860px) {
  /* Single column, and the order override is dropped so every feature reads
     text-then-video rather than flipping every other one. */
  .feature { grid-template-columns: 1fr; }
  .feature:nth-child(even) .feature__text { order: 0; }
}

/* Focus ring for anything not given a bespoke one above. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
