/* Christian Jeremiah — portfolio. Direction: "Bright studio" (warm paper, ink, one electric accent, card grids, pill controls).
   Tokens first, then layout, then components, then motion. Motion is transform and opacity only. */

/* Google Sans (the open successor to Product Sans), Latin subset, self-hosted in fonts/google-sans/ */
@font-face {
  font-family: 'Google Sans';
  src: url('/fonts/google-sans/google-sans-normal.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Google Sans';
  src: url('/fonts/google-sans/google-sans-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
/* Playfair Display italic (Latin), self-hosted in fonts/playfair-display/. Used for the H1 swap word only. */
@font-face {
  font-family: 'Playfair Display';
  src: url('/fonts/playfair-display/playfair-display-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root, :root[data-theme="light"] {
  /* colour: paper ground, ink, one accent, white cards */
  --bg: #f4f2ed;
  --card: #ffffff;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-edge: rgba(255, 255, 255, 0.7);
  --glass-hover: rgba(255, 255, 255, 0.85);
  --surface: #e7e4dc;
  --ink: #151515;
  --muted: #6d6b65;
  --line: #d9d5cb;
  --accent: #2b4cff;
  --accent-ink: #ffffff;
  --field: #151515;      /* dark band */
  --field-ink: #f4f2ed;
  --field-muted: #a9a79f;

  /* five type steps, no more */
  --step-small: clamp(0.875rem, 0.84rem + 0.15vw, 0.9375rem);   /* 14–15px */
  --step-body: clamp(1.0625rem, 1.02rem + 0.25vw, 1.1875rem);   /* 17–19px */
  --step-lead: clamp(1.3125rem, 1.15rem + 0.6vw, 1.6875rem);    /* 21–27px */
  --step-head: clamp(2.25rem, 1.6rem + 2.6vw, 3.75rem);         /* 36–60px */
  --step-display: clamp(3rem, 1.2rem + 6.4vw, 7.5rem);          /* 48–120px */

  /* one radius family, one pair of margins */
  --radius: 22px;
  --radius-sm: 14px;
  --pad: clamp(20px, 3.4vw, 56px);
  --gap: 16px;

  --font: 'Google Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

/* desktop and laptop (incl. scaled displays): 240px side margins so the content sits in the middle of the page */
@media (min-width: 1024px) {
  :root, :root[data-theme="light"], :root[data-theme="dark"] { --pad: 240px; }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--ink);
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--muted) var(--bg);
}

body {
  margin: 0;
  --page-bg: var(--bg); /* resolved here so the hero, which re-declares --bg, can still fade into the page */
  font-family: var(--font);
  font-size: var(--step-body);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
/* Theme-specific pictures: both are in the page, only the active theme's one shows (and loads). */
:root[data-theme="light"] [data-for-theme="dark"],
:root:not([data-theme="light"]) [data-for-theme="light"] { display: none !important; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.035em; line-height: 1; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.field-band :focus-visible { outline-color: var(--field-ink); }

.skip {
  position: absolute; left: var(--pad); top: -100px; z-index: 10;
  background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 999px;
}
.skip:focus { top: 12px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* dark mode: same roles, inverted values. Toggled by data-theme on <html>. */
:root[data-theme="dark"] {
  --bg: #111110;
  --card: #1c1c1b;
  --glass: rgba(28, 28, 27, 0.45);
  --glass-edge: rgba(255, 255, 255, 0.12);
  --glass-hover: rgba(255, 255, 255, 0.12);
  --surface: #262624;
  --ink: #f2f0ea;
  --muted: #a3a197;
  --line: #3a3934;
  --accent: #7d96ff;
  --accent-ink: #0d0d0d;
  --field: #1f1f1d;
  --field-ink: #f2f0ea;
  --field-muted: #a3a197;
  color-scheme: dark;
}
:root[data-theme="dark"] .field input::placeholder,
:root[data-theme="dark"] .field textarea::placeholder { color: #6f6d66; }

/* ---------- theme toggle: shows the icon for the mode you will switch to ---------- */

.theme-toggle {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%; padding: 0; margin-left: 4px;
  background: transparent; color: var(--ink); border: 0; cursor: pointer;
  transition: background-color 200ms ease, transform 160ms var(--ease-out);
}
.theme-toggle:hover { background: var(--bg); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle svg { width: 18px; height: 18px; grid-area: 1 / 1; transition: opacity 240ms ease, transform 400ms var(--ease-out); }
.theme-toggle .icon-sun { opacity: 0; transform: rotate(-60deg); }
:root[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(60deg); }
:root[data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; transform: none; }
:root[data-theme="light"] .theme-toggle .icon-moon, :root:not([data-theme]) .theme-toggle .icon-moon { opacity: 1; }

/* ---------- layout primitives ---------- */

.wrap { padding-inline: var(--pad); }
.small { font-size: var(--step-small); color: var(--muted); }
.display { font-size: var(--step-display); letter-spacing: -0.05em; line-height: 0.92; font-weight: 400; }
.head { font-size: var(--step-head); letter-spacing: -0.04em; line-height: 1; font-weight: 400; }
.lead { font-size: var(--step-lead); line-height: 1.25; letter-spacing: -0.02em; }

/* ---------- top bar: a white pill that floats over the paper ---------- */

.topbar {
  position: sticky; top: 16px; z-index: 5;
  /* Three columns: wordmark | centred links | actions. Equal side columns keep the links truly centred. */
  display: grid; grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  align-items: center; gap: 16px;
  margin: 16px var(--pad) 0;
  padding: 8px 8px 8px 28px;
  border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 8px 32px -12px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.wordmark { font-size: 22px; font-weight: 500; letter-spacing: -0.03em; text-decoration: none; }
/* The nav sits inside the glass top bar, so it carries no surface of its own. */
.nav {
  display: flex; gap: 4px; align-items: center; font-size: var(--step-small);
}
.nav a:not(.btn) {
  font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--muted); padding: 9px 16px; border-radius: 999px;
  transition: color 200ms ease, background-color 200ms ease;
}
.nav a:not(.btn):hover, .nav a:not(.btn)[aria-current="page"] { color: var(--ink); background: var(--glass-hover); }
.wordmark { justify-self: start; }
.topbar__actions { justify-self: end; display: flex; align-items: center; gap: 4px; font-size: var(--step-small); }
.topbar__actions .btn { min-height: 40px; padding: 0 18px; white-space: nowrap; }
/* Language menu: a globe and the current language code; the menu drops below the bar. */
.lang { position: relative; margin-left: 4px; }
.lang > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 12px; border-radius: 999px; color: var(--ink);
  font-size: var(--step-small); font-weight: 500; letter-spacing: 0.02em;
  transition: background-color 200ms ease, transform 160ms var(--ease-out);
}
.lang > summary::-webkit-details-marker { display: none; }
.lang > summary:hover, .lang[open] > summary { background: var(--glass-hover); }
.lang > summary:active { transform: scale(0.96); }
.lang > summary svg { width: 16px; height: 16px; }
.lang__menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 6; min-width: 160px;
  padding: 6px; border-radius: var(--radius-sm); background: var(--card);
  box-shadow: 0 0 0 1px var(--line), 0 16px 40px -16px rgba(0, 0, 0, 0.3);
  transform-origin: top right; animation: lang-in 180ms var(--ease-out);
}
@keyframes lang-in { from { opacity: 0; transform: translateY(-4px) scale(0.97); } }
.lang__menu a {
  display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; transition: background-color 160ms ease, color 160ms ease;
}
.lang__menu a:hover { background: var(--bg); color: var(--ink); }
.lang__menu a[aria-current="true"] { color: var(--ink); }
.lang__menu a[aria-current="true"]::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
/* Phone menu: two bars that cross into an X; the panel drops below the bar like the language menu. */
.menu-toggle, .menu { display: none; }
.menu-toggle {
  place-items: center; flex: none; position: relative;
  width: 40px; height: 40px; border-radius: 50%; padding: 0;
  background: transparent; color: var(--ink); border: 0; cursor: pointer;
  transition: background-color 200ms ease, transform 160ms var(--ease-out);
}
.menu-toggle:hover, .menu-toggle[aria-expanded="true"] { background: var(--glass-hover); }
.menu-toggle:active { transform: scale(0.92); }
.menu-toggle span {
  position: absolute; left: 12px; right: 12px; height: 1.6px; border-radius: 2px; background: currentColor;
  transition: transform 300ms var(--ease-out);
}
.menu-toggle span:first-child { transform: translateY(-4px); }
.menu-toggle span:last-child { transform: translateY(4px); }
.menu-toggle[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }
.menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 10px); z-index: 6;
  flex-direction: column; gap: 12px; padding: 10px;
  max-height: calc(100dvh - 110px); overflow-y: auto; overscroll-behavior: contain;
  border-radius: var(--radius); background: var(--card);
  box-shadow: 0 0 0 1px var(--line), 0 20px 48px -18px rgba(0, 0, 0, 0.35);
  transform-origin: top center; animation: lang-in 200ms var(--ease-out);
}
.menu[hidden] { display: none !important; }
.menu__nav { display: flex; flex-direction: column; }
.menu__nav a {
  display: block; padding: 13px 14px; border-radius: var(--radius-sm);
  font-size: var(--step-body); font-weight: 500; letter-spacing: -0.01em; text-decoration: none; color: var(--ink);
  transition: background-color 160ms ease;
}
.menu__nav a:hover, .menu__nav a[aria-current="page"] { background: var(--bg); }
.menu__nav a[aria-current="page"] { color: var(--accent); }
.menu__theme {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px;
  border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent;
  font: inherit; font-size: var(--step-body); font-weight: 500; color: var(--ink); text-align: left; cursor: pointer;
  transition: background-color 160ms ease;
}
.menu__theme:hover { background: var(--bg); border-radius: var(--radius-sm); }
.menu__theme-icon { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; }
.menu__theme-icon svg { width: 20px; height: 20px; grid-area: 1 / 1; transition: opacity 240ms ease, transform 400ms var(--ease-out); }
.menu__theme .icon-sun { opacity: 0; transform: rotate(-60deg); }
:root[data-theme="dark"] .menu__theme .icon-moon { opacity: 0; transform: rotate(60deg); }
:root[data-theme="dark"] .menu__theme .icon-sun { opacity: 1; transform: none; }
.menu__langs {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 10px 4px 2px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--step-small);
}
.menu__langs svg { width: 16px; height: 16px; margin: 0 6px 0 8px; flex: none; }
.menu__langs a {
  padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--muted);
  transition: background-color 160ms ease, color 160ms ease;
}
.menu__langs a:hover { background: var(--bg); color: var(--ink); }
.menu__langs a[aria-current="true"] { color: var(--ink); background: var(--bg); font-weight: 600; }

@media (max-width: 720px) {
  .topbar { grid-template-columns: 1fr auto; padding-left: 22px; }
  .nav { display: none; }
  /* With scripting, the theme and language controls move into the menu and the contact button stays in the bar;
     without it everything stays in the bar. */
  :root:not(.no-js) .topbar__actions > .theme-toggle, :root:not(.no-js) .topbar__actions > .lang { display: none; }
  :root:not(.no-js) .menu-toggle { display: inline-grid; }
  :root:not(.no-js) .menu { display: flex; }
  .topbar { gap: 8px; }
  .topbar__actions { gap: 6px; }
  .theme-toggle { margin-left: 0; }

  /* Thumb reach: on phones the bar sits at the bottom of the screen and the menu opens upward. */
  .topbar {
    position: fixed; top: auto; left: var(--pad); right: var(--pad); margin: 0;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .menu { top: auto; bottom: calc(100% + 10px); transform-origin: bottom center; animation-name: menu-up; }
  /* The hero no longer has to slide under a bar at the top. */
  .home-hero { --topbar-space: 0px; }
}
@keyframes menu-up { from { opacity: 0; transform: translateY(4px) scale(0.97); } }
@media (max-width: 360px) {
  .topbar { padding-left: 18px; }
  .wordmark { font-size: 20px; }
  .topbar__actions .btn { padding: 0 14px; }
}
@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  .menu { animation: none; }
  .menu-toggle span { transition: none; }
}
/* Laptops with 240px margins leave a narrow bar, so tighten the nav links to keep everything inside it. */
@media (min-width: 721px) and (max-width: 1365px) {
  .topbar { padding-left: 20px; gap: 8px; }
  .nav { gap: 0; }
  .nav a:not(.btn) { padding-inline: 10px; }
}
/* Below 1440px there is no room for six links in every language; Resources and FAQ stay reachable on the page. */
@media (min-width: 721px) and (max-width: 1439px) {
  .nav a[href$="#resources"], .nav a[href$="#faq"] { display: none; }
}
/* Small laptops keep the 240px content margins, so the bar borrows some of that room. */
@media (min-width: 1024px) and (max-width: 1279px) {
  .topbar { margin-inline: calc(var(--pad) - 80px); }
  .lang > summary svg { display: none; }
}

/* ---------- buttons and text links ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font: inherit; font-size: var(--step-small); font-weight: 500; letter-spacing: -0.005em;
  text-decoration: none; border: 0; cursor: pointer; white-space: nowrap;
  transition: background-color 240ms var(--ease-out), transform 160ms var(--ease-out);
}
.btn:hover { background: var(--accent); color: var(--accent-ink); }
.btn:active { transform: scale(0.97); }
.btn svg { width: 16px; height: 16px; transition: transform 240ms var(--ease-out); }
.btn:hover svg { transform: translate(2px, -2px); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--bg); }
.field-band .btn { background: var(--bg); color: var(--ink); }
.field-band .btn:hover { background: var(--accent); color: var(--accent-ink); }

.text-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--step-small); font-weight: 500; text-decoration: none;
  transition: color 200ms ease;
}
.text-link svg { width: 14px; height: 14px; flex: none; transition: transform 240ms var(--ease-out); }
.text-link:hover { color: var(--accent); }
.text-link:hover svg { transform: translate(2px, -2px); }
.text-link:active { transform: scale(0.98); }

/* ---------- HOME: hero ---------- */

/* Full-bleed, full-height hero on the floating-layers artwork. It is pulled up under the sticky topbar
   (16px margin + 58px bar) so the image reaches the top of the viewport. Dark tokens are re-declared
   locally so text, chips and buttons stay legible in both site themes, and a scrim keeps the copy at
   >= 4.5:1 contrast wherever it overlaps the artwork. The copy stays on the --pad grid (240px on desktop). */
.home-hero {
  --ink: #f4f2ed; --muted: #b4b2aa; --card: rgba(255, 255, 255, 0.06); --line: rgba(255, 255, 255, 0.16);
  --bg: #0b0b0b; --accent: #7d96ff; --accent-ink: #0d0d0d;
  --topbar-space: 74px;
  --fade-h: clamp(140px, 24vh, 280px); /* bottom fade into the page background */
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 100vh; min-height: 100svh;
  margin-top: calc(-1 * var(--topbar-space));
  padding: calc(var(--topbar-space) + clamp(48px, 6vw, 96px)) var(--pad) calc(var(--fade-h) * 0.75);
  color: var(--ink);
  background: #0b0b0b; /* shows while the image loads, and if it fails */
}
.home-hero > * { position: relative; z-index: 1; }
.home-hero > .home-hero__bg { position: absolute; inset: 0; z-index: -2; }
.home-hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; display: block; }
.home-hero::before, .home-hero::after { content: ''; position: absolute; z-index: -1; pointer-events: none; }
/* Scrim behind the copy. */
.home-hero::before {
  inset: 0;
  background: linear-gradient(90deg, rgba(11, 11, 11, 0.85) 0%, rgba(11, 11, 11, 0.55) 45%, rgba(11, 11, 11, 0) 70%);
}
/* Seamless edge: the image melts into the page colour (either theme). Eased stops avoid a visible band. */
.home-hero::after {
  inset: auto 0 0 0; height: var(--fade-h);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--page-bg) 0%, transparent) 0%,
    color-mix(in srgb, var(--page-bg) 19%, transparent) 25%,
    color-mix(in srgb, var(--page-bg) 50%, transparent) 50%,
    color-mix(in srgb, var(--page-bg) 81%, transparent) 75%,
    var(--page-bg) 100%);
}
/* Light theme: same composition on paper. The greyscale artwork is inverted so the layers read light. */
:root[data-theme="light"] .home-hero {
  --ink: #151515; --muted: #5f5d57; --card: rgba(255, 255, 255, 0.6); --line: rgba(21, 21, 21, 0.14);
  --bg: #f4f2ed; --accent: #2b4cff; --accent-ink: #ffffff;
  background: #f4f2ed;
}
:root[data-theme="light"] .home-hero::before {
  background: linear-gradient(90deg, rgba(244, 242, 237, 0.9) 0%, rgba(244, 242, 237, 0.6) 45%, rgba(244, 242, 237, 0) 70%);
}
@media (max-width: 720px) {
  /* Copy at the top, layer stack showing below it. */
  .home-hero { --fade-h: 120px; justify-content: flex-start; padding-bottom: clamp(260px, 70vw, 380px); }
  /* Text sits above the artwork on phones, so darken top-down and fade out toward the stack. */
  .home-hero::before { background: linear-gradient(180deg, rgba(11, 11, 11, 0.88) 0%, rgba(11, 11, 11, 0.7) 50%, rgba(11, 11, 11, 0) 80%); }
  .home-hero__bg img { object-position: 50% 80%; }
  :root[data-theme="light"] .home-hero::before { background: linear-gradient(180deg, rgba(244, 242, 237, 0.92) 0%, rgba(244, 242, 237, 0.72) 50%, rgba(244, 242, 237, 0) 80%); }
}
.home-hero__eyebrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: var(--step-small); color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px;
  border-radius: 999px; background: var(--card); color: var(--ink); font-size: var(--step-small);
  box-shadow: inset 0 0 0 1px var(--line);
}
.chip--live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.home-hero h1 { margin-top: 0; font-size: calc(var(--step-display) / 1.4); letter-spacing: -0.055em; line-height: 0.92; font-weight: 400; max-width: 13ch; }
.home-hero__row {
  margin-top: clamp(40px, 5vw, 64px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: end;
}
.home-hero__lead { font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.015em; max-width: 36ch; }
.home-hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.badges { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 10px; }
.badges .chip { min-height: 40px; padding: 0 18px; font-size: var(--step-body); }

.stats { margin-top: clamp(48px, 6vw, 80px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: clamp(20px, 2.4vw, 32px);
  display: grid; gap: 12px; align-content: space-between; min-height: 180px;
}
.stat-card .figure { font-size: clamp(2.5rem, 1.6rem + 3vw, 4.25rem); letter-spacing: -0.05em; line-height: 0.95; font-weight: 400; }
.stat-card .label { font-size: var(--step-small); color: var(--muted); max-width: 28ch; }

/* ---------- HOME: headline word swap. "users" blurs out and "business" blurs in after 5s.
   Pure CSS, so it runs without JS; reduced-motion users keep the static first word. ---------- */

.swap { display: inline-grid; vertical-align: baseline; }
.swap > span { grid-area: 1 / 1; }
.swap em { font-family: 'Playfair Display', Georgia, serif; font-style: italic; letter-spacing: -0.02em; }
/* One 14s timeline: users 0–5s, blur to business 5–7s, business 7–12s, blur back to users 12–14s.
   Percentages are seconds / 14: 5s = 35.714%, 7s = 50%, 12s = 85.714%. */
.swap__a { animation: swap-users 14s ease-in-out infinite; }
.swap__b { opacity: 0; animation: swap-business 14s ease-in-out infinite; }
@keyframes swap-users {
  0%, 35.714% { opacity: 1; filter: blur(0); }
  50%, 85.714% { opacity: 0; filter: blur(14px); }
  100% { opacity: 1; filter: blur(0); }
}
@keyframes swap-business {
  0%, 35.714% { opacity: 0; filter: blur(14px); }
  50%, 85.714% { opacity: 1; filter: blur(0); }
  100% { opacity: 0; filter: blur(14px); }
}

/* ---------- HOME: work grid ---------- */

.section { padding-block: clamp(69px, 7.15vw, 114px); }
/* The last homepage section sits closer to the footer. */
#faq { padding-bottom: clamp(34px, 3.6vw, 57px); }
.section__head {
  display: grid; grid-template-columns: minmax(max-content, 1fr) minmax(0, 40ch); gap: 32px; align-items: end;
  margin-bottom: clamp(40px, 5vw, 72px);
}
.section__head h2 { font-size: var(--step-head); font-weight: 400; letter-spacing: -0.045em; line-height: 0.98; }
.section__head p { color: var(--muted); font-size: var(--step-body); }
.section__head > .text-link { justify-self: end; font-size: var(--step-body); }

.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 32px) var(--gap); }
/* Card: the image fills it, the title and subtext sit at the bottom. On hover a dark gradient
   fades in behind the text and the subtext rises in from below. */
