/* ==========================================================================
   Dopler — shared styles (every page)
   Sizes are written in design pixels from the 1440×1024 Figma frames and
   multiplied by --u, so each "stage" scales to fit the screen like the design.
   ========================================================================== */
:root {
  /* theme: three base colours, swapped by clicking the asterisk (js/theme.js animates them; dark mode turns
     white into #353535, #353535 into white and the purple into #FEE75C). Everything else is mixed from them. */
  --c-bg: #ffffff;
  --c-ink: #353535;
  --c-accent: #6b58f6;
  --inv: 0;                                                  /* 0 light → 1 dark, for things that can only be inverted */
  --purple: var(--c-accent);
  --purple-deep: color-mix(in srgb, var(--c-accent) 84%, #000);
  --purple-dark: color-mix(in srgb, var(--c-accent) 40%, #000);
  --purple-shade1: color-mix(in srgb, var(--c-accent) 91%, #000);   /* the character's rim shading */
  --purple-shade2: color-mix(in srgb, var(--c-accent) 80%, #000);
  --ink: var(--c-ink);
  --ink-2: var(--c-ink);
  --mute: color-mix(in srgb, var(--c-ink) 60%, transparent);
  --line: color-mix(in srgb, var(--c-ink) 13%, var(--c-bg));
  --bg: var(--c-bg);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  /* one design px, fitted to both width and height of the viewport */
  --u: min(calc(100vw / 1440), calc(100svh / 1024));
  /* one design px, fitted to width only */
  --w: calc(100vw / 1440);
  --gutter: max(calc(44 * var(--w)), 16px);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-optical-sizing: auto;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg, video { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }

/* small "(Label)" section heading used across the home page */
.kicker {
  font-size: max(calc(16 * var(--u)), 13px);
  line-height: 30px; letter-spacing: -.015em; color: var(--ink); font-weight: 400;
}

/* ---------- rotating asterisk: one full turn every 4 s, around its true centre (set in js/brand.js) ---------- */
.star-spin {
  transform-box: view-box;
  animation: star-spin 4s linear infinite;
}
/* the asterisk's extra turn when the theme switches (js/theme.js), on top of its steady spin */
.star-spin { rotate: var(--star-x, 0deg); }
.hero-logo .star-spin, .foot-logo .star-spin { cursor: pointer; pointer-events: auto; }
.hero-logo .star-spin:focus, .foot-logo .star-spin:focus { outline: none; }
.hero-logo .star-spin:focus-visible, .foot-logo .star-spin:focus-visible { stroke: var(--ink); stroke-width: 6px; }

/* brand marks and characters take the theme colours (their SVG fill attributes are only the light defaults) */
.star-spin, .ticker-item svg path { fill: var(--purple); }
.hero-logo path:not(.star-spin), .foot-logo path:not(.star-spin), .nav > .nav-mark path:not(.star-spin),
.loader path:not(.star-spin) { fill: var(--ink); }
:is(.char, .lift) stop:nth-child(-n+2) { stop-color: var(--purple); }
:is(.char, .lift) stop:nth-child(3) { stop-color: var(--purple-shade1); }
:is(.char, .lift) stop:nth-child(4) { stop-color: var(--purple-shade2); }
:is(.char, .lift) circle.bubble { fill: var(--purple); }
:is(.char, .lift) .eye { fill: var(--bg); }
/* the footer character is a button (back to top), but it never draws a focus box: tabbing to it wakes it instead */
.char .body:focus, .char .body:focus-visible { outline: none; }
@keyframes star-spin { to { transform: rotate(360deg); } }

/* ---------- typography animation (js/type.js) ----------
   Text waiting to be split is hidden for a moment so it doesn't flash in un-split; the class is only added when
   the script runs, so if it doesn't, text simply shows. Each line is a mask; the padding gives letters room to
   overshoot without being clipped, and the negative margin keeps the layout exactly as before. */
.ta-on [data-ta="wait"] { visibility: hidden; }
/* SplitText names the mask "<linesClass>-mask" → .ta-mask-line-mask; the extra room keeps descenders and accents from being clipped */
.ta-mask-line-mask, .ta-line-mask { padding: .16em .1em .22em; margin: -.16em -.1em -.22em; }

/* ---------- nav (glass bar) ----------
   Matches the Figma nav: square corners, #F2F2F2 over white, soft inner shading on the top and left edges
   (light from -45°). The glass itself (refraction, depth, dispersion, frost) is an SVG filter built in
   js/chrome.js from the same settings used in Figma; browsers without SVG backdrop filters get a plain frost. */
.nav {
  position: fixed; z-index: 50; left: 50%; top: max(calc(43 * var(--u)), 14px);
  transform: translateX(-50%);
  width: min(calc(685 * var(--u)), calc(100vw - 24px)); min-width: min(440px, calc(100vw - 24px));
  height: max(calc(90 * var(--u)), 56px);
  border-radius: 0;
  background: color-mix(in srgb, color-mix(in srgb, var(--c-ink) 20%, var(--c-bg)) 30%, transparent);   /* reads as #F2F2F2 over white, lets colour through */
  -webkit-backdrop-filter: blur(2px) saturate(1.2);
  backdrop-filter: blur(2px) saturate(1.2);
  box-shadow:
    inset max(calc(10 * var(--u)), 6px) max(calc(10 * var(--u)), 6px) max(calc(18 * var(--u)), 12px) calc(-8 * var(--u)) rgba(0, 0, 0, .035),
    inset 1px 1px 0 rgba(255, 255, 255, .55);                /* lit edge: shows over colour, invisible on white */
  transition: transform .5s var(--ease), opacity .4s ease;
}
.nav.glass { -webkit-backdrop-filter: url(#navGlass); backdrop-filter: url(#navGlass); }
/* lit rim: light from -45° (top-left) catches the top and left edges hard and the opposite corner softly */
.nav::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  padding: max(calc(1.5 * var(--u)), 1px);
  background: linear-gradient(135deg, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .35) 22%, rgba(255, 255, 255, 0) 45%,
                                      rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, .45) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.nav.hide { transform: translate(-50%, -160%); }
.nav a {
  font-size: max(calc(20 * var(--u)), 15px); font-weight: 500; letter-spacing: -.015em; line-height: 1.4; color: var(--ink-2);
  /* each item sits at its Figma x position (set as --x in js/chrome.js), centred on it */
  position: absolute; left: var(--x); top: 50%; transform: translate(-50%, -50%); padding: 6px 4px; white-space: nowrap;
}
/* nav links: the "See full project" wipe (see .wipe below), sized so the block sits evenly round the word once it
   has slid in; --pl / --pt are the link's own padding, so the white copy lines up with the label */
.nav a.wipe { --padL: .6em; --padR: .6em; --slide: 0em; --pl: 4px; --pt: 6px; }   /* the word doesn't move in the nav */
/* in the nav the block starts as a dot in the middle of the word and grows into the sharp rectangle, its corners
   squaring off as it grows (fast out, long settle); leaving, it draws back into the dot and the dot goes */
.nav a.wipe .wf {
  --dot: .36em;                                             /* half the dot */
  clip-path: inset(calc(50% - var(--dot)) calc(50% - var(--dot)) round var(--dot)); opacity: 0;
  transition: clip-path .4s cubic-bezier(.55, 0, .25, 1), opacity .1s linear .36s;
}
.nav a.wipe:hover .wf, .nav a.wipe:focus-visible .wf {
  clip-path: inset(0 0 0 0 round 0); opacity: 1;
  transition: clip-path .38s cubic-bezier(.2, .9, .25, 1), opacity .06s linear;
}
@media (prefers-reduced-motion: reduce) { .nav a.wipe .wf, .nav a.wipe:is(:hover, :focus-visible) .wf { transition: opacity .15s linear; } }
/* the white copy of the items, cut to the dark shapes under the bar (js/chrome.js) */
.nav-matte { position: absolute; inset: 0; pointer-events: none; clip-path: inset(50%); }
.nav-matte a { color: var(--bg); }
.nav-matte .wf { display: none; }
.nav-matte .nav-mark path { fill: var(--bg); }
.nav-mark { display: block; padding: 4px; line-height: 0; }
.nav-mark svg { width: max(calc(65 * var(--u)), 48px); height: auto; overflow: visible; }

/* ---------- the character (circle with eyes and bubbles) ---------- */
.char { position: absolute; width: calc(1198 * var(--u)); aspect-ratio: 1; pointer-events: none; }
.char svg { width: 100%; height: 100%; overflow: visible; }
.char .body { pointer-events: auto; }
.char .eye { pointer-events: none; }        /* the eyes are part of the body as far as the mouse is concerned */
.char .bubble { pointer-events: none; }
/* blinking is driven from js/character.js (it changes the eye shape) */


/* pill that follows the cursor (Book a call, Back to top, View project) */
.cursor-pill {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  padding: max(calc(8 * var(--u)), 6px) max(calc(22.5 * var(--u)), 16px); background: var(--bg); color: var(--purple);
  font-size: max(calc(20 * var(--u)), 15px); line-height: 1.45; font-weight: 500; letter-spacing: -.01em; white-space: nowrap;
  opacity: 0; transform: translate(-50%, -50%) scale(.6);
  transition: opacity .2s ease, transform .3s var(--ease);
}
.cursor-pill.dark { background: var(--ink); color: var(--bg); font-size: 12px; padding: 8px 14px; border-radius: 99px; box-shadow: none; }
.cursor-pill.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------- closing: CTA that turns into the footer ---------- */
.closing { position: relative; height: 260svh; }   /* set exactly in js/chrome.js: a hold on the CTA, then the scroll to the footer */
.closing-pin { position: sticky; top: 0; height: 100svh; overflow: hidden; background: var(--bg); }
.closing-stage { position: absolute; left: 50%; top: 0; width: calc(1440 * var(--u)); height: 100svh; transform: translateX(-50%); }
/* the character hangs from the top of the screen itself (fixed, like the hero's sits on the bottom), so its edge is
   never seen as the section scrolls in: it pops down from above as the CTA text appears, and stays */
.closing .char { position: fixed; z-index: 6; left: calc(50% - 599 * var(--u)); top: calc(-629 * var(--u)); transform: rotate(180deg); }
.closing .char.parked { visibility: hidden; translate: 0 -120%; }
.closing .char .body { cursor: none; }      /* the cursor becomes the "Back to top" box, like the hero's "Book a call" */
.cta-copy {
  position: absolute; left: 0; right: 0; top: calc(656 * var(--u));
  display: flex; flex-direction: column; align-items: center; gap: calc(40 * var(--u)); text-align: center;
}
.cta-copy .btn { transition: opacity .5s ease .45s, translate .7s cubic-bezier(.2, .7, .2, 1) .45s; }
.cta-copy:not(.in) .btn { opacity: 0; translate: 0 24px; transition-delay: 0s; }
.ta-on .cta-copy:not(.in) :is(h2, p) { visibility: hidden; }   /* waiting on screen: the stretched letters would peek over their masks */
.cta-copy h2 { font-size: max(calc(72 * var(--u)), 34px); line-height: 1.1; letter-spacing: -.03em; font-weight: 500; color: var(--ink-2); }
.cta-copy p { margin-top: calc(-24 * var(--u)); font-size: max(calc(20 * var(--u)), 15px); line-height: 1.4; letter-spacing: -.01em; color: color-mix(in srgb, var(--ink) 70%, transparent); font-weight: 500; }
/* buttons: the same hover as the Work section's "See full project". A deeper purple wipes in from the left edge,
   the label slides along into it, and the arrow accelerates off to the right and fades as the wipe completes.
   Leaving, everything comes back on the same fast-then-settle curve. */
.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; padding: max(calc(18 * var(--u)), 13px) max(calc(32 * var(--u)), 24px);
  border-radius: 0; background: var(--purple); color: var(--bg); font-size: max(calc(20 * var(--u)), 16px); font-weight: 500; letter-spacing: -.01em;
}
.btn::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--purple-deep); clip-path: inset(0 100% 0 0); transition: clip-path .45s var(--ease); }
.btn-lbl { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; transition: translate .45s var(--ease); }
.btn-arr { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: translate .45s var(--ease), opacity .3s var(--ease); }
.btn:hover::before, .btn:focus-visible::before { clip-path: inset(0 0 0 0); }
.btn:hover .btn-lbl, .btn:focus-visible .btn-lbl { translate: calc(.7em) 0; }
.btn:hover .btn-arr, .btn:focus-visible .btn-arr { translate: 3.2em 0; opacity: 0; transition: translate .45s cubic-bezier(.6, 0, .9, .4), opacity .25s ease .2s; }
@media (prefers-reduced-motion: reduce) { .btn::before, .btn-lbl, .btn-arr { transition: none; } }

.foot { position: absolute; left: 0; right: 0; bottom: 0; height: calc(438 * var(--u)); }
.foot-cols {
  position: absolute; left: calc(80 * var(--u)); right: calc(80 * var(--u)); top: calc(94 * var(--u));
  display: flex; justify-content: space-between; align-items: flex-start;
}
.foot-col { display: flex; flex-direction: column; gap: calc(20 * var(--u)); }
.foot-col:last-child { align-items: flex-start; }
.foot-col h3 { font-size: max(calc(14 * var(--u)), 12px); font-weight: 400; color: var(--mute); letter-spacing: -.01em; }
.foot-col ul { list-style: none; display: flex; flex-direction: column; gap: calc(10 * var(--u)); }
.foot-col a { font-size: max(calc(20 * var(--u)), 15px); font-weight: 500; letter-spacing: -.02em; color: var(--ink-2); line-height: 1.4; position: relative; }
/* footer links: the same wipe, with the same proportions as "See full project" (23 px slide, 42 px of block past the
   word at 20 px), and a little taller than the line so the block reads as a box */
.foot-col a.wipe { --padL: 0em; --padR: 2.1em; --slide: 1.15em; --padY: .2em; }

/* ---------- the "See full project" hover, shared by text links (nav, footer) ----------
   A purple block wipes in from the left; the label slides along into it. The block carries a white copy of the
   label revealed by a moving clip-path mask, so each letter turns white exactly as the block's edge passes over it.
   Markup (built by js/chrome.js): <a class="wipe"><span class="wl">Text</span><span class="wf"><span class="wl">Text</span></span></a> */
.wipe { --padL: 0em; --padR: 0em; --padY: 0em; --slide: 0em; --pl: 0px; --pt: 0px; isolation: isolate; }
.wipe:not(.nav a) { position: relative; display: inline-block; }
.wipe .wl { display: inline-block; white-space: nowrap; transition: translate .45s var(--ease); }
.wipe .wf {
  position: absolute; top: calc(var(--padY) * -1); bottom: calc(var(--padY) * -1);   /* above the dark label: it covers it with the white copy */
  left: calc(var(--padL) * -1); right: calc(var(--padR) * -1);
  background: var(--purple); color: var(--bg); clip-path: inset(0 100% 0 0); transition: clip-path .45s var(--ease); pointer-events: none;
}
.wipe .wf .wl { position: absolute; left: calc(var(--padL) + var(--pl)); top: calc(var(--padY) + var(--pt)); }
.wipe:hover .wf, .wipe:focus-visible .wf { clip-path: inset(0 0 0 0); }
.wipe:hover .wl, .wipe:focus-visible .wl { translate: var(--slide) 0; }
@media (prefers-reduced-motion: reduce) { .wipe .wf, .wipe .wl { transition: none; } }
.foot-logo { position: absolute; left: 50%; bottom: calc(124 * var(--u)); width: calc(767 * var(--u)); transform: translateX(-50%); }
.foot-logo svg { width: 100%; height: auto; overflow: visible; }
/* the logo rises out of its own bottom edge as the footer arrives (the rest of its text plays line by line) */
.foot-logo { clip-path: inset(-50% -10% 0 -10%); }
.foot-logo svg { transition: translate 1.1s cubic-bezier(.16, 1, .3, 1) .15s; }
.foot:not(.in) .foot-logo svg { translate: 0 105%; transition: none; }
.foot-bar {
  position: absolute; left: calc(80 * var(--u)); right: calc(80 * var(--u)); bottom: calc(40 * var(--u));
  display: flex; justify-content: space-between; font-size: max(calc(14 * var(--u)), 12px); color: var(--mute); letter-spacing: -.01em;
}

/* back-to-top overlay: the footer character drops down into the hero character */
.lift { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.lift .veil { position: absolute; inset: 0; background: var(--bg); opacity: 0; }

@media (max-width: 760px) {
  .nav { display: flex; align-items: center; justify-content: space-around; padding: 0 8px; }
  .nav a { position: static; transform: none; }
  .closing .char { width: 150vw; left: -25vw; top: -94vw; }
  .cta-copy { top: auto; bottom: 28svh; padding: 0 20px; gap: 22px; }
  .cta-copy h2 { font-size: 34px; }
  .cta-copy p { margin-top: -10px; }
  .foot { height: 62svh; }
  .foot-cols { left: 20px; right: 20px; top: 0; }
  .foot-col { gap: 12px; }
  .foot-logo { width: calc(100vw - 40px); bottom: 64px; }
  .foot-bar { left: 20px; right: 20px; bottom: 20px; flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .star-spin { animation: none; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}

/* the brand asterisk as a footnote mark on section labels: "(Work✱)" (js/brand.js). Small, raised like a real
   asterisk, in the accent colour; it turns once (three arms' worth) as the label comes into view, and again on hover. */
.ast { display: inline-block; width: .4em; height: .4em; margin: 0 .07em 0 .045em; line-height: 0;
  vertical-align: .33em; }   /* sized and seated like a typeset asterisk: its top on the cap height (Inter: .727em) */
.ast svg { display: block; width: 100%; height: 100%; overflow: visible; transform-origin: 49.6% 49.8%;   /* the star's true centre (centre of the circle through its arm tips) */ rotate: -144deg; scale: .6;
  transition: rotate 1.3s cubic-bezier(.2, .7, .2, 1) .15s, scale .6s cubic-bezier(.3, 1.6, .5, 1) .15s; }
.ast svg path { fill: var(--purple); }
.ast.on svg { rotate: 0deg; scale: 1; }
:hover > .ast.on svg, .ast.on:hover svg { rotate: 72deg; transition: rotate .7s cubic-bezier(.2, .7, .2, 1); }
@media (prefers-reduced-motion: reduce) { .ast svg { rotate: 0deg; scale: 1; transition: none; } }

/* the asterisk on links (js/chrome.js wipeLink): out of the text flow, just after the word, raised like the labels' */
.wipe .wl { position: relative; }
.wipe .wl .ast { position: absolute; left: 100%; top: .2em; margin: 0 0 0 .08em; vertical-align: 0; }
.wipe .wl .ast svg { rotate: -144deg; scale: 0; transition: rotate .35s ease, scale .25s ease; }
/* hover: it pops into the purple block in white, a beat after the block has grown */
.wipe .wf .ast path { fill: var(--bg); }
.wipe:is(:hover, :focus-visible) .wf .ast svg { rotate: 0deg; scale: 1;
  transition: rotate .7s cubic-bezier(.2, .7, .2, 1) .14s, scale .45s cubic-bezier(.3, 1.8, .5, 1) .14s; }
/* active: the link for where you are keeps its asterisk, in the accent colour */
.wipe.is-active > .wl .ast svg { rotate: 0deg; scale: 1;
  transition: rotate .9s cubic-bezier(.2, .7, .2, 1), scale .5s cubic-bezier(.3, 1.8, .5, 1); }
@media (prefers-reduced-motion: reduce) { .wipe .wl .ast svg { transition: none !important; } }

/* the tag that hangs from the footer character when you reach the footer (js/chrome.js): "Click me, I'll fly you up".
   It drops down on its string, sways like something hanging, and hides while you hover the character itself. */
.foot-tag { position: fixed; z-index: 7; left: 50%; top: 0; translate: -50% 0; display: flex; flex-direction: column; align-items: center;
  transform-origin: 50% 0; visibility: hidden; pointer-events: none; animation: ft-sway 3.6s ease-in-out infinite; }
.foot-tag.on { visibility: visible; pointer-events: auto; cursor: pointer; }
.ft-string { width: 1.5px; height: 34px; background: color-mix(in srgb, var(--ink) 55%, transparent); transform-origin: 50% 0; scale: 1 0;
  transition: scale .35s cubic-bezier(.55, 0, .45, 1); }
.ft-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px 9px 12px; border-radius: 99px; white-space: nowrap;
  background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 500; letter-spacing: -.01em; box-shadow: 0 10px 26px rgb(30 20 80 / .2);
  translate: 0 -46px; scale: .6; opacity: 0;
  transition: translate .35s cubic-bezier(.55, 0, .45, 1), scale .3s ease, opacity .2s ease; }
.ft-pill svg { width: 14px; height: 14px; flex: none; }
.ft-pill svg path { fill: var(--purple); }
/* dropping in: the string pays out, then the tag falls to its end and bounces */
.foot-tag.on .ft-string { scale: 1 1; transition: scale .45s cubic-bezier(.2, .7, .3, 1); }
.foot-tag.on .ft-pill { translate: 0 0; scale: 1; opacity: 1;
  transition: translate .8s cubic-bezier(.3, 1.6, .5, 1) .18s, scale .5s cubic-bezier(.3, 1.6, .5, 1) .18s, opacity .15s ease .18s; }
.foot-tag.on:hover .ft-pill { background: var(--purple); }
.foot-tag.on:hover .ft-pill svg path { fill: var(--bg); }
.foot-tag.hush .ft-pill { translate: 0 -46px; scale: .6; opacity: 0; }
.foot-tag.hush .ft-string { scale: 1 0; }
@keyframes ft-sway { 0%, 100% { rotate: -2.5deg; } 50% { rotate: 2.5deg; } }
@media (prefers-reduced-motion: reduce) { .foot-tag { animation: none; } .ft-string, .ft-pill { transition: none !important; } }
