/* GLOW theme layout and components. Reads tokens.css only: no raw colours, sizes or timings in here. */

/* ---------------- base ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--nav-h); background: var(--ink-0); }
html.motion { scroll-behavior: smooth; }
body {
  margin: 0; background: transparent; color: var(--text);   /* html carries the page colour, so the ambient layer shows through */
  font: var(--w-body) var(--fs-md)/var(--lh-body) var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: clip; min-height: 100vh;
}
h1, h2, h3, p, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, video, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }   /* the display rule above must not beat the hidden attribute */
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }   /* the outline follows each element's own radius */
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip {
  position: fixed; left: var(--s-4); top: var(--s-4); z-index: 200; padding: var(--s-3) var(--s-4);
  border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font-weight: var(--w-bold);
  translate: 0 -200%;
}
.skip:focus { translate: 0 0; }
.noscript { padding: var(--s-8) var(--gutter); color: var(--text-2); text-align: center; }
main:focus { outline: none; }
.wrap { max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* the page behind everything: a fine dot grid that fades out, and slow orange light drifting under it */
.ambient { position: fixed; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; }
.ambient::before {
  content: ""; position: absolute; inset: 0; background-image: var(--dot-grid); background-size: var(--dot-gap) var(--dot-gap);
  -webkit-mask-image: var(--dot-mask-page); mask-image: var(--dot-mask-page);
}
.am { position: absolute; display: block; width: var(--glow-page-size); aspect-ratio: 1; border-radius: 50%; background: var(--glow-page); will-change: transform; }
.am--1 { left: calc(var(--glow-page-size) * -.35); top: 18%; }
.am--2 { right: calc(var(--glow-page-size) * -.4); top: 45%; }
.am--3 { left: 30%; bottom: calc(var(--glow-page-size) * -.55); }

.ico { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sico { width: 18px; height: 18px; flex: none; fill: currentColor; }
.logo { fill: currentColor; height: auto; }

/* headings: white fading to grey */
.grad {
  background: var(--head-grad); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent; padding-bottom: .06em;
}
.h2 { font-size: var(--fs-h2); font-weight: var(--w-head); line-height: var(--lh-head); letter-spacing: var(--track-h2); max-width: 20ch; text-wrap: balance; }
.t1 { color: var(--text); }
.t2 { color: var(--text-3); }

/* the lit dot (slide captions, card notes) */
.dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow), 0 0 2px var(--accent); }

/* buttons */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 22px; border-radius: var(--r-pill); white-space: nowrap;
  font-size: var(--fs-md); font-weight: var(--w-bold); letter-spacing: -.005em;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), translate var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn--sm { min-height: 38px; padding: 0 16px; font-size: var(--fs-sm); }
.btn--lg { min-height: 56px; padding: 0 28px; font-size: var(--fs-lg); }
.btn--accent { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-cta); isolation: isolate; }
.btn--accent::before {
  content: ""; position: absolute; z-index: -1; left: 12%; right: 12%; bottom: -16px; height: 28px;
  background: var(--glow-under); filter: blur(12px); pointer-events: none;
}
.btn--accent:hover { background: var(--accent-hi); translate: 0 -1px; }
/* a band of light crosses the orange on hover (and every few seconds on the hero button) */
.btn--accent::after {
  content: ""; position: absolute; z-index: -1; inset: 0; border-radius: inherit; pointer-events: none;
  background: var(--shine) no-repeat; background-size: 250% 100%; background-position: 130% 0;
}
.motion .btn--accent:hover::after { background-position: -30% 0; transition: background-position var(--shine-dur) var(--ease); }
.btn--glass {
  border: 1px solid var(--line-2); background: var(--glass); color: var(--text); box-shadow: var(--glass-edge);
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
}
.btn--glass:hover { border-color: var(--line-3); }

/* lit panel: spotlight from the top, a bright edge above it */
.panel {
  position: relative; overflow: clip; isolation: isolate; border-radius: var(--r-panel);
  border: 1px solid var(--line); background: var(--spot), var(--ink-1);
  padding: clamp(28px, 5vw, 72px);
}
.beam { position: absolute; z-index: 1; top: -1px; left: 50%; width: var(--beam-w); height: 1px; translate: -50% 0; background: var(--beam); pointer-events: none; }
.beam::after { content: ""; position: absolute; left: 15%; right: 15%; top: 0; height: 28px; background: var(--spot-soft); filter: blur(6px); }

