/* Studio layout: warm stone paper, big Geist type, rounded media, ink pill buttons */
:root {
  --paper: #ffffff;
  --paper-2: #eef0f4;
  --card: #f5f6f8;
  --ink: #121417;
  --ink-2: #3a3e45;
  --muted: #6c717a;
  --line: rgba(18, 20, 23, 0.1);
  --on-ink: #ffffff;
  --accent: #2f6bff;
  --glow-a: #63a4ff;
  --glow-b: #8fe3ff;
  --glow-c: #a99bff;
  --glow-strength: 0.75;
  --ok: #22a05a;
  --danger: #d23f2c;
  --sans: "Geist", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --wrap: 1680px;
  --r-lg: 28px;
  --r-md: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #0f1115;
  --paper-2: #1d2027;
  --card: #171a20;
  --ink: #eef0f4;
  --ink-2: #c3c7cf;
  --muted: #8d929c;
  --line: rgba(238, 240, 244, 0.1);
  --on-ink: #0f1115;
  --accent: #6c9bff;
  --glow-a: #2f6bff;
  --glow-b: #1fb6ff;
  --glow-c: #7a5cff;
  --glow-strength: 0.45;
  --danger: #ff7a66;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
:root { --gutter: 20px; }
@media (min-width: 900px) { :root { --gutter: 48px; } }
@media (min-width: 1440px) { :root { --gutter: 64px; } }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
.muted { color: var(--muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--card); padding: 8px 14px; border-radius: 999px; z-index: 50; }

h1, h2, h3 { font-weight: 500; letter-spacing: -0.035em; line-height: 1.02; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(34px, 4.6vw, 64px); }
h3 { font-size: 22px; letter-spacing: -0.02em; line-height: 1.2; }
.lead { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.5; color: var(--ink-2); max-width: 46ch; margin: 0; }

/* Iridescent glow at the top of every page */
.glow { position: absolute; inset: 0 0 auto 0; height: min(120vh, 1200px); overflow: hidden; pointer-events: none; z-index: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 35%, transparent 100%); mask-image: linear-gradient(to bottom, #000 0%, #000 35%, transparent 100%); opacity: var(--glow-strength); }
.glow span { position: absolute; border-radius: 50%; filter: blur(70px); will-change: transform; }
.glow .g1 { width: 62vw; height: 52vh; left: 18vw; top: -22vh; background: radial-gradient(closest-side, var(--glow-a), transparent); animation: drift-1 18s ease-in-out infinite alternate; }
.glow .g2 { width: 46vw; height: 46vh; left: 52vw; top: -8vh; background: radial-gradient(closest-side, var(--glow-b), transparent); animation: drift-2 22s ease-in-out infinite alternate; }
.glow .g3 { width: 40vw; height: 40vh; left: -6vw; top: 4vh; background: radial-gradient(closest-side, var(--glow-c), transparent); animation: drift-3 26s ease-in-out infinite alternate; }
.glow .g4 { inset: -40% -20% auto -20%; height: 120%; border-radius: 0; filter: blur(90px); opacity: .55; background: conic-gradient(from 0deg at 50% 40%, var(--glow-a), var(--glow-b), var(--glow-c), var(--glow-a)); animation: spin-slow 40s linear infinite; mix-blend-mode: soft-light; }
@keyframes drift-1 { to { transform: translate(8vw, 10vh) scale(1.15); } }
@keyframes drift-2 { to { transform: translate(-14vw, 8vh) scale(.9); } }
@keyframes drift-3 { to { transform: translate(12vw, -6vh) scale(1.2); } }
@keyframes spin-slow { to { transform: rotate(360deg); } }
.glow { animation: hue 16s ease-in-out infinite alternate; }
@keyframes hue { to { filter: hue-rotate(-28deg) saturate(1.15); } }
.site-header, main, .site-footer, .fallback-note { position: relative; z-index: 1; }
.site-header { z-index: 20; }

/* Page transitions between documents (Chrome, Edge, Safari 18+) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .35s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .55s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-12px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); } }

/* Buttons — always pills */
.btn {
  --bg: transparent; --fg: var(--ink); --bd: var(--line);
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 999px; border: 1px solid var(--bd);
  background: var(--bg); color: var(--fg); font: 500 16px/1 var(--sans); letter-spacing: -0.01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: color .45s var(--ease), border-color .45s var(--ease), transform .25s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--fill, var(--ink)); transform: translateY(101%); transition: transform .5s var(--ease);
}
.btn:hover::before { transform: translateY(0); }
.btn:active { transform: scale(.97); }
.btn-sm { min-height: 42px; padding: 0 18px; font-size: 15px; }
.btn-ink { --bg: var(--ink); --fg: var(--on-ink); --bd: var(--ink); --fill: var(--ink-2); }
.btn-ghost:hover { --fg: var(--on-ink); border-color: var(--ink); }
.btn-paper { --bg: var(--on-ink); --fg: var(--ink); --bd: var(--on-ink); --fill: var(--paper-2); }
.btn-outline-paper { --fg: var(--on-ink); --bd: color-mix(in srgb, var(--on-ink) 30%, transparent); --fill: var(--on-ink); }
.btn-outline-paper:hover { --fg: var(--ink); }
.count { font: 500 12px/1 var(--mono); background: var(--paper-2); color: var(--ink); border-radius: 999px; padding: 5px 8px; transition: background .4s; }
.btn-ghost:hover .count { background: var(--ink-2); color: var(--on-ink); }
.icon-btn { width: 42px; height: 42px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: background .3s, transform .4s var(--ease); }
.icon-btn:hover { background: var(--card); transform: rotate(-20deg); }
.icon-btn .moon { display: none; }
:root[data-theme="dark"] .icon-btn .sun { display: none; }
:root[data-theme="dark"] .icon-btn .moon { display: block; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top, 0px); pointer-events: none; }
.site-header .header-inner { max-width: none; width: 100%; margin: 0 auto; }
.header-inner { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; height: 76px; pointer-events: auto;
  border: 1px solid transparent; border-radius: 0;
  transition: width .7s var(--ease), margin .7s var(--ease), height .6s var(--ease), padding .7s var(--ease), border-radius .7s var(--ease), background-color .5s, border-color .5s, box-shadow .6s var(--ease), backdrop-filter .5s; }
.header-inner::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .5s;
  background: radial-gradient(120% 140% at 12% 0%, rgba(255,255,255,.55), transparent 45%), radial-gradient(80% 120% at 100% 100%, color-mix(in srgb, var(--glow-b) 22%, transparent), transparent 60%); mix-blend-mode: soft-light; }
/* Scrolled: a floating pill of liquid glass */
.site-header.is-scrolled .header-inner {
  /* exactly the content width of the page container */
  width: min(calc(100% - 2 * var(--gutter)), calc(var(--wrap) - 2 * var(--gutter))); margin-top: 12px; height: 64px; padding-left: 18px; padding-right: 10px; border-radius: 999px;
  background-color: rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5);
  border-color: rgba(18, 20, 23, .05);
  box-shadow: 0 8px 24px -16px rgba(18,20,23,.18); }
.site-header.is-scrolled .header-inner::after { opacity: 0; }
:root[data-theme="dark"] .site-header.is-scrolled .header-inner {
  background-color: rgba(22, 25, 31, .62); border-color: rgba(255, 255, 255, .06);
  box-shadow: 0 8px 24px -16px rgba(0,0,0,.5); }
:root[data-theme="dark"] .header-inner::after { background: radial-gradient(120% 140% at 12% 0%, rgba(255,255,255,.12), transparent 45%), radial-gradient(80% 120% at 100% 100%, color-mix(in srgb, var(--glow-a) 30%, transparent), transparent 60%); }
.site-header.is-scrolled .icon-btn, .site-header.is-scrolled .lang-btn { border-color: transparent; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header.is-scrolled .header-inner { background-color: color-mix(in srgb, var(--paper) 94%, transparent); }
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; letter-spacing: -0.03em; text-decoration: none; justify-self: start; }
.brand { color: var(--ink); line-height: 0; padding: 6px 0; }
.brand-logo { display: block; height: 24px; width: auto; transition: transform .6s var(--ease), color .3s; }
.brand:hover .brand-logo { transform: scale(1.04); }
.nav { position: relative; display: flex; gap: 4px; padding: 5px; border-radius: 999px; background: transparent; border: 0; }
.nav a { position: relative; z-index: 1; white-space: nowrap; text-decoration: none; font-size: 15px; padding: 8px 16px; border-radius: 999px; color: var(--ink); transition: color .35s var(--ease); }
/* black pill that glides to the hovered link and rests on the current page */
.nav-pill { position: absolute; z-index: 0; top: 5px; left: 0; height: calc(100% - 10px); width: 0; border-radius: 999px; background: var(--ink); opacity: 0; pointer-events: none;
  transition: transform .5s var(--ease), width .5s var(--ease), opacity .3s ease; }
