/* Frame to Real, direction "Selects": a director's marked-up contact sheet.
   Loaded last, after the Taste kit. Tokens first, then only what the kit does not draw. */

:root {
  --p-bg: #f3f0e8; --p-surface: #e6e3db; --p-ink: #15130f; --p-muted: #605d57;
  --p-accent: #d4321f; --p-accent-ink: #ffffff; --p-action: #15130f; --p-action-ink: #f3f0e8;
  --p-inv-bg: #15130f; --p-inv-surface: #211f1b; --p-inv-ink: #f3f0e8; --p-inv-muted: #a8a59d;
  --p-inv-accent: #d4321f; --p-inv-accent-ink: #ffffff; --p-inv-action: #f3f0e8; --p-inv-action-ink: #15130f;
  --font-display: var(--font-archivo), system-ui, sans-serif;
  --font-text: var(--font-archivo), system-ui, sans-serif;
  --display-weight: 800;
  --display-tracking: -0.03em;
  --display-tracking-xl: -0.04em;
  --display-stretch: 78%;
  --ly-scale: 1;
  --t-h2: clamp(38px, 4.2vw + 21.6px, 96px);
  --t-h3: clamp(20px, .57vw + 17.8px, 26px);
  --ly-h1-quiet: clamp(52px, 8.4vw + 19.2px, 140px);
  --ly-lead: clamp(20px, 1.14vw + 15.5px, 32px);
}

/* prints have hard corners: above the kit's own radius rules */
html[data-radius][data-buttons] { --r-sm: 0px; --r-md: 0px; --r-lg: 0px; --r-btn: 0px; }