/* ---------------- nav ---------------- */
.bar {
  position: fixed; z-index: 50; top: 0; left: 0; right: 0; height: var(--nav-h);
  padding: 0 calc(var(--inset) + var(--gutter));
  transition: background-color var(--t-mid) var(--ease), border-color var(--t-mid) var(--ease);
  border-bottom: 1px solid transparent;
}
.bar.scrolled {
  background: var(--glass-strong); border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
}
.nav { height: 100%; max-width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s-4); }
/* the logo sits on an orange tile, the same mark as the favicon and the social profile pictures */
.mark {
  display: inline-flex; align-items: center; justify-content: center; justify-self: start; height: 40px; padding: 0 13px;
  border-radius: var(--r-tile); background: var(--accent); color: var(--accent-ink);
  box-shadow: var(--tile-edge); transition: background-color var(--t-fast) var(--ease);
}
.mark:hover { background: var(--accent-hi); }
.mark:focus-visible { border-radius: var(--r-tile); }
.mark .logo { width: 58px; }
.nav-links { display: flex; gap: var(--s-1); padding: var(--s-1); border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--glass); -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur)); }
.nav-links a { padding: 7px 16px; border-radius: var(--r-pill); color: var(--text-2); font-size: var(--fs-sm); font-weight: var(--w-mid); transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.nav-links a:hover { color: var(--text); background: var(--ink-3); }
.nav-r { justify-self: end; display: flex; align-items: center; gap: var(--s-2); }
.menu-btn { display: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--glass); align-items: center; justify-content: center; }
.menu-btn .ico { width: 18px; height: 18px; }
.menu {
  position: absolute; top: calc(var(--nav-h) - var(--s-1)); right: calc(var(--inset) + var(--gutter));
  min-width: 220px; padding: var(--s-2); border-radius: var(--r-card); border: 1px solid var(--line-2);
  background: var(--glass-strong); -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-card);
}
.menu a { display: block; padding: var(--s-3) var(--s-4); border-radius: var(--r-media); font-weight: var(--w-mid); }
.menu a:hover { background: var(--ink-3); }

/* ---------------- hero ---------------- */
/* the panel hangs from the very top of the window: no dark strip above it (Kim, 18 Nov) */
.hero { padding: 0 var(--inset); }
.hero-panel {
  position: relative; overflow: clip; isolation: isolate; border-radius: 0 0 var(--r-panel) var(--r-panel);
  border: 1px solid var(--line); border-top: 0; background: var(--spot), var(--ink-1);
  padding: calc(var(--nav-h) + var(--hero-pad-top)) 0 clamp(20px, 2.6vw, 32px); text-align: center;
}
.hero-fx { position: absolute; z-index: -1; inset: 0; pointer-events: none; }
.hero-fx::before {
  content: ""; position: absolute; inset: 0; background-image: var(--dot-grid); background-size: var(--dot-gap) var(--dot-gap);
  -webkit-mask-image: var(--dot-mask-hero); mask-image: var(--dot-mask-hero);
}
.fx-head { position: absolute; display: block; left: 50%; top: 2%; width: min(1100px, 120%); aspect-ratio: 2 / 1; translate: -50% 0; border-radius: 50%; background: var(--glow-head); }
.hero-copy { max-width: 980px; margin: 0 auto; padding: 0 var(--gutter); display: flex; flex-direction: column; align-items: center; gap: var(--s-5); }
.hero h1 { font-size: var(--fs-h1); font-weight: var(--w-head); line-height: var(--lh-tight); letter-spacing: var(--track-h1); max-width: 15ch; text-wrap: balance; }
/* each word carries the white-to-grey fill; the padding keeps descenders inside the painted box */
.hero h1 .w {
  display: inline-block; padding: .06em .1em .16em; margin: -.06em -.1em -.16em;
  background: var(--head-grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.lede { font-size: var(--fs-lg); color: var(--text-2); max-width: 52ch; text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s-4) var(--s-5); margin-top: var(--s-2); }
.socials { display: flex; gap: var(--s-2); }
.socials a {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--glass); color: var(--text-2);
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.socials a:hover { color: var(--text); border-color: var(--line-3); }
.socials .sico { width: 17px; height: 17px; }
.proof { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-4) var(--s-7); margin-top: var(--s-6); padding: 0 var(--gutter); }
.proof > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.proof > div + div { padding-left: var(--s-7); border-left: 1px solid var(--line); }
.proof dt { font-size: var(--fs-h3); font-weight: var(--w-head); letter-spacing: -.02em; color: var(--accent); line-height: 1.1; }
.proof dd { font-size: var(--fs-sm); color: var(--text-3); max-width: 26ch; line-height: 1.35; }
/* count-up: the final figure holds the width, the live figure sits on top of it */
.cnt { display: inline-grid; justify-items: center; }
.cnt > span { grid-area: 1 / 1; }
.cnt-ghost { visibility: hidden; }

