/* Inter by Rasmus Andersson — SIL Open Font License 1.1 (rsms.me/inter). Latin subset, variable weight. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/inter-latin.woff2") format("woff2");
}

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius-sm: .7rem;
  --radius: 1rem;
  --radius-lg: 1.5rem;
  --ease: cubic-bezier(.2, .75, .2, 1);

  /* Light surfaces */
  --bg: #f6f7f9;
  --surface: #fff;
  --surface-2: #eef1f5;
  --ink: #0b1220;
  --ink-2: #1f2a3c;
  --muted: #556072;
  --line: #e2e6ec;
  --line-strong: #ccd3dd;
  --grid-line: rgba(11, 18, 32, .05);
  --shadow: 0 24px 50px -28px rgba(11, 18, 32, .35);

  /* Dark surfaces */
  --dark: #070a12;
  --dark-2: #0d1320;
  --dark-3: #151d2e;
  --on-dark: #eef2f8;
  --on-dark-muted: #a0abbe;

  /* Brand */
  --accent: #2f5fe3;
  --accent-hover: #234bc0;
  --accent-soft: #e8eefd;
  --accent-on-dark: #93b3ff;
  --highlight: #19c6c6;
  --glow-1: #3b6cff;
  --glow-2: #7c4dff;
  --glow-3: #19c6c6;
  --btn-dark-bg: #2f5fe3;
  --btn-dark-ink: #fff;
  --btn-dark-hover: #4a74f0;
  --focus: var(--accent);
}

.theme-service {
  --bg: #faf8f4;
  --surface-2: #f3efe7;
  --ink: #13202e;
  --ink-2: #22344a;
  --muted: #5a6573;
  --line: #e9e3d8;
  --line-strong: #d8cfc0;
  --grid-line: rgba(22, 50, 79, .05);
  --shadow: 0 24px 50px -28px rgba(22, 50, 79, .4);
  --dark: #102235;
  --dark-2: #16324f;
  --dark-3: #1d3d5e;
  --on-dark: #f5f1ea;
  --on-dark-muted: #b9c4cf;
  --accent: #16324f;
  --accent-hover: #0d2237;
  --accent-soft: #e5ecf2;
  --accent-on-dark: #f3b664;
  --highlight: #d9822b;
  --glow-1: #f3b664;
  --glow-2: #9cc3b4;
  --glow-3: #b7d2ea;
  --btn-dark-bg: #f3b664;
  --btn-dark-ink: #13202e;
  --btn-dark-hover: #f7c985;
}

/* Any dark region re-maps the neutral tokens so components adapt automatically. */
.on-dark {
  color: var(--on-dark);
  --ink: var(--on-dark);
  --ink-2: #d6dde9;
  --muted: var(--on-dark-muted);
  --line: rgba(255, 255, 255, .1);
  --line-strong: rgba(255, 255, 255, .22);
  --surface: var(--dark-2);
  --grid-line: rgba(255, 255, 255, .045);
  --focus: var(--accent-on-dark);
  --btn-bg: var(--btn-dark-bg);
  --btn-ink: var(--btn-dark-ink);
  --btn-hover: var(--btn-dark-hover);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 6rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font);
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.1; letter-spacing: -.03em; text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.skip-link { position: absolute; left: -999px; top: 1rem; z-index: 100; padding: .75rem 1rem; border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-weight: 600; }
.skip-link:focus { left: 1rem; }
.wrap { width: min(var(--container), 100% - 2 * var(--gutter)); margin-inline: auto; }
.narrow { width: min(44rem, 100% - 2 * var(--gutter)); margin-inline: auto; }
main { min-height: 60vh; background: var(--bg); }
/* The studio canvas is dark so the translucent header and overscroll areas blend into the hero and footer. */
body.theme-studio { background: var(--dark); }