.nav a.on { color: var(--on-ink); }
.no-js .nav a[aria-current="page"], html:not(.js) .nav a[aria-current="page"] { background: var(--ink); color: var(--on-ink); }
@media (prefers-reduced-motion: reduce) { .nav-pill { transition: opacity .2s; } }
.header-actions { display: flex; gap: 8px; align-items: center; justify-self: end; }

/* Hero */
.hero { position: relative; min-height: min(100svh, 1100px); display: flex; flex-direction: column; margin-top: -76px; padding-top: 76px; overflow: hidden; }
.sculpture { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
.hero-inner { position: relative; flex: 1; display: grid; grid-template-rows: auto 1fr auto; gap: 32px; padding-top: 40px; padding-bottom: 48px; pointer-events: none; width: 100%; }
.hero-inner a, .hero-inner button { pointer-events: auto; }
.hero-top { display: flex; justify-content: space-between; gap: 16px; font-size: 15px; color: var(--ink-2); }
.hero-role { margin: 0; text-align: right; }
.status { display: inline-flex; align-items: center; gap: 10px; margin: 0; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); } 50% { box-shadow: 0 0 0 7px transparent; } }
.hero-title { align-self: end; font-size: clamp(52px, 9vw, 176px); letter-spacing: -0.055em; line-height: .92; font-weight: 500; max-width: 11ch; }
.hero-foot { display: flex; justify-content: space-between; align-items: end; gap: 32px; flex-wrap: wrap; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-hint { position: absolute; right: 40px; top: 50%; margin: 0; font: 400 12px/1 var(--mono); color: var(--muted); writing-mode: vertical-rl; transform: translateY(-50%) rotate(180deg); }

/* Word reveal */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.w > span { display: inline-block; animation: word-up 1.1s var(--ease) both; animation-delay: calc(var(--i) * 70ms + 120ms); }
@keyframes word-up { from { transform: translateY(105%); } }

/* Scroll reveal: only hides content once JS has confirmed it can reveal it */
.js .reveal:not(.in) { opacity: 0; transform: translateY(28px); }
.js .reveal { transition: opacity 1s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0ms); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .w > span, .status-dot, .glow, .glow span, .vk-glow, .vk-glow i, .vk-metal { animation: none; }
  .js .reveal:not(.in) { opacity: 1; transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .btn::before { transition: none; }
}

/* Sections */
.section { padding-top: clamp(80px, 11vw, 160px); }
.section-tight { padding-top: 32px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.section-note { margin: 0; max-width: 34ch; color: var(--muted); }
.page-head { padding-top: clamp(72px, 11vw, 160px); padding-bottom: 32px; display: grid; gap: 28px; }
.page-title { font-size: clamp(48px, 8vw, 128px); letter-spacing: -0.05em; line-height: .95; max-width: 14ch; }

/* Services */
.service-grid { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.service-card { flex: 1 1 calc(33.333% - 14px); min-width: 260px; background: var(--card); border-radius: var(--r-md); padding: 28px 28px 32px; min-height: 230px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; transition: background .4s var(--ease), color .4s var(--ease), transform .5s var(--ease); }
.service-icon { margin-bottom: 40px; display: block; color: var(--ink); line-height: 0; transition: color .4s var(--ease), transform .6s var(--ease); transform-origin: left bottom; }
.service-icon svg * { stroke-dasharray: 90; stroke-dashoffset: 0; }
.service-card:hover .service-icon { color: var(--on-ink); transform: scale(1.06); }
.service-card:hover .service-icon svg * { animation: icon-draw 1.1s var(--ease); }
@keyframes icon-draw { from { stroke-dashoffset: 90; } }
.service-card { min-height: 0; gap: 10px; justify-content: flex-start; }
.service-card p { margin: 0; color: var(--muted); max-width: 36ch; transition: color .4s; }
.service-card:hover { background: var(--ink); color: var(--on-ink); transform: translateY(-4px); }
.service-card:hover p { color: color-mix(in srgb, var(--on-ink) 70%, transparent); }

/* Projects */
.project-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 64px 20px; }
.project-card { grid-column: span 6; }
.project-card:nth-child(4n + 1) { grid-column: span 7; }
.project-card:nth-child(4n + 2) { grid-column: span 5; padding-top: 96px; }
.project-card:nth-child(4n + 3) { grid-column: span 5; }
.project-card:nth-child(4n + 4) { grid-column: span 7; }
.project-grid > .project-card:last-child:nth-child(odd):not(:first-child) { grid-column: 1 / -1; padding-top: 0; }
.project-grid > .project-card:last-child:nth-child(odd):not(:first-child) .project-media { aspect-ratio: 21 / 9; }
.project-card[hidden] { display: none; }
.project-link { display: grid; gap: 14px; text-decoration: none; cursor: none; }
@media (hover: none) { .project-link { cursor: pointer; } }
.project-media { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden; background: var(--paper-2); transform: translateZ(0); }
.project-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); transition: transform 1.2s var(--ease); }
.project-link:hover .project-media img { transform: scale(1.0); }
.project-media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.media-empty { width: 100%; height: 100%; }
.project-tags { position: absolute; left: 16px; top: 16px; display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.project-tags li { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--paper) 82%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: var(--ink); }
.project-info { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 4px 4px 0; }
.project-info h3 { font-size: clamp(20px, 1.8vw, 26px); }
.project-meta { margin: 0; color: var(--muted); font-size: 15px; white-space: nowrap; }
.project-summary { margin: 0; padding: 0 4px; color: var(--muted); max-width: 52ch; }

.cursor-pill { position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none; padding: 14px 20px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font: 500 14px/1 var(--sans); transform: translate(-50%, -50%) scale(0); transition: transform .45s var(--ease); white-space: nowrap; }
.cursor-pill.on { transform: translate(-50%, -50%) scale(1); }
@media (hover: none) { .cursor-pill { display: none; } }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 500 15px/1 var(--sans); padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; transition: background .35s var(--ease), color .35s var(--ease), border-color .35s; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.project-card.is-filtering { animation: card-in .7s var(--ease) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }

/* Posts */
.post-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.post-row a { position: relative; display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 8px 32px; align-items: baseline; padding: 30px 20px; margin: 0 -20px; border-bottom: 1px solid var(--line); border-radius: 0; text-decoration: none; transition: background .4s var(--ease), border-radius .4s var(--ease); }
.post-row a:hover { background: var(--card); border-radius: var(--r-md); border-bottom-color: transparent; }
.post-row time, .post-row-time { font: 400 13px/1.6 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.post-row-main { display: grid; gap: 6px; min-width: 0; }
.post-row-title { font-size: clamp(22px, 2.2vw, 30px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.15; }
.post-row a > * { transition: transform .5s var(--ease); }
.post-row a:hover > * { transform: translateX(8px); }
.post-row-excerpt { color: var(--muted); max-width: 64ch; }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; }
.about .prose { font-size: clamp(19px, 1.7vw, 24px); line-height: 1.45; letter-spacing: -0.015em; max-width: 34em; }

/* Contact */
.contact-wrap { padding-top: clamp(80px, 11vw, 160px); padding-bottom: 24px; scroll-margin-top: 40px; }
.contact { background: var(--ink); color: var(--on-ink); border-radius: calc(var(--r-lg) + 8px); padding: clamp(28px, 5vw, 72px); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 72px); position: relative; overflow: hidden; }
.contact::after { content: ""; position: absolute; width: 560px; height: 560px; left: -200px; bottom: -300px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--on-ink) 14%, transparent), transparent 70%); pointer-events: none; }
.contact-intro { display: flex; flex-direction: column; gap: 20px; position: relative; z-index: 1; min-width: 0; }
.contact h2 { font-size: clamp(40px, 5.6vw, 88px); max-width: 11ch; letter-spacing: -0.05em; }
.contact-lead { margin: 0; color: color-mix(in srgb, var(--on-ink) 65%, transparent); max-width: 36ch; font-size: 18px; }
.contact-direct { margin-top: auto; display: grid; gap: 14px; padding-top: 24px; }
.contact-or { margin: 0; font: 400 13px/1 var(--mono); color: color-mix(in srgb, var(--on-ink) 55%, transparent); }
.contact-email { justify-self: start; font-size: clamp(20px, 2.4vw, 30px); letter-spacing: -0.03em; text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--on-ink) 35%, transparent); overflow-wrap: anywhere; transition: border-color .3s; }
.contact-email:hover { border-color: var(--on-ink); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.contact-card { position: relative; z-index: 1; background: var(--paper); color: var(--ink); border-radius: var(--r-lg); padding: clamp(22px, 3vw, 36px); min-width: 0; }

/* Contact form */
.cform { display: grid; }
.cform-fields { display: grid; gap: 18px; }
.cform-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.cfield { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.cfield label, .cfield legend { font-size: 14px; font-weight: 500; color: var(--ink); padding: 0; margin-bottom: 8px; }
.cfield label { margin-bottom: 0; }
.opt-note { font-weight: 400; color: var(--muted); }
.cfield input, .cfield textarea {
  width: 100%; font: 400 16px/1.45 var(--sans); color: var(--ink);
  background: var(--card); border: 1px solid transparent; border-radius: 16px; padding: 14px 16px;
  transition: border-color .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
}
.cfield textarea { resize: vertical; min-height: 120px; }
.cfield input::placeholder, .cfield textarea::placeholder { color: var(--muted); }
.cfield input:hover, .cfield textarea:hover { border-color: var(--line); }
.cfield input:focus, .cfield textarea:focus { outline: none; background: var(--paper); border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 10%, transparent); }
.cfield.has-error input, .cfield.has-error textarea { border-color: var(--danger); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); font-size: 14.5px; color: var(--ink-2); transition: background .3s var(--ease), color .3s, border-color .3s, transform .2s var(--ease); user-select: none; }
.opt:hover span { border-color: var(--ink); color: var(--ink); }
.opt input:checked + span { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.opt input:active + span { transform: scale(.96); }
.opt input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.cerr { margin: 0; font-size: 13.5px; color: var(--danger); min-height: 0; }
.cerr:empty { display: none; }
.cerr-form { padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, var(--danger) 10%, transparent); }
.cform-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.cform-note { margin: 0; font-size: 13.5px; color: var(--muted); }
.btn-send[aria-busy="true"] { pointer-events: none; }
.btn-send[aria-busy="true"]::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cform-ok { display: grid; justify-items: start; gap: 12px; padding: 12px 0; animation: ok-in .7s var(--ease) both; }
.cform-ok h3 { font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -0.035em; }
.cform-ok p { margin: 0; color: var(--ink-2); max-width: 40ch; }
.cform-ok p:empty { display: none; }
.ok-mark { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--on-ink); }
.ok-mark path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: tick .6s var(--ease) .25s forwards; }
@keyframes tick { to { stroke-dashoffset: 0; } }
@keyframes ok-in { from { opacity: 0; transform: translateY(12px); } }

/* Contact dialog */
.contact-dialog { width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: calc(var(--r-lg) + 4px); background: var(--paper); color: var(--ink); box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .45); overflow: auto; overscroll-behavior: contain; }
.contact-dialog::backdrop { background: rgba(16, 15, 14, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.contact-dialog[open] { animation: dialog-in .55s var(--ease); }
.contact-dialog[open]::backdrop { animation: fade .4s ease; }
.contact-dialog.closing { animation: dialog-out .3s var(--ease) forwards; }
.contact-dialog.closing::backdrop { animation: fade .3s ease reverse forwards; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(40px) scale(.97); } }
@keyframes dialog-out { to { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }
.cd-inner { padding: clamp(22px, 4vw, 40px); display: grid; gap: 24px; }
.cd-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.cd-head h2 { font-size: clamp(28px, 3.4vw, 42px); }
body.dialog-open { overflow: hidden; }

/* Language switcher */
.lang { position: relative; }
.lang-btn { list-style: none; display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 14px 0 12px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; font: 500 14px/1 var(--sans); color: var(--ink); transition: background .3s; user-select: none; }
.lang-btn::-webkit-details-marker { display: none; }
.lang-btn:hover, .lang[open] .lang-btn { background: var(--card); }
.lang-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; list-style: none; margin: 0; padding: 6px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .3); z-index: 30; transform-origin: top right; animation: menu-in .35s var(--ease); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.96); } }
.lang-menu a { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 14px; border-radius: 14px; text-decoration: none; font-size: 15px; transition: background .2s; }
.lang-menu a span { font: 400 12px/1 var(--mono); color: var(--muted); }
.lang-menu a:hover { background: var(--paper-2); }
.lang-menu a[aria-current="true"] { background: var(--ink); color: var(--on-ink); }
.lang-menu a[aria-current="true"] span { color: inherit; opacity: .6; }
.fallback-note { margin-top: 16px; margin-bottom: 0; font-size: 14px; color: var(--muted); }
.fallback-note::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); margin-right: 10px; vertical-align: middle; }
.footer-cta { display: grid; gap: 16px; justify-items: start; }

/* Chinese: no negative tracking, taller lines */
:lang(zh) { --sans: "Geist", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; }
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3, :lang(zh) .hero-title, :lang(zh) .page-title, :lang(zh) .next-title { letter-spacing: 0; line-height: 1.15; }
:lang(zh) .hero-title { max-width: 9em; font-size: clamp(44px, 7vw, 136px); }
:lang(de) .hero-title, :lang(pt) .hero-title, :lang(es) .hero-title, :lang(ru) .hero-title { font-size: clamp(44px, 7.4vw, 150px); max-width: 13ch; }
.hero-title, .page-title { overflow-wrap: break-word; hyphens: auto; }

/* Prose */
.prose { max-width: 68ch; font-size: 18px; line-height: 1.72; }
.prose > *:first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose figure { margin: 0 0 1.25em; }
.prose h2 { font-size: clamp(28px, 2.6vw, 36px); margin: 1.8em 0 .55em; letter-spacing: -0.035em; }
.prose h3 { font-size: 24px; margin: 1.6em 0 .5em; }
.prose h4, .prose h5, .prose h6 { font-size: 19px; margin: 1.4em 0 .4em; font-weight: 600; }
.prose a { text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); text-underline-offset: 4px; text-decoration-thickness: 1px; transition: text-decoration-color .3s; }
.prose a:hover { text-decoration-color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose blockquote { background: var(--card); border-radius: var(--r-md); padding: 24px 28px; font-size: 21px; line-height: 1.5; letter-spacing: -0.015em; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose code { font-family: var(--mono); font-size: .85em; background: var(--card); padding: .15em .4em; border-radius: 6px; }
.prose pre { background: var(--card); padding: 20px 22px; border-radius: 16px; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.prose pre code { background: none; padding: 0; }
.prose img { border-radius: var(--r-md); }
.prose figure img { width: 100%; }
.prose figcaption { color: var(--muted); font-size: 14px; margin-top: 12px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.6em 0; }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--r-md); }
@media (min-width: 1100px) { .case-body figure, .case-body iframe { width: calc(100% + 280px); max-width: none; } }

/* Case + article */
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font-size: 15px; padding: 9px 16px 9px 12px; border: 1px solid var(--line); border-radius: 999px; transition: color .3s, border-color .3s, gap .4s var(--ease); justify-self: start; }
.back::before { content: ""; width: 7px; height: 7px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.back:hover { color: var(--ink); border-color: var(--ink); gap: 12px; }
.case-head, .article-head { padding-top: clamp(48px, 7vw, 104px); display: grid; gap: 28px; }
.case-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: 24px 0 0; padding: 28px 0 0; border-top: 1px solid var(--line); }
.case-meta dt { font: 400 13px/1.4 var(--mono); color: var(--muted); margin-bottom: 6px; }
.case-meta dd { margin: 0; }
.case-cover { margin-top: 56px; margin-bottom: 80px; }
.case-cover img, .article-cover img { width: 100%; border-radius: var(--r-lg); }
.next { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 12px 32px; margin: clamp(96px, 12vw, 160px) 0 40px; padding: clamp(28px, 4vw, 48px); background: var(--card); border-radius: calc(var(--r-lg) + 8px); text-decoration: none; cursor: none; transition: background .5s var(--ease), color .5s var(--ease); }
@media (hover: none) { .next { cursor: pointer; } }
.next:hover { background: var(--ink); color: var(--on-ink); }
.next-label { font: 400 13px/1 var(--mono); color: var(--muted); grid-column: 1; }
.next-title { grid-column: 1; font-size: clamp(32px, 4.6vw, 68px); letter-spacing: -0.045em; line-height: 1; font-weight: 500; }
.next img { grid-column: 2; grid-row: 1 / span 2; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-md); transition: transform .9s var(--ease); }
.next:hover img { transform: scale(.97) rotate(-1deg); }
.article-meta { display: flex; gap: 20px; color: var(--muted); font: 400 14px/1 var(--mono); margin: 0; }
.article-cover { margin-top: 56px; }
.article-body { margin: 64px auto 0; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 40px auto 0; max-width: 68ch; }
.tags li { font-size: 14px; color: var(--ink-2); background: var(--card); border-radius: 999px; padding: 7px 14px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-top: 0; margin-top: clamp(80px, 10vw, 140px); }
.post-nav a { text-decoration: none; font-size: 22px; font-weight: 500; letter-spacing: -0.025em; line-height: 1.25; display: grid; gap: 10px; padding: 28px; background: var(--card); border-radius: var(--r-md); transition: background .45s var(--ease), color .45s var(--ease); }
.post-nav a span { font: 400 13px/1 var(--mono); color: var(--muted); }
.post-nav a:hover { background: var(--ink); color: var(--on-ink); }
.post-nav .right { text-align: right; }
.notfound { padding-bottom: 160px; }