/* the stage: a coverflow of Kim's mockups. app.js sets --tx, --tz, --ry and --shade on each slide from the tokens */
.stage { position: relative; margin-top: var(--stage-gap); }
.stage::before {
  content: ""; position: absolute; z-index: 0; left: 4%; right: 4%; top: -16%; bottom: 8%; background: var(--glow-deck); pointer-events: none;
  translate: calc(var(--gx, 0) * var(--par-glow) * -1) calc(var(--gy, 0) * var(--par-glow) * -1);   /* the slower, farther layer */
}
/* The deck is flat: each slide is drawn in z-index order (app.js sets it), not depth-sorted in 3D. In 3D the leaving and
   arriving slides cut through each other mid-step and left a hard line down the middle. The deck holds the perspective;
   --px/--py (the smoothed pointer) move the eye. Clicks go to the slides. */
.deck {
  position: relative; z-index: 1; transform-style: flat; touch-action: pan-y;
  -webkit-user-select: none; user-select: none; pointer-events: none;
  perspective: var(--stage-persp);
  perspective-origin: calc(50% - var(--px, 0) * var(--par-eye)) calc(var(--deck-eye-y) - var(--py, 0) * var(--par-eye) * .5);
}
/* registered so the step transitions on these three alone; the tilt and the pointer turn in the same transform stay instant */
@property --tx { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --tz { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --ry { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.deck-sizer { display: block; width: var(--deck-w); aspect-ratio: 16 / 10; margin: 0 auto; visibility: hidden; }
.slide {
  position: absolute; top: 0; left: 50%; width: var(--deck-w); aspect-ratio: 16 / 10; pointer-events: auto;
  /* read right to left: centre the slide on the deck, turn it, move it out and back, then the whole deck's lean (scroll
     tilt) and the pointer turn around the deck's bottom centre (the slide box starts at the deck's centre, so 0 100%) */
  transform-origin: 0 100%;
  transform: rotateX(calc(var(--tilt, var(--tilt-static)) - var(--py, 0) * var(--par-turn-x))) rotateY(calc(var(--px, 0) * var(--par-turn-y)))
             translate3d(var(--tx), 0, var(--tz)) rotateY(var(--ry)) translateX(-50%);
  --dd: var(--deck-in-dur); --de: var(--deck-in-ease);
}
.slide.is-out { --dd: var(--deck-out-dur); --de: var(--deck-out-ease); }   /* moving away from the middle */
.deck.is-live .slide { transition: --tx var(--dd) var(--de), --tz var(--dd) var(--de), --ry var(--dd) var(--de), opacity var(--deck-fade) var(--ease-out); }
.deck.is-live .slide.is-jump { transition: none; }   /* a hidden slide wrapping to the other end (app.js layout) */
.slide.is-far { opacity: 0; pointer-events: none; }
.slide-in {
  position: relative; display: block; width: 100%; height: 100%; overflow: hidden; border-radius: var(--r-media);
  background: var(--ink-2); box-shadow: var(--shadow-screen); -webkit-user-drag: none;
}
.slide-in img { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; transition: scale var(--t-slow) var(--ease-out); }
.slide-in::before { content: ""; position: absolute; z-index: 2; inset: 0; border-radius: inherit; background: var(--glare); pointer-events: none; }
.slide-in::after { content: ""; position: absolute; z-index: 1; inset: 0; background: var(--ink-0); opacity: var(--shade, 0); pointer-events: none; transition: opacity var(--dd) var(--de); }   /* side slides sit in shadow */
.slide.is-cur .slide-in:hover img { scale: 1.03; }
.slide-in:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--r-media); }
.slide-cap {
  position: absolute; z-index: 3; left: var(--s-4); bottom: var(--s-4); max-width: calc(100% - var(--s-6));
  display: inline-flex; align-items: center; gap: var(--s-2); padding: 8px 14px 8px 11px;
  border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--glass-strong); box-shadow: var(--glass-edge);
  color: var(--text); font-size: var(--fs-sm); line-height: 1.2; white-space: nowrap;
  opacity: 0; translate: 0 8px; transition: opacity var(--t-mid) var(--ease), translate var(--t-mid) var(--ease-out);
}
.slide.is-cur .slide-cap { opacity: 1; translate: 0 0; transition-delay: .25s; }
.slide-cap b { font-weight: var(--w-bold); }
.slide-cap span { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text-3); }