/* ---------- Type primitives ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .65rem; margin: 0;
  color: var(--accent); font: 600 .75rem/1.3 var(--mono); letter-spacing: .09em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 1.5rem; height: 1px; background: currentColor; opacity: .7; }
.on-dark .eyebrow { color: var(--accent-on-dark); }
.eyebrow-pill { padding: .45rem .9rem .45rem .7rem; border: 1px solid var(--line-strong); border-radius: 999px; background: color-mix(in srgb, var(--surface) 55%, transparent); color: var(--ink-2); letter-spacing: .06em; backdrop-filter: blur(8px); }
.on-dark .eyebrow-pill { color: var(--ink-2); background: rgba(255, 255, 255, .04); }
.eyebrow-pill::before { display: none; }
.pulse { position: relative; width: .5rem; height: .5rem; border-radius: 50%; background: var(--highlight); box-shadow: 0 0 0 0 color-mix(in srgb, var(--highlight) 60%, transparent); }
.lede { max-width: 38rem; margin: 0; color: var(--muted); font-size: clamp(1.08rem, 1.5vw, 1.28rem); line-height: 1.6; }
.link-arrow { display: inline-flex; align-items: center; gap: .45rem; color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
.on-dark .link-arrow { color: var(--accent-on-dark); }
.link-arrow .icon, .button .icon { transition: transform .3s var(--ease); }
.link-arrow:hover .icon, .button:hover .icon { transform: translateX(3px); }
.link-arrow:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 2.25rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 3rem; padding: .8rem 1.35rem; border: 1px solid transparent; border-radius: 999px;
  background: var(--btn-bg, var(--accent)); color: var(--btn-ink, #fff);
  font: 600 .95rem/1.1 var(--font); letter-spacing: -.01em; text-decoration: none; cursor: pointer;
  transition: transform .3s var(--ease), background-color .3s, border-color .3s, box-shadow .3s, color .3s;
}
.button:hover { background: var(--btn-hover, var(--accent-hover)); transform: translateY(-1px); box-shadow: 0 12px 28px -12px color-mix(in srgb, var(--btn-bg, var(--accent)) 80%, transparent); }
.button:active { transform: translateY(0); }
.button[disabled] { opacity: .6; cursor: progress; transform: none; }
.button-ghost { --btn-bg: transparent; --btn-ink: var(--ink); --btn-hover: color-mix(in srgb, var(--ink) 7%, transparent); border-color: var(--line-strong); }
.button-ghost:hover { box-shadow: none; border-color: color-mix(in srgb, var(--ink) 40%, transparent); }
.button-light { --btn-bg: #fff; --btn-ink: #0b1220; --btn-hover: #e6ecf8; }
.button-sm { min-height: 2.5rem; padding: .55rem 1.05rem; font-size: .875rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
}
.site-header.on-dark { background: color-mix(in srgb, var(--dark) 92%, transparent); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 4.25rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-size: .95rem; font-weight: 650; letter-spacing: -.02em; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .6rem;
  background: linear-gradient(135deg, var(--glow-1), var(--glow-2)); color: #fff; font-size: .95rem; font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}
.theme-service .brand-mark { background: linear-gradient(135deg, var(--dark-2), var(--dark-3)); color: var(--accent-on-dark); }
.site-nav { display: flex; gap: .15rem; margin-left: auto; }
.site-nav a { padding: .5rem .85rem; border-radius: 999px; color: var(--muted); font-size: .92rem; font-weight: 500; text-decoration: none; transition: color .2s, background-color .2s; }
.site-nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.site-nav a[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.header-cta[aria-current="page"] { box-shadow: 0 0 0 3px color-mix(in srgb, var(--btn-bg, var(--accent)) 30%, transparent); }

@supports (animation-timeline: scroll()) {
  .site-header { animation: header-lift linear both; animation-timeline: scroll(root); animation-range: 0 160px; }
  @keyframes header-lift { to { box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .45); } }
}

/* ---------- Hero ---------- */
.hero, .page-hero, .cta-card, .featured-post { position: relative; isolation: isolate; overflow: hidden; }
.hero { padding-block: clamp(4rem, 10vw, 8.5rem) clamp(3rem, 6vw, 4.5rem); background: linear-gradient(180deg, var(--bg), var(--surface-2)); }
.hero.on-dark, .page-hero.on-dark, .section-dark, .marquee-band, .cta-card, .featured-post, .site-footer { background: var(--dark); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); align-items: center; gap: clamp(3rem, 6vw, 5rem); }
.hero h1 { margin: 1.5rem 0 1.5rem; font-size: clamp(2.75rem, 6.4vw, 5.6rem); font-weight: 750; line-height: .98; letter-spacing: -.048em; }
.hero.on-dark h1, .page-hero.on-dark h1 { background: linear-gradient(180deg, #fff 35%, #b4c3dd); -webkit-background-clip: text; background-clip: text; color: transparent; }

.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 70% 25%, #000 15%, transparent 72%);
  mask-image: radial-gradient(ellipse 75% 70% at 70% 25%, #000 15%, transparent 72%);
}
.orb { position: absolute; width: 44rem; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle closest-side, var(--orb), transparent); opacity: .5; }
.orb-a { --orb: var(--glow-1); top: -22rem; right: -10rem; }
.orb-b { --orb: var(--glow-2); bottom: -28rem; right: 18%; opacity: .38; }
.orb-c { --orb: var(--glow-3); top: 5%; left: -26rem; opacity: .22; }
.theme-service .orb { opacity: .45; }

/* Studio hero composition */
.hero-visual { position: relative; min-height: 27rem; }
.window {
  position: absolute; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: color-mix(in srgb, var(--dark-2) 88%, transparent);
  box-shadow: 0 50px 90px -40px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.window-back { top: 0; right: 0; left: 14%; }
.window-front { right: 16%; bottom: 0; left: 0; background: color-mix(in srgb, #05070d 90%, transparent); }
.window-bar { display: flex; align-items: center; gap: .4rem; height: 2.4rem; padding-inline: .9rem; border-bottom: 1px solid var(--line); color: var(--muted); font: 500 .72rem var(--mono); }
.window-bar i { width: .55rem; height: .55rem; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.window-bar span { margin-left: .55rem; }
.wire { display: grid; gap: .7rem; padding: 1.4rem 1.4rem 5.5rem; }
.wire span { display: block; height: .55rem; border-radius: 99px; background: rgba(255, 255, 255, .08); }
.wire .wire-nav { width: 38%; height: .4rem; margin-bottom: .75rem; }
.wire .wire-title { width: 78%; height: 1.5rem; border-radius: .4rem; background: linear-gradient(90deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, .06)); }
.wire .wire-line { width: 92%; }
.wire .short { width: 62%; }
.wire .wire-btn { width: 6.5rem; height: 1.75rem; margin-top: .4rem; background: linear-gradient(90deg, var(--glow-1), var(--glow-2)); }
.wire-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: .75rem; }
.wire-cards span { height: 3.75rem; border: 1px solid var(--line); border-radius: .6rem; background: rgba(255, 255, 255, .04); }
.terminal-body { display: grid; padding: 1.1rem 1.25rem 1.35rem; color: var(--muted); font: 500 .82rem/1.95 var(--mono); }
.terminal-body .t-cmd { color: var(--on-dark); }
.terminal-body b { font-weight: 600; }
.t-prompt { color: var(--accent-on-dark); }
.t-ok { color: #4ade80; }
.caret { display: inline-block; width: .5em; height: 1.05em; margin-left: .35em; background: var(--accent-on-dark); vertical-align: -.18em; }
.chip {
  display: inline-flex; align-items: center; gap: .55rem; padding: .6rem 1rem; border: 1px solid var(--line-strong); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 75%, transparent); color: var(--ink); font-size: .85rem; font-weight: 600;
  box-shadow: var(--shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.chip-float { position: absolute; top: 44%; right: -.5rem; }
.chip-dot { width: .5rem; height: .5rem; border-radius: 50%; background: #4ade80; box-shadow: 0 0 12px #4ade80; }

/* Service hero composition */
.service-panel { position: relative; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 40px 80px -40px rgba(22, 50, 79, .45); }
.sp-head { display: flex; align-items: center; gap: .85rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.sp-head b { display: block; font-weight: 650; }
.sp-head small { color: var(--muted); font-size: .82rem; }
.sp-badge, .sp-check { display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-on-dark); }
.sp-badge { width: 2.5rem; height: 2.5rem; }
.sp-status { margin-left: auto; padding: .3rem .7rem; border-radius: 999px; background: color-mix(in srgb, var(--highlight) 16%, transparent); color: #8a4a0c; font-size: .75rem; font-weight: 650; }
.sp-steps { display: grid; gap: .6rem; margin: 1.25rem 0; padding: 0; list-style: none; }
.sp-steps li { display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; border-radius: var(--radius-sm); background: var(--surface-2); font-weight: 550; }
.sp-check { width: 1.6rem; height: 1.6rem; font-size: .8rem; }
.sp-foot { display: flex; flex-wrap: wrap; gap: .45rem; }
.sp-foot span { padding: .35rem .75rem; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font-size: .78rem; font-weight: 600; }
.theme-service .chip-float { top: auto; right: auto; bottom: -1.25rem; left: -1.25rem; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 1.5rem 2rem; margin: clamp(3.5rem, 7vw, 5.5rem) 0 0; }
.stats div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: .45rem; padding-top: 1.25rem; border-top: 1px solid var(--line-strong); }
.stats dd { margin: 0; font-size: clamp(2rem, 3.6vw, 2.75rem); font-weight: 700; line-height: 1; letter-spacing: -.045em; }
.on-dark .stats dd { background: linear-gradient(120deg, #fff 30%, var(--accent-on-dark)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats dt { max-width: 16rem; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.page-hero .stats { margin-top: clamp(2.5rem, 5vw, 4rem); }

/* ---------- Marquee ---------- */
.marquee-band { border-top: 1px solid var(--line); }
.marquee {
  display: flex; overflow: hidden; padding-block: 1.6rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; flex-shrink: 0; align-items: center; gap: 2.75rem; min-width: 100%; margin: 0; padding: 0 1.375rem; list-style: none; }
.marquee-track li { display: flex; align-items: center; gap: 2.75rem; color: var(--muted); font-size: clamp(1.05rem, 1.8vw, 1.35rem); font-weight: 550; letter-spacing: -.02em; white-space: nowrap; }
.marquee-track li::after { content: ""; width: .35rem; height: .35rem; border-radius: 50%; background: var(--accent-on-dark); opacity: .6; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(4.5rem, 10vw, 8rem); }
.section-tint { background: var(--surface-2); }
.section-head { margin-bottom: clamp(2.5rem, 5vw, 3.75rem); }
.section-head > div { max-width: 46rem; }
.section-head-split { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem 3rem; }
.section-head h2 { margin-top: 1rem; font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.04; letter-spacing: -.042em; }
.section-head p:not(.eyebrow) { max-width: 38rem; margin: 1.1rem 0 0; color: var(--muted); font-size: 1.125rem; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding-block: clamp(4rem, 10vw, 7.5rem) clamp(3rem, 7vw, 5rem); border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--bg), var(--surface-2)); }
.page-hero h1 { max-width: 18ch; margin: 1.2rem 0 1.25rem; font-size: clamp(2.5rem, 6vw, 4.75rem); font-weight: 750; line-height: 1; letter-spacing: -.046em; }
.page-hero .lede:last-child { margin-bottom: 0; }

/* ---------- Service cards ---------- */
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1rem; }
.service-card, .process-step, .post-card, .contact-card, .skill-group, .profile-card, .form-panel, .comment-panel {
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
}
.service-card, .post-card, .project-card, .contact-card, .skill-group { transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .45s; }
.service-card { position: relative; display: flex; flex-direction: column; gap: .75rem; padding: 2rem; overflow: hidden; }
.service-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(26rem circle at 100% 0%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 60%); opacity: 0; transition: opacity .45s; pointer-events: none; }
.service-card h3 { margin-top: 2.5rem; font-size: 1.35rem; }
.service-card .service-num + h3 { margin-top: 3.25rem; }
.service-card p { margin: 0; color: var(--muted); }
.service-icon { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: .9rem; background: var(--accent-soft); color: var(--accent); font-size: 1.25rem; transition: background-color .3s, color .3s; }
.service-num { color: var(--muted); font: 500 .78rem var(--mono); letter-spacing: .06em; }
.service-card .service-num { position: absolute; top: 2rem; right: 2rem; }

@media (hover: hover) {
  .service-card:hover, .post-card:hover, .contact-card:hover, .skill-group:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); box-shadow: var(--shadow); }
  .service-card:hover::before { opacity: 1; }
  .service-card:hover .service-icon, .service-row:hover .service-icon { background: var(--accent); color: #fff; }
  .theme-service .service-card:hover .service-icon, .theme-service .service-row:hover .service-icon { color: var(--accent-on-dark); }
}

/* Services page list */
.service-list { border-top: 1px solid var(--line); }
.service-row { display: grid; grid-template-columns: 4rem minmax(0, 1fr) minmax(0, 1.1fr); gap: 1.5rem 2rem; align-items: center; padding: 2.25rem 0; border-bottom: 1px solid var(--line); }
.service-row-title { display: flex; align-items: center; gap: 1.1rem; }
.service-row h2 { font-size: clamp(1.45rem, 2.5vw, 2rem); letter-spacing: -.035em; }
.service-row p { margin: 0; color: var(--muted); font-size: 1.075rem; }

/* ---------- Projects ---------- */
.section-dark { --surface: var(--dark-2); }
.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.project-grid-3 { grid-template-columns: repeat(3, 1fr); }
.project-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.project-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; padding: 1.5rem 1.5rem 0; border-bottom: 1px solid var(--line); background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--glow-1) 32%, var(--dark-3)), var(--dark-2)); }
.project-image { width: 100%; height: 100%; border-radius: .6rem .6rem 0 0; background: var(--surface-2); object-fit: cover; object-position: top; box-shadow: 0 -8px 40px -12px rgba(0, 0, 0, .55); transition: transform .8s var(--ease); }
.project-body { display: flex; flex: 1; flex-direction: column; gap: .65rem; padding: 1.5rem 1.75rem 1.75rem; }
.project-type { margin: 0; color: var(--accent); font: 600 .72rem var(--mono); letter-spacing: .09em; text-transform: uppercase; }
.on-dark .project-type { color: var(--accent-on-dark); }
.project-card h2, .project-card h3 { font-size: 1.4rem; letter-spacing: -.03em; }
.project-body > p:not(.project-type) { margin: 0; color: var(--muted); }
.project-card-feature { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.project-card-feature .project-media { aspect-ratio: auto; min-height: 24rem; padding: 2.5rem 2.5rem 0; border-right: 1px solid var(--line); border-bottom: 0; }
.project-card-feature .project-body { justify-content: center; padding: clamp(1.75rem, 4vw, 3rem); }
.project-card-feature .project-image { object-position: left top; }
.project-card-feature h2, .project-card-feature h3 { font-size: clamp(1.75rem, 3vw, 2.4rem); }
/* Desktop work grid: three cards per row on a six-column track, so an incomplete final row still fills the width.
   The featured card is child 1, so rows start at children 2, 5, 8, … (3n + 2). */
@media (min-width: 1025px) {
  .project-grid-3 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .project-grid-3 > .project-card { grid-column: span 2; }
  .project-grid-3 > .project-card-feature { grid-column: 1 / -1; }
  /* Two cards left over: each takes half the row. */
  .project-grid-3 > .project-card:nth-child(3n + 2):nth-last-child(2),
  .project-grid-3 > .project-card:nth-child(3n + 2):nth-last-child(2) + .project-card { grid-column: span 3; }
  /* One card left over: it spans the row using the featured layout. */
  .project-grid-3 > .project-card:last-child:nth-child(3n + 2) { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .project-grid-3 > .project-card:last-child:nth-child(3n + 2) .project-media { aspect-ratio: auto; min-height: 20rem; padding: 2.5rem 2.5rem 0; border-right: 1px solid var(--line); border-bottom: 0; }
  .project-grid-3 > .project-card:last-child:nth-child(3n + 2) .project-body { justify-content: center; padding: clamp(1.75rem, 4vw, 3rem); }
}
@media (hover: hover) {
  .project-card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: 0 40px 70px -40px rgba(0, 0, 0, .55); }
  .project-card:hover .project-image { transform: translateY(-6px) scale(1.025); }
}
.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; margin: auto 0 0; padding: .85rem 0 0; list-style: none; }
.tag-list li { padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .78rem; font-weight: 500; }
.project-link { align-self: flex-start; margin-top: .35rem; }