.proj {
  position: relative; display: block; aspect-ratio: 4 / 3; min-width: 0; isolation: isolate;
  border-radius: var(--radius); overflow: hidden; background: var(--surface);
  text-decoration: none; color: #fff;
  transition: transform 240ms var(--ease-out);
}
.proj:active { transform: scale(0.99); }
.proj__media { position: absolute; inset: 0; }
.proj__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-out); }
.proj:hover .proj__media img { transform: scale(1.04); }
.proj__media .chip { position: absolute; right: 18px; top: 18px; background: rgba(0, 0, 0, 0.45); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.proj::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.45) 40%, rgba(0, 0, 0, 0) 68%);
  opacity: 0; transition: opacity 600ms var(--ease-out);
}
.proj:hover::after, .proj:focus-visible::after { opacity: 1; }
.proj__body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 24px; }
.proj__text { min-width: 0; }
.proj__title { font-size: clamp(1.25rem, 1rem + 0.8vw, 1.75rem); letter-spacing: -0.03em; line-height: 1.05; font-weight: 400; color: #fff; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35); }
.proj__reveal { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 700ms var(--ease-out); }
.proj__reveal > div { min-height: 0; overflow: hidden; }
.proj__meta {
  margin-top: 10px; font-size: var(--step-small); color: rgba(255, 255, 255, 0.8);
  opacity: 0; transform: translateY(14px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.proj:hover .proj__reveal, .proj:focus-visible .proj__reveal { grid-template-rows: 1fr; }
.proj:hover .proj__meta, .proj:focus-visible .proj__meta { opacity: 1; transform: none; }
.proj__go {
  flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color 240ms var(--ease-out), color 240ms var(--ease-out), transform 240ms var(--ease-out);
}
.proj__go svg { width: 16px; height: 16px; }
.proj:hover .proj__go { background: var(--accent); color: var(--accent-ink); box-shadow: none; transform: rotate(-12deg); }

/* ---------- HOME: skills, tools ---------- */

.skill-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.skill {
  background: var(--card); border-radius: var(--radius); padding: clamp(24px, 2.6vw, 36px);
  display: grid; gap: 40px; align-content: space-between; min-height: 240px;
}
.skill__num { font-size: var(--step-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.skill dt { font-size: var(--step-lead); letter-spacing: -0.025em; line-height: 1.1; font-weight: 400; }
.skill dd { margin: 12px 0 0; font-size: var(--step-small); color: var(--muted); line-height: 1.55; }

.tool-cloud { margin-top: clamp(56px, 6vw, 88px); display: flex; flex-wrap: wrap; gap: 12px; }
.tool {
  display: inline-flex; flex-direction: column; gap: 4px; padding: 16px 22px; border-radius: var(--radius-sm);
  background: transparent; box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color 240ms var(--ease-out), transform 240ms var(--ease-out);
}
.tool:hover { background: var(--card); transform: translateY(-2px); }
.tool dt { font-size: var(--step-body); font-weight: 500; letter-spacing: -0.01em; }
.tool dd { margin: 0; font-size: var(--step-small); color: var(--muted); }

/* ---------- HOME: writing ---------- */

.blog-row {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center;
  text-decoration: none; background: var(--card); border-radius: var(--radius); padding: clamp(14px, 1.6vw, 20px);
  transition: transform 240ms var(--ease-out);
}
.blog-row:active { transform: scale(0.995); }
.blog-row__img { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface); }
.blog-row__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease-out); }
.blog-row:hover .blog-row__img img { transform: scale(1.03); }
.blog-row > div:not(.blog-row__img) { padding: clamp(8px, 2vw, 32px) clamp(8px, 2vw, 32px) clamp(8px, 2vw, 32px) 0; display: grid; gap: 18px; justify-items: start; }
.blog-row h2, .blog-row h3 { font-size: var(--step-lead); font-weight: 400; letter-spacing: -0.025em; line-height: 1.15; text-wrap: balance; transition: color 200ms ease; }
.blog-row:hover h2, .blog-row:hover h3 { color: var(--accent); }
.blog-row time { font-size: var(--step-small); color: var(--muted); }
.blog-row .text-link { margin-top: 8px; }
.blog-row--feature { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); padding: 0; }
.blog-row--feature > div:not(.blog-row__img) { padding-right: clamp(24px, 3vw, 48px); }
.blog-row--feature .blog-row__img { aspect-ratio: 4 / 3; border-radius: var(--radius); }
.blog-row--feature h2 { font-size: var(--step-lead); }

/* ---------- HOME: resources ---------- */

.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.resource {
  position: relative; height: 100%; display: grid; grid-template-rows: auto auto 1fr; gap: 10px;
  padding: clamp(24px, 2.6vw, 32px); padding-right: 76px; border-radius: var(--radius);
  background: var(--card); text-decoration: none;
  transition: transform 240ms var(--ease-out);
}
.resource:active { transform: scale(0.99); }
.resource__kind { font-size: var(--step-small); color: var(--muted); }
.resource__name { font-size: var(--step-lead); letter-spacing: -0.025em; line-height: 1.1; transition: color 200ms ease; }
.resource__desc { font-size: var(--step-small); color: var(--muted); line-height: 1.55; }
.resource__go {
  position: absolute; top: clamp(20px, 2.2vw, 28px); right: clamp(20px, 2.2vw, 28px);
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color 240ms var(--ease-out), color 240ms var(--ease-out), transform 240ms var(--ease-out);
}
.resource__go svg { width: 14px; height: 14px; }
.resource:hover .resource__name { color: var(--accent); }
.resource:hover .resource__go { background: var(--accent); color: var(--accent-ink); box-shadow: none; transform: rotate(-12deg); }

/* ---------- HOME: FAQ ---------- */

.faq { border-top: 1px solid var(--line); }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: clamp(20px, 2.2vw, 28px) 0; cursor: pointer; list-style: none;
  font-size: var(--step-lead); letter-spacing: -0.025em; line-height: 1.2;
  transition: color 200ms ease;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary:hover { color: var(--accent); }
.faq__icon { flex: none; position: relative; width: 40px; height: 40px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); }
.faq__icon::before, .faq__icon::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.5px; margin: -0.75px 0 0 -7px;
  background: currentColor; border-radius: 1px; transition: transform 300ms var(--ease-out);
}
.faq__icon::after { transform: rotate(90deg); }
.faq__item[open] .faq__icon::after { transform: rotate(0deg); }
.faq__item p { max-width: 62ch; padding: 0 64px clamp(24px, 2.6vw, 32px) 0; color: var(--muted); }

