/* 03 · TECHNOLOGY (owner, 12 Nov 2026), after the Technology section of Apple's Vision Pro page, in PYRA's type and on the
   shared left edge (edge.css). Replaces the Inside section. Dark-studio films scrubbed by the scroll (tools/web_v2_tech_shots.py,
   tools/web_v2_tech_film.py), one display still, the intelligence-layer loop (tools/web_v2_tech_ai.py), three numbers and the
   three finishes. Media in media/tech/. Built in sketches/tech/ first. */
  section.t { background: #000; color: var(--text-dark); padding: 0 var(--edge); overflow-x: clip; }   /* scoped: the app's today-dot is also i.t */
  section.t b { font-weight: 400; color: var(--text-dark); }

  /* 1 · lockup, centred */
  .t-lock { display: grid; gap: 18px; justify-items: center; text-align: center; max-width: 980px; margin: 0 auto; padding: 160px 0 40px; }
  .t-eye { font: 400 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-dark-soft); }
  .t-head { font-size: clamp(30px, 4.4vw, 52px); font-weight: 300; letter-spacing: -.025em; line-height: 1.05; max-width: 18ch; }
  .t-head span, section.t p span { color: var(--text-dark-soft); }
  .t-intro { font-size: 17px; font-weight: 300; line-height: 1.55; color: var(--text-dark-soft); max-width: 50ch; margin-top: 8px; }

  /* 2 · films, pinned and scrubbed by the scroll (owner, 12 Nov 2026: dark studio, the devices move and turn on) */
  .t-scene { position: relative; height: var(--len, 240svh); margin: 0 calc(-1 * var(--edge)); }
  .t-scene-sticky { position: sticky; top: 0; height: 100svh; display: grid; place-items: center; overflow: hidden; }
  .t-scene canvas { display: block; width: min(100vw, calc(100svh * var(--ar, 1.6))); aspect-ratio: var(--ar, 1.6); height: auto; }
  .t-film-cap { position: absolute; left: 0; right: 0; bottom: 7svh; display: grid; justify-items: center; padding: 0 var(--gutter); }
  .t-film-cap p { grid-area: 1 / 1; text-align: center; font-size: clamp(20px, 2.2vw, 28px); font-weight: 300; letter-spacing: -.02em;
    max-width: 26ch; opacity: 0; transform: translateY(12px); transition: opacity .6s, transform .8s cubic-bezier(.2,.8,.2,1); }
  .t-film-cap p.on { opacity: 1; transform: none; }
  /* once the Hub opens: "Seven layers inside." stays and the parts fade in beneath it (owner, 13 Nov 2026) */
  .t-film-side { grid-area: 1 / 1; display: grid; gap: 12px; justify-items: center; }
  .t-film-side p { grid-area: auto; }
  .t-film-cap .t-film-parts { font-size: 17px; line-height: 1.55; color: var(--text-dark-soft); max-width: 30ch; }
  /* desktop: that pair sits on the right of the opened stack, on the shared right edge */
  @media (min-width: 900px) {
    .t-film-cap { --cw: min(100vw, 177.78svh); top: 0; bottom: 0; padding: 0 var(--edge); pointer-events: none; }
    .t-film-cap > p { align-self: end; margin-bottom: 7svh; }
    .t-film-side { align-self: center; justify-self: end; justify-items: start; text-align: left;
      width: min(340px, calc((100vw - var(--cw)) / 2 + .3 * var(--cw) - var(--edge))); }
    .t-film-side p { text-align: left; transform: translateX(20px); }
    .t-film-side p.on { transform: none; }
    .t-film-side p:first-child { font-size: clamp(24px, 2.5vw, 34px); line-height: 1.1; max-width: none; }
  }

  /* 3 · the features (owner, 13 Nov 2026): centred words above their film or still, pinned together so the words stay
     through the scroll; the visual takes whatever height the words leave (--copy-h, measured in tech.js) */
  .t-feat.t-scene { height: var(--len, 190svh); }
  .t-feat .t-scene-sticky { display: grid; grid-template-rows: auto 1fr; justify-items: center; align-items: start; row-gap: 28px;
    place-content: initial; padding: 96px var(--edge) 24px; }
  .t-copy { display: grid; gap: 16px; justify-items: center; text-align: center; max-width: 640px;
    opacity: var(--co, 1); transform: translateY(calc((1 - var(--co, 1)) * 20px)); }
  .t-copy h3 { font-size: clamp(24px, 2.8vw, 36px); font-weight: 300; letter-spacing: -.025em; line-height: 1.1; }
  .t-copy h3 span { color: var(--text-dark-soft); }
  .t-copy p { font-size: 17px; font-weight: 300; line-height: 1.55; color: var(--text-dark-soft); }
  .t-feat .t-media { --room: calc(100svh - var(--copy-h, 240px) - 184px); display: grid; place-items: center; width: 100%; min-width: 0; }
  .t-feat .t-media canvas, .t-feat .t-media video { display: block; width: min(100%, calc(var(--room) * var(--ar, 1.6))); aspect-ratio: var(--ar, 1.6); height: auto; object-fit: cover; background: #000; }
  /* the display still pushes in slowly while it is pinned; its fade to black is in the image itself */
  .t-still { width: min(100%, calc(var(--room) * 1.64)); margin: 0; overflow: hidden; }
  .t-still img { display: block; width: 100%; height: auto; transform: scale(calc(1 + var(--z, 0) * .08)); transform-origin: 50% 42%;
    will-change: transform; filter: brightness(calc(.25 + var(--r, 1) * .75)); }

  /* the intelligence layer: the loop plays on its own; the words overlay its top-left corner, as Apple sets its
     Spatial Audio copy over that film. The loop's soft oval edge dissolves into the black long before the frame. */
  .t-ai { position: relative; padding: 14svh 0 8svh; }
  .t-loop { width: min(calc(100% + var(--edge) - 140px), 1480px); margin: 90px calc(-1 * var(--edge)) 0 auto; }   /* bigger (owner, 13 Nov): starts 140px in, the words sit over its dark, faded corner */
  .t-loop video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; background: #000;
    -webkit-mask-image: radial-gradient(50% 50% at 50% 50%, #000 0%, #000 42%, rgba(0,0,0,.7) 62%, rgba(0,0,0,.25) 80%, transparent 96%);
            mask-image: radial-gradient(50% 50% at 50% 50%, #000 0%, #000 42%, rgba(0,0,0,.7) 62%, rgba(0,0,0,.25) 80%, transparent 96%); }
  .t-ai .t-copy { position: absolute; top: 14svh; left: 0; z-index: 1; max-width: 420px; justify-items: start; text-align: left; }
  .t-ai .t-copy h3 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.05; }

  /* 4 · three numbers on the shared edge */
  .t-stats { list-style: none; display: grid; gap: 28px; padding: 40px 0 180px; }   /* close under the charging film (owner) */
  .t-stats li { display: grid; gap: 10px; align-content: start; padding-top: 20px; border-top: 1px solid var(--line-dark);
    opacity: var(--r, 1); transform: translateY(calc((1 - var(--r, 1)) * 24px)); }
  .t-stats strong { font-size: clamp(40px, 5vw, 64px); font-weight: 300; letter-spacing: -.04em; line-height: 1; }
  .t-stats span { font-size: 15px; line-height: 1.5; color: var(--text-dark-soft); max-width: 32ch; }
  @media (min-width: 900px) {
    .t-stats { grid-template-columns: repeat(3, 1fr); column-gap: 40px; }
  }

  /* 5 · the close: black lifting to a dark grey under the numbers and the gallery; cards stay true black on it.
     Apple's exact fade (owner, 13 Nov 2026): the section is black until 1400 px from its end, eases to #0d0d0d by
     200 px from the end and holds it. */
  section.t { background: linear-gradient(#000 0, #000 calc(100% - 1400px), #0d0d0d calc(100% - 200px), #0d0d0d); }
  .t-close { margin: 0 calc(-1 * var(--edge)); padding: 0 var(--edge); }

  /* 5b · a closer look: Apple's card gallery */
  .t-stats { padding-bottom: 120px; }
  .t-gallery { display: grid; gap: 36px; padding-bottom: 160px; }
  .t-gal-head { font-size: clamp(30px, 4.4vw, 52px); font-weight: 300; letter-spacing: -.025em; }
  .t-gal-head span { color: var(--text-dark-soft); }
  .tg { --h: 420px; display: grid; gap: 28px; margin: 0 calc(-1 * var(--edge)); }
  .tg-track { list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: max-content; gap: 20px; overflow-x: auto;
    scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 0 var(--edge); scroll-padding: 0 var(--edge); scrollbar-width: none; }
  .tg-track::-webkit-scrollbar { display: none; }
  .tg-item { scroll-snap-align: start; display: grid; gap: 20px; align-content: start; width: calc(var(--h) * .75); }
  .tg-item.wide { width: min(86vw, calc(var(--h) * 1.6)); }
  .tg-card { margin: 0; height: var(--h); border-radius: 28px; overflow: hidden; background: #000; }
  .tg-card img { width: 100%; height: 100%; object-fit: contain; display: block; }   /* whole, never cropped */
  .tg-cap { font-size: 17px; font-weight: 300; line-height: 1.45; color: var(--text-dark-soft); max-width: 44ch; }
  .tg-cap b { font-weight: 400; color: var(--text-dark); }
  .tg-nav { display: flex; justify-content: flex-end; gap: 14px; padding: 0 var(--edge); }
  .tg-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); color: var(--text-dark); }
  .tg-btn:disabled { opacity: .35; }
  .tg-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  /* desktop: the three finishes fit across the screen, side by side, no arrows (owner, 13 Nov 2026) */
  @media (min-width: 900px) {
    .tg-track { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); grid-auto-columns: auto; gap: 24px; overflow: visible; }
    .tg-item { width: auto; }
    .tg-card { height: auto; aspect-ratio: 3 / 4; }
  }
  @media (max-width: 899px) {
    /* phones: every card takes its image's own shape, so nothing is letterboxed or cropped */
    .tg-item, .tg-item.wide { width: 80vw; }
    .tg-card { height: auto; aspect-ratio: 16 / 10; }
    .tg-item.narrow .tg-card { aspect-ratio: 3 / 4; width: 62vw; }
    .tg-item.narrow { width: 62vw; }
    /* films are shorter on a phone: less scrolling through black around a smaller frame */
    .t-scene { height: calc(var(--len, 240svh) * .62); }
    /* a squarer frame where the film's sides are only black (set per film as --ar-m), so the device is bigger */
    .t-scene canvas { aspect-ratio: var(--ar-m, var(--ar, 1.6)); width: min(100vw, calc(100svh * var(--ar-m, var(--ar, 1.6)))); }
    /* phones: the same, smaller */
    .t-feat.t-scene { height: calc(var(--len, 190svh) * .8); }
    .t-feat .t-scene-sticky { row-gap: 16px; padding: 76px var(--gutter) 12px; }
    .t-copy { gap: 12px; }
    .t-copy p { font-size: 16px; }
    .t-feat .t-media { --room: calc(100svh - var(--copy-h, 300px) - 104px); margin: 0 calc(-1 * var(--gutter)); width: 100vw; }
    .t-feat .t-media canvas, .t-feat .t-media video { width: min(100vw, calc(var(--room) * var(--ar-m, var(--ar, 1.6)))); aspect-ratio: var(--ar-m, var(--ar, 1.6)); }
    .t-still { width: min(100vw, calc(var(--room) * 1.64)); }
    .t-ai { padding: 96px 0 40px; display: grid; gap: 24px; }
    .t-ai .t-copy { position: static; order: -1; max-width: none; }
    .t-loop { width: 100vw; margin: 0 calc(-1 * var(--edge)); }
    .t-loop video.is-tall { aspect-ratio: 9 / 16; }   /* the upright phone version of the loop */

    /* phones, less black between one piece and the next (owner, 13 Nov 2026): each pinned frame is only as tall as what
       it shows (tech.js measures it as --sh) and holds in the middle of the screen, so the next piece follows close
       behind; the pinned scroll is as long as before. The opening film's words sit under it instead of over it. */
    .t-scene-sticky { height: auto; top: max(0px, calc((100svh - var(--sh, 100svh)) / 2)); }
    .t-scene { height: calc(var(--sh, 100svh) + var(--len, 240svh) * .62 - 100svh); }
    .t-feat.t-scene { height: calc(var(--sh, 100svh) + var(--len, 190svh) * .8 - 100svh); }
    .t-feat .t-scene-sticky { padding: 36px var(--gutter) 36px; }
    .t-film-cap { position: static; padding-top: 12px; padding-bottom: 24px; }
    .t-lock { padding: 112px 0 8px; }
    .t-ai { padding: 36px 0 24px; gap: 20px; }
    /* the loop's top fifth is black and its oval fades in further down, so it slides up under the last lines of the
       words (owner, 17 Nov 2026: too much space); the words stay on top */
    .t-ai .t-copy { position: relative; top: auto; z-index: 1; }
    .t-ai .t-loop { position: relative; z-index: 0; margin-top: calc(-100vw * 16 / 9 * .26); }
    /* the room's floor ends in a hard diagonal near the foot of the upright loop: on phones the lower part fades into
       the black before it (owner, 17 Nov 2026), on top of the oval, and the charging words come up a little after it */
    .t-loop video.is-tall {
      -webkit-mask-image: radial-gradient(50% 50% at 50% 50%, #000 0%, #000 42%, rgba(0,0,0,.7) 62%, rgba(0,0,0,.25) 80%, transparent 96%),
                          linear-gradient(180deg, #000 0%, #000 50%, rgba(0,0,0,.45) 64%, transparent 80%);
      -webkit-mask-composite: source-in;
              mask-image: radial-gradient(50% 50% at 50% 50%, #000 0%, #000 42%, rgba(0,0,0,.7) 62%, rgba(0,0,0,.25) 80%, transparent 96%),
                          linear-gradient(180deg, #000 0%, #000 50%, rgba(0,0,0,.45) 64%, transparent 80%);
              mask-composite: intersect; }
    .t-ai + .t-feat { margin-top: -64px; }
    .t-stats { padding: 32px 0 72px; }
    .t-gallery { padding-bottom: 96px; }
  }
  .t-copy h3 span { color: var(--text-dark-soft); }

/* Phones, set like Apple's Vision Pro Technology section on a phone (owner, 13 Nov 2026): a 6.25% margin each side
   (Apple's 87.5% column); the opening words centred (40 px headline, 21 px lead); every feature's words left-aligned on
   that margin, a 21 px headline over 17 px text; numbers at 32 px; the finish cards 75% wide with 14 px captions.
   PYRA's own typeface and weights. */
@media (max-width: 899px) {
  section.t { --edge: 6.25vw; }
  section.t .t-lock { gap: 14px; }
  section.t .t-eye { font: 400 19px/1.2 var(--sans); letter-spacing: 0; text-transform: none; color: var(--text-dark); }
  section.t .t-head { font-size: 40px; line-height: 1.1; }
  section.t .t-intro { font-size: 21px; line-height: 1.2; margin-top: 14px; }

  /* the features: words on the left margin, the films and stills still edge to edge */
  section.t .t-feat .t-scene-sticky { justify-items: stretch; padding-left: var(--edge); padding-right: var(--edge); }
  section.t .t-feat .t-media { margin: 0 calc(-1 * var(--edge)); justify-self: center; }
  section.t .t-copy { justify-items: start; text-align: left; max-width: none; gap: 14px; }
  section.t .t-copy h3, section.t .t-ai .t-copy h3 { font-size: 21px; font-weight: 400; line-height: 1.2; letter-spacing: -.015em; }
  section.t .t-copy p { font-size: 17px; line-height: 1.4; }

  /* the opening film's words, under it, on the same margin */
  section.t .t-film-cap { justify-items: start; padding-left: var(--edge); padding-right: var(--edge); }
  section.t .t-film-cap p { text-align: left; font-size: 21px; line-height: 1.2; max-width: none; }
  section.t .t-film-side { justify-items: start; gap: 14px; }
  section.t .t-film-cap .t-film-parts { font-size: 17px; line-height: 1.4; max-width: none; }

  /* numbers, the finishes */
  section.t .t-stats strong { font-size: 32px; }
  section.t .t-stats span { font-size: 14px; line-height: 1.4; }
  section.t .t-gal-head { font-size: 32px; line-height: 1.25; }
  section.t .tg-item, section.t .tg-item.narrow, section.t .tg-item.narrow .tg-card { width: 75vw; }
  section.t .tg-cap { font-size: 14px; line-height: 1.3; }
}