/* carousel controls: arrows, one dot per project (the active one fills while it waits), pause */
.deck-ctrl { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: var(--s-2); margin-top: var(--deck-ctrl-gap); }
.deck-btn {
  display: grid; place-items: center; width: var(--deck-btn); height: var(--deck-btn); flex: none; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--glass); color: var(--text-2); box-shadow: var(--glass-edge);
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.deck-btn:hover { color: var(--text); border-color: var(--line-3); }
.deck-btn .ico { width: 18px; height: 18px; }
.deck-play { margin-left: var(--deck-play-gap); }
.deck-play .ico { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.deck-dots { display: flex; align-items: center; }
.deck-dot { display: grid; place-items: center; width: var(--deck-dot-w); height: var(--deck-ctrl-h); flex: none; transition: width var(--t-mid) var(--ease-out); }
.deck-dot i { position: relative; display: block; width: 6px; height: 6px; overflow: hidden; border-radius: var(--r-pill); background: var(--line-3); transition: width var(--t-mid) var(--ease-out), background-color var(--t-mid) var(--ease); }
.deck-dot:hover i { background: var(--text-3); }
.deck-dot[aria-current] { width: var(--deck-dot-cur); }
.deck-dot[aria-current] i { width: var(--deck-pill); background: var(--accent-soft); }
.deck-dot[aria-current] i::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--accent); transform-origin: 0 50%; }
.stage.is-running .deck-dot[aria-current] i::after { animation: fill var(--deck-interval) linear both; }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.deck-dot:focus-visible { outline: none; }
.deck-dot:focus-visible i { outline: 2px solid var(--accent); outline-offset: 4px; }

/* client logos: Kim's real files, grey until you point at one, on a slow loop that stops for the pointer and focus */
.logos { padding: clamp(28px, 4vw, 44px) 0 0; overflow: hidden; -webkit-mask-image: var(--fade-x); mask-image: var(--fade-x); }
.logo-row { display: flex; width: max-content; }
.logo-set { display: flex; align-items: center; }
.logo-set li { padding: 0 calc(var(--logo-gap) / 2); }
.logo-a { display: block; padding: var(--s-2); border-radius: var(--s-2); }
.logo-a img {
  width: auto; max-width: none; height: calc(var(--logo-h) * var(--k, 1));
  filter: var(--logo-mute); opacity: var(--logo-dim); transition: filter var(--t-mid) var(--ease), opacity var(--t-mid) var(--ease);
}
.logo-a:hover img, .logo-a:focus-visible img { filter: none; opacity: 1; }
.motion .logo-row { animation: marquee var(--marquee-dur) linear infinite; }
.logos:hover .logo-row, .logos:focus-within .logo-row { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
html:not(.motion) .logos { -webkit-mask-image: none; mask-image: none; }
html:not(.motion) .logo-row { width: auto; justify-content: center; }
html:not(.motion) .logo-set { flex-wrap: wrap; justify-content: center; }
html:not(.motion) .logo-set[aria-hidden] { display: none; }

/* ---------------- sections ---------------- */
.work, .about, .services, .contact { padding-top: var(--sec); }
.sec-head { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-4); margin-bottom: clamp(32px, 4vw, 56px); }

