/*
 * Figma technology page.
 *
 * The hero uses the Anatomy isometric figure as a single interactive object
 * (no plate, no border, no caption text). The object keeps its own product
 * colours because it is a brand illustration, not UI chrome; the surrounding
 * palette stays with DESIGN.md. Motion is user-driven only: no autoplay.
 */

/* ---------- Hero grid: a wider canvas for the isometric figure ---------- */

.tech-shell.tech-shell--figma {
  grid-template-areas:
    "crumb crumb crumb crumb crumb crumb crumb crumb crumb crumb crumb crumb"
    "hero  hero  hero  hero  hero  hero  visual visual visual visual visual visual"
    "strip strip strip strip strip strip strip strip strip strip strip strip"
    "toc   toc   toc   body  body  body  body  body  body  ficha ficha ficha"
    ".     .     .     rel   rel   rel   rel   rel   rel   .     .     .";
}

.tech-figma-visual {
  grid-area: visual;
  align-self: start;
  min-width: 0;
  margin-top: var(--hero-top);
}

@media (max-width: 980px) {
  .tech-shell.tech-shell--figma {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "crumb"
      "hero"
      "visual"
      "strip"
      "ficha"
      "toc"
      "body"
      "rel";
  }

  .tech-figma-visual {
    margin-top: clamp(28px, 5vw, 44px);
  }
}

/* ---------- The live object ---------- */

.tech-figma-live {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: grab;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  outline-offset: 6px;
}

.tech-figma-live[data-drag="on"] {
  cursor: grabbing;
}

/*
 * A 2 px outline is enough for this large control. The global yellow halo
 * would read as a plate border around the whole figure, which this page
 * deliberately removes. The ink token keeps the ring visible in both themes.
 */
.tech-figma-live:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  box-shadow: none;
}

/* Pointer interaction must not draw a frame around the figure. */
.tech-figma-live.is-pointer:focus-visible {
  outline: none;
}

.tech-figma-live svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/*
 * Theme tokens for the object. The figure has four tone levels plus the
 * product colours of the Figma mark. The tokens below only control the
 * structural shading so the object reads on both site themes.
 */
.tech-figma-visual {
  --anatomy-paper: #fbfbfa;
  --anatomy-face: #ffffff;
  --anatomy-top: #ffffff;
  --anatomy-shade-0: #dcdcd9;
  --anatomy-shade-1: #e5e5e2;
  --anatomy-shade-2: #ededea;
  --anatomy-shade-3: #f4f4f1;
  --anatomy-lit-top: #ffffff;
  --anatomy-lit-shade: #eeeeeb;
  --anatomy-hi: #26262a;
  --anatomy-mid: #8a8a8f;
  --anatomy-lo: #b4b4b8;
  --anatomy-faint: #d4d4d6;
  --anatomy-lit: #000000;
  --anatomy-halo: #8a8a80;
  --anatomy-halo-opacity: 0;
  --anatomy-dot: #3a3a3e;
  --anatomy-weight: 0.6px;
}

[data-theme="dark"] .tech-figma-visual {
  --anatomy-paper: #121212;
  --anatomy-face: #1b1b1b;
  --anatomy-top: #1c1c1c;
  --anatomy-shade-0: #0f0f0f;
  --anatomy-shade-1: #121212;
  --anatomy-shade-2: #151515;
  --anatomy-shade-3: #181818;
  --anatomy-lit-top: #262626;
  --anatomy-lit-shade: #1d1d1d;
  --anatomy-hi: #d4d4d4;
  --anatomy-mid: #6a6a6a;
  --anatomy-lo: #3e3e3e;
  --anatomy-faint: #2a2a2a;
  --anatomy-lit: #f2f2ee;
  --anatomy-halo: #000000;
  --anatomy-halo-opacity: 0;
  --anatomy-dot: #e6e6e6;
}

.tech-figma-live .iso-svg text {
  vector-effect: non-scaling-stroke;
}

.tech-figma-live .iso-svg path,
.tech-figma-live .iso-svg circle {
  vector-effect: non-scaling-stroke;
}

.tech-figma-live .iso-fill {
  fill: var(--anatomy-paper);
  stroke: none;
}

.tech-figma-live .iso-solid[data-lit] > .iso-fill {
  fill: var(--anatomy-face);
}

.tech-figma-live .iso-shade,
.tech-figma-live .iso-top {
  stroke: none;
}

.tech-figma-live .iso-shade[data-shade="0"] { fill: var(--anatomy-shade-0); }
.tech-figma-live .iso-shade[data-shade="1"] { fill: var(--anatomy-shade-1); }
.tech-figma-live .iso-shade[data-shade="2"] { fill: var(--anatomy-shade-2); }
.tech-figma-live .iso-shade[data-shade="3"] { fill: var(--anatomy-shade-3); }
.tech-figma-live .iso-top { fill: var(--anatomy-top); }

.tech-figma-live .iso-solid[data-lit] > .iso-top { fill: var(--anatomy-lit-top); }
.tech-figma-live .iso-solid[data-lit] > .iso-shade { fill: var(--anatomy-lit-shade); }