/* ---------- Process ---------- */
.process { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.process-step { position: relative; padding: 1.75rem; overflow: hidden; }
.process-step::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--highlight)); transform: scaleX(.2); transform-origin: left; transition: transform .8s var(--ease); }
.process-step:hover::before { transform: scaleX(1); }
.process-num { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--accent); font: 600 .8rem var(--mono); }
.process-step h3 { margin: 1.5rem 0 .5rem; font-size: 1.25rem; }
.process-step p { margin: 0; color: var(--muted); }

/* ---------- Posts ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1rem; }
.post-card { position: relative; display: flex; flex-direction: column; gap: .8rem; padding: 1.75rem; }
.post-card h3 { font-size: 1.28rem; line-height: 1.25; letter-spacing: -.025em; }
.post-card h3 a, .post-row h2 a, .featured-post h2 a { text-decoration: none; }
.post-card h3 a::after, .post-row h2 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.post-card h3 a:focus-visible, .post-row h2 a:focus-visible { outline: none; }
.post-card:has(a:focus-visible), .post-row:has(a:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.post-card > p:not(.post-meta) { margin: 0 0 .5rem; color: var(--muted); }
.post-card .link-arrow { margin-top: auto; }
.post-meta, .post-row time { margin: 0; color: var(--muted); font: 500 .74rem var(--mono); letter-spacing: .07em; text-transform: uppercase; }

.featured-post { padding: clamp(2rem, 6vw, 4.5rem); border-radius: var(--radius-lg); }
.featured-post h2 { max-width: 20ch; margin: 1.1rem 0 1.25rem; font-size: clamp(2rem, 5vw, 3.75rem); line-height: 1.02; letter-spacing: -.045em; }
.featured-post > p:not(.eyebrow) { max-width: 40rem; margin: 0 0 2rem; color: var(--muted); font-size: 1.125rem; }
.post-list { margin-top: clamp(2.5rem, 5vw, 4rem); border-top: 1px solid var(--line); }
.post-row { position: relative; display: grid; grid-template-columns: 11rem minmax(0, 1fr) auto; align-items: start; gap: 2rem; padding: 2rem 0; border-bottom: 1px solid var(--line); border-radius: 2px; }
.post-row time { padding-top: .45rem; }
.post-row h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); letter-spacing: -.03em; transition: color .3s; }
.post-row p { max-width: 44rem; margin: .55rem 0 0; color: var(--muted); }
.post-row-arrow { display: grid; place-items: center; width: 3rem; height: 3rem; border: 1px solid var(--line-strong); border-radius: 50%; transition: background-color .35s, color .35s, border-color .35s, transform .45s var(--ease); }
@media (hover: hover) {
  .post-row:hover h2 { color: var(--accent); }
  .post-row:hover .post-row-arrow { border-color: var(--accent); background: var(--accent); color: #fff; transform: rotate(-45deg); }
}

/* ---------- Article ---------- */
.article-hero h1 { max-width: none; font-size: clamp(2.2rem, 5vw, 3.75rem); }
.back-link { display: flex; width: fit-content; align-items: center; gap: .5rem; margin-bottom: 2.25rem; color: var(--muted); font-size: .9rem; font-weight: 500; text-decoration: none; }
.back-link .icon { transform: rotate(180deg); transition: transform .3s var(--ease); }
.back-link:hover { color: var(--ink); }
.back-link:hover .icon { transform: rotate(180deg) translateX(3px); }
.byline { display: flex; align-items: center; gap: .9rem; margin-top: 2.25rem; }
.byline b { display: block; font-weight: 600; }
.byline span { color: var(--muted); font-size: .9rem; }
.avatar, .profile-mark { display: grid; place-items: center; flex-shrink: 0; background: linear-gradient(135deg, var(--glow-1), var(--glow-2)); color: #fff; font-weight: 700; letter-spacing: -.02em; }
.avatar { width: 2.75rem; height: 2.75rem; border-radius: 50%; font-size: .9rem; }
.prose { color: var(--ink-2); font-size: 1.125rem; line-height: 1.8; }
.prose p { margin: 0 0 1.5em; }
.prose p:last-child { margin-bottom: 0; }
.article-body { padding-block: clamp(3rem, 7vw, 5rem); }
.article-body > p:first-child::first-letter { float: left; margin: .1em .14em 0 0; color: var(--accent); font-size: 3.7em; font-weight: 700; line-height: .82; }
.read-progress { display: none; }
@supports (animation-timeline: scroll()) {
  .read-progress { position: fixed; top: 0; right: 0; left: 0; z-index: 60; display: block; height: 3px; background: linear-gradient(90deg, var(--glow-1), var(--glow-3)); transform: scaleX(0); transform-origin: 0 50%; animation: read-progress linear both; animation-timeline: scroll(root); }
  @keyframes read-progress { to { transform: scaleX(1); } }
}
.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding-bottom: clamp(4rem, 8vw, 6rem); }
.post-nav a { display: flex; flex-direction: column; gap: .4rem; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; transition: border-color .3s, box-shadow .3s; }
.post-nav a:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: var(--shadow); }
.post-nav span { color: var(--muted); font: 500 .72rem var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.post-nav b { font-weight: 600; line-height: 1.35; letter-spacing: -.02em; }
.post-nav .post-nav-next { grid-column: 2; text-align: right; }

/* ---------- Forms ---------- */
.comment-panel { margin-bottom: clamp(3rem, 6vw, 4rem); padding: clamp(1.5rem, 4vw, 2.5rem); }
.comment-panel h2 { font-size: 1.5rem; }
.comment-panel > p { margin: .6rem 0 0; color: var(--muted); }
.comment-form, .contact-form { display: grid; gap: 1.1rem; margin-top: 1.75rem; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.comment-form label, .contact-form label { display: grid; gap: .45rem; color: var(--ink); font-size: .92rem; font-weight: 600; }
.comment-form input, .comment-form textarea, .contact-form input, .contact-form textarea {
  width: 100%; min-height: 3rem; padding: .75rem .9rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--ink); font: 400 1rem/1.5 var(--font);
  outline: 2px solid transparent; transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.comment-form textarea, .contact-form textarea { min-height: 9rem; resize: vertical; }
.comment-form input:hover, .comment-form textarea:hover, .contact-form input:hover, .contact-form textarea:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong)); }
.comment-form input:focus, .comment-form textarea:focus, .contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.contact-form input[type="file"] { padding: .55rem; cursor: pointer; }
.contact-form input[type="file"]::file-selector-button { margin-right: .9rem; padding: .5rem .95rem; border: 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: 600 .85rem var(--font); cursor: pointer; }
.comment-form .button, .contact-form .button { justify-self: start; }
.field-optional, .field-help { color: var(--muted); font-size: .8rem; font-weight: 500; }
.form-status { min-height: 1.6em; margin: 0; color: var(--muted); }
.honeypot { position: absolute; left: -9999px; }