/* Footer */
.site-footer { padding-top: clamp(64px, 8vw, 120px); overflow: hidden; }
.footer-top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.footer-note { margin: 0; color: var(--muted); font-size: 15px; }
.footer-links { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; flex-wrap: wrap; }
.footer-links a { display: inline-block; text-decoration: none; font-size: 15px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); transition: background .3s, color .3s; }
.footer-links a:hover { background: var(--ink); color: var(--on-ink); }
.footer-mark { display: block; width: 100%; margin: 0; padding-top: clamp(40px, 6vw, 88px); }
.footer-mark { position: relative; isolation: isolate; }
.footer-logo { position: relative; z-index: 1; }
/* silver hand rising behind the letters */
.footer-hand { position: absolute; z-index: 0; left: 50%; bottom: -14%; width: 52%; height: auto; transform: translateX(-46%) rotate(-4deg); pointer-events: none; user-select: none;
  filter: drop-shadow(0 30px 60px rgba(18, 20, 23, .18)); transition: transform 1.2s var(--ease); }
.footer-mark:hover .footer-hand { transform: translateX(-46%) translateY(-2%) rotate(-2deg); }
:root[data-theme="dark"] .footer-hand { filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .6)); }
.vk-wrap { position: relative; z-index: 1; display: block; }
.vk-wrap.is-liquid { filter: url(#vk-liquid); }
.vk-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
/* VK letters: the same drifting blue glow as the top of the page, seen through the letter shape */
.footer-logo { position: relative; display: block; width: 100%; aspect-ratio: 455 / 243; overflow: hidden;
  -webkit-mask: url(vk-mask.svg) no-repeat left center / contain; mask: url(vk-mask.svg) no-repeat left center / contain;
  background: color-mix(in srgb, var(--glow-a) 55%, var(--paper)); }
.vk-glow { position: absolute; inset: -20%; animation: hue 16s ease-in-out infinite alternate; }
.vk-glow i { position: absolute; border-radius: 50%; filter: blur(40px); will-change: transform; }
.vk-glow .b1 { width: 70%; height: 90%; left: 0; top: 0; background: radial-gradient(closest-side, var(--glow-a), transparent); animation: vk-d1 14s ease-in-out infinite alternate; }
.vk-glow .b2 { width: 60%; height: 80%; left: 45%; top: 10%; background: radial-gradient(closest-side, var(--glow-b), transparent); animation: vk-d2 17s ease-in-out infinite alternate; }
.vk-glow .b3 { width: 55%; height: 75%; left: 20%; top: 40%; background: radial-gradient(closest-side, var(--glow-c), transparent); animation: vk-d3 19s ease-in-out infinite alternate; }
.vk-glow .b4 { width: 45%; height: 60%; left: 60%; top: 45%; background: radial-gradient(closest-side, var(--accent), transparent); animation: vk-d1 21s ease-in-out infinite alternate-reverse; }
@keyframes vk-d1 { to { transform: translate(40%, 25%) scale(1.2); } }
@keyframes vk-d2 { to { transform: translate(-45%, 20%) scale(.85); } }
@keyframes vk-d3 { to { transform: translate(30%, -30%) scale(1.25); } }
/* Liquid metal on hover */
.vk-metal { position: absolute; inset: 0; opacity: 0; transition: opacity .9s var(--ease);
  /* brushed metal: fine horizontal grain over soft steel shading, no highlights */
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.06) 0 1px, rgba(0,0,0,.05) 1px 2px, transparent 2px 3px),
    linear-gradient(180deg, #c3c8cf 0%, #a4aab3 22%, #b8bdc4 40%, #8c929b 58%, #a9aeb6 76%, #9298a1 100%); }
.footer-mark:hover .vk-metal, .vk-wrap.is-liquid .vk-metal { opacity: 1; }
.footer-copy { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0; padding: 32px 0 max(24px, env(safe-area-inset-bottom, 0px)); font: 400 13px/1.4 var(--mono); color: var(--muted); }
.footer-copy a { color: inherit; text-decoration: none; transition: color .3s; }
.footer-copy a:hover { color: var(--ink); }
.footer-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.to-top svg { transition: transform .4s var(--ease); }
.to-top:hover svg { transform: translateY(-3px); }

/* Responsive */
@media (max-width: 960px) {
  .contact { grid-template-columns: 1fr; }
  .contact-direct { margin-top: 0; padding-top: 0; }
  .project-grid { grid-template-columns: 1fr; gap: 48px; }
  .project-card, .project-card:nth-child(n) { grid-column: auto; padding-top: 0; }
  .about { grid-template-columns: 1fr; gap: 20px; }
  .case-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-row a { grid-template-columns: 1fr; gap: 8px; }
  .post-row-time { display: none; }
  .next { grid-template-columns: 1fr; }
  .next img { grid-column: auto; grid-row: auto; }
  .hero-hint { display: none; }
}
@media (max-width: 720px) {
  .header-inner { grid-template-columns: auto 1fr auto; height: 64px; }
  .site-header.is-scrolled .header-inner { margin-top: 8px; width: calc(100% - 2 * var(--gutter) + 12px); height: 56px; padding-left: 14px; padding-right: 6px; }
  .header-inner { grid-template-columns: auto 1fr; }
  .header-inner .nav, .header-actions .lang, .header-actions .btn-contact { display: none; }
  .header-actions { justify-self: end; }
  .burger { display: inline-grid; }
  .cform-row { grid-template-columns: 1fr; }
  .hero { margin-top: -64px; padding-top: 64px; min-height: 92svh; }
  .hero-top { flex-direction: column; gap: 6px; }
  .hero-role { text-align: left; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1 1 auto; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .right { text-align: left; }
}

@media (max-width: 420px) {
  .brand-logo { height: 20px; }
}
@media (prefers-reduced-motion: reduce) { .service-card:hover .service-icon svg * { animation: none; } .service-card:hover .service-icon { transform: none; } }

/* ---------- Article: share, contents, gallery ---------- */
.prose h2, .prose h3 { scroll-margin-top: 110px; }
.article-actions { display: flex; gap: 10px; }
.article-end { margin: 48px 0 0; padding-top: 28px; border-top: 1px solid var(--line); display: flex; justify-content: flex-start; }
.share { position: relative; }
.share-btn svg { flex: none; }
.share-menu { position: absolute; left: 0; top: calc(100% + 8px); z-index: 15; min-width: 230px; padding: 6px; border-radius: 20px; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 24px 60px -20px rgba(0,0,0,.3); display: grid; gap: 2px; animation: menu-in .35s var(--ease); }
.article-end .share-menu { top: auto; bottom: calc(100% + 8px); }
.share-menu a, .share-menu button { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; border: 0; background: none; color: var(--ink); font: 400 15px/1.2 var(--sans); text-decoration: none; text-align: left; cursor: pointer; transition: background .2s; }
.share-menu a:hover, .share-menu button:hover { background: var(--card); }
.share-copy.done { color: var(--ok); }

.article-layout { display: block; }
.article-layout.has-toc { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: start; margin-top: 56px; }
.article-layout.has-toc .article-body { margin-top: 0; margin-left: 0; }
.article-layout.has-toc .tags { margin-left: 0; }
.article-main { min-width: 0; max-width: 68ch; }
.article-layout:not(.has-toc) .article-main { margin: 0 auto; }
.toc { position: sticky; top: 100px; }
.toc-box summary { display: none; }
.toc-title { margin: 0 0 12px; font: 400 13px/1.4 var(--mono); color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.toc li a { position: relative; display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 1.5px solid transparent; color: var(--muted); text-decoration: none; font-size: 14.5px; line-height: 1.35; transition: color .25s, border-color .25s; }
.toc li.toc-l3 a { padding-left: 30px; font-size: 13.5px; }
.toc li a:hover { color: var(--ink); }
.toc li a.active { color: var(--ink); border-left-color: var(--ink); }
@media (max-width: 1100px) {
  .article-layout.has-toc { grid-template-columns: 1fr; gap: 24px; margin-top: 40px; }
  .article-main { margin: 0 auto; }
  .toc { position: sticky; top: 76px; z-index: 5; }
  .toc-box { background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 20px; padding: 0 16px; }
  .toc-box summary { display: flex; justify-content: space-between; align-items: center; list-style: none; cursor: pointer; padding: 14px 0; font-weight: 500; }
  .toc-box summary::-webkit-details-marker { display: none; }
  .toc-box summary::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .3s var(--ease); }
  .toc-box[open] summary::after { transform: rotate(-135deg); }
  .toc-title { display: none; }
  .toc-box nav { padding-bottom: 14px; max-height: 50vh; overflow: auto; }
}

.gallery { display: grid; gap: 14px; margin-top: 56px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery.g-1 { grid-template-columns: 1fr; }
.gallery.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-item { padding: 0; border: 0; background: var(--card); border-radius: var(--r-md); overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 3; }
.gallery.g-1 .g-item { aspect-ratio: 16 / 9; }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.g-item:hover img { transform: scale(1.03); }
@media (max-width: 720px) { .gallery, .gallery.g-2 { grid-template-columns: 1fr; } }
.lightbox { max-width: min(1400px, 94vw); max-height: 92vh; padding: 0; border: 0; border-radius: var(--r-lg); background: transparent; overflow: visible; }
.lightbox::backdrop { background: rgba(10, 11, 13, .82); backdrop-filter: blur(6px); }
.lightbox[open] { animation: dialog-in .45s var(--ease); }
.lightbox img { display: block; max-width: 100%; max-height: 92vh; border-radius: var(--r-lg); }
.lb-close { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.9); color: #121417; border: 0; z-index: 1; }
.footer-copy { position: relative; z-index: 2; }

/* Cookie notice */
.cookie { position: fixed; z-index: 60; left: 50%; bottom: max(16px, env(safe-area-inset-bottom, 0px)); width: min(760px, calc(100% - 2 * var(--gutter)));
  display: flex; align-items: center; gap: 16px; padding: 12px 12px 12px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, .8); box-shadow: inset 0 1px 1px rgba(255,255,255,.9), 0 20px 50px -18px rgba(18,20,23,.35);
  transform: translate(-50%, 140%); opacity: 0; transition: transform .7s var(--ease), opacity .5s; }
.cookie.show { transform: translate(-50%, 0); opacity: 1; }
:root[data-theme="dark"] .cookie { background: rgba(26, 29, 36, .95); border-color: rgba(255,255,255,.12); box-shadow: 0 20px 50px -18px rgba(0,0,0,.7); }
.cookie-icon { flex: none; animation: cookie-wobble 2.4s var(--ease) .8s both; }
@keyframes cookie-wobble { 0% { transform: rotate(-30deg) scale(.6); } 40% { transform: rotate(12deg) scale(1.05); } 70% { transform: rotate(-6deg); } 100% { transform: none; } }
.cookie p { margin: 0; flex: 1; font-size: 14.5px; line-height: 1.4; color: var(--ink-2); }
.cookie a { color: var(--ink); text-underline-offset: 3px; }
.cookie .btn { flex: none; }
@media (max-width: 600px) {
  .cookie { flex-wrap: wrap; border-radius: 24px; padding: 14px; gap: 12px; }
  .cookie p { flex: 1 1 calc(100% - 56px); font-size: 14px; }
  .cookie .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .cookie, .cookie-icon { transition: none; animation: none; } }

/* ---------- Buttons: hover = lift, soft glow and a light glint ---------- */
.btn { transition: color .35s var(--ease), border-color .35s var(--ease), transform .45s var(--ease), box-shadow .45s var(--ease), background-color .35s var(--ease); }
.btn::before { transform: none !important; opacity: 0; transition: opacity .35s var(--ease); }
.btn:hover::before { opacity: 1; }
.btn:not(.btn-send)::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.38) 48%, rgba(255,255,255,.08) 56%, transparent 70%);
  transform: translateX(-130%); }