.tech-figma-live .iso-solid[data-seamless] > .iso-shade,
.tech-figma-live .iso-solid[data-seamless] > .iso-top {
  stroke-width: 0.4;
  stroke-linejoin: round;
}

.tech-figma-live .iso-solid[data-seamless] > .iso-shade[data-shade="0"] { stroke: var(--anatomy-shade-0); }
.tech-figma-live .iso-solid[data-seamless] > .iso-shade[data-shade="1"] { stroke: var(--anatomy-shade-1); }
.tech-figma-live .iso-solid[data-seamless] > .iso-shade[data-shade="2"] { stroke: var(--anatomy-shade-2); }
.tech-figma-live .iso-solid[data-seamless] > .iso-shade[data-shade="3"] { stroke: var(--anatomy-shade-3); }
.tech-figma-live .iso-solid[data-seamless] > .iso-top { stroke: var(--anatomy-top); }
.tech-figma-live .iso-solid[data-seamless][data-lit] > .iso-top { stroke: var(--anatomy-lit-top); }
.tech-figma-live .iso-solid[data-seamless][data-lit] > .iso-shade { stroke: var(--anatomy-lit-shade); }
.tech-figma-live .iso-solid[data-lit] > .iso-edge { stroke: var(--anatomy-lit); }

/* No soft shadow: the object is flat, like the rest of the report. */
.tech-figma-live .iso-halo {
  display: none;
}

.tech-figma-live .iso-line {
  fill: none;
  stroke: var(--anatomy-lo);
  stroke-width: var(--anatomy-weight);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tech-figma-live .iso-line[data-tone="hi"] { stroke: var(--anatomy-hi); }
.tech-figma-live .iso-line[data-tone="mid"] { stroke: var(--anatomy-mid); }
.tech-figma-live .iso-line[data-tone="lo"] { stroke: var(--anatomy-lo); }
.tech-figma-live .iso-line[data-tone="faint"] { stroke: var(--anatomy-faint); }
.tech-figma-live .iso-line[data-tone="lit"] { stroke: var(--anatomy-lit); }
.tech-figma-live .iso-line[data-dotted] { stroke-dasharray: 0.01 3.5; stroke-width: 1; }
.tech-figma-live .iso-line[data-dashed] { stroke-dasharray: 3 3; }

.tech-figma-live .iso-wire-end {
  fill: var(--anatomy-paper);
  stroke: var(--anatomy-lo);
  stroke-width: var(--anatomy-weight);
}

.tech-figma-live .iso-wire[data-tone="hi"] .iso-wire-end { stroke: var(--anatomy-hi); }
.tech-figma-live .iso-wire[data-tone="mid"] .iso-wire-end { stroke: var(--anatomy-mid); }
.tech-figma-live .iso-wire[data-tone="faint"] .iso-wire-end { stroke: var(--anatomy-faint); }
.tech-figma-live .iso-wire[data-tone="lit"] .iso-wire-end { stroke: var(--anatomy-lit); }

.tech-figma-live .iso-dots circle {
  fill: var(--anatomy-dot);
  stroke: none;
  opacity: 0.32;
}

.tech-figma-live .iso-dots[data-tone="hi"] circle { opacity: 0.85; }
.tech-figma-live .iso-dots[data-tone="mid"] circle { opacity: 0.45; }
.tech-figma-live .iso-dots[data-tone="lo"] circle { opacity: 0.22; }
.tech-figma-live .iso-dots[data-tone="faint"] circle { opacity: 0.12; }

.tech-figma-live .iso-face-text {
  fill: var(--anatomy-mid);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.tech-figma-live .iso-face-text[data-tone="hi"] { fill: var(--anatomy-hi); }
.tech-figma-live .iso-face-text[data-tone="lo"] { fill: var(--anatomy-lo); }
.tech-figma-live .iso-face-text[data-tone="faint"] { fill: var(--anatomy-faint); }

/*
 * The original figure animates flow lines and pulses forever. The report
 * language does not autoplay, so these stay still; the object only moves
 * when the person drags it or uses the keyboard.
 */
.tech-figma-live .iso-line[data-flow],
.tech-figma-live .iso-dots circle[data-pulse] {
  animation: none;
}

/* ---------- Scroll-driven section rules (progressive enhancement) ---------- */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .tech-shell--figma .prose section + section {
      border-top-color: transparent;
    }

    .tech-shell--figma .prose section + section::before {
      content: "";
      position: absolute;
      inset-inline: 0;
      top: 0;
      height: 1px;
      background: var(--rule);
      transform: scaleX(0);
      transform-origin: left center;
      animation: figma-section-rule 1ms linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }
}

.tech-shell--figma .prose section {
  position: relative;
}

@keyframes figma-section-rule {
  to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .tech-figma-live .iso-line[data-flow],
  .tech-figma-live .iso-dots circle[data-pulse] {
    animation: none !important;
  }

  .tech-shell--figma .prose section::before {
    animation: none !important;
    transform: none !important;
  }
}
