/* ==========================================================================
   3d.html: the 3D studio (Coming). Follows the movie.html template.
   Sections: hero, what it will do (three drawings), ready for Movie and Deck
   (dark panel 1, the one live scene), 3D in Movie today, closing.
   Page-local classes are prefixed d3-. Shared tokens only; no new colours.
   ========================================================================== */

body { background: var(--surface); }

/* ------------------------------------------------------------ Shared bits */
.d3-kicker {
  font-size: var(--t-19); line-height: 1.2; font-weight: var(--w-semibold);
  letter-spacing: -0.012em; color: var(--ink-3);
}
.studio .d3-kicker { color: var(--studio-text-3); }
.d3-head > * + * { margin-top: 10px; }
.d3-head-center { text-align: center; margin-inline: auto; max-width: 760px; }
.d3-h3 { font-size: var(--t-24); line-height: var(--lh-24); letter-spacing: var(--tr-24); font-weight: var(--w-semibold); }
.d3-p { margin-top: 8px; color: var(--ink-3); font-size: var(--t-17); line-height: var(--lh-17); text-wrap: pretty; max-width: 30em; }
.studio .d3-p { color: var(--studio-text-2); }
@media (max-width: 733px) { .d3-br { display: none; } }

/* ------------------------------------------------------------------- Hero */
.d3-hero { padding-top: clamp(48px, 6vw, 80px); padding-bottom: calc(var(--section-y) * 0.5); position: relative; z-index: 1; }
.d3-hero-copy { text-align: center; }
.d3-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: var(--t-24); line-height: 1.2; font-weight: var(--w-semibold); letter-spacing: -0.02em; color: var(--ink);
}
.d3-eyebrow .badge { letter-spacing: 0.01em; transform: translateY(1px); }
.d3-h1 { margin-top: 14px; }
.d3-sub {
  max-width: 31em; margin: 22px auto 0;
  font-size: var(--t-19); line-height: var(--lh-19); letter-spacing: var(--tr-19); color: var(--ink-2);
}
.d3-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 28px; margin-top: 34px; }
.d3-actions .btn-link { font-size: var(--t-17); }

.d3-hero-shot {
  width: 100%; max-width: calc(1280px + var(--gutter) * 2);
  margin: clamp(48px, 6vw, 80px) auto 0; padding-inline: var(--gutter);
}
.d3-hero-shot .window-shot {
  aspect-ratio: 16 / 10;
  box-shadow: 0 0 0 0.5px rgba(0,0,0,0.42), 0 40px 100px -20px rgba(17,17,20,0.32), 0 12px 32px rgba(17,17,20,0.12);
}
.d3-hero-shot img { width: 100%; height: 100%; object-fit: cover; }

.d3-shot-cap {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 14px;
  margin-top: 22px; font-size: var(--t-14); line-height: var(--lh-14); color: var(--ink-3); text-align: center;
}
.on-dark-cap { color: var(--studio-text-3); }

/* ------------------------------------------------------- What it will do */
.d3-plans { padding-top: calc(var(--section-y) * 0.6); }
.d3-plans .d3-head { max-width: 820px; }
.d3-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: clamp(40px, 5vw, 64px); }
.d3-card { min-width: 0; }
.d3-art {
  position: relative; aspect-ratio: 590 / 400; margin-bottom: 28px;
  border-radius: var(--r-xl); background: var(--surface-2); overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 28px;
}
.d3-art svg { width: 100%; height: auto; max-height: 100%; overflow: visible; }

/* Drawing language: ink hairlines on the quiet ground, white solids, mono notes.
   No pink: these are scenes, and pink is only ever Tino. */
.d3-gridline { stroke: var(--ink); stroke-opacity: 0.06; stroke-width: 1; }
.d3-obj { fill: var(--surface); stroke: var(--ink-3); stroke-width: 1.25; }
.d3-obj-in { fill: var(--surface-3); stroke: var(--ink-3); stroke-width: 1; }
.d3-pier { stroke: var(--ink-3); stroke-width: 5; stroke-linecap: round; opacity: 0.35; }
.d3-frustum { fill: var(--ink); fill-opacity: 0.035; stroke: var(--ink-4); stroke-width: 1; stroke-linejoin: round; }
.d3-aim { stroke: var(--ink); stroke-opacity: 0.32; stroke-width: 1; stroke-dasharray: 3 4; }
.d3-light { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.25; }
.d3-cam { fill: var(--ink); stroke: none; }
.d3-note { font-family: var(--font-mono); font-size: 15px; letter-spacing: 0.04em; fill: var(--ink-3); }
.d3-prompt {
  align-self: flex-start; max-width: 26em; margin-bottom: 4px;
  font-size: var(--t-14); line-height: 20px; color: var(--ink-2);
}

