/* ==========================================================================
   Technical Information — scroll-driven optical technology scenes
   Each .ts-scene is a normal section with a sticky stage; GSAP (js/tech-scenes.js)
   scrubs that scene's timeline while it is on screen, so scrolling up reverses it.
   Supplied studio images sit on pure white and use multiply blending, so separate
   layers (frame, lenses, cross-sections) composite like the original photographs.
   ========================================================================== */
.ts {
  --ts-top: 66px;                 /* sticky header height, set by JS */
  --ts-h: calc(100vh - var(--ts-top));
  --ts-blue: #1a6fd1;
  background: #ffffff;
}
@supports (height: 100svh) { .ts { --ts-h: calc(100svh - var(--ts-top)); } }

.ts-scene { position: relative; height: 190vh; background: #ffffff; }
.ts-a { height: 230vh; }

.ts-sticky {
  position: sticky;
  top: var(--ts-top);
  height: var(--ts-h);
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px;
  align-items: center;
  overflow: hidden;
}
.ts-flip .ts-sticky { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.ts-flip .ts-copy { order: 2; }

.ts-copy { max-width: 480px; }
.ts-copy p { color: var(--color-ink-muted); font-size: 0.98rem; line-height: 1.7; margin: 0 0 14px; }
.ts-eyebrow {
  color: var(--color-accent) !important;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.74rem !important;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin: 0 0 12px !important;
}
.ts-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.5px;
  color: var(--color-header);
  margin: 0 0 18px;
}
.ts-a .ts-title { font-size: clamp(2.2rem, 4.6vw, 3.6rem); }
.ts-lead { font-size: 1.04rem !important; }
.ts-small { font-size: 0.8rem !important; color: #8a93a2 !important; }
.ts-cue { font-size: 0.7rem !important; letter-spacing: 2.4px; text-transform: uppercase; color: var(--ts-blue) !important; margin-top: 22px !important; }

.ts-stats { display: grid; grid-template-columns: repeat(4, auto); gap: 22px; margin-top: 22px; }
.ts-stats .num { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--color-header); }
.ts-stats .lbl { display: block; font-size: 0.72rem; color: var(--color-ink-muted); letter-spacing: 0.5px; }

.ts-stage { position: relative; height: 100%; display: flex; align-items: center; justify-content: center; min-width: 0; }
.ts-mul { mix-blend-mode: multiply; display: block; user-select: none; -webkit-user-drag: none; }

/* ---- A: floating eyewear ---- */
.ts-a-cam { width: 100%; will-change: transform; transform-origin: 81.6% 55%; }
.ts-a-canvas { position: relative; width: 100%; aspect-ratio: 1672 / 941; }
.ts-a-frame { position: absolute; inset: 0; width: 100%; height: auto; }
.ts-a-lens { position: absolute; height: auto; will-change: transform, opacity; }
.ts-a-lens-l { left: 36.84%; top: 48.67%; width: 27.15%; }
.ts-a-lens-r { left: 69.68%; top: 35.71%; width: 23.98%; }

/* ---- B: spherical vs aspheric ---- */
.ts-b-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; width: 100%; align-items: end; }
.ts-b-col { margin: 0; text-align: center; }
.ts-b-name { font-family: var(--font-display); font-weight: 600; font-size: 0.82rem; letter-spacing: 2.4px; text-transform: uppercase; color: var(--color-header); margin-bottom: 10px; }
.ts-b-art { position: relative; width: 100%; perspective: 900px; }
.ts-b-sph .ts-b-art { aspect-ratio: 610 / 850; }
.ts-b-asp .ts-b-art { aspect-ratio: 590 / 850; }
.ts-b-art img { position: absolute; height: auto; will-change: transform, opacity; }
.ts-b-lens { left: 0; top: 0; }
.ts-b-sph .ts-b-lens { width: 91.8%; }
.ts-b-asp .ts-b-lens { width: 96.6%; }
.ts-b-profile { top: 55.3%; }
.ts-b-sph .ts-b-profile { left: 24.6%; width: 19.7%; }
.ts-b-asp .ts-b-profile { left: 20.3%; width: 20.3%; }
.ts-b-zoom { top: 52.9%; transform-origin: 62% 47%; }
.ts-b-sph .ts-b-zoom { left: 42.6%; width: 57.4%; }
.ts-b-asp .ts-b-zoom { left: 39%; width: 61%; }
.ts-b-note { font-size: 0.78rem; color: var(--color-ink-muted); margin: 8px 0 0; }

