/* Sparsha Digital: site styles (direction A "The Touch" + C "Two Worlds") */

body { background: var(--deep); }
body.loading { overflow: hidden; }
em { font-style: normal; }
.w-mask { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; }
.w { display: inline-block; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: #fff; color: var(--navy); padding: 10px 16px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 4px; }

#surface { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; display: block; }
main, footer { position: relative; z-index: 1; }

/* ---------- cursor ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; }
.cursor-dot { width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--ember);
  display: grid; place-items: center; transition: width .35s var(--ease-out), height .35s var(--ease-out), margin .35s var(--ease-out), background .3s, opacity .3s; }
.cursor-dot span { font-size: 12px; font-weight: 500; color: #fff; opacity: 0; transition: opacity .2s; }
.cursor.link .cursor-dot { width: 44px; height: 44px; margin: -22px 0 0 -22px; background: rgba(217,103,58,.2); }
.cursor.view .cursor-dot { width: 88px; height: 88px; margin: -44px 0 0 -44px; background: var(--navy); }
.cursor.view .cursor-dot span { opacity: 1; }
.cursor.light .cursor-dot { background: var(--ivory); }
.cursor.hide .cursor-dot { opacity: 0; }
@media (hover: none) { .cursor { display: none; } }

/* ---------- nav: dark over the surface, light over ivory sections ---------- */
.nav .nav-links { color: rgba(255,255,255,.78); }
.nav .nav-links a:hover { color: #fff; }
.nav .nav-cta { background: #fff; color: var(--navy); }
.nav .nav-cta:hover { background: var(--ember); color: #fff; }
.nav.condensed .nav-inner { background: rgba(14, 28, 58, .66); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1), 0 10px 30px -12px rgba(0,0,0,.35); }
.nav.on-light .nav-links { color: var(--slate); }
.nav.on-light .nav-links a:hover { color: var(--navy); }
.nav.on-light .nav-cta { background: var(--navy); color: #fff; }
.nav.on-light.condensed .nav-inner { background: rgba(244, 243, 238, .74); box-shadow: inset 0 0 0 1px rgba(19,37,74,.08), 0 10px 30px -12px rgba(14,28,58,.18); }
.nav .logo-light, .nav.on-light .logo-dark { display: none; }
.nav.on-light .logo-light { display: block; }
.menu-btn { display: none; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.12); position: relative; }
.menu-btn i { position: absolute; left: 14px; right: 14px; height: 1.5px; background: currentColor; transition: transform .4s var(--ease-out); }
.menu-btn i:first-child { top: 18px; } .menu-btn i:last-child { top: 25px; }
.nav { color: #fff; } .nav.on-light { color: var(--navy); }
.nav.on-light .menu-btn { background: rgba(19,37,74,.07); }
.sheet { position: fixed; inset: 0; z-index: 45; background: var(--deep); color: #fff; padding: 110px var(--pad) 40px; display: flex; flex-direction: column; justify-content: space-between;
  clip-path: inset(0 0 100% 0); transition: clip-path .7s var(--ease-out); }
.sheet a.big { display: block; font-family: var(--display); font-weight: 500; font-size: 44px; letter-spacing: -0.03em; line-height: 1.25; }
.sheet p { color: var(--mist); font-size: 14px; }
body.menu-open .sheet { clip-path: inset(0 0 0 0); }
body.menu-open .nav { color: #fff; }
body.menu-open .menu-btn i:first-child { transform: translateY(3.5px) rotate(45deg); }
body.menu-open .menu-btn i:last-child { transform: translateY(-3.5px) rotate(-45deg); }
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav .nav-cta { display: none; }
  .nav.condensed .nav-inner { padding: 8px 8px 8px 18px; }
}

/* ---------- preloader ---------- */
.pre { position: fixed; inset: 0; z-index: 100; background: var(--deep); color: #fff; }
.pre .mark { position: absolute; }
.pre-count { position: absolute; left: var(--pad); bottom: calc(var(--pad) - 10px); font-family: var(--display); font-weight: 300;
  font-size: clamp(64px, 11vw, 160px); line-height: .8; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.pre-status { position: absolute; right: var(--pad); bottom: var(--pad); text-align: right; }
.pre-status .label { display: block; color: var(--mist); font-size: 11px; }
.pre-status .label + .label { color: var(--ember-light); margin-top: 6px; }
.pre-top { position: absolute; left: var(--pad); right: var(--pad); top: 28px; display: flex; justify-content: space-between; }
.pre-top .label { font-size: 11px; color: var(--mist); }

/* ---------- hero: two worlds merge (pinned) ---------- */
.hero { height: 340vh; color: #fff; }
.hero-stage { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.side { position: absolute; top: 0; bottom: 0; width: 50%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.side.l { left: 0; } .side.r { right: 0; }
.side .big { font-family: var(--display); font-weight: 600; font-size: clamp(56px, 11.5vw, 210px); letter-spacing: -0.06em; line-height: .85; color: var(--ivory); will-change: transform; }
.side .sub { margin: 26px 0 0; font-size: 15px; line-height: 24px; color: rgba(255,255,255,.85); max-width: 26ch; }
.side .label { color: rgba(255,255,255,.92); margin-bottom: 22px; font-size: 12px; }
.hero-mark { position: absolute; left: 50%; top: 50%; width: min(24vw, 300px); aspect-ratio: 452 / 200; transform: translate(-50%, -50%); }
.hero-mark > span { position: absolute; inset: 0; }
.hero-mark .mark { width: 100%; height: 100%; overflow: visible; }
.hero-mark .color { opacity: 0; }
.hero-top { position: absolute; top: 96px; left: var(--pad); right: var(--pad); display: flex; justify-content: space-between; }
.hero-top .label { font-size: 11px; color: rgba(255,255,255,.85); }
.hero-hint { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--display); font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: rgba(255,255,255,.85); white-space: nowrap; }
.hero-hint i { width: 1px; height: 40px; background: rgba(255,255,255,.25); position: relative; overflow: hidden; }
.hero-hint i::after { content: ''; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: #fff; animation: cue 2.2s var(--ease-out) infinite; }
@keyframes cue { to { top: 110%; } }
.merged { position: absolute; left: 0; right: 0; top: 56%; text-align: center; padding: 0 var(--pad); }
.merged h1 { font-family: var(--display); font-weight: 600; font-size: clamp(40px, 6.6vw, 112px); letter-spacing: -0.045em; line-height: .93; margin: 0; }
.merged h1 em { color: var(--ember-light); }
.merged-foot { margin-top: 30px; display: flex; flex-direction: column; align-items: center; gap: 26px; }
.merged-foot p { margin: 0; color: var(--mist); max-width: 46ch; font-size: 16px; line-height: 26px; }
.merged-foot .ctas { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; justify-content: center; }
@media (max-width: 700px) {
  .side .sub, .side .label { display: none; }
  .side .big { font-size: 12.5vw; }
  .hero-mark { width: 44vw; }
  .merged { top: 54%; }
}

.btn { display: inline-flex; align-items: center; gap: 12px; padding: 17px 26px; border-radius: 999px; background: #fff; color: var(--navy); font-weight: 500; font-size: 16px; line-height: 1; transition: background .3s, color .3s; will-change: transform; }
.btn:hover { background: var(--ember); color: #fff; }
.btn .arr { transition: transform .4s var(--ease-out); }
.btn:hover .arr { transform: translateX(4px); }
.ghost { color: var(--mist); font-size: 15px; border-bottom: 1px solid var(--line-dark); padding-bottom: 2px; transition: color .2s, border-color .2s; }
.ghost:hover { color: #fff; border-color: var(--mist); }

/* ---------- services (pinned, navy) ---------- */
.services { position: relative; height: 400vh; background: var(--deep); color: #fff; }
.stage { position: sticky; top: 0; height: 100vh; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; align-items: center; padding: 0 var(--pad); }
.stage .mark { width: min(40vw, 560px); justify-self: center; overflow: visible; }
.chapters { position: relative; height: 360px; }
.chapter { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 22px; opacity: 0; }
.chapter .label { color: var(--ember-light); }
.chapter h2 { font-family: var(--display); font-weight: 500; font-size: clamp(40px, 5.6vw, 88px); letter-spacing: -0.035em; line-height: .95; margin: 0; }
.chapter h2 em { color: var(--ember-light); }
.chapter p { color: var(--mist); max-width: 38ch; margin: 0; }
.chapter ul { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; color: var(--mist); }
.chapter li::before { content: '— '; color: var(--line-dark); }
.stage-head { position: absolute; top: 96px; left: var(--pad); right: var(--pad); display: flex; justify-content: space-between; }
.stage-head .label { font-size: 11px; color: var(--mist); }
.stage-rail { position: absolute; left: var(--pad); right: var(--pad); bottom: 36px; display: flex; gap: 24px; }
.stage-rail div { flex: 1; font-family: var(--display); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--line-dark); padding-top: 12px; position: relative; transition: color .4s; }
.stage-rail div::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--line-dark); }
.stage-rail div b { position: absolute; top: 0; left: 0; height: 1px; width: 100%; background: var(--ember); transform: scaleX(0); transform-origin: 0 0; }
.stage-rail div.on { color: #fff; }
@media (max-width: 800px) {
  .stage { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .stage .mark { width: 70vw; align-self: end; margin-bottom: 4vh; }
  .chapters { align-self: start; height: 320px; }
}

/* ---------- ivory band: manifesto, process, work ---------- */
.ivory { background: var(--ivory); color: var(--navy); }
.label { }
.manifesto-wrap { height: 220vh; }
.manifesto { position: sticky; top: 0; height: 100vh; display: grid; place-items: center; padding: 0 var(--pad); }
.manifesto p { font-family: var(--display); font-weight: 500; font-size: clamp(28px, 4.4vw, 64px); line-height: 1.08; letter-spacing: -0.03em; max-width: 22ch; margin: 0; }
.manifesto .w { color: #CFD2D6; }
.manifesto .label { display: block; margin-bottom: 32px; }

.process { position: relative; height: 380vh; }
.process-stage { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
.process-head { padding: 0 var(--pad); display: flex; justify-content: space-between; align-items: end; gap: 40px; margin-bottom: 8vh; }
.process-head h2, .work-head h2 { font-family: var(--display); font-weight: 500; font-size: clamp(36px, 5vw, 76px); letter-spacing: -0.035em; line-height: .95; margin: 14px 0 0; max-width: 14ch; }
.process-head p, .work-head p { max-width: 32ch; color: var(--slate); margin: 0; }
.track-wrap { position: relative; }
.track { display: flex; padding-left: var(--pad); will-change: transform; }
.week { flex: 0 0 min(34vw, 440px); padding: 34px 40px 0 0; }
.week .n { font-family: var(--display); font-weight: 300; font-size: clamp(64px, 7vw, 112px); letter-spacing: -0.05em; line-height: .8; }
.week .n small { font-size: 13px; letter-spacing: .3em; font-weight: 400; color: var(--slate); margin-left: 8px; vertical-align: top; }
.week h3 { font-family: var(--display); font-weight: 500; font-size: 26px; margin: 26px 0 8px; letter-spacing: -0.01em; }
.week p { color: var(--slate); margin: 0; font-size: 15px; line-height: 24px; max-width: 30ch; }
.track-line, .track-fill { position: absolute; left: 0; top: 0; height: 1px; width: 100%; }
.track-line { background: var(--line); }
.track-fill { background: var(--ember); transform-origin: 0 0; transform: scaleX(0); }
.spark-dot { position: absolute; top: 0; left: 0; width: 56px; height: 26px; margin: -13px 0 0 -28px; }
.spark-dot .mark { width: 100%; height: 100%; }
@media (max-width: 800px) { .week { flex-basis: 78vw; } .process-head { flex-direction: column; align-items: start; gap: 18px; } }

.work { padding: 16vh var(--pad) 18vh; }
.work-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 56px; gap: 40px; }
.projects { display: grid; grid-template-columns: repeat(12, 1fr); gap: 72px 24px; }
.project:nth-child(1) { grid-column: 1 / span 7; }
.project:nth-child(2) { grid-column: 9 / span 4; margin-top: 22vh; }
.project:nth-child(3) { grid-column: 3 / span 8; }
.shot { position: relative; overflow: hidden; border-radius: 4px; aspect-ratio: 4 / 3; clip-path: inset(18% 12% 18% 12%); }
.project:nth-child(2) .shot { aspect-ratio: 3 / 4; }
.project:nth-child(3) .shot { aspect-ratio: 16 / 9; }
.shot-inner { position: absolute; inset: -8%; }
.meta { display: flex; justify-content: space-between; margin-top: 18px; font-size: 14px; }
.meta b { font-family: var(--display); font-weight: 500; font-size: 22px; letter-spacing: -0.01em; }
.meta span { color: var(--slate); }
.p1 { background: var(--navy); }
.p1 .phone { position: absolute; width: 26%; aspect-ratio: 9/19; border-radius: 26px; background: var(--ivory); left: 50%; top: 50%; transform: translate(-50%, -46%) rotate(-6deg); box-shadow: 0 40px 80px -30px rgba(0,0,0,.6); }
.p1 .phone::before { content: ''; position: absolute; inset: 14% 10% auto; height: 18%; border-radius: 10px; background: var(--ember); }
.p1 .phone::after { content: ''; position: absolute; inset: 38% 10% 10%; border-radius: 6px; background: repeating-linear-gradient(var(--line) 0 10px, transparent 10px 24px); }
.p1 .ring { position: absolute; width: 70%; aspect-ratio: 1; border: 1px solid var(--line-dark); border-radius: 50%; left: 15%; top: 10%; }
.p2 { background: var(--ember); }
.p2 .type { position: absolute; left: 10%; bottom: 8%; font-family: var(--display); font-weight: 600; font-size: clamp(40px, 6vw, 96px); line-height: .85; color: var(--ivory); letter-spacing: -0.05em; }
.p2 .sun { position: absolute; width: 46%; aspect-ratio: 1; border-radius: 50%; background: var(--ivory); right: -6%; top: 8%; }
.p3 { background: var(--mist); }
.p3 .browser { position: absolute; left: 12%; right: 12%; top: 16%; bottom: -10%; background: var(--ivory); border-radius: 10px 10px 0 0; box-shadow: 0 30px 80px -30px rgba(19,37,74,.5); }
.p3 .browser::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 30px; border-bottom: 1px solid var(--line); }
.p3 .browser i { position: absolute; left: 7%; top: 22%; width: 46%; height: 16%; background: var(--navy); border-radius: 4px; }
.p3 .browser b { position: absolute; right: 7%; top: 22%; width: 30%; height: 52%; background: var(--tide); border-radius: 4px; }
.p3 .browser u { position: absolute; left: 7%; top: 46%; width: 40%; height: 28%; background: repeating-linear-gradient(var(--line) 0 8px, transparent 8px 20px); }
@media (max-width: 800px) { .project:nth-child(n) { grid-column: 1 / -1; margin-top: 0; } .work-head { flex-direction: column; align-items: start; gap: 18px; } }

/* ---------- the touch: transparent over the surface ---------- */
.touch { position: relative; height: 100vh; min-height: 640px; color: #fff; overflow: hidden; }
.touch .mark { position: absolute; left: 50%; top: 58%; width: min(46vw, 560px); transform: translate(-50%, -50%); overflow: visible; }
.touch-copy { position: absolute; left: 0; right: 0; top: 13vh; padding: 0 var(--pad); text-align: center; }
.touch-copy h2 { font-family: var(--display); font-weight: 500; font-size: clamp(38px, 5.6vw, 88px); letter-spacing: -0.035em; line-height: .95; margin: 16px 0 0; }
.touch-copy h2 em { color: var(--ember-light); }
.swap { display: grid; }
.swap > * { grid-area: 1 / 1; transition: opacity .6s, transform .8s var(--ease-out); }
.swap .after { opacity: 0; transform: translateY(30px); }
.touch.done .before { opacity: 0; transform: translateY(-30px); }
.touch.done .after { opacity: 1; transform: none; }
.touch-hint { position: absolute; bottom: 12vh; left: 0; right: 0; text-align: center; color: var(--mist); font-size: 14px; transition: opacity .4s; }
.touch.done .touch-hint { opacity: 0; }
.touch-cta { position: absolute; bottom: 11vh; left: 50%; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; display: flex; gap: 18px; align-items: center; white-space: nowrap; transition: opacity .6s .2s, transform .8s .2s var(--ease-out); }
.touch.done .touch-cta { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
@media (max-width: 600px) { .touch-cta { flex-direction: column; } }

/* ---------- footer ---------- */
footer { background: var(--deep); color: var(--mist); padding: 0 var(--pad) 40px; font-size: 14px; }
.foot-grid { border-top: 1px solid var(--line-dark); padding-top: 40px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.foot-grid h4 { font-family: var(--display); font-weight: 400; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--slate); margin: 0 0 14px; }
.foot-grid a { display: block; line-height: 30px; transition: color .2s; }
.foot-grid a:hover { color: #fff; }
.egg { display: inline-flex; flex-direction: column; cursor: default; }
.egg .nav-logo { height: 26px; width: auto; }
.egg small { font-size: 13px; margin-top: 14px; opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .5s var(--ease-out); }
.egg:hover small, .egg:focus-within small { opacity: 1; transform: none; }
.egg small b { font-weight: 500; color: var(--ember-light); font-size: 16px; }
.foot-base { margin-top: 48px; display: flex; justify-content: space-between; font-size: 13px; color: var(--slate); }
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- reduced motion: no pinning, no travel ---------- */
.reduced .hero { height: auto; }
.reduced .hero-stage { position: relative; height: 100vh; }
.reduced .services, .reduced .manifesto-wrap, .reduced .process { height: auto; }
.reduced .stage, .reduced .manifesto, .reduced .process-stage { position: relative; height: auto; min-height: 100vh; }
.reduced .stage { grid-template-columns: 1fr; padding-block: 140px 120px; gap: 60px; }
.reduced .chapters { height: auto; display: grid; gap: 64px; }
.reduced .chapter { position: relative; opacity: 1; }
.reduced .stage-rail, .reduced .spark-dot { display: none; }
.reduced .track { flex-wrap: wrap; padding-right: var(--pad); gap: 40px 0; }
.reduced .process-stage { padding-block: 120px; }
.reduced .shot { clip-path: none; }
@media (max-width: 600px) {
  .pre-status { left: var(--pad); right: auto; text-align: left; bottom: calc(var(--pad) + 96px); }
}
@media (max-width: 600px) { .hero-top .label:last-child { display: none; } }

/* =================== polish pass =================== */

/* hero: each word is swallowed by the seam at the centre line */
.side { overflow: hidden; }

/* the ivory chapter is a sheet laid over the navy, with soft corners at both ends */
.ivory { position: relative; z-index: 2; border-radius: clamp(22px, 3vw, 44px);
  background-color: var(--ivory);
  /* fine paper grain, static and cheap (tiled SVG noise) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .07  0 0 0 0 .14  0 0 0 0 .29  0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  box-shadow: 0 -30px 80px -40px rgba(0, 0, 0, .5); }
.services .stage { transform-origin: 50% 100%; }

/* services: a large outlined chapter numeral sits quietly behind the copy */
.chapter::before { content: attr(data-n); position: absolute; left: -.04em; top: 50%; transform: translateY(-58%); z-index: -1;
  font-family: var(--display); font-weight: 600; font-size: clamp(180px, 26vw, 400px); letter-spacing: -0.06em; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.2px rgba(169, 195, 214, .22); pointer-events: none; }
.chapters { isolation: isolate; }

/* process: the spark rides upright with a soft glow */
.spark-dot::before { content: ''; position: absolute; left: 50%; top: 50%; width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 153, 106, .35), rgba(240, 153, 106, 0) 65%); }
.spark-dot > span { position: relative; display: block; width: 100%; height: 100%; }
.week { transition: opacity .4s; }

/* work: the shot presses in, the title gains an arrow */
.shot { transition: transform .8s var(--ease-out), border-radius .8s var(--ease-out); }
.project:hover .shot { transform: scale(.975); border-radius: 14px; }
.meta b { display: inline-flex; align-items: center; gap: 10px; }
.meta b::after { content: '→'; font-weight: 300; color: var(--ember-deep); opacity: 0; transform: translateX(-8px); transition: opacity .4s, transform .6s var(--ease-out); }
.project:hover .meta b::after { opacity: 1; transform: none; }

/* footer: the wordmark, huge and quiet, rising out of the floor */
.foot-word { margin: 56px calc(var(--pad) * -1) -40px; height: 21vw; overflow: hidden; position: relative; }
.foot-word .word { width: 100%; height: auto; transform: translateY(30%); }
/* services holds for one extra screen while the ivory sheet slides over it */
.services { height: 500vh; }
.ivory { margin-top: -100vh; }
.reduced .ivory { margin-top: 0; }
.foot-word .word { transform: none; }
.stage .mark { width: min(34vw, 480px); }
@media (max-width: 800px) { .stage .mark { width: 64vw; } }
.stage .mark { margin-right: 6vw; }
@media (max-width: 800px) { .stage-head { display: none; } .stage .mark { margin-right: 0; } }

/* =================== preloader v2 =================== */
.pre-line { position: absolute; height: 1px; width: 0; margin-top: -.5px; pointer-events: none; }
.pre-line.l { left: 0; background: linear-gradient(90deg, rgba(240,153,106,0), rgba(240,153,106,.35) 40%, #F0996A); }
.pre-line.r { right: 0; background: linear-gradient(270deg, rgba(169,195,214,0), rgba(169,195,214,.35) 40%, #A9C3D6); }
/* a glowing pen tip on the drawing end of each line */
.pre-line::after { content: ''; position: absolute; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; transition: opacity .3s; }
.pre-line.l::after { right: -3.5px; background: #FFC79A; box-shadow: 0 0 10px 3px rgba(240,153,106,.7); }
.pre-line.r::after { left: -3.5px; background: #D5E6F1; box-shadow: 0 0 10px 3px rgba(134,172,200,.7); }
.pre.lines-done .pre-line::after { opacity: 0; }

.pre-count { overflow: hidden; line-height: 1; padding-top: .04em; }
#count { display: flex; }
.digit { display: inline-block; height: 1em; overflow: hidden; }
.digit i { display: block; transition: transform .5s cubic-bezier(.16, 1, .3, 1); will-change: transform; }
.digit b { display: block; height: 1em; line-height: 1em; font-weight: inherit; text-align: center; }
.digit.d0 { width: 0; transition: width .5s cubic-bezier(.16, 1, .3, 1); }
#count.hundred .digit.d0 { width: .5em; }
.status-roll { display: block; overflow: hidden; }
.status-roll .label { display: block; }
/* only the slow columns roll; the ones column ticks instantly so it always reads cleanly */
.digit.d2 i { transition: none; }
.digit.d1 i { transition-duration: .32s; }
/* digits tick crisply (a mid-roll digit reads as a broken glyph at this speed) */
.digit i, .digit.d1 i { transition: none; }
.digit { padding: 0 .015em; }
.digit i { font-style: normal; }

/* =================== device QA fixes (WebKit pass) =================== */
/* small phones: footer goes single-column so the email never overflows */
@media (max-width: 420px) {
  .foot-grid { grid-template-columns: 1fr; gap: 26px; }
  .foot-base { flex-direction: column; gap: 6px; }
}
.foot-grid a { overflow-wrap: anywhere; }

/* short phones (iPhone SE and similar): services chapters must fit above the mark */
@media (max-width: 800px) and (max-height: 720px) {
  .stage { grid-template-rows: 1.25fr .75fr; }
  .chapters { height: 300px; }
  .chapter { gap: 14px; }
  .chapter h2 { font-size: 34px; }
  .chapter p { font-size: 15px; line-height: 23px; }
  .chapter ul { display: none; }
  .stage .mark { width: 52vw; margin-bottom: 9vh; }
  .chapter::before { font-size: 150px; }
  .touch-copy { top: 10vh; }
  .touch .mark { top: 52%; width: 62vw; }
  .touch-cta { bottom: 6vh; gap: 12px; }
  .merged-foot { margin-top: 20px; gap: 18px; }
  .merged-foot p { font-size: 15px; line-height: 23px; }
}

/* placeholder project art: keep the headline inside the card */
.p2 .type { bottom: 16%; }
@media (max-width: 800px) and (max-height: 720px) {
  .touch-cta .ghost { display: none; }   /* the button already opens the email */
}

/* iOS Safari: 100vh ignores the visible toolbar, so pinned screens use the small viewport unit */
@supports (height: 100svh) {
  .hero-stage, .stage, .manifesto, .process-stage { height: 100svh; }
  .touch { height: 100svh; }
  .foot-word { height: 21vw; }
}

/* =================== portrait phones: the two worlds stack =================== */
/* human on top, digital below, the seam runs across the middle (surface.js matches at aspect < .8) */
@media (max-aspect-ratio: 4/5) {
  .side { left: 0; right: 0; width: 100%; height: 50%; bottom: auto; }
  .side.l { top: 0; justify-content: flex-end; padding-bottom: max(12vh, 26vw); }
  .side.r { top: 50%; justify-content: flex-start; padding-top: max(12vh, 26vw); }
  .side .big { font-size: min(23vw, 150px); }
  .side .label { display: block; margin-bottom: 14px; }
  .side .sub { display: block; margin-top: 14px; font-size: 14px; line-height: 21px; max-width: 30ch; }
  .hero-mark { width: min(46vw, 260px); }
}
@media (max-aspect-ratio: 4/5) and (max-height: 600px) {
  .side .sub { display: none; }
}

/* =================== phones: process becomes a vertical timeline =================== */
@media (max-width: 800px) {
  .process { height: auto; }
  .process-stage, .reduced .process-stage { position: relative; height: auto; overflow: visible; display: block; padding: 16vh 0 12vh; }
  .process-head { margin-bottom: 9vh; }
  .track-wrap { margin: 0 var(--pad); padding-left: 34px; }
  .track { flex-direction: column; flex-wrap: nowrap; padding: 0; gap: 52px; transform: none !important; }
  .week { flex: none; padding: 0; position: relative; }
  .week .n { font-size: 64px; }
  .week h3 { margin-top: 16px; }
  .week p { max-width: 34ch; }
  /* node on the line for each week; lights up when the spark reaches it */
  .week::before { content: ''; position: absolute; left: -38px; top: 22px; width: 9px; height: 9px; border-radius: 50%;
    background: var(--ivory); box-shadow: 0 0 0 1px var(--line); transition: background .4s, box-shadow .4s; }
  .week.on::before { background: var(--ember); box-shadow: 0 0 0 4px rgba(217, 103, 58, .18); }
  .track-line, .track-fill { left: 0; top: 0; width: 1px; height: 100%; }
  .track-fill { transform-origin: 0 0; transform: scaleY(0); }
  .spark-dot, .reduced .spark-dot { display: block; left: 0; top: 0; width: 44px; height: 20px; margin: -10px 0 0 -22px; }
}

/* Safari/WebKit: overflow:hidden doesn't clip children animated on their own layer; clip-path does */
.side { clip-path: inset(0); }

/* portrait phones: keep the stacked hero uncluttered (the nav already carries the brand) */
@media (max-aspect-ratio: 4/5) {
  .hero-top { display: none; }
  .side .label { display: none; }
  .side.l { padding-bottom: max(9vh, 22vw); }
  .side.r { padding-top: max(9vh, 22vw); }
}
@media (max-aspect-ratio: 4/5) and (max-height: 760px) {
  .side .sub { display: none; }
}
/* very short screens: let the contact scene fit the viewport */
@media (max-height: 660px) { .touch { min-height: 0; } }