/* ---------- Contact ---------- */
.contact-layout { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; gap: clamp(1.5rem, 4vw, 3rem); }
.contact-layout-simple { grid-template-columns: 1fr; }
.contact-cards { display: grid; gap: 1rem; }
.contact-layout-simple .contact-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.contact-card { display: flex; align-items: flex-start; gap: 1.1rem; padding: 1.5rem; }
.contact-card h2 { margin: .15rem 0 .45rem; color: var(--muted); font: 600 .72rem var(--mono); letter-spacing: .09em; text-transform: uppercase; }
.contact-card a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.contact-card a:hover { color: var(--accent); text-decoration: underline; }
.contact-card p { margin: 0; }
.hours { display: grid; grid-template-columns: auto auto; justify-content: start; gap: .3rem 1.25rem; margin: 0; }
.hours dt { font-weight: 600; }
.hours dd { margin: 0; color: var(--muted); }
.form-panel { padding: clamp(1.5rem, 4vw, 2.75rem); box-shadow: var(--shadow); }
.form-panel h2 { margin: 1rem 0 .65rem; font-size: clamp(1.75rem, 3vw, 2.3rem); letter-spacing: -.038em; }
.form-panel > p:not(.eyebrow) { margin: 0; color: var(--muted); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); align-items: start; gap: clamp(2rem, 6vw, 5.5rem); }
.profile-card { position: sticky; top: 6rem; padding: 2rem; }
.profile-mark { width: 4.5rem; height: 4.5rem; border-radius: 1.25rem; font-size: 1.4rem; box-shadow: 0 20px 40px -20px var(--glow-2); }
.profile-card h2 { margin: 1.4rem 0 .25rem; font-size: 1.35rem; }
.profile-role { margin: 0; color: var(--muted); }
.profile-facts { display: grid; gap: .75rem; margin: 1.5rem 0 0; padding: 1.5rem 0 0; border-top: 1px solid var(--line); list-style: none; }
.profile-facts li { display: flex; gap: .65rem; color: var(--ink-2); font-size: .92rem; line-height: 1.45; }
.profile-facts .icon { margin-top: .1rem; color: var(--accent); }
.profile-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.75rem; }
.about-body p:first-child { color: var(--ink); font-size: clamp(1.2rem, 2vw, 1.4rem); font-weight: 500; line-height: 1.55; letter-spacing: -.02em; }
.timeline { margin: 0; padding: 0; border-top: 1px solid var(--line-strong); list-style: none; }
.timeline li { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 2rem; padding: 2.25rem 0; border-bottom: 1px solid var(--line-strong); }
.timeline-period { padding-top: .35rem; color: var(--accent); font: 600 .82rem var(--mono); letter-spacing: .04em; }
.timeline h3 { font-size: clamp(1.25rem, 2.2vw, 1.55rem); }
.timeline-org { margin: .3rem 0 .8rem; color: var(--ink-2); font-weight: 500; }
.timeline li p:last-child { max-width: 46rem; margin: 0; color: var(--muted); }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem; }
.skill-group { padding: 1.75rem; }
.skill-group h3 { font-size: 1.1rem; }
.skill-group .tag-list { margin-top: .5rem; }