.btn:not(.btn-send):hover::after { transform: translateX(130%); transition: transform .9s var(--ease); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -12px color-mix(in srgb, var(--accent) 70%, transparent), 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.btn:active { transform: translateY(0) scale(.97); box-shadow: none; transition-duration: .15s; }
.btn:focus-visible { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); }
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } .btn::after { display: none; } }

/* 404 */
.nf { position: relative; min-height: calc(100svh - 76px); display: grid; align-items: center; padding-top: 40px; padding-bottom: 80px; overflow: hidden; }
.nf-sculpture { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.nf-inner { position: relative; display: grid; justify-items: start; gap: 24px; pointer-events: none; }
.nf-inner a { pointer-events: auto; }
.nf-code { margin: 0; display: flex; font-weight: 600; font-size: clamp(140px, 30vw, 440px); line-height: .8; letter-spacing: -0.07em; animation: hue 14s ease-in-out infinite alternate; }
.nf-code span { display: inline-block; padding-right: .04em;
  background: radial-gradient(70% 80% at 30% 30%, var(--glow-b), transparent 70%), radial-gradient(70% 80% at 70% 75%, var(--glow-c), transparent 70%), linear-gradient(120deg, var(--accent), var(--glow-a) 45%, var(--glow-b) 70%, var(--accent));
  background-size: 200% 200%, 200% 200%, 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  animation: nf-float 6s ease-in-out infinite, nf-flow 10s ease-in-out infinite alternate; }
.nf-code span:nth-child(2) { animation-delay: -2s; }
.nf-code span:nth-child(3) { animation-delay: -4s; }
@keyframes nf-flow { from { background-position: 0% 0%, 100% 100%, 0% 0; } to { background-position: 100% 100%, 0% 0%, 100% 0; } }
@keyframes nf-float { 50% { transform: translateY(-3%) rotate(-2deg); } }
.nf-title { font-size: clamp(32px, 4.4vw, 64px); letter-spacing: -0.04em; max-width: 16ch; }
.nf-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .nf-code, .nf-code span { animation: none; } }
@media (max-width: 600px) { .nf-actions .btn { flex: 1 1 auto; } .nf { align-items: start; padding-top: 60px; } }