/* ---------- HOME: about (a card that follows the theme) ---------- */

.dark {
  background: var(--card); color: var(--ink);
  border-radius: clamp(28px, 3vw, 44px); margin-inline: var(--pad);
  padding: clamp(56px, 7vw, 112px) clamp(28px, 4vw, 72px);
}
.dark .small, .dark .sign span { color: var(--muted); }
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(40px, 6vw, 120px); align-items: start; }
.about-grid h2 { font-size: var(--step-head); font-weight: 400; letter-spacing: -0.045em; line-height: 0.98; }
.about-intro { display: grid; gap: clamp(28px, 3vw, 48px); }
.portrait {
  margin: 0; max-width: 420px; padding: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 10px);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.35);
}
.portrait img {
  display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover;
  border-radius: var(--radius);
  outline: 1px solid var(--line); outline-offset: -1px;
}
.about { max-width: 58ch; }
.about p { font-size: var(--step-body); line-height: 1.6; color: var(--ink); }
.about p + p { margin-top: 1.1em; }
.about .sign { margin-top: 40px; }
.about .sign strong { display: block; font-size: var(--step-lead); font-weight: 400; letter-spacing: -0.02em; }
.about .sign span { font-size: var(--step-small); }

/* ---------- SHARED: section heads in pages without the grid ---------- */