/* work: bento of dark cards */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(12px, 1.4vw, 20px); }
.card { grid-column: span 4; }
.card--xl { grid-column: span 7; }
.card--l { grid-column: span 5; }
.card-in {
  position: relative; isolation: isolate; display: flex; flex-direction: column; height: 100%; padding: var(--s-2);
  border-radius: var(--r-card); border: 1px solid var(--line); background: var(--spot-card), var(--ink-2);
  box-shadow: var(--shadow-card); transition: border-color var(--t-mid) var(--ease);
}
.card-in::before {
  content: ""; position: absolute; z-index: 2; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), var(--sheen), transparent 60%);
  transition: opacity var(--t-mid) var(--ease);
}
.card-in:hover { border-color: var(--line-2); }
.card-in:hover::before { opacity: 1; }
.card-in:focus-visible { border-radius: var(--r-card); }
.card-media { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; border-radius: calc(var(--r-card) - 8px); background: var(--ink-2); }
.card--xl .card-media { aspect-ratio: 16 / 10; }
/* the l card sits beside an xl card: its picture stretches to the row height instead of leaving a gap */
.card--l .card-media { aspect-ratio: auto; flex: 1 1 0; min-height: 240px; }
.card--l .card-media img, .card--l .card-media video { position: absolute; inset: 0; }
.card--l .card-body { flex: none; }
.card-media img, .card-media video { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease-out); }
.card-in:hover .card-media img, .card-in:hover .card-media video { transform: scale(1.03); }
.card-go {
  position: absolute; z-index: 3; top: var(--s-3); right: var(--s-3); display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-cta);
  transition: background-color var(--t-fast) var(--ease), scale var(--t-mid) var(--ease-out);
}
.card-in:hover .card-go, .card-in:focus-visible .card-go { background: var(--accent-hi); scale: 1.08; }
.card-body { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: var(--s-4) var(--s-3) var(--s-3); }
.card-meta { font-size: var(--fs-xs); color: var(--text-3); letter-spacing: var(--track-label); font-weight: var(--w-mid); }
.card-body h3 { font-size: var(--fs-h3); font-weight: var(--w-bold); letter-spacing: -.02em; line-height: 1.15; }
.card-does { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.45; text-wrap: pretty; }
.card-note {
  align-self: flex-start; margin-top: auto; display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 5px 11px 5px 9px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--ink-3);
  font-size: var(--fs-xs); color: var(--text-2); line-height: 1.3;
}
.card-body .card-note { margin-top: auto; }
.card-note .dot { box-shadow: 0 0 6px var(--accent-glow); }
.card-does { margin-bottom: var(--s-3); }


/* about */
.about-panel { display: grid; grid-template-columns: minmax(180px, 1fr) 2.3fr; gap: clamp(24px, 5vw, 80px); align-items: start; }
.about-side { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-5); }
.about-logo {
  display: grid; place-items: center; width: clamp(120px, 13vw, 176px); aspect-ratio: 1; border-radius: calc(var(--r-tile) * 2);
  background: var(--spot-accent), var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-cta);
}
.about-logo .logo { width: 70%; }
.statement { font-size: var(--fs-statement); font-weight: var(--w-head); line-height: 1.08; letter-spacing: -.03em; text-wrap: balance; margin-bottom: var(--s-5); }
.body { font-size: var(--fs-lg); color: var(--text-2); max-width: 58ch; text-wrap: pretty; }

/* services */
.svc { display: flex; flex-wrap: wrap; gap: clamp(12px, 1.4vw, 16px); }
.svc-card {
  flex: 1 1 260px; display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-5); min-height: 196px;
  border-radius: var(--r-card); border: 1px solid var(--line); background: var(--spot-card), var(--ink-2);
}
.svc-card { transition: border-color var(--t-mid) var(--ease), translate var(--t-mid) var(--ease-out); }
.svc-card:hover { border-color: var(--line-2); translate: 0 -2px; }
.svc-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
/* each service gets a raised dark tile with an orange line icon (Lucide set, same family as the rest of the site) */
.svc-ico {
  display: grid; place-items: center; width: var(--icon-tile); height: var(--icon-tile); flex: none;
  border-radius: var(--r-media); border: 1px solid var(--line-2); background: var(--icon-tile-bg); color: var(--accent);
  box-shadow: var(--icon-tile-glow); transition: box-shadow var(--t-mid) var(--ease), scale var(--t-mid) var(--ease-out);
}
.svc-ico .ico { width: 22px; height: 22px; stroke-width: 1.7; }
.svc-card:hover .svc-ico { box-shadow: var(--icon-tile-hot); scale: 1.06; }
.svc-card .n { font-size: var(--fs-sm); font-weight: var(--w-bold); color: var(--text-3); font-variant-numeric: tabular-nums; }
.svc-card h3 { font-size: var(--fs-h3); font-weight: var(--w-bold); letter-spacing: -.02em; line-height: 1.15; margin-top: var(--s-3); }   /* headings line up under the icon row */
.svc-card p { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.5; }
.tools { margin-top: clamp(40px, 5vw, 64px); padding-top: var(--s-6); border-top: 1px solid var(--line); }
.tools-h { font-size: var(--fs-md); font-weight: var(--w-bold); color: var(--text); margin-bottom: var(--s-5); }
.tool-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: var(--s-5); }
.tool-gh { font-size: var(--fs-xs); font-weight: var(--w-mid); color: var(--text-3); letter-spacing: var(--track-label); margin-bottom: var(--s-3); }
.tool-list { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.tool {
  display: inline-flex; align-items: center; gap: var(--s-2); padding: 7px 13px 7px 10px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--ink-2); font-size: var(--fs-sm); color: var(--text-2); line-height: 1.2;
}
.tico { width: 16px; height: 16px; flex: none; fill: currentColor; color: var(--text); }
.tico--none { border-radius: 50%; border: 1px solid var(--line-3); background: var(--ink-3); }

