/* ==========================================================================
   Comparison pages: vs-kamera.html, vs-radar.html, vs-sturzmatte.html,
   vs-armband.html
   --------------------------------------------------------------------------
   Loaded after css/style.css on these four pages only. Reuses tokens and the
   shared classes (.section, .shell, .tile, .prose, .btn, .hero__stage …)
   wherever they already do the job, including the hero itself: it's the
   same .hero__stage + initHeroScene() WebGL field index.html's hero uses,
   nothing comparison-specific about it. This file only adds what the
   comparison layout needs on top of that: the comparison table, the two-up
   cards, the image/text split, and the FAQ grid. Each page used to have a
   second, mid-page 3D scene explaining the comparison pictorially; removed
   as redundant with the table below it (see git history: e3d473e added it,
   this commit removed it).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Comparison table
   -------------------------------------------------------------------------- */

.ctable {
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  overflow: hidden;
  background: var(--surface-raised);
  box-shadow: var(--shadow-card);
}

.ctable__head,
.ctable__row {
  display: grid;
  grid-template-columns: minmax(9.5rem, 1.05fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(0.85rem, 2vw, 1.5rem);
  padding: 1rem clamp(1.15rem, 2.4vw, 1.75rem);
  align-items: start;
}

.ctable__head {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: -0.005em;
  color: var(--ink-faint);
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--line);
}

.ctable__head span:first-child {
  visibility: hidden;
}

.ctable__head--accent {
  color: var(--accent-text);
}

.ctable__row {
  border-top: 1px solid var(--line);
}

.ctable__row:first-of-type {
  border-top: 0;
}

.ctable__label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  padding-top: 0.15rem;
}

.ctable__cell {
  position: relative;
  padding-left: 1.05rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-muted);
}

/* Both sides of the comparison get a marker, not just RadarHero's, so the
   two rows read as two options being weighed rather than one decorated
   answer next to one plain one. */
.ctable__cell::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-faint);
}

.ctable__cell--accent {
  color: var(--ink);
}

.ctable__cell--accent::before {
  background: var(--accent-fill);
}

.ctable__tag {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-faint);
  margin-right: 0.5em;
}

@media (max-width: 720px) {
  /* Below 720px the six-row spec-table reads as a long grey slab with a
     hairline under every row. Each criterion becomes its own card instead,
     with real spacing between them, closer to how the rest of this site
     handles a list of comparable things (team-grid, dcards) than to a
     dense data table. */
  .ctable {
    display: grid;
    gap: 0.75rem;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  .ctable__head {
    display: none;
  }

  .ctable__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.6rem;
    padding: 1.15rem clamp(1rem, 4vw, 1.5rem);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--surface-raised);
    box-shadow: var(--shadow-card);
  }

  .ctable__row:first-of-type {
    border-top: 1px solid var(--line);
  }

  .ctable__label {
    padding-top: 0;
    font-size: 0.8125rem;
    color: var(--ink-faint);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }

  .ctable__tag {
    display: inline;
  }
}

/* --------------------------------------------------------------------------
   Two-up cards (deliberately two, not the usual three)
   -------------------------------------------------------------------------- */

.duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.85rem, 1.4vw, 1.15rem);
}

.dcards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.dcard {
  --stack: 0.3rem;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 1.15rem;
  align-items: start;
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
}

.dcard h3 {
  font-size: 1.0625rem;
  letter-spacing: -0.012em;
}