.band { background: transparent; }
.band .small { color: var(--muted); }

/* ---------- CASE STUDY: long-form page ---------- */
/* Outcome headline, hero, details, overview, numbers, then numbered chapters beside a sticky contents rail. */

.cs-head { padding-top: clamp(96px, 14vh, 150px); }
.cs-back { display: inline-flex; gap: 8px; font-size: var(--step-small); color: var(--muted); text-decoration: none; transition: color 200ms ease; }
.cs-back:hover { color: var(--ink); }
.cs-eyebrow { margin-top: clamp(32px, 4vw, 56px); font-size: var(--step-small); color: var(--muted); }
.cs-title { margin-top: 16px; max-width: 22ch; font-size: clamp(2.5rem, 1.5rem + 3.6vw, 5.25rem); font-weight: 400; letter-spacing: -0.045em; line-height: 1; }
.cs-sub { margin-top: 28px; max-width: 46ch; font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.01em; }
.cs-tags { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }

.cs-hero { margin: clamp(48px, 6vw, 88px) 0 0; }
.cs-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); background: var(--surface); }

.cs-meta {
  margin-top: var(--gap); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap);
}
.cs-meta > div { background: var(--card); border-radius: var(--radius-sm); padding: 18px 20px; }
.cs-meta > .is-wide { grid-column: span 2; }
.cs-meta > .is-full { grid-column: 1 / -1; }
.cs-meta dt { font-size: var(--step-small); color: var(--muted); }
.cs-meta dd { margin: 6px 0 0; font-size: var(--step-body); line-height: 1.45; }