html { background: var(--p-bg); scrollbar-color: var(--p-ink) var(--p-bg); }
::selection { background: var(--p-accent); color: #fff; }
/* tight tracking closes the word gaps: open them again at display sizes */
h1, h2, .step__line { word-spacing: .06em; }

/* ---- the pencil */
.pencil { display: block; max-width: none; overflow: visible; pointer-events: none; color: var(--p-accent); }
.pencil__ink { fill: currentColor; }
.pencil__reveal { fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.circled { position: relative; display: inline-block; margin-left: .26em; white-space: nowrap; }
.circled > .pencil { position: absolute; left: 50%; top: 50%; width: calc(106% + .62em); height: calc(108% + .5em); translate: -50% -50%; }

/* ---- nav: on Home it lies clear on the film and leaves with it; the kit's opaque bar everywhere else */
.nav--over { position: absolute; }
.nav--over:not(.is-open) { background: transparent; border-bottom-color: transparent; color: #fff; --ink: #fff; --muted: #fff; }
.nav--over.is-open { position: fixed; }
.nav__toggle { width: auto; padding: 0; border: 0; background: none; color: inherit; }
.nav__toggle > span { font: 500 15px/1 var(--font-text); }
.nav__links { justify-content: flex-end; }
.nav__links > .nav__item:last-child > .nav__link { padding-right: 0; }
.nav__links > .nav__item:last-child > .nav__link::before,
.nav__links > .nav__item:last-child > .nav__link[aria-current="page"]::after { right: 0; }

/* ---- Home hero */
.hero--photo .hero__text { width: 100%; }
.hero--photo h1 { font-size: var(--ly-h1-mega); line-height: .9; max-width: none; }
.hero--photo .btn-row { --action: var(--p-bg); --action-ink: var(--p-ink); }
html[data-buttons="block"] .hero--photo[data-tone="dark"] .btn--secondary:hover { background: none; color: #fff; text-decoration-color: #fff; }
.hero--photo { --ly-pos: 32% 30%; --ly-pos-phone: 50% 30%; }
.hero__row { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-4); }
.hero__row > * { margin: 0; }
.hero__row .hero__lead { max-width: none; font-weight: 500; white-space: nowrap; }
.hero__tail { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); width: 100%; }
/* a wide screen sets the foot of the hero on the page's columns */
@media (min-width: 1280px) {
  .hero__row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: center; }
  .hero__row .hero__lead { grid-column: 1 / span 4; }
  .hero__row .btn-row { grid-column: 5 / span 4; }
  .hero__tail { grid-column: 9 / -1; }
}
.hero__label { font-size: var(--t-small); line-height: 1.4; }
.hero__tail .loop-pause { position: relative; right: auto; bottom: auto; flex: none; background: var(--p-bg); color: var(--p-ink); border-color: transparent; }
.loop-pause__play, .loop-pause.is-paused .loop-pause__pause { display: none; }
.loop-pause.is-paused .loop-pause__play { display: block; }

/* a phone and a tablet keep the film full-screen: the words stay on it */
@media (max-width: 1023px) {
  .hero--photo[data-tone] { --photo: 0px; background: #1b1b1b; color: #fff; --ink: #fff; --muted: #fff; --line: rgb(255 255 255 / .4); --line-strong: rgb(255 255 255 / .7); }
  .hero--photo > .hero__bg { top: 0; bottom: 0; height: 100%; }
  .hero--photo > .wrap > .hero-text { justify-content: flex-end; }
  html[data-buttons="block"] .hero--photo[data-tone="dark"] .btn--secondary { color: #fff; text-decoration-color: rgb(255 255 255 / .6); }
}
@media (max-width: 639px) {
  .hero__row .btn-row { width: 100%; }
}

/* ---- Work hero: ink on paper, then the film edge to edge. A click anywhere on it plays. */
.hero--product h1 { font-size: clamp(40px, 5vw + 20.5px, 88px); line-height: .94; max-width: none; }
.hero--product .hero__lead { max-width: 24ch; }
.hero--product .hero__stage { --ly-pos: 44% 34%; cursor: pointer; }
.stage-play { left: max(var(--gut), calc(50vw - 640px)); bottom: var(--s-6); }
@media (max-width: 639px) { .hero--product .hero__stage { flex: 1 1 0; aspect-ratio: auto; min-height: 240px; } }
/* the ring on the Work poster: this box is the image's own cover box, so the mark stays on the earbud at any crop */
.hero__stage { container-type: size; }
.stage-marks { position: absolute; z-index: 1; pointer-events: none;
  width: max(100cqw, calc(100cqh * 16 / 9)); height: max(100cqh, calc(100cqw * 9 / 16));
  left: calc((100cqw - max(100cqw, calc(100cqh * 16 / 9))) * .44); top: calc((100cqh - max(100cqh, calc(100cqw * 9 / 16))) * .34); }
.stage-marks > .pencil { position: absolute; left: 32.8%; top: 36.2%; width: 8.6%; height: 15%; }

/* ---- statement heroes (How it works, Contact) */
.hero--statement h1 { max-width: 12ch; line-height: .94; }
.hero--statement .hero__in > :last-child .btn-row { margin-top: var(--s-5); }
.hero--contact h1 { font-size: clamp(38px, 3.4vw + 24.7px, 72px); line-height: 1; max-width: none; }
/* the address fills the content width at every size: 8.55 is its width in ems */
.address__link { position: relative; display: block; min-height: 44px; font: var(--display-weight) calc((min(100vw, 1440px) - 2 * var(--gut)) / 8.55)/1 var(--font-display); font-stretch: var(--display-stretch); letter-spacing: var(--display-tracking-xl); white-space: nowrap; color: var(--ink); text-decoration: none; }
.address__link > .pencil { position: absolute; left: 0; bottom: -.15em; width: 100%; height: .22em; }

/* ---- contact sheet */
.sheet-hint { margin-bottom: var(--s-3); font-size: var(--t-small); color: var(--muted); }
.sheet { position: relative; }
.sheet__print { margin: 0; background: #000; aspect-ratio: 2568 / 560; }
.sheet__print > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sheet__frames { position: absolute; inset: 0; z-index: 2; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(3, 1fr); }
.sheet__frame { appearance: none; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; min-width: 0; min-height: 0; }
.sheet__frame:focus-visible { outline: 2px solid var(--p-accent); outline-offset: -2px; }
.sheet__circle { position: absolute; z-index: 1; width: calc(100% / 8 * 1.12); height: calc(100% / 3 * 1.06); left: calc(var(--c8) * 100% / 8 - 100% / 8 * .06); top: calc(var(--r3) * 100% / 3); }
.sheet__loupe { position: absolute; left: 0; top: 0; z-index: 3; width: calc(100% / 8 * 2.4); aspect-ratio: 16 / 9; overflow: hidden; background: #000; outline: 2px solid var(--p-bg); opacity: 0; scale: .96; visibility: hidden; pointer-events: none; transition: opacity 100ms var(--ease), scale 100ms var(--ease), transform 180ms var(--ease), visibility 0s linear 100ms; }
.sheet__loupe.is-on { opacity: 1; scale: 1; visibility: visible; transition: opacity 140ms var(--ease), scale 180ms var(--m-ease-enter), transform 180ms var(--ease), visibility 0s; }
.sheet__loupe-img { position: absolute; left: 0; top: 0; width: 800%; height: 300%; background-size: 100% 100%; transition: transform 180ms var(--ease); }
.sheet__loupe.is-placing, .sheet__loupe.is-placing .sheet__loupe-img { transition: none; }
.sheet__loupe-time { position: absolute; left: var(--s-3); bottom: var(--s-2); font: 500 var(--t-label)/1 var(--font-text); color: #fff; }
@media (max-width: 1023px) {
  .sheet__print { aspect-ratio: 1320 / 1136; }
  .sheet__frames { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(6, 1fr); }
  .sheet__circle { width: calc(100% / 4 * 1.12); height: calc(100% / 6 * 1.06); left: calc(var(--c4) * 100% / 4 - 100% / 4 * .06); top: calc(var(--r6) * 100% / 6); }
  .sheet__loupe { display: none; }
}

/* ---- Discover Georgia: the small side note */
.discover { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: end; margin-top: var(--s-8); color: inherit; text-decoration: none; }
.discover__text { grid-column: 1 / span 6; display: grid; gap: var(--s-2); justify-items: start; }
.discover__line { max-width: 44ch; font-size: var(--t-body); line-height: 1.5; }
.discover__still { grid-column: 10 / -1; aspect-ratio: 16 / 9; overflow: hidden; background: var(--p-surface); }
.discover__still > img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 639px) {
  .discover { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; margin-top: var(--s-7); }
  .discover__text { grid-column: 1; }
  .discover__still { grid-column: 2; }
}
/* the sheet and the side note stay on one screen: tighter air on a short tablet and on a phone */
@media (min-width: 640px) and (max-width: 1023px) and (max-height: 1100px) { #frames { --padt: 72px; --padb: 40px; --head-gap: 24px; } #frames .discover { margin-top: var(--s-4); } }
@media (max-width: 639px) { #frames { --padb: 40px; } #frames .discover { margin-top: var(--s-5); } .sheet-hint { margin-bottom: var(--s-2); } }

/* ---- case note */
.note { margin-bottom: var(--s-8); }
.note dt { margin-bottom: var(--s-2); font: var(--display-weight) var(--t-h3)/1.2 var(--font-display); font-stretch: var(--display-stretch); letter-spacing: var(--display-tracking); }
.note dd { margin: 0; font-size: var(--t-lead); line-height: 1.45; max-width: 34ch; }

/* ---- steps */
.step > h3 { margin-bottom: var(--s-1); }
.step > p:not(.step__line) { font-size: var(--t-body); }
/* the line fills the content width at every size: 7.84 is its width in ems */
.step > .step__line { margin-top: var(--s-6); font: var(--display-weight) calc((min(100vw, 1440px) - 2 * var(--gut)) / 7.84)/.92 var(--font-display); font-stretch: var(--display-stretch); letter-spacing: var(--display-tracking-xl); white-space: nowrap; }
.step__frame { margin: var(--s-4) 0 0; aspect-ratio: 16 / 9; overflow: hidden; background: var(--p-surface); }
.step__frame > img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 640px) and (max-width: 1023px) { #steps .grid > .span-6 { grid-column: span 6; } }

/* ---- the close: the last thing on every page, in the page's largest quiet type */
.closing__cta .section-head, .closing__cta .section-head--split > div { max-width: none; }
.closing__cta h2 { font-size: clamp(46px, 7vw + 20px, 124px); line-height: .94; max-width: none; }
.closing__cta .btn--xl { flex: none; font-stretch: var(--display-stretch); }
@media (min-width: 640px) and (max-width: 1023px) { .closing__cta h2 { font-size: 13vw; } }
.site-links { display: flex; gap: var(--s-5); }

/* ---- the film dialog */
.film { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; color: #fff; opacity: 1; transition: opacity 240ms var(--m-ease-enter), overlay 160ms allow-discrete, display 160ms allow-discrete; }
.film:not([open]) { opacity: 0; transition-duration: 160ms; }
.film::backdrop { background: transparent; }
.film__frame { position: absolute; inset: 0; display: grid; place-items: center; scale: 1; transition: scale 240ms var(--m-ease-enter); }
@starting-style { .film[open] { opacity: 0; } .film[open] .film__frame { scale: .97; } }
.film__frame > iframe { display: block; width: min(100vw, calc(100dvh * 16 / 9)); aspect-ratio: 16 / 9; border: 0; }
.film__close { position: absolute; right: var(--s-4); top: var(--s-4); z-index: 2; min-height: 44px; padding: 0 var(--s-4); border: 0; background: var(--p-bg); color: var(--p-ink); font: 500 var(--t-body)/1 var(--font-text); cursor: pointer; }

/* ---- motion (Emil stage). Each mark is the last thing to land in its moment, and rests fully drawn without script. */
@keyframes pencil-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: no-preference) {
  /* hero: the ring draws as the offer line settles */
  html.m-enter .hero[data-enter] .pencil__reveal { stroke-dashoffset: 1; }
  html.m-enter .hero[data-enter]:is(.is-entering, .is-entered) .pencil__reveal,
  html.m-enter.m-enter-done .hero[data-enter] .pencil__reveal { stroke-dashoffset: 0; animation: pencil-draw 620ms var(--m-ease-io) 760ms backwards; }
  html.m-enter .hero[data-enter].is-still .pencil__reveal { stroke-dashoffset: 0; animation: none; }

  /* contact sheet: the ring starts just before the print finishes developing */
  .sheet:has(> .mo-pd.is-armed) .pencil__reveal { stroke-dashoffset: 1; }
  .sheet:has(> .mo-pd:is(.is-live, .is-done):not([data-moment-still])) .pencil__reveal { animation: pencil-draw 620ms var(--m-ease-io) 1250ms backwards; }

  /* press: every control answers before the action happens */
  .hero__tail .loop-pause, .film__close { transition: scale var(--m-press) var(--ease); }
  .hero__tail .loop-pause:active, .film__close:active { scale: .94; }
  .sheet:has(.sheet__frame:active) .sheet__loupe.is-on { scale: .97; transition-duration: var(--m-press); }
  .ly-play:active .ly-play__disc { transform: scale(.96); transition-duration: var(--m-press); }
}

/* the kit's play button grows on hover: a touch screen fires that on tap and leaves it stuck */
@media (hover: none) { .ly-play:hover .ly-play__disc { transform: none; } }

html:has(.film[open]) { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .sheet__loupe, .sheet__loupe-img { scale: 1; transition: opacity 120ms linear; }
  .film, .film__frame { transition: none; }
}