/* Burger + mobile menu */
.burger { position: relative; }
.burger span { position: absolute; left: 50%; top: 50%; margin: -0.8px 0 0 -9px; width: 18px; height: 1.6px; border-radius: 2px; background: var(--ink); transition: transform .35s var(--ease); }
.burger span:first-child { transform: translateY(-3.5px); } .burger span:last-child { transform: translateY(3.5px); }
.burger[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }
.mmenu { pointer-events: auto; position: absolute; left: var(--gutter); right: var(--gutter); top: calc(100% + 8px); padding: 10px; border-radius: 28px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 30px 70px -24px rgba(0,0,0,.35); display: grid; gap: 12px; opacity: 0; transform: translateY(-8px) scale(.98); transform-origin: top center; transition: opacity .3s var(--ease), transform .3s var(--ease); }
.mmenu.show { opacity: 1; transform: none; }
.mmenu-nav { display: grid; }
.mmenu-nav a { text-decoration: none; font-size: 22px; letter-spacing: -.01em; padding: 12px 14px; border-radius: 18px; color: var(--ink); transition: background .2s; }
.mmenu-nav a:hover, .mmenu-nav a[aria-current="page"] { background: var(--paper-2); }
.mmenu-langs { list-style: none; margin: 0; padding: 0 4px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.mmenu-langs a { display: grid; place-items: center; height: 40px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font: 500 13px/1 var(--mono); color: var(--ink); }
.mmenu-langs a[aria-current="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.mmenu-cta { width: 100%; justify-content: center; }
@media (min-width: 721px) { .mmenu, .burger { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .mmenu, .burger span { transition: none; } }

/* Burger: no rotate on hover, no sticky hover on touch */
.burger, .burger:hover { transform: none; }
@media (hover: none) { .burger:hover { background: transparent; } }
.burger[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); }
.burger[aria-expanded="true"] span { background: var(--on-ink); }
.burger span { transition: transform .35s var(--ease), background .2s; }
/* Sticky contact button (mobile) */
.sticky-cta { display: none; }
@media (max-width: 720px) {
  .sticky-cta { display: flex; justify-content: center; position: fixed; z-index: 50; left: var(--gutter); right: var(--gutter); bottom: max(14px, env(safe-area-inset-bottom, 0px)); height: 54px; box-shadow: 0 18px 40px -14px rgba(0,0,0,.45); transition: transform .4s var(--ease), opacity .3s; }
  .sticky-cta.away { transform: translateY(140%); opacity: 0; pointer-events: none; }
  body { padding-bottom: 84px; }
  .mmenu-cta { display: none; }
}
/* Mobile footer: hand rises from below the screen edge */
@media (max-width: 720px) {
  body { padding-bottom: 0; }
  .site-footer > .wrap { display: flex; flex-direction: column; }
  .footer-copy { order: 2; padding: 20px 0 0; }
  .footer-mark { order: 3; padding-bottom: 150px; }
  .footer-hand { width: 82%; bottom: -26%; transform: translateX(-48%) rotate(-4deg); }
  .footer-mark:hover .footer-hand { transform: translateX(-48%) rotate(-4deg); }
}
/* Contact block: tight edges on tablet/mobile */
@media (max-width: 960px) {
  .contact { padding: clamp(28px, 5vw, 48px) 5px 5px; gap: 28px; }
  .contact-intro { padding: 0 clamp(18px, 4vw, 40px); }
}
@media (max-width: 720px) {
  .contact-wrap { padding-left: 5px; padding-right: 5px; }
}
/* Mobile: 5px side gutters everywhere */
@media (max-width: 720px) { :root { --gutter: 5px; } .post-row a { margin: 0; padding: 22px 14px; } }
/* Mobile: compact service cards */
@media (max-width: 720px) {
  .service-grid { gap: 6px; }
  .service-card { padding: 18px 20px 20px; gap: 6px; min-width: 0; flex-basis: 100%; }
  .service-icon { margin-bottom: 12px; }
  .service-icon svg { width: 32px; height: 32px; }
  .service-card h3 { font-size: 19px; }
  .service-card p { font-size: 14.5px; line-height: 1.5; }
}
/* Selected work: stacked showcase cards */
.pf-stack { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; }
.pf { position: sticky; top: calc(96px + var(--i) * 18px); }
.pf-card { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(20px, 3vw, 48px); min-height: min(76vh, 640px); padding: clamp(14px, 1.6vw, 22px); border-radius: calc(var(--r-lg) + 10px); text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); box-shadow: 0 -24px 60px -40px rgba(18, 20, 23, .35); transition: background .5s var(--ease), color .5s var(--ease), transform .6s var(--ease); transform-origin: top center; }
.pf:nth-child(3n + 2) .pf-card { background: var(--ink); color: var(--on-ink); border-color: transparent; }
.pf-text { display: flex; flex-direction: column; gap: 18px; padding: clamp(10px, 2vw, 28px); min-width: 0; }
.pf-top { display: flex; justify-content: space-between; gap: 12px; font: 400 13px/1 var(--mono); opacity: .65; }
.pf-num { font-variant-numeric: tabular-nums; }
.pf-num span { opacity: .5; }
.pf-title { margin: auto 0 0; font-size: clamp(30px, 3.2vw, 52px); line-height: 1; letter-spacing: -.035em; font-weight: 500; text-wrap: balance; }
.pf-summary { margin: 0; font-size: clamp(15px, 1.1vw, 17px); line-height: 1.55; opacity: .7; max-width: 44ch; }
.pf-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 8px; }
.pf-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pf-tags li { font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid currentColor; opacity: .55; }
.pf-go { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 18px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-size: 14px; font-weight: 500; transition: gap .4s var(--ease); }
.pf-go svg { width: 30px; height: 30px; padding: 7px; border-radius: 50%; background: var(--on-ink); color: var(--ink); transition: transform .5s var(--ease); }
.pf:nth-child(3n + 2) .pf-go { background: var(--on-ink); color: var(--ink); }
.pf:nth-child(3n + 2) .pf-go svg { background: var(--ink); color: var(--on-ink); }
.pf-card:hover .pf-go { gap: 16px; }
.pf-card:hover .pf-go svg { transform: rotate(45deg); }
.pf-media { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--paper-2); min-height: 280px; transform: translateZ(0); }
.pf-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1.4s var(--ease); }
.pf-card:hover .pf-media img { transform: scale(1); }
@media (max-width: 960px) {
  .pf { top: calc(84px + var(--i) * 12px); }
  .pf-card { grid-template-columns: 1fr; min-height: 0; }
  .pf-media { order: -1; aspect-ratio: 4 / 3; min-height: 0; }
  .pf-title { margin-top: 4px; }
}
@media (max-width: 720px) {
  .pf-stack { gap: 12px; }
  .pf { top: calc(74px + var(--i) * 10px); }
  .pf-card { padding: 5px; gap: 6px; border-radius: calc(var(--r-lg) + 4px); }
  .pf-text { padding: 14px 14px 12px; gap: 12px; }
  .pf-title { font-size: 30px; }
  .pf-go { height: 40px; }
}
@media (prefers-reduced-motion: reduce) { .pf { position: static; } }
.pf-num b, .pf-num i { font: inherit; }
.pf[hidden] { display: none; }
.pf.is-filtering { animation: card-in .7s var(--ease) both; }
/* Consent checkbox */
.consent-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: 14px; line-height: 1.45; color: var(--muted); font-weight: 400; }
.consent-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.consent-box { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: -1px; border-radius: 7px; border: 1.5px solid var(--line-strong, var(--muted)); background: var(--paper); color: transparent; transition: background .25s var(--ease), border-color .25s, color .25s, transform .3s var(--ease); }
.consent-row:hover .consent-box { border-color: var(--ink); }
.consent-row input:checked + .consent-box { background: var(--ink); border-color: var(--ink); color: var(--on-ink); transform: scale(1.05); }
.consent-row input:focus-visible + .consent-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.consent-row a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.cfield.consent.has-error .consent-box { border-color: #e5484d; }
/* Hero status + role, refined */
.hero-top { align-items: center; gap: 20px; }
.status { gap: 12px; height: 40px; padding: 0 16px 0 12px; border-radius: 999px; font-size: 14px; color: var(--ink);
  background: color-mix(in srgb, var(--paper) 55%, transparent); border: 1px solid color-mix(in srgb, var(--ink) 9%, transparent);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 10px 30px -18px rgba(18, 20, 23, .35), inset 0 1px 0 rgba(255, 255, 255, .5); }
.status-dot { position: relative; width: 8px; height: 8px; animation: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.status-dot i { position: absolute; inset: 0; border-radius: 50%; background: var(--ok); animation: status-ping 2.2s cubic-bezier(.2, .7, .3, 1) infinite; }
@keyframes status-ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(3.4); opacity: 0; } }
.status-sep { width: 1px; height: 14px; background: color-mix(in srgb, var(--ink) 18%, transparent); }
.status-loc { font: 400 12.5px/1 var(--mono); color: var(--muted); letter-spacing: .02em; }
.hero-line { flex: 1; height: 1px; min-width: 40px; background: linear-gradient(90deg, color-mix(in srgb, var(--ink) 18%, transparent), color-mix(in srgb, var(--ink) 4%, transparent) 50%, color-mix(in srgb, var(--ink) 18%, transparent)); }
.hero-role { display: inline-flex; align-items: center; gap: 10px; font: 400 12.5px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.hero-role-mark { font-size: 11px; color: var(--accent); display: inline-block; animation: role-spin 9s linear infinite; }
@keyframes role-spin { to { transform: rotate(360deg); } }
:root[data-theme="dark"] .status { box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06); }
@media (max-width: 720px) {
  .hero-top { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero-line { display: none; }
  .status { height: 36px; font-size: 13.5px; }
  .hero-role { font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) { .status-dot i, .hero-role-mark { animation: none; } }
/* Mobile: status + role merged into one compact glass badge */
@media (max-width: 720px) {
  .hero-top { display: inline-grid; grid-template-columns: auto; gap: 6px; justify-self: start; width: fit-content; max-width: 100%; padding: 10px 14px 11px 12px; border-radius: 18px;
    background: color-mix(in srgb, var(--paper) 60%, transparent); border: 1px solid color-mix(in srgb, var(--ink) 9%, transparent);
    backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 10px 30px -18px rgba(18, 20, 23, .35), inset 0 1px 0 rgba(255, 255, 255, .5); }
  :root[data-theme="dark"] .hero-top { box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06); }
  .status { height: auto; padding: 0; background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; font-size: 13.5px; font-weight: 500; gap: 10px; }
  .hero-role { padding-left: 18px; font-size: 10.5px; letter-spacing: .07em; gap: 0; color: var(--muted); }
  .hero-role-mark { display: none; }
  .status-sep, .status-loc { display: none; }
  :root[data-theme="dark"] .status { box-shadow: none; }
}
/* Tablet + mobile: headings and descriptions use the full line width */
@media (max-width: 960px) {
  h1, h2, h3, .pf-title { text-wrap: wrap; }
  .hero-title, :lang(zh) .hero-title, :lang(de) .hero-title, :lang(pt) .hero-title, :lang(es) .hero-title, :lang(ru) .hero-title,
  .page-title, .contact h2, .nf-title { max-width: none; }
  .lead, .section-note, .service-card p, .project-summary, .post-row-excerpt, .contact-lead, .cform-ok p, .pf-summary { max-width: none; }
  .hero-title, .page-title { hyphens: manual; }
}
/* Numbers block */
.stats { padding-top: clamp(24px, 4vw, 56px); }
.stats-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { position: relative; display: flex; flex-direction: column; gap: 14px; padding: clamp(28px, 3.4vw, 48px) clamp(16px, 2vw, 32px); }
.stat + .stat::before { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 1px; background: var(--line); }
.stat:first-child { padding-left: 0; }
.stat-num { font-size: clamp(48px, 6.4vw, 104px); line-height: .9; font-weight: 500; letter-spacing: -.055em; font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, var(--ink) 30%, color-mix(in srgb, var(--accent) 70%, var(--ink)) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-label { font: 400 12.5px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); max-width: 28ch; }
@media (max-width: 960px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(odd) { padding-left: 0; }
  .stat:nth-child(odd)::before { display: none; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .stat-label { max-width: none; }
}
@media (max-width: 720px) {
  .stat { padding: 24px 12px; gap: 10px; }
  .stat-num { font-size: 52px; }
  .stat-label { font-size: 11px; }
}
/* Mobile: no horizontal overflow anywhere */
html, body { overflow-x: clip; }
@media (max-width: 720px) {
  .site-header.is-scrolled .header-inner { width: calc(100% - 2 * var(--gutter)); padding-left: 12px; padding-right: 6px; }
  .page-title-long { font-size: clamp(30px, 9.4vw, 64px); }
  .mmenu { left: var(--gutter); right: var(--gutter); }
}
@media (max-width: 720px) { .brand-logo { height: 17px; } }
@media (max-width: 720px) { .cform-foot { display: block; } .cform-foot .btn-send { width: 100%; justify-content: center; } }
/* Hero always fills the whole first screen; the next block starts below the fold */
.hero, .hero:where(*) { min-height: 100vh; min-height: 100svh; }
@media (max-width: 720px) { .hero { min-height: 100vh; min-height: 100svh; } }
.footer-mark { cursor: default; }
/* Client logos marquee */
.clients { padding-top: clamp(40px, 5vw, 72px); }
.clients-label { margin: 0 auto 22px; font: 400 12.5px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.marquee { position: relative; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-list { display: flex; align-items: center; gap: clamp(48px, 6vw, 96px); margin: 0; padding: 8px clamp(24px, 3vw, 48px); list-style: none; }
@keyframes marquee { to { transform: translateX(-50%); } }
.client { flex: none; color: var(--ink); opacity: .45; transition: opacity .35s var(--ease); }
.client:hover { opacity: 1; }
.client img { height: 32px; width: auto; display: block; filter: grayscale(1); }
:root[data-theme="dark"] .client img { filter: grayscale(1) invert(1); }
.client-word { display: inline-flex; align-items: center; gap: 10px; font-size: clamp(20px, 1.8vw, 26px); font-weight: 600; letter-spacing: -.03em; white-space: nowrap; }
@media (max-width: 720px) { .marquee-track { animation-duration: 28s; } .client-word { font-size: 19px; } .client-word svg { width: 22px; height: 22px; } .clients-label { margin-bottom: 14px; } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } .marquee { overflow-x: auto; } }
.clients { padding-top: clamp(96px, 10vw, 160px); }
/* Selected work cards: same spacing system as the contact block */
.pf-card { padding: clamp(28px, 5vw, 72px); gap: clamp(28px, 5vw, 72px); border-radius: calc(var(--r-lg) + 8px); }
.pf-text { padding: 0; }
@media (max-width: 960px) {
  .pf-card { padding: 5px 5px clamp(28px, 5vw, 48px); gap: 28px; }
  .pf-text { padding: 0 clamp(18px, 4vw, 40px); }
}
/* Video covers and gallery items behave like images */
.project-media video, .pf-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); transition: transform 1.2s var(--ease); }
.pf-card:hover .pf-media video, .project-link:hover .project-media video { transform: scale(1); }
.case-cover video, .article-cover video { display: block; width: 100%; height: auto; border-radius: var(--r-lg); background: var(--paper-2); }
.next video { grid-column: 2; grid-row: 1 / span 2; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-md); }
@media (max-width: 960px) { .next video { grid-column: auto; grid-row: auto; } }
.g-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-video { cursor: default; }
/* Share: icon row */
.share { display: flex; flex-wrap: wrap; gap: 8px; }
.share-ic { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; transition: background .3s var(--ease), color .3s var(--ease), border-color .3s, transform .4s var(--ease); }
.share-ic:hover { background: var(--ink); color: var(--on-ink); border-color: var(--ink); transform: translateY(-2px); }
.share-ic svg { width: 17px; height: 17px; }
.share-tip { position: absolute; bottom: calc(100% + 8px); left: 0; transform: translateY(4px); padding: 6px 10px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font: 500 12px/1 var(--sans); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s var(--ease); }
.share-copy.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.share-copy.done .share-tip { opacity: 1; transform: none; }
/* FAQ */
.faq { padding-top: clamp(96px, 10vw, 160px); padding-bottom: clamp(24px, 4vw, 48px); text-align: center; }
.faq-eyebrow { margin: 0 0 14px; font: 500 12.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.faq-h { font-size: clamp(34px, 4.4vw, 64px); letter-spacing: -.045em; margin: 0 auto clamp(32px, 4vw, 56px); max-width: 18ch; }
.faq-list { max-width: 1000px; margin: 0 auto; padding: 12px; border-radius: calc(var(--r-lg) + 12px); background: var(--card); display: flex; flex-direction: column; text-align: left; }
.faq-item { background: var(--paper); border-top: 1px solid var(--line); transition: margin .45s var(--ease), border-radius .45s var(--ease), box-shadow .45s var(--ease); }
.faq-item:first-child { border-top: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.faq-item:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.faq-item:only-child { border-radius: var(--r-lg); }
.faq-item[open] { border-radius: var(--r-lg); border-top-color: transparent; margin: 12px 0; box-shadow: 0 18px 40px -30px rgba(18, 20, 23, .25); }
.faq-item[open]:first-child { margin-top: 0; }
.faq-item[open]:last-child { margin-bottom: 0; }
.faq-item:has(+ .faq-item[open]) { border-bottom-left-radius: var(--r-lg); border-bottom-right-radius: var(--r-lg); }
.faq-item[open] + .faq-item { border-top-color: transparent; border-top-left-radius: var(--r-lg); border-top-right-radius: var(--r-lg); }
.faq-item summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: clamp(20px, 2.2vw, 28px) clamp(20px, 3vw, 36px); cursor: pointer; font-size: clamp(17px, 1.5vw, 21px); font-weight: 500; letter-spacing: -.02em; color: var(--ink); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary svg { flex: none; color: var(--muted); transition: transform .45s var(--ease), color .3s; }
.faq-item summary:hover svg { color: var(--ink); }
.faq-item[open] summary svg { transform: rotate(180deg); }
.faq-a { padding: 0 clamp(20px, 3vw, 36px) clamp(22px, 2.4vw, 30px); color: var(--muted); font-size: clamp(15px, 1.15vw, 17px); line-height: 1.7; }
.faq-a p { margin: 0 0 12px; } .faq-a p:last-child { margin-bottom: 0; }
.faq-a a { color: var(--ink); text-underline-offset: 3px; }
.faq-item[open] .faq-a { animation: faq-in .5s var(--ease); }
@keyframes faq-in { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 720px) { .faq-list { padding: 5px; border-radius: calc(var(--r-lg) + 4px); } .faq-item[open] { margin: 5px 0; } }
@media (prefers-reduced-motion: reduce) { .faq-item, .faq-item summary svg { transition: none; } .faq-item[open] .faq-a { animation: none; } }
/* Scrolled navbar floats below the top edge (translate, so the page doesn't jump) */
.header-inner { transition: width .7s var(--ease), height .6s var(--ease), padding .7s var(--ease), border-radius .7s var(--ease), background-color .5s, border-color .5s, box-shadow .6s var(--ease), backdrop-filter .5s, transform .7s var(--ease); }
.site-header.is-scrolled .header-inner { margin-top: 0; transform: translateY(14px); }
@media (max-width: 720px) { .site-header.is-scrolled .header-inner { margin-top: 0; transform: translateY(8px); } }
.mmenu { top: calc(100% + 16px); }
/* Desktop: same tight 5px edges inside blocks as on mobile */
.contact { padding: 5px; gap: 5px; }
.contact-intro { padding: clamp(28px, 4vw, 64px); }
.pf-card { padding: 5px; gap: 5px; }
.pf-text { padding: clamp(28px, 4vw, 64px); }
.faq-list { padding: 5px; }
.faq-item[open] { margin: 5px 0; }
@media (max-width: 960px) {
  .contact { padding: clamp(28px, 5vw, 48px) 5px 5px; gap: 28px; }
  .contact-intro { padding: 0 clamp(18px, 4vw, 40px); }
  .pf-card { padding: 5px 5px clamp(28px, 5vw, 48px); gap: 28px; }
  .pf-text { padding: 0 clamp(18px, 4vw, 40px); }
}
.service-icon { margin-bottom: 4px; } @media (max-width: 720px) { .service-icon { margin-bottom: 2px; } }
/* Mobile: icon on the left, title and text to its right */
@media (max-width: 720px) {
  .service-card { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; row-gap: 4px; align-items: start; }
  .service-icon { grid-row: 1 / span 2; margin: 0; }
  .service-icon svg { width: 30px; height: 30px; }
  .service-card h3 { align-self: center; min-height: 30px; display: flex; align-items: center; }
}
@media (max-width: 720px) { .cookie { bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 64px); } }
/* Marquee: 4 copies, scroll half the track so the loop is seamless on any width */
.marquee-track { animation-duration: 114s; }
@media (max-width: 720px) { .marquee-track { animation-duration: 84s; } }
.marquee-list { flex: none; }
/* Back-to-top: bigger, aligned with the bottom of the "Get in touch" button */
.footer-top { align-items: flex-end; }
.footer-right { align-self: flex-end; }
.to-top { width: 56px; height: 56px; }
.to-top svg { width: 22px; height: 22px; }
.to-top:hover { transform: none; }
/* Concentric corners: outer radius = inner radius + the 5px inset */
.contact, .pf-card, .faq-list { border-radius: calc(var(--r-lg) + 5px); }
.contact-card, .pf-media, .faq-item:first-child, .faq-item:last-child, .faq-item:only-child, .faq-item[open] { --in-r: var(--r-lg); }

/* Case study: text stays readable, images and video fill the whole canvas width */
.prose.case-body { max-width: none; }
.case-body > * { max-width: 68ch; }
.case-body > figure, .case-body > iframe, .case-body > video, .case-body > img,
.case-body > p:has(> img:only-child), .case-body > p:has(> a:only-child > img) { max-width: none; width: 100%; }
.case-body img, .case-body video { display: block; width: 100%; height: auto; }
@media (min-width: 1100px) { .case-body figure, .case-body iframe { width: 100%; } }

/* Project cover: soft 3D tilt toward the cursor */
.case-cover { perspective: 1400px; }
.tilt { position: relative; display: block; border-radius: var(--r-lg); transform-style: preserve-3d; transition: transform .6s cubic-bezier(.2,.8,.2,1); will-change: transform; }
.tilt.is-on { transition: transform .12s ease-out; }
.tilt > img, .tilt > video { display: block; }
.tilt::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .5s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.22), transparent 45%); mix-blend-mode: soft-light; }
.tilt.is-on::after { opacity: 1; }