.dcard p {
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

@media (max-width: 620px) {
  .duo,
  .dcards {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --------------------------------------------------------------------------
   Image / text split
   -------------------------------------------------------------------------- */

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

.split__copy {
  --stack: 1.1rem;
}

@media (max-width: 1024px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --------------------------------------------------------------------------
   FAQ grid
   -------------------------------------------------------------------------- */

.qa {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.qa__item {
  --stack: 0.6rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
}

.qa__item:nth-child(odd) {
  padding-right: clamp(1rem, 3vw, 2.5rem);
  border-right: 1px solid var(--line);
}

.qa__item:nth-child(even) {
  padding-left: clamp(1rem, 3vw, 2.5rem);
}

.qa__item:nth-last-child(-n + 2) {
  border-bottom: 0;
}

@media (max-width: 760px) {
  .qa {
    grid-template-columns: minmax(0, 1fr);
  }

  .qa__item:nth-child(odd) {
    border-right: 0;
    padding-right: 0;
  }

  .qa__item:nth-child(even) {
    padding-left: 0;
  }

  .qa__item:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .qa__item:last-child {
    border-bottom: 0;
  }
}

/* --------------------------------------------------------------------------
   Diagram: the one motivated animated section per page

   Entrances (a shape drawing in, fading in, springing into place) use
   --ease-out, the same token the sitewide [data-reveal] transition in
   style.css already uses: a gentle-spring curve, not a literal spring
   simulation. Exits (the camera fading out) keep --ease-settle, the site's
   default critically-damped curve. Repeated elements (the four boxes, the
   four mesh links and nodes) stagger 80ms apart, the same cadence
   team.html's person cards and index.html's bento tiles already use.
   -------------------------------------------------------------------------- */

.diagram {
  display: grid;
  justify-items: center;
  gap: 1.35rem;
  padding: clamp(1.75rem, 3.5vw, 2.75rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface-raised);
  box-shadow: var(--shadow-card);
}

.diagram__art {
  width: min(280px, 68vw);
  height: auto;
  overflow: visible;
}

.diagram__caption {
  max-width: 48ch;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

/* --- vs-kamera: lens crossed out, replaced by an expanding field --- */

.diagram__camera {
  transform-box: fill-box;
  transform-origin: center;
}

.diagram__body {
  fill: var(--surface-sunken);
  stroke: var(--line-strong);
  stroke-width: 2;
}

.diagram__lens-outer {
  fill: none;
  stroke: var(--ink-muted);
  stroke-width: 3;
}

.diagram__lens-inner {
  fill: none;
  stroke: var(--ink-faint);
  stroke-width: 2;
}

.diagram__lens-core {
  fill: var(--ink-muted);
}

.diagram__flash {
  fill: var(--surface-sunken);
  stroke: var(--line-strong);
  stroke-width: 2;
}

.diagram__slash {
  stroke: var(--danger-text);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 180;
  stroke-dashoffset: 180;
}

.diagram[data-active="true"] .diagram__slash {
  animation: rh-slash-draw 480ms var(--ease-out) 150ms forwards;
}

.diagram[data-active="true"] .diagram__camera {
  animation: rh-camera-out 520ms var(--ease-settle) 680ms forwards;
}

.diagram__waves {
  opacity: 0;
  transform: scale(0.85);
  transform-box: fill-box;
  transform-origin: center;
}

.diagram[data-active="true"] .diagram__waves {
  animation: rh-waves-in 640ms var(--ease-out) 900ms forwards;
}

.diagram__ring {
  fill: none;
  stroke: var(--accent-fill);
}

.diagram__ring--1 {
  stroke-width: 3;
  opacity: 0.85;
}

.diagram__ring--2 {
  stroke-width: 2.4;
  opacity: 0.55;
}

.diagram__ring--3 {
  stroke-width: 2;
  opacity: 0.32;
}

.diagram__ring--4 {
  stroke-width: 1.6;
  opacity: 0.18;
}

.diagram[data-active="true"] .diagram__ring--4 {
  animation: rh-ring-pulse 3400ms ease-in-out 1600ms infinite;
}

.diagram__ring-core {
  fill: var(--accent-fill);
}

@keyframes rh-slash-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes rh-camera-out {
  to {
    opacity: 0;
    transform: scale(0.92);
  }
}

@keyframes rh-waves-in {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rh-ring-pulse {
  0%,
  100% {
    opacity: 0.18;
  }
  50% {
    opacity: 0.5;
  }
}

/* --- vs-radar: isolated single-room units, then one connected mesh --- */

.diagram__split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  width: 100%;
}

.diagram__side {
  display: grid;
  justify-items: center;
  gap: 0.85rem;
}

.diagram__arrow {
  display: grid;
  place-items: center;
  color: var(--ink-faint);
}

.diagram__label {
  max-width: 24ch;
  text-align: center;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.diagram__room {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 2;
}

.diagram__sensor {
  fill: var(--ink-muted);
}

/* The cone is the sensor's actual field of view: it grows in from the
   mount point, same way the vs-kamera wave field arrives. */
.diagram__cone {
  fill: var(--accent-soft-strong);
  stroke: var(--accent-fill);
  stroke-width: 1.5;
  opacity: 0;
  transform: scale(0.85);
  transform-box: fill-box;
  transform-origin: 50% 10%;
}

.diagram[data-active="true"] .diagram__cone {
  animation: rh-waves-in 520ms var(--ease-out) 150ms forwards;
}

/* The two corners the cone never reaches. These land after the cone so
   the contrast (covered vs. not) reads as sequence, not a static fact,
   then keep a slow pulse so the point stays visible without looping fast
   enough to be distracting. */
.diagram__blind {
  fill: var(--danger-soft);
  stroke: var(--danger-text);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
  opacity: 0;
}

.diagram[data-active="true"] .diagram__blind {
  animation:
    rh-blind-in 420ms var(--ease-out) calc(720ms + var(--i, 0) * 120ms) forwards,
    rh-blind-pulse 2600ms ease-in-out calc(1400ms + var(--i, 0) * 120ms) infinite;
}

.diagram__blind-mark {
  fill: none;
  stroke: var(--danger-text);
  stroke-width: 2;
  stroke-dasharray: 3 3;
  opacity: 0;
}

.diagram[data-active="true"] .diagram__blind-mark {
  animation: rh-blind-in 380ms var(--ease-out) 900ms forwards;
}

/* Faint full-room wash behind the mesh: the visual negative of the two
   blind-spot wedges on the left, coverage with no gap. */
.diagram__coverage {
  fill: var(--accent-soft);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.8);
}

.diagram[data-active="true"] .diagram__coverage {
  animation: rh-waves-in 560ms var(--ease-out) 150ms forwards;
}

/* Static room context (bed, nightstand) for the vs-sturzmatte and
   vs-armband diagrams. Deliberately not animated: these are scene-setting,
   not the point being made, so they don't compete with .diagram__cone,
   .diagram__blind or .diagram__coverage for attention. */
.diagram__bed,
.diagram__nightstand {
  fill: var(--surface-sunken);
  stroke: var(--line);
  stroke-width: 1.5;
}

@keyframes rh-blind-in {
  to {
    opacity: 1;
  }
}

@keyframes rh-blind-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.diagram__link {
  stroke: var(--accent-fill);
  stroke-width: 2.5;
  stroke-dasharray: 90;
  stroke-dashoffset: 90;
  opacity: 0.75;
}

.diagram[data-active="true"] .diagram__link {
  animation: rh-link-draw 460ms var(--ease-out) forwards;
  animation-delay: calc(440ms + var(--i, 0) * 80ms);
}

.diagram__node {
  fill: var(--accent-fill);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.4);
}

.diagram[data-active="true"] .diagram__node {
  animation: rh-node-in 380ms var(--ease-out) forwards;
  animation-delay: calc(520ms + var(--i, 0) * 80ms);
}

.diagram__hub {
  fill: var(--accent-fill);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.5);
}

.diagram[data-active="true"] .diagram__hub {
  animation: rh-node-in 380ms var(--ease-out) 340ms forwards;
}

@keyframes rh-unit-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes rh-link-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes rh-node-in {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 640px) {
  .diagram__split {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }

  .diagram__arrow {
    rotate: 90deg;
  }

  .diagram__art {
    width: min(220px, 60vw);
  }
}