.d3-cove { fill: var(--ink); fill-opacity: 0.035; stroke: none; }
.d3-strip { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.25; }
.d3-shadow { fill: var(--ink); opacity: 0.06; }
.d3-shadow-in { fill: var(--ink); opacity: 0.08; }
.d3-table { fill: var(--surface); stroke: var(--ink-3); stroke-width: 1.25; }
.d3-table-side { fill: var(--surface-3); stroke: var(--ink-3); stroke-width: 1.25; }
.d3-ticks {
  fill: none; stroke: var(--ink-3); stroke-width: 5; stroke-dasharray: 1 13.4; opacity: 0.55;
  stroke-dashoffset: 0;
}
.d3-bottle { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.25; stroke-linejoin: round; }
.d3-cap { fill: var(--ink); }
.d3-label-line { stroke: var(--ink-4); stroke-width: 1.25; stroke-linecap: round; }
.d3-glint { stroke: var(--ink); stroke-opacity: 0.14; stroke-width: 3; stroke-linecap: round; }
.d3-arc { fill: none; stroke: var(--ink-3); stroke-width: 1.25; stroke-linecap: round; }
.d3-arc-head { fill: none; stroke: var(--ink-3); stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
/* Type in 3D: a stepped extrusion behind a white face, and the film lane it lands in. */
.d3-extrude text, .d3-face, .d3-face-line { font-family: var(--font); font-weight: 700; font-size: 150px; letter-spacing: -0.05em; }
.d3-extrude text { fill: var(--line); stroke: none; }
.d3-extrude .d3-back { fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-opacity: 0.5; stroke-linejoin: round; }
/* outline drawn under the face, so the glyph's overlapping contours never show */
.d3-face-line { fill: none; stroke: var(--ink-2); stroke-width: 2.5; stroke-linejoin: round; }
.d3-face { fill: var(--surface); stroke: none; }
.d3-lane-art { fill: none; stroke: var(--ink-4); stroke-width: 1; stroke-dasharray: 3 4; }
.d3-clip-art { fill: var(--surface-3); stroke: var(--ink-3); stroke-width: 1; }
.d3-clip-art-on { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.25; }
.d3-head-art { stroke: var(--ink); stroke-width: 1.5; }
/* The turntable turns once, when you arrive. */
@media (prefers-reduced-motion: no-preference) {
  .reveal-ready .d3-card .d3-ticks { transition: stroke-dashoffset 2600ms var(--ease-in-out) 300ms; }
  .reveal-ready .d3-card.is-in .d3-ticks { stroke-dashoffset: -96; }
}

/* ---------------------------------------------------- Ready for Movie and Deck */
/* Edge to edge, like the bands on movie.html and deck.html: the whole window
   goes dark around the work. Square, full width, ~160px above and below. */
.d3-handoff-band { padding-inline: 0; }
.d3-handoff-band > .studio.d3-handoff { border-radius: 0; max-width: none; margin-inline: 0; padding-block: clamp(96px, 11.112vw, 160px); }
.d3-lede { margin: 18px auto 0; max-width: 32em; font-size: var(--t-19); line-height: var(--lh-19); }

.d3-scene {
  display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 20px; align-items: start;
  max-width: 1120px; margin: clamp(40px, 5vw, 64px) auto 0;
}
.d3-win {
  position: relative; min-width: 0;
  border-radius: 12px; background: #0E0E10; color: var(--studio-text);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.10), 0 30px 80px rgba(0,0,0,0.5);
  font-size: 12.5px; line-height: 17px;
}
.d3-bar { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-bottom: 1px solid var(--studio-line); }
.d3-lights { display: inline-flex; gap: 7px; }
.d3-lights i { width: 11px; height: 11px; border-radius: 50%; background: #FF5F57; box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.18); }
.d3-lights i:nth-child(2) { background: #FEBC2E; }
.d3-lights i:nth-child(3) { background: #28C840; }
.d3-app { margin-left: 4px; font-size: 12px; color: var(--studio-text-3); white-space: nowrap; }
.d3-title { font-size: 12.5px; font-weight: var(--w-semibold); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d3-title em { font-style: normal; font-weight: var(--w-regular); color: var(--studio-text-3); margin-left: 6px; font-size: 12px; }
.d3-mark { margin-left: auto; height: 17px; color: var(--studio-text); }
.d3-tc { margin-left: auto; font-size: 12px; color: var(--studio-text-2); }

/* Source window */
.d3-src { padding-bottom: 16px; }
.d3-render { position: relative; margin: 14px 14px 0; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #000; }
/* the island alone, rendered by the engine without the film's titles and cropped at full size (img/3d/island-*.webp): never scaled up */
.d3-render img, .d3-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.d3-render-tag {
  position: absolute; left: 8px; bottom: 8px; display: inline-flex; gap: 6px; align-items: center;
  height: 20px; padding: 0 8px; border-radius: var(--r-pill);
  background: rgba(14,14,16,0.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 11px; color: var(--studio-text-2);
}
.d3-render-tag .mono { color: var(--studio-text); font-size: 10.5px; }
.d3-props { margin: 12px 14px 0; }
.d3-props div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--studio-line); }
.d3-props dt { color: var(--studio-text-3); }
.d3-props dd { margin: 0; color: var(--studio-text); }
.d3-props .mono { font-size: 11.5px; }
.d3-you {
  margin: 14px 14px 0 auto; width: max-content; max-width: calc(100% - 28px);
  padding: 9px 13px; border-radius: 16px 16px 6px 16px;
  background: var(--studio-raised); color: var(--studio-text);
}

/* Destination window */
.d3-viewer { position: relative; padding: 18px 18px 76px; background: #0B0B0D; }
.d3-frame {
  position: relative; width: min(100%, 560px); margin: 0 auto; aspect-ratio: 16 / 9;
  border-radius: 3px; background: #000; box-shadow: 0 0 0 0.5px rgba(255,255,255,0.10);
}
.d3-frame img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 3px;
  opacity: 0; transform: scale(1.035);
  transition: opacity 700ms var(--ease), transform 1100ms var(--ease-out);
}
.d3-frame.is-tino-done img { opacity: 1; transform: none; }
.d3-frame { overflow: hidden; }
.d3-frame-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 11px; color: var(--studio-text-3); transition: opacity 300ms var(--ease);
}
.d3-frame.is-tino-done .d3-frame-empty { opacity: 0; }

.d3-tl { display: grid; grid-template-columns: 96px minmax(0, 1fr); border-top: 1px solid var(--studio-line); background: var(--studio-ground); border-radius: 0 0 12px 12px; padding-bottom: 8px; }
.d3-tl-names { display: flex; flex-direction: column; border-right: 1px solid var(--studio-line); }
.d3-tl-ruler-h { height: 30px; display: flex; align-items: center; padding-left: 14px; font-size: 11.5px; font-weight: var(--w-semibold); color: var(--studio-text-2); border-bottom: 1px solid var(--studio-line); }
.d3-row { position: relative; height: 38px; display: flex; align-items: center; padding-left: 14px; color: var(--studio-text-2); }
.d3-row-new { color: var(--studio-text); }

.d3-tl-lanes { position: relative; padding: 0 14px 0 10px; }
.d3-ruler { position: relative; height: 30px; border-bottom: 1px solid var(--studio-line); }
.d3-ruler span:not(.tino-range) {
  position: absolute; top: 9px; padding-left: 5px; border-left: 1px solid var(--studio-line-2);
  font-family: var(--font-mono); font-size: 10.5px; line-height: 12px; color: var(--studio-text-3);
}
.d3-lane { position: relative; height: 38px; }
.d3-clip {
  position: absolute; top: 6px; bottom: 6px; display: flex; align-items: center; gap: 6px;
  padding: 0 10px; border-radius: 6px; overflow: hidden; white-space: nowrap;
  background: #3A3531; color: var(--studio-text); font-size: 12px;
}
.d3-clip em { font-style: normal; color: var(--studio-text-2); }
.d3-clip-audio { background: #26272B; padding: 0 6px; }
.d3-wave { flex: 1; height: 14px; opacity: 0.5;
  background: repeating-linear-gradient(90deg, var(--studio-text-3) 0 1px, transparent 1px 4px);
  -webkit-mask: linear-gradient(180deg, transparent 0 20%, #000 20% 80%, transparent 80%);
          mask: linear-gradient(180deg, transparent 0 20%, #000 20% 80%, transparent 80%);
}
/* The new clip arrives with the edit; before it, an empty slot. */
.d3-clip-new { background: #3A3531; opacity: 0; transform: translateY(4px); transition: opacity 360ms var(--ease), transform 480ms var(--ease-out); }
.d3-clip-new.is-tino-done { opacity: 1; transform: none; }
.d3-lane:has(.d3-clip-new)::before {
  content: ""; position: absolute; top: 6px; bottom: 6px; left: calc(40% + 0px); width: 50%;
  border-radius: 6px; box-shadow: inset 0 0 0 1px var(--studio-line-2);
  background: repeating-linear-gradient(135deg, rgba(255,255,255,0.03) 0 6px, transparent 6px 12px);
}
.d3-lane:has(.d3-clip-new) { position: relative; }
.d3-row-new { transition: color 300ms var(--ease); }
#d3-range { left: 40%; }
/* your playhead: white; Tino's: the dot's own pink line */
.d3-you-head { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,0.7); pointer-events: none; }
.d3-you-head::before { content: ""; position: absolute; left: -4px; top: 0; width: 9px; height: 10px; border-radius: 2px 2px 4px 4px; background: var(--studio-text); }
.d3-tl-lanes .d3-ruler, .d3-tl-lanes .d3-lane { margin-right: 0; }
.d3-stop { position: absolute; top: 15px; bottom: 0; width: 0; left: calc(10px + (100% - 24px) * 0.40); }
/* your playhead sits where the header and the viewer are: 00:00:04:00 */
.d3-you-head { left: calc(10px + (100% - 24px) * 0.40) !important; }

.d3-toast {
  position: absolute; left: 50%; bottom: 24px; z-index: 2; margin-left: 0;
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none;
  transition: opacity 240ms var(--ease), transform 240ms var(--ease-out);
}
.d3-toast.is-tino-done { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; transition-delay: 600ms; }
.d3-toast.is-gone { opacity: 0; transform: translate(-50%, 8px); pointer-events: none; transition-delay: 0ms; }
.d3-toast b { font-weight: var(--w-semibold); }

/* -------------------------------------------------------------- 3D today */
.d3-today { padding-top: var(--section-y); padding-bottom: calc(var(--section-y) * 0.5); }
.d3-today-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 48px; flex-wrap: wrap; }
.d3-today-head > div > * + * { margin-top: 10px; }
.d3-today-aside { max-width: 24em; font-size: var(--t-17); color: var(--ink-3); padding-bottom: 8px; }
.d3-today-aside .btn-link { margin-left: 4px; }
.d3-reel { display: flex; flex-direction: column; gap: 28px; margin-top: 48px; }
.d3-row-films { display: flex; gap: 20px; align-items: flex-start; }
.d3-film { flex: var(--ar) 1 0; min-width: 0; }
.d3-poster {
  position: relative; aspect-ratio: var(--ar); border-radius: var(--r-md); overflow: hidden; background: var(--surface-2);
  box-shadow: 0 0 0 0.5px rgba(17,17,20,0.08);
}
.d3-poster img { width: 100%; height: 100%; object-fit: cover; }

.d3-film figcaption { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; font-size: var(--t-14); line-height: var(--lh-14); }
.d3-film figcaption b { font-weight: var(--w-semibold); color: var(--ink); }
.d3-film figcaption span { color: var(--ink-3); }
.d3-film figcaption .mono { font-size: 12px; color: var(--ink-3); }
.d3-films-note { margin-top: 40px; font-size: var(--t-14); color: var(--ink-3); }
.d3-films-note .btn-link { margin-left: 6px; }

/* ---------------------------------------------------------------- Closing */
.d3-close { padding-bottom: calc(var(--section-y) * 1.1); }
.d3-close-icon { margin: 0 auto 28px; }
.d3-small { margin-top: 16px; font-size: var(--t-14); color: var(--ink-3); }
.d3-close .d3-actions { margin-top: 30px; }

/* ------------------------------------------------------------ Responsive */
@media (max-width: 1068px) {
  .d3-scene { grid-template-columns: minmax(0, 280px) minmax(0, 1fr); }
  .d3-props { display: none; }
  .d3-trio { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 20px; }
  .d3-trio .d3-card:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; align-items: center; }
  .d3-trio .d3-card:last-child .d3-art { grid-row: 1 / span 2; margin-bottom: 0; }
  .d3-trio .d3-card:last-child .d3-h3 { align-self: end; }
  .d3-trio .d3-card:last-child .d3-p { align-self: start; }
}
@media (max-width: 860px) {
  .d3-scene { grid-template-columns: 1fr; max-width: 600px; }
  .d3-src { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-bottom: 14px; }
  .d3-src .d3-bar { grid-column: 1 / -1; }
  .d3-src .d3-you { align-self: end; margin: 14px 14px 0 0; }
  .d3-props { display: none; }
}
@media (max-width: 733px) {
  .d3-eyebrow { font-size: 19px; }
  .d3-sub { margin-top: 16px; }
  .d3-actions { flex-direction: column; gap: 18px; }
  .d3-hero-shot .window-shot { aspect-ratio: 800 / 832; border-radius: 10px; }
  .d3-trio { grid-template-columns: 1fr; gap: 48px; }
  .d3-trio .d3-card:last-child { display: block; }
  .d3-trio .d3-card:last-child .d3-art { margin-bottom: 22px; }
  .d3-art { padding: 20px; margin-bottom: 22px; border-radius: var(--r-lg); }
  .d3-prompt { font-size: 13px; line-height: 18px; }
  .d3-note { font-size: 17px; letter-spacing: 0.02em; }
  .d3-src { display: block; }
  .d3-src .d3-you { margin: 12px 12px 0 auto; }
  .d3-render { margin: 12px 12px 0; }
  .d3-bar { padding: 0 12px; height: 40px; gap: 8px; }
  .d3-bar .d3-lights { display: none; }
  .d3-app { margin-left: 0; }
  .d3-tl { grid-template-columns: 64px minmax(0, 1fr); }
  .d3-tl-ruler-h, .d3-row { padding-left: 10px; }
  .d3-row { font-size: 11.5px; }
  .d3-clip em { display: none; }
  .d3-ruler span:nth-child(2n):not(.tino-range) { display: none; }
  .d3-viewer { padding: 12px 12px 66px; }
  .d3-toast { bottom: 20px; }
  .d3-toast > span { white-space: nowrap; }
  .d3-row-films { flex-wrap: wrap; gap: 24px 12px; }
  .d3-film[style*="1.7778"] { flex-basis: 100%; }
  .d3-row-films:first-child .d3-film[style*="0.5625"] { flex: 0 0 100%; display: grid; grid-template-columns: 50% minmax(0, 1fr); gap: 16px; align-items: center; margin-inline: 0; }
  .d3-row-films:first-child .d3-film[style*="0.5625"] figcaption { margin-top: 0; }
  .d3-reel { gap: 24px; margin-top: 32px; }
  .d3-films-note { margin-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .d3-frame img, .d3-frame-empty, .d3-clip-new, .d3-toast, .d3-ticks { transition-duration: 0ms !important; }
}
.is-shot .d3-frame img, .is-shot .d3-frame-empty, .is-shot .d3-clip-new, .is-shot .d3-toast, .is-shot .d3-ticks { transition: none !important; }
/* Tino's head rides in the ruler; while the dot is out (its home mark is away) the marks it would half-cover
   (0:04 under the dot, 0:06 under the label) step aside rather than peek out, and come back once it is home. */
.d3-ruler span:nth-child(3):not(.tino-range), .d3-ruler span:nth-child(4):not(.tino-range) { transition: color 320ms var(--ease) 200ms; }
.d3-scene:has(#d3-home.is-tino-away) .d3-ruler span:nth-child(3):not(.tino-range),
.d3-scene:has(#d3-home.is-tino-away) .d3-ruler span:nth-child(4):not(.tino-range) { color: transparent; transition-delay: 0ms; transition-duration: 120ms; }