/* ---------- Call to action ---------- */
.cta-band { padding-block: clamp(2rem, 5vw, 4rem) clamp(4rem, 8vw, 6rem); }
.section + .cta-band, .section-tint + .cta-band { padding-top: 0; }
.section-tint + .cta-band { padding-top: clamp(4rem, 8vw, 6rem); }
.cta-card { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 2rem 3rem; padding: clamp(2.25rem, 6vw, 4.5rem); border-radius: var(--radius-lg); }
.cta-card h2 { max-width: 14ch; margin: 1.1rem 0 1rem; font-size: clamp(2.25rem, 5.4vw, 4.25rem); line-height: .98; letter-spacing: -.05em; }
.cta-card > div > p:not(.eyebrow) { max-width: 34rem; margin: 0; color: var(--muted); font-size: 1.1rem; }
.cta-card .actions { margin-top: 0; }

/* ---------- Footer ---------- */
.site-footer { position: relative; overflow: hidden; padding-top: clamp(4rem, 8vw, 6rem); }
.footer-top { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 2.5rem; padding-bottom: clamp(3rem, 6vw, 4.5rem); }
.footer-brand p { max-width: 22rem; margin: 1.1rem 0 0; color: var(--muted); }
.footer-label { margin: 0 0 1.1rem; color: var(--ink); font: 600 .72rem var(--mono); letter-spacing: .09em; text-transform: uppercase; }
.footer-links { display: grid; gap: .65rem; margin: 0; padding: 0; color: var(--muted); font-size: .93rem; list-style: none; }
.footer-links a { text-decoration: none; overflow-wrap: anywhere; transition: color .2s; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-block: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.footer-bottom a { text-decoration: none; }
.footer-bottom a:hover { color: var(--ink); text-decoration: underline; }
.footer-wordmark {
  margin: 0; overflow: hidden; font-size: min(17vw, 15rem); font-weight: 800; line-height: .78; letter-spacing: -.065em; text-align: center; white-space: nowrap;
  background: linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, 0) 80%); -webkit-background-clip: text; background-clip: text; color: transparent;
  user-select: none; transform: translateY(8%);
}