/* Project card: 3 tags in one line, the button never wraps */
.pf-bottom { flex-wrap: nowrap; }
.pf-tags { flex-wrap: nowrap; min-width: 0; overflow: hidden; }
.pf-tags li { white-space: nowrap; flex-shrink: 0; }
.pf-bottom > :last-child { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 640px) { .pf-tags li:nth-child(n+3) { display: none; } .pf-bottom > :last-child { margin-left: auto; } }

/* Work filters: one row that scrolls sideways on mobile */
@media (max-width: 760px) {
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    margin-inline: -5px; padding: 2px 5px; scroll-snap-type: x proximity;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .filters::-webkit-scrollbar { display: none; }
  .filters .chip { flex-shrink: 0; white-space: nowrap; scroll-snap-align: start; }
}

/* Contact form: success state */
.cform-ok { display: grid; gap: clamp(24px, 3vw, 36px); padding: 4px 0 0; justify-items: stretch; }
.ok-hero { display: grid; justify-items: start; gap: 14px; }
.ok-mark { position: relative; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--on-ink);
  animation: ok-pop .7s cubic-bezier(.2,1.4,.4,1) both; }
.ok-ring { position: absolute; inset: -10px; border-radius: 50%; border: 1px solid var(--ink); opacity: 0; animation: ok-ring 1.6s var(--ease) .3s; }
.ok-mark svg { position: relative; }
.ok-mark path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: tick .55s var(--ease) .35s forwards; }
.cform-ok h3 { font-size: clamp(32px, 3.6vw, 48px); letter-spacing: -0.045em; line-height: 1; margin: 6px 0 0; }
.cform-ok .ok-hero p { margin: 0; color: var(--muted); font-size: 17px; max-width: 44ch; }
.ok-email { font-weight: 500; color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.ok-next { border-top: 1px solid var(--line); padding-top: 22px; display: grid; gap: 14px; }
.ok-label { font: 400 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.ok-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ok-steps li { display: grid; align-content: start; gap: 10px; padding: 16px; border-radius: 16px; background: color-mix(in srgb, var(--ink) 4%, transparent);
  animation: ok-in .6s var(--ease) both; animation-delay: calc(.35s + var(--n) * .08s); }
.ok-steps li:first-child { background: var(--ink); color: var(--on-ink); }
.ok-num { font: 500 12px/1 var(--mono); opacity: .5; }
.ok-step { font-size: 15px; line-height: 1.3; font-weight: 500; letter-spacing: -.01em; }
.ok-when { font: 400 12px/1.2 var(--mono); opacity: .6; margin-top: auto; }
.ok-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@keyframes ok-pop { from { transform: scale(.4); opacity: 0; } }
@keyframes ok-ring { 0% { transform: scale(.8); opacity: .5; } 100% { transform: scale(1.5); opacity: 0; } }
@media (max-width: 560px) {
  .ok-steps { grid-template-columns: 1fr; }
  .ok-steps li { grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 14px 16px; }
  .ok-actions .btn { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .ok-mark, .ok-ring, .ok-steps li { animation: none; } .ok-mark path { stroke-dashoffset: 0; animation: none; } }
/* after sending: hide the form title, the close button floats in the corner */
.contact-dialog:has([data-ok]:not([hidden])) #cd-title { visibility: hidden; height: 0; }
.contact-dialog:has([data-ok]:not([hidden])) .cd-head { margin-bottom: -40px; position: relative; z-index: 1; }