/* ---- C: measurements ---- */
.ts-c .ts-stage { flex-direction: column; }
.ts-c-svg { width: 100%; height: auto; overflow: visible; }
.ts-c-svg .ts-dim { stroke: var(--ts-blue); stroke-width: 3; fill: none; }
.ts-c-svg .ts-ext { stroke: var(--ts-blue); stroke-width: 1.6; stroke-dasharray: 6 6; opacity: 0.7; }
.ts-c-svg .ts-ed-circle { fill: none; stroke: var(--ts-blue); stroke-width: 2; stroke-dasharray: 8 7; }
.ts-c-svg .ts-dot { fill: var(--ts-blue); }
.ts-c-svg .ts-lbl { font-family: var(--font-display); font-weight: 700; font-size: 34px; fill: var(--ts-blue); text-anchor: middle; }
.ts-fig-note { font-size: 0.74rem; color: #8a93a2; margin: 6px 0 0; text-align: center; }
.ts-defs { list-style: none; margin: 0 0 14px; padding: 0; }
.ts-defs li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--color-border); font-size: 0.9rem; color: var(--color-ink-muted); transition: color .3s ease, opacity .3s ease; }
.ts-defs li b { font-family: var(--font-display); color: var(--ts-blue); }
.ts-defs li.is-on { color: var(--color-ink); }

