/* Engineering chapter: the 3D scroll film and the sections after it */
.ef { position: relative; height: 2640vh; }
.ef-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: #070908; }
.ef-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ef-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; background: radial-gradient(140% 110% at 55% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%); }
.ef-lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: visible; }
.ef-lines line { stroke: rgba(230, 204, 146, 0.75); stroke-width: 1; opacity: 0; }
.ef-lines circle { fill: #E6CC92; opacity: 0; filter: drop-shadow(0 0 4px rgba(230, 204, 146, 0.9)); }
.ef-labels { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.ef-lab { position: absolute; left: 0; top: 0; display: grid; gap: 1px; padding: 6px 10px; border-radius: 9px; background: rgba(8, 11, 10, 0.78); border: 1px solid rgba(230, 204, 146, 0.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); white-space: nowrap; opacity: 0; will-change: transform, opacity; }
.ef-lab b { font: 600 13px var(--body); color: var(--text); }
.ef-lab span { font: 500 11.5px var(--body); color: var(--muted); }

.ef-hud { position: absolute; right: var(--gut); top: 82px; z-index: 4; min-width: 220px; padding: 12px 14px; border-radius: 12px; background: rgba(8, 11, 10, 0.74); border: 1px solid var(--line-2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font: 500 12.5px/1.7 var(--mono); color: var(--text); opacity: 0; transform: translateY(-6px); transition: opacity .35s, transform .35s; pointer-events: none; }
.ef-hud.on { opacity: 1; transform: none; }
.ef-hud b { font: 600 10.5px var(--body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); margin-right: 8px; }

.ef-idx { position: absolute; right: var(--gut); top: 50%; translate: 0 -50%; z-index: 4; display: grid; gap: 2px; }
.ef-idx button { all: unset; cursor: pointer; display: grid; grid-template-columns: 1fr 10px; align-items: center; gap: 10px; padding: 4px 0; justify-items: end; }
.ef-idx i { grid-column: 2; grid-row: 1; width: 6px; height: 6px; border-radius: 50%; background: rgba(236, 230, 217, 0.3); transition: background .3s, transform .3s; }
.ef-idx span { grid-column: 1; grid-row: 1; font: 600 11px var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); opacity: 0; transform: translateX(6px); transition: opacity .3s, transform .3s, color .3s; }
.ef-idx:hover span, .ef-idx button.on span, .ef-idx button:focus-visible span { opacity: 1; transform: none; }
.ef-idx button.on i { background: var(--brass-hi); transform: scale(1.6); box-shadow: 0 0 10px rgba(230, 204, 146, 0.8); }
.ef-idx button.on span { color: var(--brass-hi); }
.ef-idx button:hover span { color: var(--text); }

.ef-cap { position: absolute; left: var(--gut); bottom: 90px; z-index: 5; width: min(460px, 38vw); opacity: 0; visibility: hidden; transform: translateY(16px); transition: opacity .5s, transform .5s, visibility 0s .5s; pointer-events: none; }
.ef-cap.on { opacity: 1; visibility: visible; transform: none; transition: opacity .5s, transform .5s, visibility 0s; }
.ef-cap::before { content: ""; position: absolute; inset: -50px -70px; z-index: -1; background: radial-gradient(closest-side, rgba(5, 6, 5, 0.86), rgba(5, 6, 5, 0.5) 60%, transparent); }
.ef-cap .eb { margin-bottom: 10px; }
.ef-cap h2 { font-size: clamp(30px, 3.1vw, 48px); }
.ef-cap p:last-child { margin: 12px 0 0; color: #CFC8BA; font-size: clamp(14.5px, 1.1vw, 17px); text-wrap: pretty; }
.ef-cap.fin { width: min(560px, 44vw); }
.ef-spec { margin: 16px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; }
.ef-spec div { display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line-2); }
.ef-spec dt { font: 600 10.5px var(--body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); }
.ef-spec dd { margin: 0; font-size: 13.5px; color: var(--text); }

.ef-cue { position: absolute; left: 50%; bottom: 70px; translate: -50% 0; z-index: 4; display: flex; align-items: center; gap: 10px; font: 600 12px var(--body); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); pointer-events: none; }
.ef-cue span { width: 18px; height: 28px; border: 1.5px solid var(--muted); border-radius: 10px; position: relative; }
.ef-cue span::after { content: ""; position: absolute; left: 50%; top: 6px; width: 2px; height: 6px; margin-left: -1px; background: var(--brass-hi); border-radius: 2px; animation: wheel 1.6s ease-in-out infinite; }
@keyframes wheel { 50% { transform: translateY(7px); opacity: 0.3; } }
.ef-bar { position: absolute; left: var(--gut); right: var(--gut); bottom: 28px; z-index: 4; height: 2px; background: var(--line); }
.ef-bar i { position: absolute; inset: 0; background: linear-gradient(90deg, var(--brass), var(--brass-hi)); transform-origin: 0 50%; transform: scaleX(0); }
.ef-cut { position: absolute; inset: 0; z-index: 6; background: #050605; opacity: 0; pointer-events: none; }
.ef-nogl { display: none; }
.ef.no-gl .ef-stage canvas, .ef.no-gl .ef-idx, .ef.no-gl .ef-cue { display: none; }
.ef.no-gl .ef-nogl { display: grid; position: absolute; inset: 70px var(--gut) auto; z-index: 3; gap: 12px; color: var(--muted); font-size: 14px; }
.ef.no-gl .ef-nogl > div { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ef.no-gl .ef-nogl img { width: 100%; border-radius: 10px; }
.ef.no-gl .ef-nogl figcaption { font-size: 12px; }

@media (max-width: 760px) {
  .ef { height: 2200vh; }
  .ef-cap { left: var(--gut); right: var(--gut); width: auto; bottom: 52px; }
  .ef-cap::before { inset: -40px -30px -60px; }
  .ef-cap h2 { font-size: 26px; }
  .ef-cap p:last-child { font-size: 13.5px; margin-top: 8px; }
  .ef-cap.fin { width: auto; } .ef-spec { gap: 6px 14px; } .ef-spec dd { font-size: 12px; } .ef-spec dt { font-size: 9.5px; }
  .ef-hud { top: 64px; right: auto; left: var(--gut); min-width: 0; padding: 8px 10px; font-size: 11px; line-height: 1.6; }
  .ef-hud b { font-size: 9.5px; margin-right: 6px; }
  .ef-idx { display: none; }
  .ef-lab { padding: 4px 8px; } .ef-lab b { font-size: 11.5px; } .ef-lab span { display: none; }
  .ef-cue { bottom: 260px; }
  .ef-bar { bottom: 18px; }
  .ef.no-gl .ef-nogl > div { grid-template-columns: 1fr 1fr; }
}

/* ------------------------------------------------------------ after the film */
.specs { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 64px); }
.specs div { display: grid; grid-template-columns: minmax(120px, 0.4fr) minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.specs dt { font: 600 11.5px var(--body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); padding-top: 3px; }
.specs dd { margin: 0; color: var(--text); font-size: 15px; }
@media (max-width: 860px) { .specs { grid-template-columns: minmax(0, 1fr); } .specs div { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
.gal { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 18px); }
.gal figure { margin: 0; display: grid; gap: 8px; }
.gal img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.gal figure:hover img { transform: scale(1.02); }
.gal figcaption { font-size: 13px; color: var(--muted); }
@media (max-width: 860px) { .gal { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.proof .card h3 { font-size: clamp(24px, 2vw, 30px); }
.tests { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 22px); }
.tests li { position: relative; padding: 24px 22px 22px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.tests .n { font: 500 12px var(--mono); color: var(--brass); }
.tests h3 { margin: 8px 0 8px; font-size: clamp(24px, 2vw, 30px); }
.tests p { margin: 0; color: #CFC8BA; font-size: 14.5px; }
@media (max-width: 980px) { .tests { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .tests { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------ building on what already exists */
.prior { padding: clamp(150px, 24vh, 240px) 0 clamp(60px, 8vw, 110px); }
.prior-h { position: relative; display: inline-block; margin: 0 0 clamp(36px, 5vw, 64px); font-size: clamp(44px, 6.4vw, 104px); line-height: 1.02; }
.prior-h span { position: relative; z-index: 1; }
.prior-ul { position: absolute; left: 0; right: 0; bottom: -0.1em; height: max(5px, 0.075em); border-radius: 99px; background: #E5484D; box-shadow: 0 0 18px rgba(229, 72, 77, 0.45); transform-origin: 0 50%; transform: scaleX(0); }
.pa-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 1.8vw, 26px); }
@media (max-width: 560px) { .pa-grid { grid-template-columns: minmax(0, 1fr); } }
.pa { margin: 0; }
.pa-media { position: relative; aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden; background: radial-gradient(80% 90% at 30% 20%, rgba(201, 164, 92, 0.1), transparent 60%), #0E1110; border: 1px solid var(--line); }
.pa-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s; }
.pa.has-video video, .pa.has-still video { opacity: 1; }
.pa-ph { position: absolute; inset: 0; display: grid; place-items: center; }
.pa-ph svg { width: 54px; height: 54px; fill: none; stroke: rgba(230, 204, 146, 0.45); stroke-width: 1.4; }
.pa-ph svg path { fill: rgba(230, 204, 146, 0.25); stroke: none; }
.pa.has-video .pa-ph, .pa.has-still .pa-ph { display: none; }
/* the name shows only on a card still waiting for its clip; the clips themselves carry no text */
.pa.has-video .pa-name, .pa.has-still .pa-name { display: none; }
.pa-name { position: absolute; left: 14px; bottom: 12px; z-index: 2; font: 600 11px var(--body); letter-spacing: 0.18em; text-transform: uppercase; color: rgba(236, 230, 217, 0.85); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8); }
/* the clip that is playing is lit; the one waiting on its still sits back a little */
.pa .pa-media { transition: border-color .4s, box-shadow .4s, opacity .4s, filter .4s; }
.pa.has-video:not(.is-on) .pa-media { filter: saturate(0.6) brightness(0.7); }
.pa.is-on .pa-media { border-color: rgba(230, 204, 146, 0.6); box-shadow: 0 0 0 1px rgba(230, 204, 146, 0.25), 0 24px 60px rgba(0, 0, 0, 0.5); }

/* the founder's line above the title, in his own hand (Homemade Apple, self-hosted, Apache License 2.0) */
@font-face { font-family: "Homemade Apple"; font-weight: 400; font-display: swap; src: url("fonts/homemade-apple.woff2") format("woff2"); }
.quote { margin: 0 0 clamp(34px, 5vw, 70px); max-width: min(1000px, 100%); }
.quote blockquote { margin: 0; }
.quote p { margin: 0; font: 400 clamp(22px, 2.6vw, 40px)/1.6 "Homemade Apple", "Segoe Script", "Bradley Hand", cursive; color: #ECE6D9; }
.quote figcaption { margin-top: clamp(10px, 1.2vw, 16px); font: 400 clamp(15px, 1.35vw, 21px)/1.4 "Homemade Apple", "Segoe Script", "Bradley Hand", cursive; color: #E6CC92; }
.quote figcaption::before { content: "\2014\00a0"; }
/* written out left to right as it comes into view */
.quote.rv { transform: none; }
.quote.rv p, .quote.rv figcaption { clip-path: inset(-0.4em 100% -0.6em 0); transition: clip-path 2.4s cubic-bezier(.45, .1, .3, 1); }
.quote.rv figcaption { transition-duration: 1.2s; transition-delay: 2.1s; }
.quote.rv.in p, .quote.rv.in figcaption { clip-path: inset(-0.4em -2% -0.6em 0); }
@media (prefers-reduced-motion: reduce) { .quote.rv p, .quote.rv figcaption { clip-path: none; transition: none; } }
.prior { padding-top: clamp(130px, 19vh, 210px); }
.pa.has-video { cursor: pointer; }