/* contact */
.contact-panel {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-5); text-align: center;
  padding: clamp(56px, 9vw, 120px) clamp(20px, 5vw, 72px) clamp(28px, 4vw, 44px);
}
.contact-panel .h2 { max-width: 15ch; }
.contact-cta { margin-top: var(--s-2); }
.contact-cta .sico { width: 20px; height: 20px; }
.contact-foot {
  width: 100%; margin-top: clamp(32px, 5vw, 64px); padding-top: var(--s-5); border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--s-5); text-align: left;
}
.card-lines { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); color: var(--text-3); }
.card-lines b { color: var(--text); font-weight: var(--w-bold); font-size: var(--fs-md); }
.elsewhere ul { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.elsewhere a { display: inline-flex; align-items: center; gap: var(--s-1); font-size: var(--fs-sm); color: var(--text-2); font-weight: var(--w-mid); border-radius: var(--s-1); transition: color var(--t-fast) var(--ease); }
.elsewhere a:hover { color: var(--text); }

/* the hot panel: the big orange moment, same look as Kim's orange posts. Ink on orange only (5.6:1). */
.panel--hot { background: var(--spot-accent), var(--accent); border-color: transparent; color: var(--accent-ink); box-shadow: 0 40px 90px -40px var(--accent-glow); }
.panel--hot .beam { opacity: .55; }
.panel--hot .grad { background: none; color: var(--accent-ink); -webkit-text-fill-color: var(--accent-ink); }
.panel--hot .dot { background: var(--accent-ink); box-shadow: none; }
.panel--hot .btn--accent { background: var(--ink-0); color: var(--text); box-shadow: var(--shadow-ink-btn); }
.panel--hot .btn--accent::before, .panel--hot .btn--accent::after { display: none; }
.panel--hot .btn--accent:hover { background: var(--ink-2); }
.panel--hot :focus-visible { outline-color: var(--accent-ink); }
.panel--hot .contact-foot { border-top-color: var(--on-accent-line); }
.panel--hot .card-lines, .panel--hot .card-lines b, .panel--hot .tool-gh, .panel--hot .elsewhere a { color: var(--accent-ink); }
.panel--hot .card-lines span, .panel--hot .tool-gh { font-weight: var(--w-mid); }
.panel--hot .elsewhere a { text-decoration: underline; text-decoration-color: var(--on-accent-line); text-underline-offset: 3px; }
.panel--hot .elsewhere a:hover { text-decoration-color: var(--accent-ink); }

/* footer */
.foot { padding: var(--sec) 0 var(--s-6); }
.foot-in { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--s-5); padding-top: var(--s-6); border-top: 1px solid var(--line); }
.foot .mark { height: 48px; padding: 0 16px; }
.foot .mark .logo { width: 72px; }
.foot-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2) var(--s-5); }
.foot-nav a { font-size: var(--fs-sm); color: var(--text-2); font-weight: var(--w-mid); border-radius: var(--s-1); }
.foot-nav a:hover { color: var(--text); }
.foot-base { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2) var(--s-5); font-size: var(--fs-xs); color: var(--text-3); }