.cs-overview { margin-top: clamp(80px, 10vw, 140px); }
.cs-ov {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(24px, 4vw, 64px);
  padding-block: clamp(32px, 4vw, 52px); border-top: 1px solid var(--line);
}
.cs-ov:last-child { border-bottom: 1px solid var(--line); }
.cs-label { font-size: var(--step-small); color: var(--muted); }
.cs-ov h2 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.75rem); font-weight: 400; letter-spacing: -0.04em; line-height: 1.02; max-width: 20ch; }
.cs-ov p:not(.cs-label) { margin-top: 20px; max-width: 58ch; line-height: 1.6; }
.cs-ov h2 + p { margin-top: 24px; }
.cs-ov p + p { margin-top: 1em; }

.cs-stats { margin-top: clamp(48px, 6vw, 80px); display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: var(--gap); }
.cs-stat { background: var(--card); border-radius: var(--radius); padding: clamp(24px, 2.8vw, 36px); display: grid; gap: 14px; align-content: space-between; min-height: 200px; }
.cs-stat__fig { font-size: clamp(2.25rem, 1.5rem + 2.4vw, 3.75rem); letter-spacing: -0.05em; line-height: 0.95; color: var(--accent); }
.cs-stat__label { font-size: var(--step-body); color: var(--muted); max-width: 28ch; }

.cs-body {
  margin-top: clamp(96px, 12vw, 160px);
  display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 3fr); gap: clamp(32px, 5vw, 96px); align-items: start;
}
.cs-toc { position: sticky; top: 112px; font-size: var(--step-small); }
.cs-toc > p { color: var(--muted); margin-bottom: 14px; }
.cs-toc ol { display: grid; gap: 2px; border-left: 1px solid var(--line); }
.cs-toc a {
  display: flex; gap: 12px; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 1px solid transparent;
  color: var(--muted); text-decoration: none; transition: color 200ms ease, border-color 200ms ease;
}
.cs-toc a span { font-variant-numeric: tabular-nums; opacity: 0.7; }
.cs-toc a:hover { color: var(--ink); }
.cs-toc a[aria-current="true"] { color: var(--ink); border-left-color: var(--accent); }

.cs-ch { scroll-margin-top: 112px; }
.cs-ch + .cs-ch { margin-top: clamp(80px, 9vw, 128px); }
.cs-num { font-size: var(--step-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.cs-ch h2 { margin-top: 14px; font-size: var(--step-head); font-weight: 400; letter-spacing: -0.04em; line-height: 1.02; max-width: 22ch; }
.cs-ch p:not(.cs-num) { margin-top: 20px; max-width: 62ch; line-height: 1.65; }
.cs-ch h2 + p { margin-top: 28px; }
.cs-ch p + p { margin-top: 1em; }
.cs-ch ul { margin-top: 24px; display: grid; gap: 12px; max-width: 62ch; }
.cs-ch li { position: relative; padding-left: 26px; line-height: 1.55; }
.cs-ch li::before { content: ''; position: absolute; left: 0; top: 0.75em; width: 10px; height: 2px; background: var(--accent); }
.cs-ch .case-figure { margin-top: clamp(40px, 5vw, 64px); }
.cs-external { margin-top: clamp(56px, 6vw, 80px); }

.cs-next-wrap { margin-top: clamp(112px, 13vw, 180px); padding-bottom: clamp(40px, 5vw, 72px); }
.cs-next {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center;
  padding: clamp(14px, 1.6vw, 20px); border-radius: var(--radius); background: var(--card); text-decoration: none;
  transition: transform 240ms var(--ease-out);
}
.cs-next:active { transform: scale(0.995); }
.cs-next__img { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface); }
.cs-next__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease-out); }
.cs-next:hover .cs-next__img img { transform: scale(1.03); }
.cs-next__text { padding: clamp(8px, 2vw, 32px) clamp(8px, 2vw, 32px) clamp(8px, 2vw, 32px) 0; }
.cs-next__text h2 { margin-top: 14px; font-size: var(--step-head); font-weight: 400; letter-spacing: -0.04em; line-height: 1.02; transition: color 200ms ease; }
.cs-next:hover h2 { color: var(--accent); }
.cs-next__text > p:not(.cs-label) { margin-top: 18px; color: var(--muted); max-width: 44ch; }
.cs-next__text .cs-tags { margin-top: 20px; }
.cs-next__text .text-link { margin-top: 28px; }

