:root {
  color-scheme: light;
  --paper: #f7f7f5;
  --ink: #0b0b0b;
  --muted: #666662;
  --line: #c9c9c4;
  --violet: #6b5cff;
  --night: #070707;
  --night-muted: #a6a6a1;
  --night-line: #343432;
  --gutter: clamp(1.25rem, 4.5vw, 4.5rem);
  --section-space: clamp(6.5rem, 11.7vw, 11.7rem);
  --heading-space: clamp(3.9rem, 9.1vw, 9.1rem);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-kerning: normal;
  font-optical-sizing: auto;
  font-feature-settings: "kern" 1, "liga" 1;
  font-synthesis: none;
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
body { min-width: 0; margin: 0; overflow-x: clip; background: var(--paper); text-rendering: optimizeLegibility; }
img, video { display: block; width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { appearance: none; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }

.skip-link { position: fixed; z-index: 50; top: 1rem; left: 1rem; padding: .75rem 1rem; transform: translateY(-180%); background: var(--ink); color: white; }
.skip-link:focus { transform: translateY(0); }

.ui-icon { display: inline-block; width: 1rem; height: 1rem; flex: 0 0 auto; background: currentColor; -webkit-mask-position: center; -webkit-mask-repeat: no-repeat; -webkit-mask-size: contain; mask-position: center; mask-repeat: no-repeat; mask-size: contain; }
.ui-icon-arrow-down-right { -webkit-mask-image: url("/assets/icons/arrow-down-right.svg"); mask-image: url("/assets/icons/arrow-down-right.svg"); }
.ui-icon-arrow-up { -webkit-mask-image: url("/assets/icons/arrow-up.svg"); mask-image: url("/assets/icons/arrow-up.svg"); }
.hero, .chapter, .story-footer { width: min(100%, 100rem); margin: 0 auto; padding-right: clamp(1.25rem, 3vw, 3rem); padding-left: clamp(1.25rem, 3vw, 3rem); }
.hero { position: relative; display: grid; min-height: 100svh; padding-top: clamp(7.5rem, 12vw, 11rem); padding-bottom: clamp(3rem, 6vw, 6rem); grid-template-columns: minmax(0, .92fr) minmax(24rem, 1.08fr); grid-template-areas: ". media" "copy media"; column-gap: clamp(2rem, 5vw, 6rem); align-items: end; }
.hero-copy { grid-area: copy; padding-left: clamp(2rem, 5vw, 5.5rem); }
.hero h1 { max-width: 11ch; margin: 0; font-size: clamp(3.8rem, 5.65vw, 7rem); font-weight: 400; letter-spacing: -.055em; line-height: .88; text-wrap: balance; }
.hero h1 span { white-space: nowrap; }
.hero-copy p { max-width: 35rem; margin: clamp(2rem, 4vw, 3.5rem) 0 0; color: var(--muted); font-size: clamp(1.05rem, 1.5vw, 1.35rem); letter-spacing: -.012em; line-height: 1.5; text-wrap: pretty; }

.media-frame { position: relative; overflow: hidden; margin: 0; border: 1px solid var(--line); background: #eee; }
.hero-visual { width: min(100%, 34rem); align-self: center; justify-self: end; grid-area: media; }
.hero-media { width: 100%; aspect-ratio: 1 / 1; }
.media-frame video { width: 100%; height: 100%; object-fit: cover; }
.interactive-hero { isolation: isolate; background: white; }
.artifact-canvas { position: absolute; z-index: 1; inset: 0; display: block; width: 100%; height: 100%; touch-action: pan-y; }
.interactive-caption { margin: .75rem 0 0; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; letter-spacing: .035em; line-height: 1.35; text-transform: uppercase; }
.media-control { position: absolute; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; background: linear-gradient(transparent, rgb(0 0 0 / 38%)); color: white; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .68rem; letter-spacing: .025em; line-height: 1.35; }
.media-control button { min-width: 3rem; text-align: left; }

.light-story { border-top: 1px solid var(--line); }
.chapter { padding-top: var(--section-space); padding-bottom: var(--section-space); }
.chapter + .chapter { border-top: 1px solid var(--line); }
.chapter-heading { display: grid; margin-bottom: var(--heading-space); grid-template-columns: minmax(8rem, .38fr) minmax(0, 1fr); gap: clamp(1rem, 4vw, 5rem); align-items: start; }
.chapter-number { font-size: clamp(5rem, 11vw, 12rem); font-weight: 300; letter-spacing: -.06em; line-height: .78; }
.chapter-heading h2 { max-width: 12ch; margin: 0; font-size: clamp(2.4rem, 5vw, 5.75rem); font-weight: 500; letter-spacing: -.045em; line-height: .95; text-wrap: balance; }
.chapter-heading h2::before { margin-right: .35em; content: "/"; font-weight: 300; }
.chapter-heading p { max-width: 34rem; margin: clamp(1.5rem, 3vw, 3rem) 0 0; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.4rem); letter-spacing: -.012em; line-height: 1.5; text-wrap: pretty; }

.full-media { margin: 0; }
.full-media img { background: #eeeeec; }
.full-media figcaption, .phone-media figcaption { display: flex; justify-content: space-between; margin-top: .75rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; letter-spacing: .035em; line-height: 1.35; text-transform: uppercase; }
.icon-study { width: min(100%, 44rem); margin-inline: auto; }
.icon-study img { aspect-ratio: 1 / 1; object-fit: contain; }

.matter-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(16rem, .7fr); gap: clamp(1.5rem, 3vw, 3rem); align-items: end; }
.raw-study { aspect-ratio: 1 / 1; }
.debug-study img { aspect-ratio: .72 / 1; object-fit: cover; }

.motion-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(12rem, .28fr); gap: clamp(2rem, 6vw, 7rem); align-items: stretch; }
.motion-media { aspect-ratio: 1.5 / 1; }
.motion-media video { object-fit: cover; }
.parameter-list { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(.68rem, .8vw, .8rem); letter-spacing: .015em; line-height: 1.35; }
.parameter-list div { display: flex; min-height: 3.6rem; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.parameter-list dt, .parameter-list dd { margin: 0; }
.parameter-list dd { color: var(--muted); }

.dark-story { background: var(--night); color: #f3f3f0; }
.dark-story .chapter + .chapter { border-color: var(--night-line); }
.dark-story .chapter-heading p, .dark-story figcaption { color: var(--night-muted); }
.chapter-instrument { position: relative; }
.chapter-instrument::before { position: absolute; top: 0; right: 6%; width: 28rem; height: 24rem; background: radial-gradient(circle, rgb(107 92 255 / 11%), transparent 69%); content: ""; pointer-events: none; }
.tuning-study { position: relative; z-index: 1; width: min(100%, 68rem); margin-left: auto; }
.tuning-study img { max-height: 78svh; object-fit: contain; object-position: right; background: transparent; }
.tuning-note { position: absolute; z-index: 2; top: 50%; left: clamp(2rem, 5vw, 5rem); width: min(29rem, 45%); transform: translateY(-50%); }
.tuning-note span { display: block; margin-bottom: 1.25rem; color: var(--night-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; letter-spacing: .035em; line-height: 1.35; text-transform: uppercase; }
.tuning-note p { margin: 0; color: #f3f3f0; font-size: clamp(1.25rem, 2.1vw, 2rem); font-weight: 400; letter-spacing: -.025em; line-height: 1.2; text-wrap: balance; }
.xcode-study { position: relative; z-index: 1; margin-top: clamp(4rem, 8vw, 8rem); }
.xcode-study img { border: 1px solid var(--night-line); background: #f5f5f2; }

.product-sequence { display: grid; width: min(100%, 58rem); margin-inline: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 4rem); align-items: end; }
.phone-media { margin: 0; }
.phone-media video { aspect-ratio: .462 / 1; border: 1px solid var(--night-line); background: #111; object-fit: cover; }
.icon-coda { display: grid; width: min(100%, 75rem); margin: var(--heading-space) auto 0; padding-top: var(--heading-space); border-top: 1px solid var(--night-line); grid-template-columns: minmax(0, .8fr) minmax(20rem, 1fr); gap: clamp(3rem, 8vw, 10rem); align-items: center; }
.icon-coda-copy > span { display: block; margin-bottom: 1.25rem; color: var(--night-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; letter-spacing: .035em; line-height: 1.35; text-transform: uppercase; }
.icon-coda-copy h3 { max-width: 11ch; margin: 0; font-size: clamp(2.5rem, 4vw, 4.75rem); font-weight: 500; letter-spacing: -.045em; line-height: .95; text-wrap: balance; }
.icon-coda-copy p { max-width: 31rem; margin: clamp(1.5rem, 3vw, 2.5rem) 0 0; color: var(--night-muted); font-size: clamp(1rem, 1.35vw, 1.25rem); letter-spacing: -.012em; line-height: 1.5; text-wrap: pretty; }
.final-icon-study { width: min(100%, 34rem); margin: 0; justify-self: end; }
.final-icon-study img { aspect-ratio: 1 / 1; object-fit: contain; }
.final-icon-study figcaption { display: flex; justify-content: space-between; margin-top: .75rem; color: var(--night-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; letter-spacing: .035em; line-height: 1.35; text-transform: uppercase; }

.story-footer { padding-top: clamp(6.5rem, 13vw, 13rem); padding-bottom: clamp(3rem, 6vw, 6rem); }
.story-footer p { max-width: 16ch; margin: 0 0 clamp(6.5rem, 13vw, 13rem); font-size: clamp(3rem, 7vw, 8rem); font-weight: 400; letter-spacing: -.05em; line-height: .95; text-wrap: balance; }
.story-footer a { display: inline-flex; gap: .6rem; align-items: center; border-bottom: 1px solid var(--night-line); padding-bottom: .45rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; letter-spacing: .035em; line-height: 1.35; text-transform: uppercase; }
.story-footer .ui-icon { width: .9rem; height: .9rem; }

.related-case { background: #0b0b0b; color: var(--paper); }
.related-case-inner { display: grid; width: calc(100% - var(--site-gutter) * 2); max-width: 80rem; margin: 0 auto; padding-block: clamp(4rem, 7vw, 7rem); grid-template-columns: 1fr 1fr; gap: clamp(3rem, 9vw, 10rem); align-items: center; }
.related-case .section-label { margin: 0 0 1.75rem; color: #aaa; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .6875rem; letter-spacing: .035em; line-height: 1.5; }
.related-case h2 { max-width: 11ch; margin: 0; font-size: clamp(2.35rem, 3.5vw, 3.5rem); font-weight: 400; letter-spacing: -.045em; line-height: 1.1; text-wrap: balance; }
.related-case-copy > p:not(.section-label) { max-width: 28rem; margin: 1.75rem 0 0; color: #aaa; font-size: 1.0625rem; letter-spacing: -.012em; line-height: 1.65; }
.related-case-copy .text-link { margin-top: 2rem; text-decoration: underline; text-underline-offset: .35em; }
.related-case-visual { display: block; width: 100%; max-width: 30rem; aspect-ratio: 1; justify-self: end; overflow: hidden; border: 1px solid #343432; border-radius: 1.5rem; background: #eeeee9; }
.related-case-visual img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.related-case-visual:focus-visible { outline: 2px solid #fff; outline-offset: 6px; }

@media (max-width: 900px) {
  .hero { min-height: auto; padding-top: 8rem; grid-template-columns: 1fr; grid-template-areas: "copy" "media"; row-gap: 2.5rem; }
  .hero-copy { padding-left: 0; }
  .hero-visual { width: 100%; max-width: 46rem; justify-self: stretch; }
  .chapter-heading { grid-template-columns: 1fr; }
  .chapter-number { font-size: 5.5rem; }
  .matter-grid, .motion-layout { grid-template-columns: 1fr; }
  .debug-study { width: min(72%, 28rem); margin-left: auto; }
  .parameter-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
  .tuning-note { position: static; width: min(100%, 36rem); margin-bottom: 3rem; transform: none; }
  .icon-coda { grid-template-columns: 1fr; }
  .final-icon-study { width: min(100%, 34rem); justify-self: center; }
}

@media (max-width: 600px) {
  .hero h1 { font-size: clamp(3.75rem, 18vw, 5.8rem); }
  .hero h1 span { white-space: normal; }
  .hero-copy p { max-width: 28rem; }
  .chapter { padding-top: 6.5rem; padding-bottom: 6.5rem; }
  .chapter-heading { margin-bottom: 3.9rem; }
  .chapter-heading h2 { font-size: 2.75rem; line-height: .98; }
  .icon-study img { aspect-ratio: auto; }
  .parameter-list { grid-template-columns: 1fr; }
  .product-sequence { width: min(82%, 26rem); grid-template-columns: 1fr; gap: 3rem; }
  .phone-media { width: 100%; }
  .story-footer p { font-size: clamp(3rem, 14vw, 5rem); }
  .related-case-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .related-case-visual { max-width: 24rem; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