/* ---------------- case study ---------------- */
.detail {
  position: fixed; z-index: 100; inset: 0; overflow-y: auto; overscroll-behavior: contain; background: var(--ink-0);
  visibility: hidden; opacity: 0; transition: opacity var(--t-mid) var(--ease), visibility 0s linear var(--t-mid);
}
.detail.on { visibility: visible; opacity: 1; transition: opacity var(--t-mid) var(--ease); }
.detail:focus { outline: none; }
.dbar {
  position: sticky; z-index: 3; top: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-3) calc(var(--inset) + var(--gutter)); background: var(--glass-strong); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
}
.dmark { display: inline-flex; align-items: center; height: 36px; padding: 0 11px; border-radius: var(--r-tile); background: var(--accent); color: var(--accent-ink); }
.dmark .logo { width: 50px; }
.dsheet { max-width: calc(1200px + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter) var(--s-9); }
.motion .detail.in .dsheet { animation: rise var(--t-slow) var(--ease-out) both; }
@keyframes rise { from { opacity: 0; translate: 0 var(--reveal-dist); } to { opacity: 1; translate: 0 0; } }
.dhead { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--s-4); text-align: center; padding: clamp(48px, 7vw, 96px) 0 clamp(32px, 4vw, 48px); background: var(--spot-soft); }
.dtitle { font-size: clamp(2.4rem, 1.3rem + 4.4vw, 5rem); font-weight: var(--w-head); line-height: var(--lh-tight); letter-spacing: var(--track-h1); }
.dblurb { font-size: var(--fs-lg); color: var(--text-2); max-width: 60ch; text-wrap: pretty; }
.dmeta { font-size: var(--fs-sm); font-weight: var(--w-mid); color: var(--text-3); letter-spacing: var(--track-label); }
.dmeta:empty { display: none; }
.dcover { overflow: hidden; border-radius: var(--r-panel); border: 1px solid var(--line); background: var(--ink-2); }
.dcover img, .dcover video { width: 100%; height: auto; }
.dstat { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--s-3); margin-top: var(--s-4); }
.dstat > div { padding: var(--s-5); border-radius: var(--r-card); border: 1px solid var(--line); background: var(--spot-card), var(--ink-2); }
.dstat dt { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem); font-weight: var(--w-head); letter-spacing: -.03em; line-height: 1.05; color: var(--accent); }
.dstat dd { font-size: var(--fs-sm); color: var(--text-3); margin-top: var(--s-1); }
.dbody { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(28px, 4vw, 56px); margin: clamp(40px, 6vw, 72px) 0; }
.dbody.nofacts { grid-template-columns: 1fr; }
.dbody.nofacts .dfacts { display: none; }
.dfacts > div { padding: var(--s-3) 0; border-top: 1px solid var(--line); }
.dfacts dt { font-size: var(--fs-xs); color: var(--text-3); letter-spacing: var(--track-label); }
.dfacts dd { font-size: var(--fs-sm); color: var(--text); margin-top: 2px; }
.dsections { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--s-6) clamp(24px, 3vw, 40px); }
.dsec h3 { font-size: var(--fs-h3); font-weight: var(--w-bold); letter-spacing: -.02em; margin-bottom: var(--s-3); }
.dsec p { font-size: var(--fs-md); color: var(--text-2); max-width: 62ch; }
.dmore { text-align: center; margin: 0 0 clamp(32px, 4vw, 48px); }
.dgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.dghead { grid-column: 1 / -1; font-size: var(--fs-h3); font-weight: var(--w-bold); letter-spacing: -.02em; margin-top: var(--s-6); }
.gp.wide { grid-column: 1 / -1; }
.gm { overflow: hidden; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--ink-2); }
.gm img, .gm video { width: 100%; height: auto; }
.motion .gm img { opacity: 0; transition: opacity var(--t-mid) var(--ease); }
.motion .gm img.ld { opacity: 1; }
.gp figcaption { margin-top: var(--s-3); font-size: var(--fs-sm); color: var(--text-3); line-height: 1.45; }
.gp figcaption i { font-style: normal; }
.dcta { margin-top: clamp(56px, 7vw, 96px); display: flex; flex-direction: column; align-items: center; gap: var(--s-5); text-align: center; }
.dnext {
  display: flex; flex-direction: column; gap: var(--s-2); width: 100%; margin-top: var(--s-4); padding: var(--s-6);
  border-radius: var(--r-card); border: 1px solid var(--line); background: var(--ink-2); text-align: left;
  transition: border-color var(--t-mid) var(--ease);
}
.dnext:hover { border-color: var(--line-2); }
.dnext:focus-visible { border-radius: var(--r-card); }
.dnext-t { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); font-size: clamp(1.6rem, 1rem + 2vw, 2.6rem); font-weight: var(--w-head); letter-spacing: -.03em; }

/* ---------------- motion (only when the visitor allows it) ---------------- */
/* the headline rises word by word, then the lede, buttons and numbers follow, then the carousel lifts in */
.motion .hero h1 .w { opacity: 0; translate: 0 var(--word-dist); transition: opacity var(--t-slow) var(--ease-out), translate var(--t-slow) var(--ease-out); transition-delay: calc(var(--i) * var(--word-step) + 120ms); }
.motion.ready .hero h1 .w { opacity: 1; translate: 0 0; }
.motion .hero-copy > :not(h1) { opacity: 0; translate: 0 16px; transition: opacity var(--t-slow) var(--ease-out), translate var(--t-slow) var(--ease-out); }
.motion.ready .hero-copy > :not(h1) { opacity: 1; translate: 0 0; }
.motion.ready .hero-copy > :nth-child(2) { transition-delay: 380ms; }
.motion.ready .hero-copy > :nth-child(3) { transition-delay: 470ms; }
.motion .stage, .motion .logos { opacity: 0; translate: 0 48px; transition: opacity 1.1s var(--ease-out) 420ms, translate 1.3s var(--ease-out) 420ms; }
.motion .logos { transition-delay: 700ms; }
.motion.ready .stage, .motion.ready .logos { opacity: 1; translate: 0 0; }