@media (max-width: 1040px) {
  .cs-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-body { grid-template-columns: 1fr; }
  .cs-toc { display: none; }
}
@media (max-width: 860px) {
  .cs-ov { grid-template-columns: 1fr; gap: 14px; }
  .cs-stats { grid-template-columns: 1fr; }
  .cs-stat { min-height: 0; }
  .cs-next { grid-template-columns: 1fr; }
  .cs-next__text { padding: 8px 12px 12px; }
}
@media (max-width: 560px) {
  .cs-meta { gap: 8px; }
  .cs-meta > .is-wide { grid-column: 1 / -1; }
  .cs-meta > div { padding: 14px 16px; }
}

/* ---------- ESSAY: practical long-form ---------- */
/* Header, hero, then one reading column: thesis, step strip, sections that each open with "The move". */

.es-head { padding-top: clamp(96px, 14vh, 150px); }
.es-title { margin-top: 16px; font-size: var(--step-display); font-weight: 400; letter-spacing: -0.05em; line-height: 0.96; }
.es-meta { margin-top: 24px; font-size: var(--step-small); color: var(--muted); }
.es-hero { margin: clamp(48px, 6vw, 88px) 0 0; }
.es-hero img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border-radius: var(--radius); background: var(--surface); }

.es-col { max-width: calc(800px + 2 * var(--pad)); padding-bottom: clamp(48px, 6vw, 96px); }
.es-thesis { margin-top: clamp(56px, 7vw, 104px); font-size: var(--step-lead); line-height: 1.4; letter-spacing: -0.01em; }
.es-formula {
  margin-top: 32px; padding: 22px 26px; border-radius: var(--radius-sm); background: var(--card);
  font-size: var(--step-body); font-weight: 500; letter-spacing: -0.01em; line-height: 1.45;
  box-shadow: inset 0 0 0 1px var(--line);
}
.es-strip { margin-top: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.es-strip li { display: grid; gap: 2px; padding: 16px 18px; border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px var(--line); line-height: 1.3; }
.es-strip__n { font-size: var(--step-small); color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.es-strip strong { font-weight: 500; }
.es-strip em { font-style: italic; color: var(--muted); }
.es-worked { margin-top: 24px; font-size: var(--step-small); color: var(--muted); }
.es-worked strong { color: var(--ink); font-weight: 500; }

.es-sec { margin-top: clamp(88px, 10vw, 140px); scroll-margin-top: 112px; }
.es-label {
  display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--card);
  font-size: var(--step-small); color: var(--muted);
}
.es-sec h2 { margin-top: 18px; font-size: var(--step-head); font-weight: 400; letter-spacing: -0.04em; line-height: 1.02; }
.es-move { margin-top: 28px; padding-left: 18px; border-left: 2px solid var(--accent); font-size: var(--step-lead); line-height: 1.35; letter-spacing: -0.01em; }
.es-move strong { font-weight: 500; color: var(--accent); }
.es-body > * + * { margin-top: 20px; }
.es-body { margin-top: 32px; }
.es-body p { line-height: 1.65; }
.es-body strong { font-weight: 500; }

.es-defs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.es-defs > div { padding: 18px 20px; border-radius: var(--radius-sm); background: var(--card); }
.es-defs dt { font-weight: 500; }
.es-defs dd { margin: 6px 0 0; font-size: var(--step-small); color: var(--muted); line-height: 1.5; }

.es-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.es-compare > div { padding: 20px 22px; border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px var(--line); }
.es-compare p:not(.es-tag) { margin-top: 8px; }
.es-tag { font-size: var(--step-small); color: var(--muted); }

.es-example { padding: 20px 22px; border-radius: var(--radius-sm); background: var(--surface); }
.es-example .es-tag { color: var(--ink); font-weight: 500; }
.es-example p:not(.es-tag) { margin-top: 6px; }

.es-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.es-levels > div { padding: 20px; border-radius: var(--radius-sm); background: var(--card); display: grid; gap: 8px; align-content: start; }
.es-level__name { font-size: var(--step-lead); letter-spacing: -0.02em; }
.es-levels p:not(.es-level__name) { font-size: var(--step-small); line-height: 1.5; color: var(--muted); }
.es-level__ex span { color: var(--ink); font-weight: 500; }

.es-close { margin-top: 32px; font-size: var(--step-lead); line-height: 1.35; letter-spacing: -0.01em; font-style: italic; }

.es-recap { margin-top: 28px; counter-reset: rc; display: grid; gap: 10px; }
.es-recap li { counter-increment: rc; position: relative; padding-left: 44px; line-height: 1.55; }
.es-recap li::before { content: counter(rc, decimal-leading-zero); position: absolute; left: 0; top: 0.1em; font-size: var(--step-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.es-recap strong { font-weight: 500; }

.es-check { margin-top: 28px; display: grid; gap: 12px; }
.es-check li { position: relative; padding: 16px 18px 16px 52px; border-radius: var(--radius-sm); background: var(--card); line-height: 1.5; }
.es-check li::before {
  content: ''; position: absolute; left: 18px; top: 18px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='10'/%3E%3C/svg%3E") center / contain no-repeat;
}
.es-check li::after {
  content: ''; position: absolute; left: 24px; top: 23px; width: 8px; height: 5px;
  border-left: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); transform: rotate(-45deg);
}
.es-check strong { font-weight: 500; }

.es-related { margin-top: clamp(88px, 10vw, 140px); }
.es-related .cs-next { margin-top: 18px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.es-related .cs-next__text h2 { font-size: var(--step-lead); letter-spacing: -0.025em; line-height: 1.15; }

.es-cta { margin-top: clamp(56px, 6vw, 88px); padding: clamp(28px, 3.4vw, 44px); border-radius: var(--radius); background: var(--field); color: var(--field-ink); }
.es-cta h2 { font-size: var(--step-head); font-weight: 400; letter-spacing: -0.04em; line-height: 1.02; max-width: 18ch; }
.es-cta p:not(.es-cta__btns) { margin-top: 16px; color: var(--field-muted); max-width: 44ch; }
.es-cta__btns { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.es-cta .btn { background: var(--field-ink); color: var(--field); }
.es-cta :focus-visible { outline-color: var(--field-ink); }

.es-bio { margin-top: 40px; display: flex; gap: 20px; align-items: center; }
.es-bio img { flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.es-bio p { font-size: var(--step-small); color: var(--muted); line-height: 1.55; max-width: 60ch; }
.es-bio strong { color: var(--ink); font-weight: 500; }

.blog-row__sub { color: var(--muted); font-size: var(--step-body); line-height: 1.45; max-width: 40ch; }

@media (max-width: 860px) {
  .es-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .es-levels { grid-template-columns: 1fr; }
  .es-related .cs-next { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .es-compare { grid-template-columns: 1fr; }
  .es-hero img { aspect-ratio: 4 / 3; }
}

/* ---------- ARTICLE: split page (case-figure is shared with case studies) ---------- */

.case { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-inline: var(--pad); }
.case__media {
  position: sticky; top: 0; height: 100svh; margin: 0;
  padding: var(--gap) var(--gap) var(--gap) 0;
}
.case__media .frame {
  width: 100%; height: 100%; border-radius: var(--radius); overflow: hidden; background: var(--surface);
}
.case__media img { width: 100%; height: 100%; object-fit: cover; }
.case__media figcaption {
  position: absolute; left: calc(var(--gap) + 16px); bottom: calc(var(--gap) + 16px);
  background: var(--card); color: var(--ink); border-radius: 999px; padding: 12px 18px; font-size: var(--step-small);
}
.case__read { padding: clamp(96px, 12vh, 140px) 0 120px clamp(32px, 5vw, 96px); }
.case__read > * + * { margin-top: 0; }
.case__back { font-size: var(--step-small); color: var(--muted); text-decoration: none; display: inline-flex; gap: 8px; transition: color 200ms ease; }
.case__back:hover { color: var(--ink); }
.case__title { font-size: var(--step-head); font-weight: 400; letter-spacing: -0.045em; line-height: 1; text-wrap: balance; }
.case__lede { margin-top: 28px; font-size: var(--step-body); line-height: 1.55; max-width: 46ch; }
.case__lede + .case__section { margin-top: 32px; }
.case-figure { margin: clamp(56px, 6vw, 88px) 0 0; }
.case-figure img { width: 100%; height: auto; border-radius: var(--radius); background: var(--surface); }
.case-figure figcaption { margin-top: 14px; font-size: var(--step-small); color: var(--muted); max-width: 52ch; }
.deck { margin-top: 24px; font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.01em; max-width: 36ch; }
.facts { margin-top: 56px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.facts > div { background: var(--card); border-radius: var(--radius-sm); padding: 18px 20px; }
.facts dt { font-size: var(--step-small); color: var(--muted); }
.facts dd { margin: 6px 0 0; font-size: var(--step-body); }
.case__section { margin-top: clamp(72px, 9vw, 120px); }
.case__section h2 { font-size: var(--step-head); font-weight: 400; letter-spacing: -0.04em; line-height: 1; }
.case__section p { margin-top: 20px; font-size: var(--step-body); line-height: 1.6; max-width: 46ch; }
.case__section p + p { margin-top: 1em; }
.case__section ul { margin-top: 20px; display: grid; gap: 12px; max-width: 46ch; }
.case__section li { position: relative; padding-left: 26px; line-height: 1.5; }
.case__section li::before { content: ''; position: absolute; left: 0; top: 0.72em; width: 10px; height: 2px; background: var(--accent); }
.stats .stats { margin-top: 28px; }
.case__section .stats { margin-top: 28px; gap: var(--gap); }
.case__section .stat { background: var(--card); border-radius: var(--radius); padding: clamp(20px, 2.4vw, 32px); }
.case__section .stat .figure { font-size: var(--step-display); letter-spacing: -0.05em; line-height: 0.95; font-weight: 400; color: var(--accent); }
.case__section .stat .label { margin-top: 10px; font-size: var(--step-body); max-width: 30ch; }
.case__tail { margin-top: clamp(96px, 12vw, 160px); }
.case__next {
  display: block; text-decoration: none; background: var(--field); color: var(--field-ink);
  border-radius: var(--radius); padding: clamp(28px, 3vw, 44px); transition: transform 200ms var(--ease-out);
}
.case__next:active { transform: scale(0.99); }
.case__next span { display: inline-flex; align-items: center; gap: 8px; font-size: var(--step-small); color: var(--field-muted); }
.case__next svg { width: 14px; height: 14px; flex: none; }
.case__next strong { display: block; margin-top: 10px; font-size: var(--step-head); font-weight: 400; letter-spacing: -0.04em; line-height: 1.02; }
.cover img, .blog-row--feature .blog-row__img img { object-fit: contain; background: var(--surface); }

.article { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-inline: var(--pad); }
.article__read { padding: clamp(96px, 12vh, 140px) 0 120px clamp(32px, 5vw, 96px); max-width: 720px; }
.article__read h1 { font-size: var(--step-display); font-weight: 400; letter-spacing: -0.05em; line-height: 0.96; }
.article__read .date { margin-top: 24px; display: block; font-size: var(--step-small); color: var(--muted); }
.article__read h2, .article__read h4 { margin-top: 72px; font-size: var(--step-head); font-weight: 400; letter-spacing: -0.04em; line-height: 1.02; }
.article__read p, .article__read li { margin-top: 1.1em; font-size: var(--step-body); line-height: 1.65; max-width: 62ch; }
.article__read li { position: relative; padding-left: 24px; }
.article__read li::before { content: ''; position: absolute; left: 0; top: 0.8em; width: 10px; height: 2px; background: var(--accent); }
.article__read .label { margin-top: 1.4em; font-weight: 500; }
.article__read blockquote { margin: 1.2em 0 0; font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.01em; }

/* ---------- list pages ---------- */

.page-head { padding: clamp(96px, 14vh, 160px) var(--pad) 40px; }
.page-head h1 { font-size: var(--step-display); font-weight: 400; letter-spacing: -0.05em; line-height: 0.95; }
.page-lede { margin-top: 24px; font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.01em; max-width: 30ch; }

/* ---------- CONTACT ---------- */

.contact { min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(48px, 7vw, 140px); align-items: center; padding-block: 160px 120px; }
.contact__prompt { font-size: var(--step-display); letter-spacing: -0.05em; line-height: 0.95; font-weight: 400; }
.contact__lede { margin-top: 28px; font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.01em; max-width: 30ch; }
.contact__note { font-size: var(--step-body); color: var(--muted); margin-top: 6px; max-width: 46ch; }
.contact__aside { min-width: 0; }
.contact form { display: grid; gap: 14px; background: var(--card); border-radius: var(--radius); padding: clamp(24px, 3vw, 40px); }
.field { display: grid; gap: 8px; }
.field label { font-size: var(--step-small); color: var(--muted); }
.field input, .field textarea {
  font: inherit; font-size: var(--step-body); color: var(--ink);
  background: var(--bg); border: 0; border-radius: var(--radius-sm);
  padding: 14px 16px; width: 100%;
  transition: box-shadow 200ms ease;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #9a988f; }
.field input:focus, .field textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.contact form .btn { justify-self: start; margin-top: 6px; }
.contact__note a { color: var(--ink); text-underline-offset: 0.2em; }
.contact__note[data-state="ok"] { color: var(--ink); }
.contact__note[data-state="error"] { color: #c2410c; }
:root[data-theme="dark"] .contact__note[data-state="error"] { color: #fb923c; }
.contact form .btn:disabled { opacity: 0.6; cursor: progress; }

/* LinkedIn card: fills the row under the form. */
.li-card {
  margin-top: var(--gap); display: flex; align-items: center; gap: 18px;
  padding: 18px 20px; border-radius: var(--radius); background: var(--card); text-decoration: none;
  transition: transform 200ms var(--ease-out);
}
.li-card:active { transform: scale(0.99); }
.li-card__logo { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: #0a66c2; color: #fff; }
.li-card__logo svg { width: 24px; height: 24px; }
.li-card__text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.li-card__text strong { font-weight: 500; transition: color 200ms ease; }
.li-card__text span { font-size: var(--step-small); color: var(--muted); overflow-wrap: anywhere; }
.li-card__go {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color 240ms var(--ease-out), color 240ms var(--ease-out), transform 240ms var(--ease-out);
}
.li-card__go svg { width: 14px; height: 14px; }
.li-card:hover strong { color: var(--accent); }
.li-card:hover .li-card__go { background: var(--accent); color: var(--accent-ink); box-shadow: none; transform: rotate(-12deg); }

.strip-section { padding-block: clamp(96px, 10vw, 160px) 0; }
.strip-section .head { margin-bottom: clamp(32px, 4vw, 56px); font-weight: 400; letter-spacing: -0.045em; }
.strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gap); }
.strip__item { display: grid; gap: 12px; text-decoration: none; min-width: 0; }
.strip__item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface); transition: transform 500ms var(--ease-out); }
.strip__item span { font-size: var(--step-small); color: var(--muted); transition: color 200ms ease; }
.strip__item:hover img { transform: scale(1.02); }
.strip__item:hover span { color: var(--ink); }
.strip__item:active img { transform: scale(0.99); }

/* ---------- footer ---------- */

/* A band that follows the theme: warm grey in light, near-black in dark. */
.footer {
  --f-bg: #0d0e10; --f-ink: #ffffff; --f-muted: #8b8c91; --f-line: #1c1d21; --f-mark: rgba(255, 255, 255, 0.62);
  --f-fade: clamp(60px, 7vw, 110px); /* height of the blend from the page into the footer */
  /* Full-bleed band; the content inside stays on the --pad grid (240px on desktop).
     The top melts from the page colour into the footer colour so there is no hard edge. */
  margin: clamp(32px, 4vw, 60px) 0 0;
  background: linear-gradient(180deg,
    var(--page-bg) 0%,
    color-mix(in srgb, var(--f-bg) 50%, var(--page-bg)) calc(var(--f-fade) * 0.5),
    var(--f-bg) var(--f-fade));
  color: var(--f-muted);
  font-size: var(--step-small); overflow: hidden;
}
.footer__inner { padding-block: var(--f-fade) 0; padding-inline: var(--pad); display: grid; justify-items: center; gap: 12px; text-align: center; }
.footer__legal { font-size: 16px; }
.footer__links a {
  display: inline-flex; align-items: center; gap: 6px; font-size: 16px; color: var(--f-ink); text-decoration: none;
  transition: opacity 200ms ease;
}
.footer__links a:hover { opacity: 0.7; }
.footer__links svg { width: 12px; height: 12px; }
.footer__links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 24px; }
.footer__cookie { font: inherit; font-size: 16px; color: var(--f-muted); background: none; border: 0; padding: 0; cursor: pointer; transition: color 200ms ease; }
.footer__cookie:hover { color: var(--f-ink); }

/* Cookie consent: a small card in the corner, never covering the whole page. */
.consent {
  position: fixed; left: 16px; bottom: 16px; z-index: 20; width: min(400px, calc(100vw - 32px));
  padding: 20px 22px; border-radius: var(--radius); background: var(--card); color: var(--ink);
  box-shadow: 0 0 0 1px var(--line), 0 24px 48px -20px rgba(0, 0, 0, 0.35);
  opacity: 0; transform: translateY(12px);
  transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out);
}
.consent.is-open { opacity: 1; transform: none; }
.consent__title { font-weight: 500; }
.consent__text { margin-top: 6px; font-size: var(--step-small); color: var(--muted); line-height: 1.5; }
.consent__btns { margin-top: 16px; display: flex; align-items: center; gap: 12px; }
.consent .btn { min-height: 40px; padding: 0 20px; }
.consent__decline {
  font: inherit; font-size: var(--step-small); min-height: 40px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink); border: 0; box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color 200ms ease;
}
.consent__decline:hover { background: var(--bg); }
.footer :focus-visible { outline-color: var(--f-ink); }
.footer__legal strong { color: var(--f-ink); font-weight: 500; }
.footer__mark {
  margin: 0; padding-inline: 0; text-align: center; user-select: none;
  font-size: clamp(4rem, 17vw, 17rem); font-weight: 500; letter-spacing: -0.04em; line-height: 0.95;
  height: 0.62em; overflow: hidden;
  background: linear-gradient(to bottom, var(--f-mark), transparent 92%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}

:root[data-theme="light"] .footer { --f-bg: #e8e5dd; --f-ink: #151515; --f-muted: #5f5d57; --f-line: #d9d5cb; --f-mark: rgba(21, 21, 21, 0.5); }

/* Phones: the nav bar is fixed to the bottom, so the footer band extends behind it
   and the cookie notice sits above it instead of covering it. */
@media (max-width: 720px) {
  .footer { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
  .consent { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- smooth scroll (Lenis): the library owns scrolling, so native smooth behaviour must be off ---------- */

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-scrolling iframe { pointer-events: none; }

/* ---------- motion: entrance for each part, once, as it enters ---------- */

/* Blur-in: each part starts soft, transparent and a little low, then comes into focus as it
   enters the viewport. Without JS (html.no-js is removed by the script) everything shows at once. */
[data-reveal] {
  opacity: 0;
  filter: blur(14px);
  transform: translateY(24px);
  transition: opacity 1100ms var(--ease-out), filter 1100ms var(--ease-out), transform 1100ms var(--ease-out);
  transition-delay: calc(var(--d, 0) * 90ms);
}
[data-reveal].is-in { opacity: 1; filter: blur(0); transform: none; }
.no-js [data-reveal] { opacity: 1; filter: none; transform: none; }

/* ---------- responsive: phone is its own composition ---------- */

@media (max-width: 1040px) {
  .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .home-hero__row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stat-card { min-height: 0; }
  .section__head { grid-template-columns: 1fr; gap: 16px; }
  .work-grid { grid-template-columns: 1fr; }
  .skill-grid { grid-template-columns: 1fr; }
  .resource-grid { grid-template-columns: 1fr; }
  .faq__item p { padding-right: 0; }
  .blog-row, .blog-row--feature { grid-template-columns: 1fr; }
  .blog-row > div:not(.blog-row__img) { padding: 8px 12px 12px; }
  .blog-row__img { aspect-ratio: 16 / 10; }
  .about-grid { grid-template-columns: 1fr; }
  .dark { margin-inline: 12px; border-radius: 28px; }
  .case, .article { grid-template-columns: 1fr; padding-inline: 0; }
  .case__media { position: relative; top: 0; height: 44svh; padding: var(--gap); }
  .case__media figcaption { left: calc(var(--gap) + 12px); bottom: calc(var(--gap) + 12px); }
  .case__read, .article__read { padding: 40px var(--pad) 96px; max-width: none; }
  .facts { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; padding-block: 120px 96px; }
  .strip { grid-template-columns: 1fr 1fr; }
}

/* ---------- reduced motion: keep the content, drop the travel ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation: none !important; }
  [data-reveal] { opacity: 1; filter: none; transform: none; }
  .case__media { position: relative; top: 0; }
}