/* ---------- Motion (progressive enhancement, CSS only) ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .orb { animation: drift 24s ease-in-out infinite alternate; will-change: transform; }
  .orb-b { animation-duration: 30s; animation-delay: -8s; }
  .orb-c { animation-duration: 36s; animation-delay: -14s; }
  .pulse { animation: pulse 2.4s ease-out infinite; }
  .window-back { animation: float 10s ease-in-out infinite; }
  .window-front, .service-panel { animation: float 10s ease-in-out -5s infinite; }
  .chip-float { animation: float 7s ease-in-out -2s infinite; }
  .caret { animation: blink 1.1s steps(1) infinite; }
  .terminal-body span { animation: type-in .5s var(--ease) both; animation-delay: calc(var(--i) * .32s + .6s); }
  .sp-steps li { animation: type-in .6s var(--ease) both; animation-delay: calc(var(--i) * .2s + .5s); }
  .hero-copy > *, .page-hero .wrap > *, .page-hero .narrow > * { animation: rise .9s var(--ease) both; }
  .hero-copy > :nth-child(2), .page-hero .wrap > :nth-child(2), .page-hero .narrow > :nth-child(2) { animation-delay: .08s; }
  .hero-copy > :nth-child(3), .page-hero .wrap > :nth-child(3), .page-hero .narrow > :nth-child(3) { animation-delay: .16s; }
  .hero-copy > :nth-child(4), .page-hero .wrap > :nth-child(4), .page-hero .narrow > :nth-child(4) { animation-delay: .24s; }
  .page-hero .narrow > :nth-child(5) { animation-delay: .32s; }
  .hero-visual { animation: rise 1.1s var(--ease) .2s both; }
  .marquee-track { animation: marquee 50s linear infinite; }
  .marquee:hover .marquee-track { animation-play-state: paused; }

  @supports (animation-timeline: view()) {
    .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
    .process-step::before { animation: grow-line linear both; animation-timeline: view(); animation-range: entry 40% cover 45%; }
  }

  @keyframes drift { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(-5rem, 3rem, 0) scale(1.12); } 100% { transform: translate3d(3rem, -2rem, 0) scale(.94); } }
  @keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
  @keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--highlight) 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 .6rem transparent; } }
  @keyframes blink { 50% { opacity: 0; } }
  @keyframes type-in { from { opacity: 0; transform: translateX(-.5rem); } }
  @keyframes rise { from { opacity: 0; transform: translateY(1.25rem); } }
  @keyframes reveal { from { opacity: 0; transform: translateY(2.25rem); } }
  @keyframes grow-line { from { transform: scaleX(.2); } to { transform: scaleX(1); } }
  @keyframes marquee { to { transform: translateX(-100%); } }
}
@media (prefers-reduced-motion: reduce) {
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee-track { flex-wrap: wrap; justify-content: center; row-gap: 1rem; }
  .marquee-track[aria-hidden="true"] { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { width: min(100%, 36rem); min-height: 24rem; }
  .project-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .project-grid-3 > .project-card:last-child:nth-child(even) { grid-column: 1 / -1; }
  .project-card-feature { grid-template-columns: 1fr; }
  .project-card-feature .project-media { min-height: 0; aspect-ratio: 16 / 10; padding: 1.75rem 1.75rem 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .contact-layout, .about-grid { grid-template-columns: 1fr; }
  .profile-card { position: static; }
  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
  .service-row { grid-template-columns: 3rem minmax(0, 1fr); }
  .service-row p { grid-column: 2; }
}
@media (max-width: 820px) {
  .header-inner { flex-wrap: wrap; column-gap: 1rem; min-height: 3.75rem; padding-top: .65rem; }
  .header-cta { margin-left: auto; }
  .site-nav {
    order: 3; width: calc(100% + 2 * var(--gutter)); margin: .35rem calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter) .6rem;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { flex-shrink: 0; }
  .site-nav a:first-child { margin-left: -.85rem; }
}
@media (max-width: 640px) {
  .brand { min-width: 0; font-size: .85rem; }
  .header-inner { column-gap: .75rem; }
  .service-card .service-num + h3 { margin-top: 2rem; }
  .brand-name { max-width: 8.25rem; line-height: 1.2; }
  .header-cta { min-height: 2.25rem; padding: .45rem .85rem; font-size: .8rem; }
  .hero-visual { min-height: 21rem; }
  .window-back { left: 8%; }
  .window-front { right: 6%; }
  .chip-float { right: 0; }
  .project-grid, .project-grid-3 { grid-template-columns: 1fr; }
  .post-row { grid-template-columns: 1fr; gap: .5rem; }
  .post-row-arrow { display: none; }
  .timeline li { grid-template-columns: 1fr; gap: .5rem; }
  .field-row, .post-nav, .contact-layout-simple .contact-cards { grid-template-columns: 1fr; }
  .post-nav .post-nav-next { grid-column: auto; text-align: left; }
  .footer-top { grid-template-columns: 1fr; }
  .cta-card .actions { width: 100%; }
  .cta-card .button { flex: 1 1 100%; }
  .actions .button { flex: 1 1 auto; }
}

@media print {
  .site-header, .hero-bg, .hero-visual, .marquee-band, .cta-band, .footer-wordmark, .read-progress, .comment-panel { display: none; }
  .on-dark, .site-footer { background: none; color: #000; --ink: #000; --muted: #333; }
  .hero.on-dark h1, .page-hero.on-dark h1 { background: none; color: #000; }
}