/* ---- D: index & thickness ---- */
.ts-d .ts-stage { overflow: hidden; }
.ts-d-cam { width: 100%; will-change: transform; transform-origin: 50% 0%; }
.ts-d-canvas { position: relative; width: 100%; aspect-ratio: 1536 / 912; margin-top: 34px; }
.ts-d-canvas > img { width: 100%; height: auto; }
.ts-d-labels span { position: absolute; top: -30px; transform: translateX(-50%); font-family: var(--font-display); font-weight: 600; font-size: 0.92rem; color: var(--color-header); white-space: nowrap; }
.ts-d-labels span:nth-child(1) { left: 14%; }
.ts-d-labels span:nth-child(2) { left: 38.1%; }
.ts-d-labels span:nth-child(3) { left: 62.2%; }
.ts-d-labels span:nth-child(4) { left: 85.9%; }
.ts-d-dim { position: absolute; inset: -34px 0 0 0; display: grid; grid-template-columns: repeat(4, 1fr); pointer-events: none; }
.ts-d-dim i { background: #ffffff; opacity: 0; transition: opacity .35s ease; }
.ts-d.has-pick .ts-d-dim i { opacity: 0.72; }
.ts-d.has-pick .ts-d-dim i.is-pick { opacity: 0; }
.ts-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 12px; }
.ts-chips button {
  border: 1px solid var(--color-border); background: #ffffff; color: var(--color-header);
  border-radius: 999px; padding: 7px 16px; font-family: var(--font-display); font-weight: 600; font-size: 0.85rem; cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.ts-chips button:hover { border-color: var(--ts-blue); }
.ts-chips button[aria-pressed="true"] { background: var(--ts-blue); border-color: var(--ts-blue); color: #ffffff; }

/* ---- E: coatings ---- */
.ts-e-lens { position: relative; width: 100%; aspect-ratio: 1536 / 1024; will-change: transform; }
.ts-e-lens > img { position: absolute; inset: 0; width: 100%; height: auto; }
.ts-e-sheen {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.ts-e-sheen i {
  position: absolute; top: -20%; bottom: -20%; left: 0; width: 38%;
  background: linear-gradient(100deg, rgba(255,255,255,0) 0%, rgba(214,226,255,0.0) 20%, rgba(170,150,255,0.18) 42%, rgba(255,255,255,0.65) 50%, rgba(140,215,235,0.18) 58%, rgba(255,255,255,0) 80%);
  transform: translateX(-120%) skewX(-12deg);
  mix-blend-mode: normal;
}
.ts-coats { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.ts-coats a { display: block; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 10px; transition: border-color .2s ease, box-shadow .2s ease; }
.ts-coats a:hover { border-color: var(--ts-blue); box-shadow: 0 6px 16px rgba(10,26,61,0.08); }
.ts-coats b { display: block; font-family: var(--font-display); font-size: 0.86rem; color: var(--color-header); }
.ts-coats span { display: block; font-size: 0.76rem; color: var(--color-ink-muted); }

/* ---- F: inspection ---- */
.ts-f-card { width: 100%; aspect-ratio: 1536 / 1024; border-radius: 22px; overflow: hidden; box-shadow: 0 24px 60px rgba(10,26,61,0.16); }
.ts-f-cam { position: relative; width: 100%; height: 100%; transform-origin: 51.4% 56.6%; will-change: transform; }
.ts-f-cam img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ts-f-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ts-f-ring { fill: none; stroke: #ffffff; stroke-width: 2; stroke-dasharray: 10 8; opacity: 0.9; }
.ts-f-ring2 { stroke: #9fd4ff; stroke-dasharray: 2 6; }
.ts-f-x { stroke: rgba(255,255,255,0.8); stroke-width: 1.4; }
.ts-f-tags text { fill: #ffffff; font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: 3px; paint-order: stroke; stroke: rgba(6,16,40,0.45); stroke-width: 4px; }
.ts-checks { list-style: none; margin: 0; padding: 0; }
.ts-checks li { position: relative; padding: 9px 0 9px 22px; border-bottom: 1px solid var(--color-border); font-size: 0.92rem; color: var(--color-ink); }
.ts-checks li::before { content: ''; position: absolute; left: 0; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; border: 2px solid var(--ts-blue); }

.ts-handoff { padding: 64px 0 0; text-align: left; }
.ts-handoff h2 { font-family: var(--font-display); color: var(--color-header); margin: 0; }

/* ---- Tablet ---- */
@media (max-width: 1024px) {
  .ts-sticky, .ts-flip .ts-sticky { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: 18px; padding: 18px 28px 26px; align-items: stretch; }
  .ts-flip .ts-copy { order: 2; }
  .ts-copy { max-width: none; order: 2; }
  .ts-stage { order: 1; min-height: 0; }
  .ts-copy p { font-size: 0.92rem; margin-bottom: 10px; }
  .ts-b-grid { max-width: 640px; margin: 0 auto; }
  .ts-d-canvas { max-width: 760px; margin-left: auto; margin-right: auto; }
  .ts-stage > * { max-height: 100%; }
  .ts-e-lens, .ts-f-card { max-width: 720px; margin: 0 auto; }
}

/* ---- Mobile: recomposed — visual on top, short copy below, secondary detail trimmed ---- */
@media (max-width: 700px) {
  .ts-scene { height: 175vh; }
  .ts-a { height: 200vh; }
  .ts-sticky, .ts-flip .ts-sticky { padding: 12px 18px 18px; gap: 10px; }
  .ts-title { font-size: 1.45rem; margin-bottom: 10px; }
  .ts-a .ts-title { font-size: 1.9rem; }
  .ts-copy p { font-size: 0.86rem; line-height: 1.55; }
  .ts-copy .ts-more { display: none; }             /* keep one short paragraph per scene */
  .ts-stats { grid-template-columns: repeat(4, auto); gap: 10px; margin-top: 12px; }
  .ts-stats .num { font-size: 1rem; }
  .ts-stats .lbl { font-size: 0.62rem; }
  .ts-cue { display: none; }
  .ts-b-grid { gap: 12px; }
  .ts-b-name { font-size: 0.7rem; letter-spacing: 1.6px; }
  .ts-b-note { font-size: 0.68rem; }
  .ts-c-svg .ts-lbl { font-size: 46px; }
  .ts-defs li { grid-template-columns: 40px 1fr; padding: 6px 0; font-size: 0.78rem; }
  .ts-c .ts-small, .ts-fig-note { display: none; }
  .ts-d-labels span { font-size: 0.66rem; top: -22px; }
  .ts-chips button { padding: 5px 12px; font-size: 0.78rem; }
  .ts-d .ts-small { display: none; }
  .ts-coats { grid-template-columns: 1fr 1fr; gap: 6px; }
  .ts-coats a { padding: 7px 9px; }
  .ts-coats b { font-size: 0.76rem; }
  .ts-coats span { display: none; }
  .ts-checks li { padding: 6px 0 6px 20px; font-size: 0.82rem; }
  .ts-f-tags text { font-size: 30px; }
  .ts-handoff { padding-top: 40px; }
}

/* ---- Reduced motion / no JS: plain stacked sections, final states shown ---- */
.ts-static .ts-scene { height: auto; }
.ts-static .ts-sticky { position: relative; top: 0; height: auto; min-height: 0; padding-top: 48px; padding-bottom: 48px; }
.ts-static .ts-copy .ts-more { display: block; }
.ts-static .ts-defs li { color: var(--color-ink); }
