:root {
    --bg: #0b0b0c;
    --bg-alt: #141416;
    --card: #1a1a1d;
    --card-border: #2a2a2e;
    --text: #f2f2f2;
    --muted: #a8a8ad;
    --dim: #6e6e73;
    --rainbow: linear-gradient(90deg, #ff2d78 0%, #ff7a18 20%, #ffd60a 40%, #30d158 60%, #0aa5ff 80%, #bf5af2 100%);
  }
  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Noto Sans', sans-serif;
    font-size: 18px;
    line-height: 1.65;
  }
  a { color: #7cc4ff; }
  .container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
  .section { padding: 64px 24px; }
  .section.alt { background: var(--bg-alt); }
  h2 {
    font-size: 32px;
    text-align: center;
    margin: 0 0 8px;
    font-weight: 900;
    letter-spacing: -0.5px;
  }
  p { margin: 0 0 16px; }
  .rainbow-bar {
    height: 4px;
    width: 120px;
    margin: 0 auto 36px;
    background: var(--rainbow);
    border-radius: 2px;
  }
  .rainbow-strip { height: 3px; background: var(--rainbow); border: 0; margin: 0; }
  .caption {
    color: var(--muted);
    font-size: 15px;
    text-align: center;
    margin: 12px auto 0;
    max-width: 860px;
  }
  .eyebrow {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 13px;
    color: var(--dim);
    margin: 0 0 12px;
    font-weight: 700;
  }
  .lead { max-width: 860px; margin: 0 auto; }

  /* nav */
  nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11, 11, 12, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #222;
  }
  nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
  }
  .wordmark { font-weight: 900; font-size: 20px; letter-spacing: -0.5px; text-decoration: none; color: var(--text); }
  .wordmark span {
    background: var(--rainbow);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  nav .links { display: flex; gap: 22px; font-size: 15px; }
  nav .links a { color: var(--muted); text-decoration: none; }
  nav .links a:hover { color: var(--text); }
  @media (max-width: 760px) { nav .links { display: none; } }

  /* hero */
  .hero { padding: 76px 24px 56px; text-align: center; }
  .hero h1 {
    font-size: 76px;
    line-height: 1.0;
    margin: 0 0 10px;
    font-weight: 900;
    letter-spacing: -2px;
  }
  .hero h1 span {
    background: var(--rainbow);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .hero .tagline {
    font-size: 22px;
    color: var(--muted);
    max-width: 760px;
    margin: 0 auto 28px;
  }
  .hero .rainbow-bar { width: 220px; margin-bottom: 32px; }
  .hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    align-items: center;
    text-align: left;
    margin-top: 20px;
  }
  @media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; } .hero h1 { font-size: 54px; } }
  .hero-photo {
    border-radius: 16px;
    overflow: hidden;
    border: none;
    box-shadow: none;
  }
  .hero-photo img { display: block; width: 100%; height: auto; }
  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .hero-stats .stat {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px 18px;
  }
  .hero-stats .stat b { display: block; font-size: 26px; font-weight: 900; }
  .hero-stats .stat span { font-size: 14px; color: var(--muted); }

  /* stat cards */
  .stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
  @media (max-width: 820px) { .stat-grid { grid-template-columns: 1fr 1fr; } }
  @media (max-width: 520px) { .stat-grid { grid-template-columns: 1fr; } }
  .stat-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
  }
  .stat-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--rainbow);
    opacity: 0.9;
  }
  .stat-card b { display: block; font-size: 30px; font-weight: 900; margin-bottom: 4px; }
  .stat-card span { color: var(--muted); font-size: 15px; }

  /* figures on white cards (paper figures preserved exactly) */
  figure { margin: 28px 0; text-align: center; }
  .fig-card {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    display: inline-block;
    max-width: 100%;
  }
  .fig-card img { display: block; max-width: 100%; height: auto; border-radius: 4px; }
  .fig-card.tall img { max-height: 560px; width: auto; margin: 0 auto; }
  figure img.photo {
    border-radius: 16px;
    max-width: 100%;
    height: auto;
    border: none;
    box-shadow: none;
  }
  figure img.wide { width: 100%; height: auto; border-radius: 16px; border: none; }

  /* principle */
  .principle-wrap {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 36px;
    align-items: center;
  }
  @media (max-width: 820px) { .principle-wrap { grid-template-columns: 1fr; } }
  .principle-demo {
    margin-top: 28px;
  }
  .principle-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  @media (max-width: 820px) { .principle-panels { grid-template-columns: 1fr; } }
  .principle-panel h3 {
    font-size: 16px;
    color: var(--text);
    margin: 0 0 10px;
    text-align: center;
  }
  .principle-panel svg { width: 100%; height: auto; display: block; background: #161618; border-radius: 12px; }
  .principle-readout {
    text-align: center;
    color: var(--muted);
    font-size: 15px;
    margin: 14px 0 0;
  }
  .principle-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 24px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--card-border);
  }
  @media (max-width: 820px) { .principle-controls { grid-template-columns: 1fr; } }
  .principle-controls label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
  .principle-controls label b { color: var(--text); font-weight: 600; }
  .principle-controls input[type=range] { width: 100%; accent-color: #ff7a18; }
  .principle-controls .ctl-row { display: flex; align-items: center; gap: 10px; }
  .principle-controls button {
    background: #2a2a2e; color: var(--text); border: 1px solid var(--card-border);
    border-radius: 8px; padding: 8px 16px; font-size: 14px; cursor: pointer;
  }
  .principle-controls button:hover { background: #333338; }

  /* design */
  .design-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    align-items: start;
  }
  @media (max-width: 820px) { .design-grid { grid-template-columns: 1fr; } }
  .spec-list { list-style: none; padding: 0; margin: 0; }
  .spec-list li {
    padding: 11px 0;
    border-bottom: 1px solid #26262a;
    font-size: 16px;
  }
  .spec-list li:last-child { border-bottom: 0; }
  .spec-list b { color: #fff; }


  /* tables */
  table {
    border-collapse: collapse;
    margin: 28px auto;
    font-size: 16px;
    width: 100%;
    max-width: 860px;
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
  }
  table caption { caption-side: top; color: var(--muted); font-size: 15px; margin-bottom: 10px; }
  th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #2a2a2e; }
  th { background: #222; font-weight: 700; }
  tr:last-child td { border-bottom: 0; }
  td.num, th.num { text-align: center; }

  /* bibtex */
  pre {
    background: #101012;
    border: 1px solid #2a2a2e;
    border-radius: 12px;
    padding: 20px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
    color: #d7d7db;
  }

  footer {
    text-align: center;
    color: #777;
    font-size: 15px;
    padding: 32px 24px 40px;
    border-top: 1px solid #222;
    background: #101012;
  }
  footer p { max-width: 900px; margin: 0 auto 12px; }
  footer p:last-child { margin-bottom: 0; }


  /* animation video */
  .wide-video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    background: #000;
  }

  /* scales */
  .scales {
    text-align: center;
    margin: 44px auto 0;
    max-width: 860px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 28px 24px;
  }
  .scales h3 { margin: 0 0 8px; }
  .scales p { color: var(--muted); margin: 0; font-size: 16px; }
  .scale-chips {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
  }
  .scale-chip {
    background: #222;
    border: 1px solid #333;
    border-radius: 999px;
    padding: 10px 20px;
    font-size: 18px;
    font-weight: 700;
  }
  .scale-chip small { font-size: 12px; font-weight: 400; opacity: 0.75; margin-left: 6px; }
  .scale-chip.current { background: linear-gradient(#222, #222) padding-box, var(--rainbow) border-box; border: 2px solid transparent; }

  /* narrow figure for the cropped pcb render */
  figure.narrow { max-width: 760px; margin-left: auto; margin-right: auto; }

  /* rainbow corona: a tight, sharp, fully visible rainbow border around the
     visual only (never its caption text). No blur, no fading on the edges.
     A bright white shine arc rides on the border and sweeps around it as the
     colors flow. Behind the border, a tighter glow corona (blurred, bright,
     constant) halos the visual. Hover zooms the visual 5% and the rainbow
     colors flow clockwise around it at 4s per revolution. The box stays
     fixed, only the gradient angle turns. */
  @property --corona-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
  }
  .corona { position: relative; z-index: 0; transition: scale 1.35s cubic-bezier(0.22,1,0.36,1); }
  .corona::before {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 8px;
    background:
      conic-gradient(from var(--corona-angle), transparent 0deg, rgba(255,255,255,0.95) 25deg, transparent 60deg, transparent 360deg),
      conic-gradient(from var(--corona-angle), #ff2d78, #ff7a18, #ffd60a, #30d158, #0aa5ff, #bf5af2, #ff2d78);
    filter: none;
    opacity: 1;
    z-index: -1;
    pointer-events: none;
    animation: corona-spin 4s linear infinite;
    animation-play-state: paused;
  }
  .corona::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 11px;
    background: conic-gradient(from var(--corona-angle), #ff2d78, #ff7a18, #ffd60a, #30d158, #0aa5ff, #bf5af2, #ff2d78);
    filter: blur(13px);
    opacity: 0.96;
    z-index: -2;
    pointer-events: none;
    animation: corona-spin 4s linear infinite;
    animation-play-state: paused;
  }
  .corona:hover { scale: 1.05; }
  .corona.no-zoom:hover { scale: none; }
  .corona:hover::before { animation-play-state: running; }
  .corona:hover::after { animation-play-state: running; }
  @keyframes corona-spin { to { --corona-angle: 360deg; } }
  @media (prefers-reduced-motion: reduce) {
    .corona::before { animation: none; }
    .corona::after { animation: none; }
    .corona:hover { scale: 1; }
  }

  /* the two mode videos, side by side and smaller */
  .video-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
  }
  @media (max-width: 820px) { .video-duo { grid-template-columns: 1fr; } }

  /* real-time demo: one 9:16 clip at a time, like Shorts / Reels. The feed is its
     own vertical scroll-snap list: scrolling on it moves to the next clip, and
     after the last clip the page carries on scrolling. */
  .shorts { --h: min(80vh, 760px); display: flex; justify-content: center; align-items: center; gap: 22px; margin-top: 28px; }
  .shorts-feed {
    height: var(--h); width: calc((var(--h) - 48px) * 9 / 16 + 48px);
    overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior-y: auto;
    scrollbar-width: none; outline: none;
  }
  .shorts-feed::-webkit-scrollbar { display: none; }
  .short { height: 100%; padding: 24px; box-sizing: border-box; scroll-snap-align: start; scroll-snap-stop: always; }
  .reel { height: 100%; aspect-ratio: 9 / 16; margin: 0 auto; }
  .reel.corona::before { border-radius: 19px; }
  .reel.corona::after { border-radius: 22px; }
  .reel-inner { height: 100%; border-radius: 16px; overflow: hidden; background: #000; display: flex; flex-direction: column; }
  .reel-inner video { display: block; width: 100%; object-fit: cover; background: #000; }
  .reel-top { aspect-ratio: 1 / 1; flex: none; }
  .reel-bot { flex: 1; min-height: 0; height: 100%; }
  .shorts-nav { display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
  .shorts-nav button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid #3a3a3e; background: #1c1c1f; color: #f2f2f2; display: grid; place-items: center; cursor: pointer; }
  .shorts-nav button:hover:not(:disabled) { background: #2a2a2e; }
  .shorts-nav button:disabled { opacity: 0.35; cursor: default; }
  @media (max-width: 600px) { .shorts { --h: min(72vh, 640px); gap: 10px; } .shorts-nav button { width: 40px; height: 40px; } }

  /* sensor design: mode headings, comparison table, LuxTac GEN card */
  .mode-heading { text-align: center; font-size: 24px; margin: 48px 0 20px; }
  .mode-heading.small { font-size: 20px; margin: 36px 0 4px; }
  .table-scroll { overflow-x: auto; }
  table.mode-table td:first-child { color: var(--muted); font-weight: 700; white-space: nowrap; }
  table.mode-table th { text-align: left; }
  table.mode-table td.span { text-align: center; }
  .mode-duo { margin-top: 12px; }
  .scale-chip.more { letter-spacing: 2px; }
  .gen-card {
    max-width: 860px; margin: 24px auto 0; padding: 32px 28px; border-radius: 16px;
    background: linear-gradient(#161618, #161618) padding-box, var(--rainbow) border-box;
    border: 2px solid transparent;
    display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center;
  }
  .gen-eyebrow { margin: 0 0 4px; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); }
  .gen-card h3 { margin: 0 0 8px; font-size: 30px; font-weight: 900; }
  .gen-card p { margin: 0; color: var(--muted); }
  .gen-actions { display: flex; flex-direction: column; gap: 12px; }
  .gen-btn {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 16px 22px; border-radius: 999px; font-size: 18px; font-weight: 800;
    background: #222; border: 1px solid #3a3a3e; color: #f2f2f2; cursor: default;
  }
  .gen-btn small { font-size: 13px; font-weight: 600; opacity: 0.8; }
  .gen-btn.primary { background: linear-gradient(#222, #222) padding-box, var(--rainbow) border-box; border: 2px solid transparent; }
  @media (max-width: 720px) { .gen-card { grid-template-columns: 1fr; text-align: center; } }

  /* scroll reveal, same feel as the PhoTac site */
  .reveal { opacity: 0; transition: opacity 1.4s cubic-bezier(0.22,1,0.36,1), transform 1.4s cubic-bezier(0.22,1,0.36,1); }
  .reveal-up { transform: translateY(24px); }
  .reveal-left { transform: translateX(-48px); }
  .reveal-right { transform: translateX(48px); }
  .reveal.visible { opacity: 1; transform: none; }
  @media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
  }


/* Fabrication animation */
/* fabrication animation */
  .fab-anim { margin: 0 auto 36px; max-width: 880px; }
  .fab-stage { position: relative; height: 460px; border-radius: 16px; background: #161618; border: 1px solid #2a2a2e; overflow: hidden; }
  .fab-stage canvas { display: block; width: 100%; height: 100%; }
  .fab-caption { margin: 14px 0 0; color: var(--muted); font-size: 16px; text-align: center; min-height: 24px; }
  .fab-caption b { color: var(--text); }
  .fab-controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 10px; }
  .fab-controls button { background: #2a2a2e; color: #f2f2f2; border: 1px solid #3a3a3e; border-radius: 999px; padding: 8px 18px; font: inherit; font-size: 15px; cursor: pointer; }
  .fab-controls button:hover { background: #3a3a3e; }
  .fab-dots { display: flex; gap: 8px; }
  .fab-dots button { width: 26px; height: 26px; border-radius: 50%; padding: 0; border: 1px solid #3a3a3e; background: #2a2a2e; color: #a8a8ad; font: inherit; font-size: 13px; line-height: 24px; text-align: center; cursor: pointer; }
  .fab-dots button.active { background: #f2f2f2; color: #161618; border-color: #f2f2f2; }

  /* fabrication */
  .fab-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
  @media (max-width: 820px) { .fab-steps { grid-template-columns: 1fr 1fr; } }
  @media (max-width: 520px) { .fab-steps { grid-template-columns: 1fr; } }
  .fab-step {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 20px;
  }
  .fab-step .num {
    display: inline-block;
    width: 30px; height: 30px;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    font-weight: 900;
    font-size: 15px;
    color: #0b0b0c;
    background: var(--rainbow);
    margin-bottom: 10px;
  }
  .fab-step h4 { margin: 0 0 6px; font-size: 17px; }
  .fab-step p { margin: 0; color: var(--muted); font-size: 15px; }


/* Robot experiments carousel */
/* Carousel: arrows outside, one row visible at a time */
  .exp-carousel { display: flex; align-items: center; gap: 16px; }
  .exp-arrow {
    flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%;
    border: 1px solid var(--card-border); background: var(--card); color: var(--text);
    font-size: 28px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  }
  .exp-arrow:hover { border-color: #555; background: #222; }
  .exp-viewport { flex: 1; min-width: 0; overflow: hidden; }
  .exp-track { display: flex; transition: transform 0.45s ease; }
  .exp-slide { flex: 0 0 100%; min-width: 0; }
  .exp-slide h3 { font-size: 22px; margin: 0 0 16px; text-align: center; }
  .exp-row { display: flex; gap: 10px; align-items: flex-start; }
  .exp-triplet { display: flex; gap: 10px; flex: 1; min-width: 0; }
  .exp-gap { flex: 0 0 28px; }
  .exp-row figure { flex: 1; min-width: 0; margin: 0; }
  .exp-row video { width: 100%; display: block; border-radius: 12px; background: #161618; }
  .exp-row figcaption { text-align: center; color: var(--muted); font-size: 13px; margin-top: 6px; }
  .exp-group-label { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 8px; }
  .exp-counter { text-align: center; color: var(--muted); margin-top: 18px; font-size: 16px; }
  .exp-dots { text-align: center; margin-top: 10px; }
  .exp-dots button {
    width: 10px; height: 10px; border-radius: 50%; border: none; margin: 0 5px;
    background: #444; cursor: pointer; padding: 0;
  }
  .exp-dots button.active { background: #f2f2f2; }

/* legend for the LuxTac inset on with-sensor experiment clips */
.magma-bar {
  display: inline-block; width: 72px; height: 8px; border-radius: 4px; vertical-align: middle;
  background: linear-gradient(90deg, #f7fbff, #c6dbef, #6baed6, #2171b5, #08306b);
}
.magma-ends { font-size: 13px; color: var(--dim); }

/* experiment clips: success row over failure row, 3 per row */
.exp-slide { box-sizing: border-box; padding: 8px 26px 28px; }
.exp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.exp-grid + .exp-grid { margin-top: 18px; }
@media (max-width: 640px) { .exp-grid { grid-template-columns: 1fr; } }
.exp-clip { margin: 0; min-width: 0; }
.exp-clip figcaption { text-align: center; color: var(--muted); font-size: 13px; margin-top: 8px; }
.exp-frame { border-radius: 8px; background: #000; cursor: zoom-in; }
.exp-frame video { width: 100%; display: block; border-radius: 8px; background: #161618; }

/* end card: fade to black, then the outcome */
.exp-end {
  position: absolute; inset: 0; border-radius: 8px; background: #000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.9s ease;
}
.exp-end span {
  font-weight: 700; font-size: clamp(16px, 2.4vw, 28px); letter-spacing: 6px; text-transform: uppercase;
  opacity: 0; transform: scale(0.92); transition: opacity 0.6s ease 0.5s, transform 0.6s ease 0.5s;
}
.exp-clip[data-outcome="success"] .exp-end span { color: #30d158; text-shadow: 0 0 18px rgba(48,209,88,0.55); }
.exp-clip[data-outcome="failure"] .exp-end span { color: #ff3b30; text-shadow: 0 0 18px rgba(255,59,48,0.55); }
.exp-clip.ended .exp-end, .exp-clip.ended .exp-end span { opacity: 1; transform: none; }

/* zoom icon */
.exp-zoom {
  position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25); background: rgba(11,11,12,0.7); color: #f2f2f2;
  display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
  opacity: 0.85; transition: opacity 0.2s, background 0.2s;
}
.exp-zoom svg { width: 16px; height: 16px; }
.exp-frame:hover .exp-zoom, .exp-zoom:focus-visible { opacity: 1; background: rgba(11,11,12,0.9); }

/* enlarged clip */
.exp-lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.88); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 32px 16px;
}
.exp-lightbox[hidden] { display: none; }
.exp-lightbox-inner { width: min(960px, 100%); border-radius: 8px; }
.exp-lightbox-inner:hover { scale: 1; }
.exp-lightbox-inner::before, .exp-lightbox-inner::after { animation-play-state: running; }
.exp-lightbox video { width: 100%; max-height: 82vh; display: block; border-radius: 8px; background: #000; }
.exp-lightbox-close {
  position: absolute; top: 16px; right: 20px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--card-border); background: var(--card); color: var(--text);
  font-size: 26px; line-height: 1; cursor: pointer;
}

/* second section heading inside #robot: same look as the h2 above, with breathing room */
.exp-heading { margin-top: 72px; }
.exp-carousel ~ .caption { margin-top: 20px; }

  /* paper figure on a white card (sensing principle) */
  .principle-fig { max-width: 980px; margin: 32px auto 0; }
  .fig-card.paper { background: #fff; border-radius: 14px; padding: 18px; }
  .char-fig { max-width: 1000px; margin-left: auto; margin-right: auto; }
  .char-fig .fig-card.paper img, .principle-fig .fig-card.paper img { border-radius: 0; }

  /* fabrication mode switch */
  .fab-modes { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 0 0 18px; }
  .fab-modes button { background: #1c1c1f; color: #c8c8cc; border: 2px solid #333338; border-radius: 999px; padding: 10px 20px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
  .fab-modes button:hover { color: #fff; }
  .fab-modes button.active { color: #fff; background: linear-gradient(#1c1c1f, #1c1c1f) padding-box, var(--rainbow) border-box; border-color: transparent; }

  /* sensor design: the two mode columns share grid rows, so the headings, stack
     renders and videos each start on the same line */
  .mode-duo { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; align-items: start; margin-top: 12px; }
  .mode-duo figure { margin: 18px 0 0; }
  .mode-duo .fig-card { display: block; }
  .mode-duo .fig-card img { width: 100%; aspect-ratio: 1600 / 1023; object-fit: contain; background: #121214; border-radius: 10px; }
  .mode-duo .wide-video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
  .mode-duo .caption { min-height: 3em; }
  @media (max-width: 820px) {
    .mode-duo { grid-template-columns: 1fr; }
    .mode-duo .m1.r1 { order: 1; } .mode-duo .m1.r2 { order: 2; } .mode-duo .m1.r3 { order: 3; }
    .mode-duo .m2.r1 { order: 4; } .mode-duo .m2.r2 { order: 5; } .mode-duo .m2.r3 { order: 6; }
  }

  /* interactive sensing principle */
  .pi-controls { display: flex; flex-wrap: wrap; gap: 14px 24px; justify-content: center; align-items: center; margin-bottom: 16px; }
  .pi-modes { display: flex; gap: 8px; }
  .pi-modes button { background: #1c1c1f; color: #c8c8cc; border: 2px solid #333338; border-radius: 999px; padding: 9px 18px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
  .pi-modes button.active { color: #fff; background: linear-gradient(#1c1c1f, #1c1c1f) padding-box, var(--rainbow) border-box; border-color: transparent; }
  .pi-slider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 15px; font-weight: 700; }
  .pi-slider input { width: 240px; accent-color: #f2f2f2; }
  .principle-fig .fig-card.paper { display: block; }
  #piSvg { display: block; width: 100%; height: auto; }
  .pi-readout { display: flex; flex-wrap: wrap; gap: 10px 14px; justify-content: center; align-items: center; margin-top: 16px; color: var(--muted); font-size: 15px; }
  .pi-readout b { color: #f2f2f2; min-width: 84px; }
  .pi-bar { width: 200px; height: 10px; border-radius: 999px; background: #2a2a2e; overflow: hidden; }
  .pi-bar i { display: block; height: 100%; background: #f2f2f2; border-radius: inherit; transition: width .15s; }
  .pi-bar.red i { background: #e8302a; }
  .pi-bar.green i { background: #3aa63a; }

  .pi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
  .pi-panel .pi-slider { justify-content: center; margin-top: 14px; }
  .pi-panel svg { display: block; width: 100%; height: auto; }
  .principle-fig { max-width: 1120px; }
  @media (max-width: 820px) { .pi-grid { grid-template-columns: 1fr; } }
  .pi-panel .pi-readout { display: grid; grid-template-columns: auto 1fr 3.2em; gap: 8px 12px; align-items: center; max-width: 380px; margin: 12px auto 0; }
  .pi-panel .pi-readout span { text-align: left; white-space: nowrap; }
  .pi-panel .pi-readout b { min-width: 0; text-align: right; }
  .pi-panel .pi-bar { width: auto; }
  .pi-dir { grid-column: 1 / -1; text-align: center; font-style: normal; font-weight: 700; color: #f2f2f2; }
  .converter-note { text-align: left; color: inherit; font-size: 16px; margin: 14px 0 0; }

  /* fabrication: Mode 1 and Mode 2 side by side */
  .fab-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
  .fab-duo .fab-anim { max-width: none; margin: 0; }
  .fab-duo .mode-heading.small { margin: 0 0 14px; }
  .fab-duo .fab-stage { height: 400px; }
  .fab-duo .fab-controls { gap: 10px; margin-top: 14px; flex-wrap: wrap; }
  .fab-duo .fab-controls > button { padding: 7px 14px; font-size: 14px; }
  .fab-duo .fab-dots { gap: 6px; }
  .fab-dots button { display: inline-grid; place-items: center; flex: none; line-height: 1; }
  .fab-duo .fab-caption { margin-top: 12px; }
  @media (max-width: 900px) { .fab-duo { grid-template-columns: 1fr; gap: 44px; } }

  /* hero: the render is exactly as tall as the two rows of stat cards */
  .hero-grid { align-items: stretch; }
  .hero-photo { position: relative; background: #fff; min-height: 0; }
  .hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
  .hero-stats { align-content: start; }
  @media (max-width: 820px) { .hero-photo { aspect-ratio: 1235 / 981; } }

  /* dark characterization plots (one image per figure row) */
  .fig-card.dark-plot { background: #141416; border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 22px; }
  .fig-card.dark-plot img { border-radius: 0; width: 100%; }

  /* real-time demo: sideways carousel, three cards in view, five in total.
     Each card: sensor feedback panel on top, hand + sensor panel below,
     separated by a thin black gap. */
  .demo-carousel { display: flex; align-items: center; gap: 16px; margin-top: 28px; }
  .demo-viewport { flex: 1; min-width: 0; overflow: hidden; padding: 34px 22px; margin: -34px -22px; }
  .demo-track { display: flex; gap: 26px; transition: transform 0.5s cubic-bezier(0.22,1,0.36,1); }
  .demo-slide { flex: 0 0 calc((100% - 2 * 26px) / 3); min-width: 0; }
  .demo-card { border-radius: 14px; }
  .demo-inner {
    display: flex; flex-direction: column; gap: 6px; padding: 6px;
    background: #000; border-radius: 14px;
  }
  .demo-card.corona::before { border-radius: 16px; inset: -2px; }
  .demo-card.corona::after { border-radius: 17px; inset: -3px; filter: blur(5px); opacity: 0.3; }
  .demo-card video { display: block; width: 100%; object-fit: cover; background: #000; border-radius: 9px; }
  .demo-sensor { aspect-ratio: 1 / 1; }
  .demo-hand { aspect-ratio: 4 / 3; }
  .demo-dots { margin-top: 18px; }
  @media (max-width: 760px) {
    .demo-slide { flex-basis: 100%; }
    .demo-carousel { gap: 8px; }
    .demo-carousel .exp-arrow { width: 40px; height: 40px; font-size: 24px; }
  }

  /* hero background: an interactive taxel array. The pointer is the indenter:
     taxels under it light up, moving it draws shear arrows (script.js). */
  .hero { position: relative; overflow: hidden; }
  .hero > .container { position: relative; z-index: 1; }
  .hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
  .hero-bg canvas { display: block; width: 100%; height: 100%; }
  .hero-bg::after {
    content: ""; position: absolute; inset: 0;
    background:
      radial-gradient(ellipse 60% 45% at 50% 28%, rgba(11,11,12,0.55) 0%, rgba(11,11,12,0) 100%),
      linear-gradient(to bottom, rgba(11,11,12,0) 70%, var(--bg) 100%);
  }

/* simulation: text left, video right, text sized to the video's height */
.sim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.sim-text p { margin: 0 0 14px; font-size: 17px; line-height: 1.6; }
.sim-text p:last-child { margin-bottom: 0; }
@media (max-width: 820px) { .sim-grid { grid-template-columns: 1fr; gap: 24px; } }
.demo-label { margin: 14px 0 0; text-align: center; font-weight: 700; font-size: 16px; color: var(--text, #fff); }

/* hero: author list and paper / hardware / code buttons */
.hero .authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; max-width: 900px; margin: 22px auto 22px; font-size: 17px; color: #e6e6ea; }
.hero .authors span { white-space: nowrap; }
.hero .authors a { color: inherit; text-decoration: underline; text-decoration-color: rgba(230,230,234,.45); text-underline-offset: 3px; }
.hero .authors a:hover { text-decoration-color: currentColor; }
.link-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 0 0 30px; }
.link-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px; font-size: 15px; font-weight: 600; text-decoration: none; background: #f2f2f4; color: #111; border: 1px solid transparent; }
.link-btn svg { width: 17px; height: 17px; }
a.link-btn:hover { background: #fff; }
.link-btn.soon { background: #2a2a2e; color: var(--muted); border-color: var(--card-border); cursor: default; }

@media (max-width: 520px) {
  .hero { padding-left: 0; padding-right: 0; }
  .hero-stats { gap: 10px; }
  .hero-stats .stat { padding: 14px; }
  .hero-stats .stat b { font-size: 20px; }
  .hero-stats .stat span { font-size: 13px; line-height: 1.4; }
}


/* hero figure: the two cartridges as round lenses with a turning rainbow ring */
.hero-cartridges { margin: 0; align-self: center; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; text-align: center; }
.cart b { display: block; margin-top: 16px; font-size: 17px; font-weight: 700; }
.cart span { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); }
.cart-lens { position: relative; aspect-ratio: 1; border-radius: 50%; padding: 4px; isolation: isolate;
  background: conic-gradient(from var(--corona-angle), #ff2d78, #ff7a18, #ffd60a, #30d158, #0aa5ff, #bf5af2, #ff2d78);
  animation: corona-spin 8s linear infinite; }
.cart-lens::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; z-index: -1;
  background: inherit; filter: blur(16px); opacity: 0.35; }
.cart-lens img { display: block; width: 100%; height: 100%; border-radius: 50%; background: #0b0b0c;
  box-shadow: inset 0 0 0 2px #0b0b0c; transition: transform 0.6s cubic-bezier(0.22,1,0.36,1); }
.cart:hover .cart-lens img { transform: scale(1.03); }
@media (max-width: 820px) { .hero-cartridges { gap: 18px; max-width: 520px; margin: 0 auto; width: 100%; } }
@media (max-width: 420px) { .cart b { font-size: 15px; } .cart span { font-size: 12px; } }
@media (prefers-reduced-motion: reduce) { .cart-lens { animation: none; } }

/* hero: one panel holding both cartridges, beside the stat cards */
.hero-grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; gap: 28px; }
.cart-window { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: center;
  padding: 26px 28px 22px; border-radius: 16px; border: 1px solid var(--card-border);
  background: radial-gradient(120% 90% at 50% 0%, #212127 0%, var(--card) 70%); text-align: center; }
.cart-window .cart b { margin-top: 14px; font-size: 16px; }
.hero-grid-2 .hero-stats { align-self: stretch; grid-auto-rows: 1fr; }
@media (max-width: 820px) {
  .hero-grid-2 { grid-template-columns: 1fr; gap: 18px; }
  .cart-window { gap: 18px; padding: 20px 18px 16px; align-items: start; }
  .cart-window .cart b { font-size: 14px; white-space: nowrap; }
  .hero-grid-2 .hero-stats { grid-auto-rows: auto; }
}

  /* paper page thumbnails under the abstract */
  .paper-pages { margin-top: 36px; }
  .paper-strip { display: grid; grid-template-columns: repeat(11, 1fr); gap: 8px; text-decoration: none; }
  .paper-strip img {
    display: block; width: 100%; height: auto; aspect-ratio: 612 / 792;
    border-radius: 4px; background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .paper-link { text-align: center; margin: 18px 0 0; color: var(--muted); font-size: 15px; }
  @media (max-width: 720px) {
    .paper-strip { grid-template-columns: repeat(11, 72px); gap: 6px; overflow-x: auto; padding-bottom: 6px; }
  }

  /* paper title under the wordmark */
  .hero .paper-title {
    font-size: 26px; line-height: 1.3; font-weight: 600; color: #e6e6ea;
    max-width: 860px; margin: 6px auto 0; letter-spacing: -0.2px;
  }
  @media (max-width: 820px) { .hero .paper-title { font-size: 20px; } }

  /* justified body text; low specificity so centered labels/captions with their own class keep their alignment */
  :where(.section) :where(p, li) { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
  /* captions and centered intro paragraphs: justified, last line centered (single-line labels stay centered) */
  .caption, figcaption, .section p.lead, footer p {
    text-align: justify !important; text-align-last: center; hyphens: auto; -webkit-hyphens: auto;
  }


  /* more vertical breathing room between blocks */
  .section { padding: 96px 24px; }
  h2 { margin-bottom: 12px; }
  .rainbow-bar { margin-bottom: 48px; }
  figure { margin: 44px 0; }
  .mode-heading { margin: 64px 0 28px; }
  .paper-pages { margin-top: 48px; }
  .section table { margin-top: 36px; margin-bottom: 36px; }
  .section .container > * + *:not(.rainbow-bar) { margin-top: 28px; }
  @media (max-width: 720px) { .section { padding: 64px 16px; } }

  /* fabrication: still image when WebGL is unavailable */
  .fab-stage .fab-fallback-img { display: block; width: 100%; height: 100%; object-fit: contain; background: #4a4c53; }
  .fab-stage { position: relative; }
  .fab-stage .fab-fallback-note { position: absolute; left: 0; right: 0; bottom: 8px; margin: 0; padding: 0 16px;
    text-align: center !important; text-align-last: center; font-size: 13px; color: #e6e6ea; text-shadow: 0 1px 3px #000; }

  /* Purdue logo under the link buttons */
  .hero .affiliation-logo { margin: 72px auto 80px; display: flex; justify-content: center; }
  .hero .affiliation-logo img { height: 64px; width: auto; max-width: 90%; object-fit: contain; display: block; }
  @media (max-width: 720px) { .hero .affiliation-logo { margin: 44px auto 48px; } .hero .affiliation-logo img { height: auto; width: 85%; } }

  /* fit everything before the abstract into the first screen */
  .hero { padding: 28px 24px 28px; }
  .hero .eyebrow { margin-bottom: 6px; }
  .hero h1 { font-size: 64px; margin-bottom: 6px; }
  .hero .paper-title { font-size: 22px; margin-top: 2px; }
  .hero .authors { margin: 12px auto 14px; font-size: 16px; gap: 4px 18px; }
  .hero .link-buttons { margin-bottom: 0; }
  .hero .affiliation-logo { margin: 26px auto 22px; }
  .hero .affiliation-logo img { height: 52px; }
  .hero .rainbow-bar { margin-bottom: 20px; }
  .hero .hero-grid { margin-top: 0; }
  /* short screens (laptops): tighten a little more */
  @media (max-height: 820px) and (min-width: 721px) {
    .hero { padding-top: 16px; padding-bottom: 16px; }
    .hero h1 { font-size: 54px; }
    .hero .paper-title { font-size: 19px; }
    .hero .authors { margin: 8px auto 10px; font-size: 15px; }
    .hero .affiliation-logo { margin: 16px auto 14px; }
    .hero .affiliation-logo img { height: 44px; }
    .hero .rainbow-bar { margin-bottom: 14px; }
  }


  /* ---------- board carousel ("One design, many sizes") ---------- */
  @property --bc-a { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
  @keyframes bc-spin { to { --bc-a: 360deg; } }
  .board-carousel { position: relative; margin-top: 36px; padding-bottom: 30px; }
  .bc-track { position: relative; height: 372px; perspective: 1400px; touch-action: pan-y; }
  .board-card {
    position: absolute; left: 50%; top: 0; width: 236px; margin-left: -118px; box-sizing: border-box;
    display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 14px 16px;
    background: var(--card); border: 1px solid var(--card-border); border-radius: 18px; color: var(--text);
    text-align: center; user-select: none;
    transition: transform .6s cubic-bezier(.2,.8,.2,1), opacity .6s ease, filter .6s ease, box-shadow .3s ease;
    box-shadow: 0 14px 40px rgba(0,0,0,.45);
  }
  .board-card[data-offset="0"]  { transform: translateX(0) scale(1); z-index: 3; }
  .board-card[data-offset="-1"] { transform: translateX(-74%) scale(.8) rotateY(24deg); z-index: 2; opacity: .5; filter: saturate(.6) brightness(.8); cursor: pointer; }
  .board-card[data-offset="1"]  { transform: translateX(74%) scale(.8) rotateY(-24deg); z-index: 2; opacity: .5; filter: saturate(.6) brightness(.8); cursor: pointer; }
  .board-card[data-offset="-2"], .board-card[data-offset="2"] { transform: scale(.6); opacity: 0; pointer-events: none; }
  .board-card[data-offset="-1"] .board-actions, .board-card[data-offset="1"] .board-actions { pointer-events: none; }
  .board-card[data-offset="-1"]:hover, .board-card[data-offset="1"]:hover { opacity: .8; filter: none; }

  /* chroma: spinning rainbow rim + soft rainbow glow + a sheen over the pad on hover */
  .board-card::before {
    content: ""; position: absolute; inset: -2px; border-radius: 20px; pointer-events: none; opacity: 0;
    background: conic-gradient(from var(--bc-a), #ff2d78, #ff7a18, #ffd60a, #30d158, #0aa5ff, #bf5af2, #ff2d78);
    animation: bc-spin 4s linear infinite; transition: opacity .35s ease;
  }
  .board-card::before { padding: 2px; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude; }
  .board-card:hover::before { opacity: 1; }
  .board-card:hover { animation: bc-glow 4s linear infinite; }
  @keyframes bc-glow {
    0%   { box-shadow: -14px -6px 34px rgba(255,45,120,.40), 14px 6px 34px rgba(10,165,255,.40), 0 18px 40px rgba(0,0,0,.5); }
    25%  { box-shadow: -14px -6px 34px rgba(255,214,10,.40), 14px 6px 34px rgba(191,90,242,.40), 0 18px 40px rgba(0,0,0,.5); }
    50%  { box-shadow: -14px -6px 34px rgba(48,209,88,.40),  14px 6px 34px rgba(255,45,120,.40), 0 18px 40px rgba(0,0,0,.5); }
    75%  { box-shadow: -14px -6px 34px rgba(10,165,255,.40), 14px 6px 34px rgba(255,122,24,.40), 0 18px 40px rgba(0,0,0,.5); }
    100% { box-shadow: -14px -6px 34px rgba(255,45,120,.40), 14px 6px 34px rgba(10,165,255,.40), 0 18px 40px rgba(0,0,0,.5); }
  }
  .board-card[data-offset="0"]:hover { transform: translateY(-6px) scale(1.02); }

  .board-thumb { position: relative; width: 100%; height: 206px; display: flex; align-items: center; justify-content: center;
    border-radius: 12px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #1d1d22, #121215); }
  .board-thumb img { max-width: 86%; max-height: 86%; width: auto; height: auto; display: block; border-radius: 3px;
    box-shadow: 0 8px 22px rgba(0,0,0,.55); transition: transform .5s ease; }
  .board-thumb::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; mix-blend-mode: color;
    background: linear-gradient(115deg, #ff2d78, #ff7a18, #ffd60a, #30d158, #0aa5ff, #bf5af2, #ff2d78);
    background-size: 300% 100%; transition: opacity .4s ease; animation: bc-sheen 5s linear infinite; }
  @keyframes bc-sheen { to { background-position: 300% 0; } }
  .board-card:hover .board-thumb::after { opacity: .35; }
  .board-card:hover .board-thumb img { transform: scale(1.04); }

  .board-meta { display: flex; flex-direction: column; gap: 2px; }
  .board-name { font-size: 24px; font-weight: 900; letter-spacing: -0.3px; }
  .board-sub { font-size: 14px; color: var(--muted); }
  .board-actions { display: flex; gap: 8px; width: 100%; }
  .board-btn svg { flex-shrink: 0; }
  .board-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer;
    padding: 9px 8px; min-width: 0; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 700; color: var(--text);
    background: #1b1b1f; border: 1px solid #34343a; transition: background .2s ease, border-color .2s ease, transform .15s ease; }
  .board-btn svg { width: 17px; height: 17px; fill: currentColor; }
  .board-btn:hover { background: #26262b; border-color: #4a4a52; }
  .board-btn:active { transform: scale(.97); }
  .board-btn:focus-visible { outline: 2px solid #7cc4ff; outline-offset: 2px; }
  .board-btn.view { background: linear-gradient(#1b1b1f, #1b1b1f) padding-box, var(--rainbow) border-box; border: 1.5px solid transparent; }

  .bc-nav { position: absolute; top: 176px; z-index: 5; width: 46px; height: 46px; margin-top: -23px; border-radius: 50%;
    border: 1px solid #34343a; background: rgba(20,20,24,.85); color: var(--text); font-size: 30px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center; padding-bottom: 4px; transition: background .2s, border-color .2s; }
  .bc-nav:hover { background: #26262b; border-color: #4a4a52; }
  .bc-nav.prev { left: 0; } .bc-nav.next { right: 0; }
  .bc-dots { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 10px; }
  .bc-dots button { width: 9px; height: 9px; padding: 0; border-radius: 999px; border: 0; background: #3a3a40; cursor: pointer;
    transition: width .3s ease, background .3s ease; }
  .bc-dots button[aria-selected="true"] { width: 30px; background: var(--rainbow); }

  .board-detail { margin: 18px 0 0; }
  .board-detail img { display: block; width: 100%; height: auto; filter: drop-shadow(0 8px 20px rgba(0,0,0,.5)); transition: width .5s ease; }

  /* 3D viewer */
  body.modal-open { overflow: hidden; }
  .cad-modal { width: min(1200px, 94vw); height: min(820px, 90vh); max-width: none; max-height: none; padding: 0;
    border: 0; border-radius: 18px; color: var(--text); overflow: hidden; display: none; flex-direction: column;
    background: linear-gradient(#0e0e11, #0e0e11) padding-box, var(--rainbow) border-box; border: 2px solid transparent;
    box-shadow: 0 30px 90px rgba(0,0,0,.7); }
  .cad-modal[open] { display: flex; animation: cad-in .35s cubic-bezier(.2,.8,.2,1); }
  @keyframes cad-in { from { opacity: 0; transform: scale(.96); } }
  .cad-modal::backdrop { background: rgba(4,4,6,.72); backdrop-filter: blur(4px); }
  .cad-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid #222228; }
  .cad-head h3 { margin: 0; font-size: 20px; }
  .cad-hint { margin: 2px 0 0; font-size: 13px; color: var(--muted); text-align: left; }
  .cad-tools { display: flex; gap: 8px; align-items: center; }
  .cad-tools button { font: inherit; font-size: 13px; font-weight: 700; color: var(--text); background: #1b1b1f; border: 1px solid #34343a;
    border-radius: 999px; padding: 7px 14px; cursor: pointer; }
  .cad-tools button:hover { background: #26262b; }
  .cad-tools .cad-close { width: 36px; height: 36px; padding: 0; font-size: 24px; line-height: 1; margin-left: 4px; }
  .cad-stage { position: relative; flex: 1; min-height: 0; }
  .cad-stage canvas { display: block; width: 100% !important; height: 100% !important; cursor: grab; }
  .cad-stage canvas:active { cursor: grabbing; }
  .cad-status { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
    color: var(--muted); font-size: 15px; background: #0e0e11; padding: 24px; text-align: center; }
  .cad-status[hidden] { display: none; }
  .cad-status.fallback img { max-width: 100%; max-height: 70%; object-fit: contain; }
  .cad-note { margin: 0; padding: 10px 18px 12px; font-size: 12.5px; color: var(--muted); border-top: 1px solid #222228; text-align: left; }

  .toast { position: fixed; left: 50%; bottom: 28px; z-index: 50; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
    max-width: min(520px, 90vw); padding: 12px 18px; border-radius: 12px; font-size: 14px; color: var(--text); text-align: center;
    background: linear-gradient(#18181c, #18181c) padding-box, var(--rainbow) border-box; border: 1.5px solid transparent;
    box-shadow: 0 12px 34px rgba(0,0,0,.55); transition: opacity .3s ease, transform .3s ease; }
  .toast.show { opacity: 1; transform: translate(-50%, 0); }

  @media (max-width: 720px) {
    .bc-track { height: 332px; }
    .board-card { width: 208px; margin-left: -104px; padding: 12px 10px 12px; } .board-btn { font-size: 12px; gap: 5px; padding: 8px 6px; }
    .board-thumb { height: 174px; }
    .board-card[data-offset="-1"] { transform: translateX(-62%) scale(.78) rotateY(20deg); }
    .board-card[data-offset="1"]  { transform: translateX(62%) scale(.78) rotateY(-20deg); }
    .bc-nav { top: 136px; width: 38px; height: 38px; margin-top: -19px; font-size: 24px; }
    .board-btn { font-size: 13px; padding: 9px 8px; }
    .cad-head { flex-wrap: wrap; padding: 10px 12px; }
    .cad-tools button { padding: 6px 10px; }
    .cad-modal { width: 96vw; height: 88vh; }
  }
  @media (prefers-reduced-motion: reduce) {
    .board-card, .board-card:hover, .board-card::before, .board-thumb::after { animation: none; transition: none; }
  }

  /* hero: "Get Your Sensing Pad" jumps to the board carousel */
  .link-btn.get-pad { color: #fff; background: linear-gradient(#141417, #141417) padding-box, var(--rainbow) border-box;
    border: 2px solid transparent; padding: 8px 18px; transition: transform .15s ease, box-shadow .25s ease; }
  .link-btn.get-pad:hover { transform: translateY(-2px); box-shadow: -8px 0 22px rgba(255,45,120,.35), 8px 0 22px rgba(10,165,255,.35); }
  #get-pad { scroll-margin-top: 70px; }

  /* affiliations: four logos, equal height, one line */
  .hero .affiliation-logo { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center;
    gap: clamp(14px, 3.2vw, 44px); margin: 26px auto 30px; max-width: 100%; }
  .hero .affiliation-logo img.aff { height: clamp(18px, 3.4vw, 38px); width: auto; max-width: none; min-width: 0; flex: 0 1 auto;
    object-fit: contain; display: block; opacity: .92; }
  .hero .affiliation-logo img.aff.stevens { height: clamp(30px, 5.6vw, 64px); }

/* ---- "One design, many sizes" -> carousel -> LuxTac GEN fit in one screen ---- */
#design .scales { padding: 18px 24px; }
#design .scales h3 { margin: 0 0 6px; }
#design .scales p { font-size: 15px; line-height: 1.55; }
#design .board-carousel { margin-top: 18px; padding-bottom: 24px; }
#design .gen-card { margin-top: 18px; padding: 20px 26px; gap: 20px; }
#design .gen-card h3 { font-size: 26px; margin: 0 0 6px; }
#design .gen-card p { font-size: 15px; line-height: 1.55; }
#design .gen-eyebrow { font-size: 11px; }
#design .gen-actions { gap: 10px; }
#design .gen-btn { padding: 11px 20px; font-size: 16px; }
@media (max-width: 720px) {
  #design .scales { padding: 14px 16px; }
  #design .scales h3 { font-size: 20px; }
  #design .scales p { font-size: 13.5px; line-height: 1.5; text-align: center; }
  #design .board-carousel { margin-top: 12px; padding-bottom: 20px; }
  #design .gen-card { margin-top: 12px; padding: 14px 16px; gap: 10px; }
  #design .gen-card h3 { font-size: 22px; margin: 0 0 4px; }
  #design .gen-card p { font-size: 13.5px; line-height: 1.5; }
  #design .gen-actions { flex-direction: row; gap: 8px; }
  #design .gen-btn { flex: 1; justify-content: center; padding: 9px 10px; font-size: 14px; }
  #design .gen-btn small { display: none; }
}
/* board image height follows the screen height so the three blocks always fit */
#design .board-carousel { --th: clamp(140px, calc(100svh - 622px), 206px); }
#design .board-thumb { height: var(--th); }
#design .bc-track { height: calc(var(--th) + 166px); }
#design .bc-nav { top: calc(var(--th) / 2 + 73px); }
@media (max-width: 720px) {
  #design .board-carousel { --th: clamp(120px, calc(100svh - 684px), 174px); }
  #design .bc-track { height: calc(var(--th) + 158px); }
  #design .bc-nav { top: calc(var(--th) / 2 + 63px); }
}
/* smaller cards (round 3) */
#design .board-card { width: 206px; margin-left: -103px; padding: 13px 12px 13px; gap: 10px; border-radius: 16px; }
#design .board-name { font-size: 20px; }
#design .board-sub { font-size: 12.5px; }
#design .board-btn { font-size: 12px; padding: 7px 6px; gap: 5px; }
#design .board-btn svg { width: 13px; height: 13px; }
#design .board-carousel { --th: clamp(130px, calc(100svh - 590px), 178px); }
#design .bc-track { height: calc(var(--th) + 140px); }
#design .bc-nav { top: calc(var(--th) / 2 + 58px); }
@media (max-width: 720px) {
  #design .board-card { width: 186px; margin-left: -93px; padding: 11px 10px; }
  #design .board-carousel { --th: clamp(110px, calc(100svh - 650px), 152px); }
  #design .bc-track { height: calc(var(--th) + 136px); }
  #design .bc-nav { top: calc(var(--th) / 2 + 52px); }
}
/* fallback when the carousel script has not run (e.g. page opened from file://): show the cards in a row */
#design .bc-track:has(.board-card:not([data-offset])) {
  height: auto; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; perspective: none; }
#design .board-card:not([data-offset]) { position: relative; left: auto; margin-left: 0; transform: none; opacity: 1; }
#design .board-carousel:has(.board-card:not([data-offset])) .bc-nav { display: none; }

/* announcement card: next large board (image only, no view/download) */
.mega-card {
  max-width: 980px; margin: 28px auto 0; border-radius: 18px; overflow: hidden;
  background: linear-gradient(#0e0e10, #0e0e10) padding-box, var(--rainbow) border-box;
  border: 2px solid transparent; position: relative;
}
.mega-media { position: relative; line-height: 0; }
.mega-media img { width: 100%; height: auto; display: block; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.mega-media::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(14,14,16,0) 55%, rgba(14,14,16,0.92) 100%); }
.mega-text { position: absolute; left: 28px; right: 28px; bottom: 22px; }
.mega-text h3 { margin: 0 0 6px; font-size: 34px; font-weight: 900; letter-spacing: -0.5px; }
.mega-text p { margin: 0; color: var(--muted); max-width: 560px; }
@media (max-width: 640px) {
  .mega-text { position: static; padding: 18px 20px 22px; }
  .mega-media::after { display: none; }
  .mega-text h3 { font-size: 26px; }
}
.mega-text .mega-btn { display: inline-flex; margin-top: 14px; width: auto; gap: 14px; }
.mega-text .mega-sub { margin: -2px 0 8px; font-size: 14px; color: var(--muted); }

/* hero: "See Demo" — solid animated rainbow, flickering fire glow; jumps to the real-time demo */
.demo-cta-row { display: flex; justify-content: center; margin: 16px 0 28px; }
.see-demo {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 30px; border-radius: 999px; font-size: 17px; font-weight: 900; letter-spacing: .3px;
  color: #fff; text-decoration: none; text-shadow: 0 1px 2px rgba(0,0,0,.45);
  background: linear-gradient(90deg, #ff2d78, #ff7a18, #ffd60a, #30d158, #0aa5ff, #bf5af2,
                                      #ff2d78, #ff7a18, #ffd60a, #30d158, #0aa5ff, #bf5af2, #ff2d78);
  background-size: 200% 100%; animation: sd-flow 3.2s linear infinite;
  transition: transform .15s ease;
}
.see-demo svg { width: 18px; height: 18px; }
.see-demo:hover { transform: translateY(-2px) scale(1.03); }
.see-demo-fire {
  position: absolute; inset: -6px -10px; z-index: -1; border-radius: 999px; pointer-events: none;
  background: inherit; background-size: 200% 100%; filter: blur(16px); opacity: .85;
  animation: sd-flow 3.2s linear infinite, sd-flicker 1.6s ease-in-out infinite;
}
@keyframes sd-flow { from { background-position: 0% 0; } to { background-position: 100% 0; } }
@keyframes sd-flicker {
  0%, 100% { opacity: .7;  transform: scale(1, 1); }
  20%      { opacity: .95; transform: scale(1.04, 1.12) translateY(-2px); }
  45%      { opacity: .75; transform: scale(.99, 1.02); }
  70%      { opacity: 1;   transform: scale(1.06, 1.18) translateY(-3px); }
}
#robot { scroll-margin-top: 60px; }
@media (prefers-reduced-motion: reduce) { .see-demo, .see-demo-fire { animation: none; } }

/* ordering tutorials + step-by-step guides (below the board carousel) */
.guide-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 32px; --gw: min(1040px, calc(100vw - 32px));
  width: var(--gw); margin: 18px 0 6px calc((100% - var(--gw)) / 2); }
.guide-group { display: flex; align-items: center; gap: 8px; }
.guide-btns { display: flex; gap: 8px; }
.guide-label { font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 2px; white-space: nowrap; }
.guide-row .board-btn { flex: 0 0 auto; padding: 8px 13px; font-size: 13px; text-decoration: none; white-space: nowrap; }
.guide-row .board-btn svg { width: 15px; height: 15px; }
.guide-stage { background: #000; }
.guide-stage video, .guide-stage iframe { display: block; width: 100%; height: 100%; border: 0; }
.guide-stage video { object-fit: contain; }
.guide-stage iframe { background: #fff; }
.guide-open { font-size: 13px; font-weight: 700; color: var(--text); text-decoration: none; background: #1b1b1f; border: 1px solid #34343a;
  border-radius: 999px; padding: 7px 14px; white-space: nowrap; }
.guide-open:hover { background: #26262b; }
.guide-open[hidden] { display: none; }
@media (max-width: 720px) {
  .guide-row { flex-direction: column; align-items: center; }
  .guide-group { flex-direction: column; gap: 7px; }
  .guide-btns { flex-wrap: wrap; justify-content: center; }
  .guide-label { margin-right: 0; }
}

/* 32x32 card slogan, stacked top-left over the empty part of the render */
.mega-slogan {
  position: absolute; left: 30px; top: 26px; margin: 0; pointer-events: none;
  display: flex; flex-direction: column; gap: 2px;
  font-size: clamp(26px, 5.4vw, 58px); font-weight: 900; line-height: 0.98;
  letter-spacing: 1px; text-transform: uppercase;
}
.mega-slogan span {
  background: var(--rainbow); background-size: 100% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.6));
}
@media (max-width: 640px) { .mega-slogan { left: 18px; top: 16px; } }