/* the orange light drifts slowly behind the page, and the glow behind the headline breathes */
.motion .am { animation: drift var(--drift-dur) ease-in-out infinite alternate; }
.motion .am--2 { animation-duration: calc(var(--drift-dur) * 1.3); animation-delay: -9s; animation-direction: alternate-reverse; }
.motion .am--3 { animation-duration: calc(var(--drift-dur) * .8); animation-delay: -17s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(var(--drift-x), calc(var(--drift-y) * -1)) scale(1.08); }
  100% { transform: translate(calc(var(--drift-x) * -.6), var(--drift-y)) scale(.94); }
}
.motion .fx-head { animation: breathe calc(var(--drift-dur) / 4) ease-in-out infinite alternate; }
@keyframes breathe { from { opacity: .7; } to { opacity: 1; } }

/* the hero button catches the light every few seconds */
.motion .btn--shine::after { animation: shine var(--shine-every) var(--ease) 2.4s infinite; }
@keyframes shine { 0%, 80% { background-position: 130% 0; } 93%, 100% { background-position: -30% 0; } }

/* the bright edge on a lit panel slides slowly along the top */
.motion .beam--sweep { animation: sweep var(--beam-dur) ease-in-out infinite alternate; }
@keyframes sweep { from { transform: translateX(-38%); } to { transform: translateX(38%); } }

.motion [data-reveal] { opacity: 0; translate: 0 var(--reveal-dist); transition: opacity var(--t-slow) var(--ease-out), translate var(--t-slow) var(--ease-out); }
.motion [data-reveal].in { opacity: 1; translate: 0 0; }
.motion .svc-card[data-reveal].in { transition: opacity var(--t-slow) var(--ease-out), translate var(--t-mid) var(--ease-out), border-color var(--t-mid) var(--ease); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}

/* ---------------- smaller screens ---------------- */
@media (max-width: 899px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card, .card--xl, .card--l { grid-column: span 1; }
  .card:first-child { grid-column: 1 / -1; }
  .card--xl .card-media, .card--l .card-media { aspect-ratio: 4 / 3; flex: none; min-height: 0; }
  .card:first-child .card-media { aspect-ratio: 16 / 10; }
  .card--l .card-media img, .card--l .card-media video { position: static; }
  .card--l .card-body { flex: 1; }
  .about-panel { grid-template-columns: 1fr; }
  .dbody { grid-template-columns: 1fr; }
}
@media (max-width: 759px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav-links { display: none; }
  .menu-btn { display: inline-flex; }
  .svc-card { min-height: 0; padding: var(--s-4) var(--s-5) var(--s-5); }
  .svc-card h3 { margin-top: var(--s-2); }
  .proof > div + div { padding-left: 0; border-left: 0; }
  .proof { gap: var(--s-4); flex-direction: column; }
  .dgrid { grid-template-columns: 1fr; }
}
@media (max-width: 599px) {
  /* phones keep two columns: the first project full width, the rest as small cards (name and type only) */
  .card:not(:first-child) .card-does, .card:not(:first-child) .card-note { display: none; }
  .card:not(:first-child) .card-in { padding: 6px; }
  .card:not(:first-child) .card-body { padding: var(--s-3) var(--s-2) var(--s-2); gap: 2px; }
  .card:not(:first-child) .card-body h3 { font-size: var(--fs-md); }
  .card:not(:first-child) .card-go { width: 30px; height: 30px; top: var(--s-2); right: var(--s-2); }
  .foot-in { grid-template-columns: 1fr; }
  .foot-nav { justify-content: flex-start; }
  .contact-foot { flex-direction: column; align-items: flex-start; }
  /* the carousel controls fit a 320px phone: tighter gaps here, smaller arrows and current dot come from tokens.css */
  .deck-ctrl { gap: var(--s-1); }
  .slide-cap { left: var(--s-2); bottom: var(--s-2); max-width: calc(100% - var(--s-4)); padding: 6px 11px 6px 9px; font-size: var(--fs-xs); }
  .slide-cap span { display: none; }
}
@media (max-width: 380px) {
  .nav-r .btn--sm { padding: 0 12px; }
  .mark .logo { width: 72px; }
  .hero-actions .btn { width: 100%; }
  .dmark { display: none; }   /* the detail bar keeps Back and Next only, so neither runs off the edge */
}
