/* ========================================================================
   components.css - header, hero, sections, footer
   ======================================================================== */

/* ================= Buttons ================= */
.btn {
  --b-bg: transparent;
  --b-fg: var(--text);
  --b-bd: var(--border-strong);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  line-height: 1;
  padding: 1rem 1.7rem;
  border-radius: var(--radius-pill);
  background: var(--b-bg);
  color: var(--b-fg);
  border: 1px solid var(--b-bd);
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 0.6rem 1.15rem; font-size: 0.86rem; }
.btn-block { width: 100%; justify-content: center; }
.btn .arrow { transition: transform var(--dur) var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.btn-primary {
  --b-bg: var(--text);
  --b-fg: var(--bg);
  --b-bd: var(--text);
}
.btn-primary:hover {
  --b-bg: var(--accent);
  --b-bd: var(--accent);
  --b-fg: #fff;
}
.btn-ghost:hover {
  --b-bd: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

/* Animated-underline text link */
.link-underline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  position: relative;
  padding-bottom: 4px;
}
.link-underline::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur) var(--ease);
}
.link-underline:hover { color: var(--accent-bright); }
.link-underline:hover::after { transform: scaleX(1); transform-origin: left; }
.link-underline .arrow { transition: transform var(--dur) var(--ease); }
.link-underline:hover .arrow { transform: translateX(4px); }

/* ================= Header ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom-color: var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: var(--header-h);
  transition: min-height var(--dur) var(--ease);
}
.is-scrolled .header-inner { min-height: var(--header-h-scrolled); }

/* Slim header used by case-study + blog detail pages */
.cs-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: var(--header-h);
  transition: min-height var(--dur) var(--ease);
}
.is-scrolled .cs-header-inner { min-height: var(--header-h-scrolled); }
.cs-back {
  border-bottom: 0;
  padding-bottom: 0;
}
.cs-back::after { display: none; }
.cs-back .arrow { transition: transform var(--dur) var(--ease); }
.cs-back:hover .arrow { transform: translateX(-4px); }

.brand {
  display: inline-flex;
  align-items: center;
}
.brand-logo {
  display: block;
  height: 100px;
  width: auto;
  transition: height var(--dur) var(--ease);
}
.is-scrolled .brand-logo { height: 66px; }

.primary-nav ul { display: flex; gap: clamp(1rem, 2.4vw, 2.25rem); list-style: none; padding: 0; }
.primary-nav a {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.06em;
  color: var(--text-muted);
  position: relative;
  padding-block: 0.5rem;
  transition: color var(--dur) var(--ease);
}
.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0.15rem;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.primary-nav a:hover { color: var(--text); }
.primary-nav a.is-active { color: var(--text); }
.primary-nav a.is-active::after { opacity: 1; transform: none; }

.header-actions {
  display: flex;
  align-items: center;
}
.header-cta { flex: none; }

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--positive);
  position: relative;
  flex: none;
}
.status-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--positive);
  animation: ping 2.6s var(--ease) infinite;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle-bar { width: 18px; height: 1.5px; background: var(--text); transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav {
  border-top: 1px solid var(--border);
  background: var(--bg);
  overflow: hidden;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav nav { padding: var(--sp-3) var(--gutter) var(--sp-5); }
.mobile-nav ul { list-style: none; padding: 0; counter-reset: mnav; }
.mobile-nav li { counter-increment: mnav; border-bottom: 1px solid var(--border); }
.mobile-nav li a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: var(--sp-3) 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.mobile-nav li a::before {
  content: counter(mnav, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
}
.mobile-nav .btn { margin-top: var(--sp-4); }

/* ================= Hero ================= */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h)); /* fallback for browsers without svh */
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  padding-block: clamp(3rem, 8vh, 6.5rem);
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
  background: radial-gradient(
    420px circle at var(--gx, 20%) var(--gy, 30%),
    var(--accent-soft),
    transparent 70%);
}
.hero:hover .hero-glow { opacity: 1; }

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  /* left: copy (~52%) · right: 3D scene (~48%) */
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5.5rem);
}
.hero-copy-col { min-width: 0; max-width: 40rem; }
.hero-eyebrow { margin-bottom: var(--sp-4); }
.hero h1 {
  font-size: var(--fs-hero);
  letter-spacing: -0.04em;
  line-height: 1.05;
  max-width: 18ch;
}
.hero h1 .accent { color: var(--accent-bright); }
.hero-copy {
  margin-top: var(--sp-3);
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 52ch;
}
.hero-copy strong { color: var(--text); font-weight: 500; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-4);
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}
.hero-availability {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--text);
}
.hero-signature {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

/* ================= About ================= */
.about .section-index { margin-bottom: clamp(2.5rem, 5vw, 4rem); }

.about-headline {
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--border);
}
.about-headline h2 {
  font-size: clamp(2.3rem, 1.4rem + 3.4vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  max-width: 22ch;
}
.about-headline h2 .accent { color: var(--accent-bright); }
.about-kicker {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.05rem, 0.95rem + 0.6vw, 1.3rem);
  line-height: 1.45;
  color: var(--text-muted);
  max-width: 42ch;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 4.2fr) minmax(0, 7.8fr);
  gap: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 6vw, 5rem);
  align-items: start;
  margin-top: clamp(3rem, 6vw, 4.5rem);
}

/* Editorial framed portrait */
.about-figure { margin: 0; }
.about-figure-mat {
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.about-figure-mat img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 10%;
  border-radius: 2px;
  filter: grayscale(1) contrast(1.04);
  transition: filter 0.8s var(--ease), transform 0.8s var(--ease-out);
}
.about-figure:hover .about-figure-mat img { filter: none; transform: scale(1.02); }

.about-plate {
  margin-top: var(--sp-3);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border);
  display: grid;
  gap: 0.35rem;
}
.ap-fig {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.ap-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.ap-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

/* Prose */
.about-prose {
  max-width: 46ch;
  font-size: 1.125rem;
  line-height: 1.75;
}
.about-prose p { color: var(--text-muted); }
.about-prose p + p { margin-top: var(--sp-3); }
.about-prose p:first-child {
  color: var(--text);
  font-size: 1.2rem;
}
.about-prose-link { display: flex; width: fit-content; margin-top: var(--sp-4); }
/* Optional About extras (Home > About). Absent from the markup unless filled. */
.about-availability {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--text-muted);
}
.about-cv { display: flex; width: fit-content; margin-top: var(--sp-2); }

/* ================= Stats ================= */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(3.5rem, 7vw, 5rem);
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border);
}
.stat {
  padding: var(--sp-4) var(--sp-4);
  border-right: 1px solid var(--border);
}
.stat:first-child { padding-left: 0; }
.stat:last-child { border-right: 0; padding-right: 0; }
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 1.5rem + 2.8vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
}
.stat-num::after {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  background: var(--accent);
  margin-top: var(--sp-2);
}
.stat-label {
  display: block;
  margin-top: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  max-width: 22ch;
}

/* ================= Expertise ================= */
.exp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.75rem, 1.4vw, 1.25rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.exp-card {
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 2.4vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}
.exp-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  height: 2px; width: 0;
  background: var(--accent);
  transition: width 0.45s var(--ease);
}
.exp-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  transform: translateY(-4px);
}
.exp-card:hover::before { width: 100%; }

.exp-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
}
.exp-card-n {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.12em;
  color: var(--text-dim);
  transition: color var(--dur) var(--ease);
}
.exp-card:hover .exp-card-n { color: var(--accent-bright); }
.exp-card-arrow {
  font-family: var(--font-mono);
  color: var(--text-dim);
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease),
    color var(--dur) var(--ease);
}
.exp-card:hover .exp-card-arrow { opacity: 1; transform: none; color: var(--accent-bright); }

.exp-card h3 {
  font-size: clamp(1.1rem, 1rem + 0.55vw, 1.32rem);
  margin-bottom: 0.55rem;
}
.exp-card > p {
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--text-muted);
}
.exp-card-kw {
  margin-top: auto;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  line-height: 1.6;
  color: var(--text-dim);
}
/* Optional per-service extras (Services CPT). None render unless a field is set,
   so a service with only a title + description matches the original card. */
.exp-card-icon {
  display: block;
  width: 32px;
  height: 32px;
  margin-bottom: var(--sp-3);
  object-fit: contain;
}
.exp-card-media {
  margin: 0 0 var(--sp-3);
  border-radius: 8px;
  overflow: hidden;
}
.exp-card-media img {
  display: block;
  width: 100%;
  height: auto;
}
.exp-card-cta {
  position: absolute;
  inset: -1px; /* cover the card's 1px border too */
  z-index: 2;
  border-radius: inherit;
}

/* ================= Performance ================= */
.perf-layout {
  display: grid;
  grid-template-columns: minmax(0, 5.5fr) minmax(0, 6.5fr);
  gap: clamp(3rem, 6vw, 5rem) var(--col-gap);
  align-items: start;
}

/* Left column */
.perf-lead-p {
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.35rem);
  line-height: 1.6;
  color: var(--text);
  max-width: 40ch;
}
.perf-levers { margin-top: clamp(2rem, 4vw, 3rem); }
.perf-levers-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}
.perf-levers ul { list-style: none; padding: 0; }
.perf-levers li {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  gap: 0.5rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.perf-levers li::before {
  content: "+";
  font-family: var(--font-mono);
  color: var(--accent);
}
.perf-note {
  margin-top: var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  line-height: 1.7;
  color: var(--text-dim);
  padding-left: var(--sp-3);
  border-left: 1px solid var(--border-strong);
  max-width: 44ch;
}

/* Right column: dashboard */
.perf-dash {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.perf-dash-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem var(--sp-3);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--text-dim);
}
.perf-dash-head .dots { display: inline-flex; gap: 5px; }
.perf-dash-head .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.perf-pill {
  margin-left: auto;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.6rem;
}

.perf-score {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2rem);
  padding: clamp(1.75rem, 4vw, 2.5rem) var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.perf-gauge {
  --val: 95;
  position: relative;
  width: clamp(112px, 26vw, 136px);
  aspect-ratio: 1;
  flex: none;
}
.perf-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.perf-gauge-track { fill: none; stroke: var(--border); stroke-width: 7; }
.perf-gauge-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 1.7s var(--ease);
}
.perf-dash.is-primed .perf-gauge-fill { stroke-dashoffset: calc(100 - var(--val)); }
.perf-gauge-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 1rem + 2vw, 2.1rem);
  letter-spacing: -0.03em;
  color: var(--text);
}
.perf-score-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.25rem);
  color: var(--text);
}
.perf-score-sub {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--text-dim);
  margin-top: 0.35rem;
}

.perf-cwv {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--border);
}
.perf-cwv > div {
  padding: var(--sp-3) var(--sp-2);
  text-align: center;
  border-right: 1px solid var(--border);
}
.perf-cwv > div:last-child { border-right: 0; }
.perf-cwv dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}
.perf-cwv dd {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--text);
  margin-top: 0.4rem;
}

.perf-pipeline { padding: var(--sp-4); }
.pp-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--sp-3);
}
.pp-steps {
  list-style: none;
  padding: 0;
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: clamp(0.62rem, 0.55rem + 0.25vw, 0.72rem);
  color: var(--text-dim);
  margin-bottom: var(--sp-2);
}
.pp-steps li { transition: color var(--dur) var(--ease); white-space: nowrap; }
.pp-steps li.is-lit { color: var(--accent-bright); }
.pp-track {
  height: 2px;
  background: var(--border);
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}
.pp-fill {
  position: absolute;
  inset: 0;
  width: 0;
  background: var(--accent);
  transition: width 1.5s var(--ease);
}
.perf-dash.is-primed .pp-fill { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  .perf-gauge-fill,
  .pp-fill { transition: none; }
}

/* ================= Work / Case studies ================= */
.work-list {
  display: grid;
  gap: clamp(4.5rem, 9vw, 8rem);
}
.work-item {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--sp-4) var(--col-gap);
  align-items: center;
}
.work-media {
  grid-column: 1 / 8;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  position: relative;
}
.work-body { grid-column: 8 / 13; }
.work-item:nth-child(even) .work-media { grid-column: 6 / 13; order: 2; }
.work-item:nth-child(even) .work-body { grid-column: 1 / 6; }
/* Project without a featured image: body spans the full row. */
.work-item--no-media .work-body,
.work-item--no-media:nth-child(even) .work-body { grid-column: 1 / -1; }

.work-media img {
  width: 100%;
  display: block;
  transition: transform 0.7s var(--ease-out);
}
.work-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 10, 11, 0.4), transparent 55%);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.work-item:hover .work-media img { transform: scale(1.03); }
.work-item:hover .work-media::after { opacity: 1; }

.work-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.work-meta .num { color: var(--accent); }
.work-body h2,
.work-body h3 {
  margin: var(--sp-2) 0 var(--sp-3);
  font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.15rem);
}
.work-body > p { font-size: var(--fs-sm); max-width: 42ch; }
.work-tags {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: var(--sp-3) 0 var(--sp-4);
}
.work-tags li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
}
.work-outcome {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--text-muted);
  border-left: 1px solid var(--accent);
  padding-left: var(--sp-2);
  margin-bottom: var(--sp-3);
  max-width: 40ch;
}

/* ================= Process timeline ================= */
.timeline {
  list-style: none;
  padding: 0;
  position: relative;
  counter-reset: tl;
  max-width: 46rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 1px;
  background: var(--border);
}
.timeline-progress {
  position: absolute;
  left: -0.5px; top: 4px;
  width: 2px;
  height: 0;
  background: var(--accent);
  transition: height 0.4s linear;
}
.timeline-step {
  counter-increment: tl;
  position: relative;
  padding: clamp(1.5rem, 3vw, 2.25rem) 0 clamp(1.5rem, 3vw, 2.25rem) clamp(3rem, 6vw, 5rem);
  border-bottom: 1px solid var(--border);
  opacity: 0.4;
  transition: opacity 0.5s var(--ease);
}
.timeline-step.is-active { opacity: 1; }
.timeline-step::before {
  content: counter(tl, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: clamp(1.5rem, 3vw, 2.25rem);
  transform: translateX(-50%);
  width: 2.25rem; height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.timeline-step.is-active::before { border-color: var(--accent); color: var(--accent); }
.timeline-step h3 { margin-bottom: 0.4rem; }
.timeline-step p { font-size: var(--fs-sm); max-width: 52ch; }
/* Experience entries reuse .timeline-step; these only apply when the fields are set. */
.timeline-step .exp-logo {
  display: block;
  height: 22px;
  width: auto;
  margin-bottom: 0.55rem;
  opacity: 0.85;
}
.timeline-step .exp-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--text-dim);
  margin: 0 0 0.6rem;
}
.timeline-step .exp-list {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  max-width: 52ch;
}
.timeline-step .exp-list li {
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--text-muted);
}
.timeline-step .exp-tags {
  list-style: none;
  padding: 0;
  margin: var(--sp-2) 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.timeline-step .exp-tags li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
}

/* ================= Why ================= */
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border-strong);
}
.why-col {
  padding: var(--sp-5) var(--sp-4) 0;
  border-right: 1px solid var(--border);
}
.why-col:first-child { padding-left: 0; }
.why-col:last-child { border-right: 0; padding-right: 0; }
.why-col .why-num {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--accent);
  letter-spacing: 0.1em;
}
.why-col h3 { margin: var(--sp-3) 0 var(--sp-2); font-size: 1.35rem; }
.why-col p { font-size: var(--fs-sm); max-width: 34ch; }

/* ================= Reviews ================= */
.reviews-list {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--border-strong);
}
.review {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0 clamp(1rem, 3vw, 2rem);
  padding: clamp(2rem, 4.5vw, 3.25rem) 0;
  border-bottom: 1px solid var(--border);
  margin: 0;
}
.review-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.75rem;
  line-height: 0.7;
  color: var(--accent);
  opacity: 0.5;
}
.review-body blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.1rem, 1rem + 0.7vw, 1.4rem);
  line-height: 1.5;
  letter-spacing: -0.012em;
  color: var(--text);
  max-width: 62ch;
}
.review-cite {
  margin-top: var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.rc-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  flex: none;
  background: var(--surface-2);
}
.rc-info { display: grid; gap: 0.28rem; min-width: 0; }
.review-cite .rc-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.review-cite .rc-title { font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--text-muted); }
.review-cite .rc-rel { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.03em; color: var(--text-dim); }

/* ================= Blog / Writing ================= */
.blog-list {
  list-style: none;
  padding: 0;
  margin: clamp(2.5rem, 5vw, 4rem) 0 0;
  border-top: 1px solid var(--border-strong);
}
.blog-post { border-bottom: 1px solid var(--border); }
.blog-link {
  display: grid;
  grid-template-columns: clamp(160px, 22vw, 220px) minmax(0, 1fr) auto;
  gap: 0 clamp(1.5rem, 4vw, 2.75rem);
  align-items: center;
  padding: clamp(1.5rem, 3vw, 2.25rem) 0;
}

.blog-thumb {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  aspect-ratio: 16 / 10;
  align-self: center;
}
.blog-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}
.blog-link:hover .blog-thumb img { transform: scale(1.04); }

.blog-meta {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 0.7rem;
  font-family: var(--font-mono);
}
.blog-meta .bp-date { font-size: var(--fs-meta); letter-spacing: 0.04em; color: var(--text-dim); }
.blog-meta .bp-cat {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.blog-main h3 {
  font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem);
  max-width: 32ch;
  transition: color var(--dur) var(--ease);
}
.blog-main p {
  margin-top: 0.55rem;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  max-width: 54ch;
}
.blog-cue {
  align-self: center;
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.blog-cue .arrow { display: inline-block; transition: transform var(--dur) var(--ease); }
.blog-link:hover .blog-main h3 { color: var(--accent-bright); }
.blog-link:hover .blog-cue { color: var(--text); }
.blog-link:hover .blog-cue .arrow { transform: translateX(4px); }

/* ================= Skills matrix ================= */
.skills-matrix {
  border-top: 1px solid var(--border);
}
.skill-row {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: var(--sp-3) var(--col-gap);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.skill-row h3 {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}
.skill-row ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.6rem;
}
.skill-row li {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.7rem;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.skill-row li:hover { color: var(--text); border-color: var(--border-strong); }
/* Optional per-technology icon (Technologies CPT). Absent unless set. */
.skill-row li img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  margin-right: 0.4rem;
  vertical-align: -2px;
}

/* ================= Remote ================= */
.remote-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--sp-5) var(--col-gap);
  align-items: start;
}
.remote-statement {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.55rem, 1.1rem + 2.2vw, 2.7rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--text);
  max-width: 18ch;
}
.remote-body > p { font-size: var(--fs-lead); line-height: 1.6; max-width: 48ch; }
.remote-body > p + p { margin-top: var(--sp-3); font-size: var(--fs-body); }
.remote-countries {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: var(--sp-4) 0;
}
.remote-countries li {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.06em;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 0.5rem 1rem;
}
.remote-availability {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}

/* ================= Contact / Final CTA ================= */
.cta-section { padding-block: clamp(5rem, 4rem + 8vw, 11rem); }

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 30rem);
  gap: clamp(3rem, 6vw, 5.5rem) clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.contact-intro h2 {
  font-size: clamp(2.6rem, 1.6rem + 4vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.04em;
  margin-top: var(--sp-3);
}
.contact-intro h2 .line { display: block; }
.contact-intro h2 .accent { color: var(--accent-bright); }
.contact-intro > p {
  margin-top: var(--sp-4);
  font-size: var(--fs-lead);
  max-width: 40ch;
}
.contact-details {
  margin-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  max-width: 26rem;
}
.contact-details div {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}
.contact-details dt { color: var(--text-dim); letter-spacing: 0.1em; text-transform: uppercase; }
.contact-details dd { color: var(--text); text-align: right; }
.contact-details a { transition: color var(--dur) var(--ease); }
.contact-details a:hover { color: var(--accent-bright); }

/* Form */
.contact-form { display: grid; gap: var(--sp-3); }
.field { display: grid; gap: 0.5rem; }
.field label {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.field label span { color: var(--text-dim); text-transform: none; letter-spacing: 0; }
.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 0.98rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.8rem 0.9rem;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.field textarea { resize: vertical; min-height: 7rem; line-height: 1.6; }
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 1.1rem, calc(100% - 14px) 1.1rem;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
}
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--border-strong); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  background: var(--surface-2);
}
/* Keyboard focus needs a visible indicator beyond the border tint. */
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-dim); }
/* honeypot: present in the DOM for bots, hidden from people + AT */
.field-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.contact-form .btn { margin-top: var(--sp-1); }
.form-note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--text-dim);
}
/* Contact form states (hidden status box is removed from the grid). */
.form-status[hidden] { display: none; }
.form-status p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  line-height: 1.55;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
}
.form-status--success {
  color: var(--positive);
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.08);
}
.form-status--error {
  color: #ffb4b4;
  border-color: rgba(255, 120, 120, 0.4);
  background: rgba(255, 120, 120, 0.08);
}
.field--error input,
.field--error select,
.field--error textarea { border-color: rgba(255, 120, 120, 0.65); }
.field-error {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.5;
  color: #ffb4b4;
}
.contact-form.is-sending { opacity: 0.75; pointer-events: none; }
.contact-cta-wrap { margin-top: var(--sp-4); }

/* ================= Footer ================= */
.site-footer {
  position: relative;
  border-top: 1px solid var(--border-strong);
  padding-block: clamp(3.5rem, 7vw, 6rem) var(--sp-4);
}
/* hairline accent bleed at the very top edge */
.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: clamp(80px, 18vw, 200px);
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 4.4fr) minmax(0, 5fr) minmax(0, 2.4fr);
  gap: var(--sp-6) var(--col-gap);
  align-items: start;
}

/* ---- Brand column ---- */
.footer-brand .f-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.footer-brand .f-role {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--text-muted);
  margin-top: 0.4rem;
}
.footer-brand .f-blurb {
  margin-top: var(--sp-3);
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 40ch;
}
.footer-brand .f-status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--text-muted);
}
.footer-brand .f-mail {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 3px;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.footer-brand .f-mail .arrow { transition: transform var(--dur) var(--ease); }
.footer-brand .f-mail:hover { color: var(--accent-bright); border-color: var(--accent); }
.footer-brand .f-mail:hover .arrow { transform: translateX(3px); }
/* Optional footer CTA (Site Settings > Footer). Hidden unless configured. */
.footer-brand .f-cta { margin-top: var(--sp-3); }

/* ---- Column headings (shared) ---- */
.footer-sitemap h4,
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--sp-3);
}

/* ---- Sitemap: numbered, two columns ---- */
.footer-sitemap ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.15rem clamp(1rem, 3vw, 2.5rem);
  counter-reset: fn;
}
.footer-sitemap li { counter-increment: fn; }
.footer-sitemap a {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  padding: 0.4rem 0;
  transition: color var(--dur) var(--ease);
}
/* Number every item (menu-managed or fallback). The .fn-num span rule is kept
   for any markup that still ships its own number. */
.footer-sitemap a::before {
  content: counter(fn, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  transition: color var(--dur) var(--ease);
}
.footer-sitemap a:has(.fn-num)::before { content: none; }
.footer-sitemap a .fn-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  transition: color var(--dur) var(--ease);
}
.footer-sitemap a:hover { color: var(--text); }
.footer-sitemap a:hover::before,
.footer-sitemap a:hover .fn-num { color: var(--accent); }

/* ---- Connect column ---- */
.footer-col .footer-social {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-col a {
  display: block;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  padding: 0.4rem 0;
  transition: color var(--dur) var(--ease);
}
.footer-col a:hover { color: var(--accent-bright); }

/* ---- Bottom bar ---- */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}
.footer-bottom p {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}
.footer-bottom .f-built { margin-right: auto; }
.footer-bottom .f-top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: color var(--dur) var(--ease);
}
.footer-bottom .f-top span { transition: transform var(--dur) var(--ease); }
.footer-bottom .f-top:hover { color: var(--accent-bright); }
.footer-bottom .f-top:hover span { transform: translateY(-3px); }

/* ================= Breadcrumbs + utility page headers ================= */
.breadcrumbs {
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.55rem;
}
.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.breadcrumbs li + li::before {
  content: "/";
  color: var(--border-strong);
}
.breadcrumbs a {
  color: var(--text-muted);
  transition: color var(--dur) var(--ease);
}
.breadcrumbs a:hover,
.breadcrumbs a:focus-visible { color: var(--accent-bright); }
.breadcrumbs [aria-current="page"] { color: var(--text-dim); }

.page-header {
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}
.page-header .page-title {
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
}
.page-header .page-title span { color: var(--accent-bright); }
.archive-description {
  margin-top: var(--sp-2);
  max-width: 60ch;
  color: var(--text-muted);
}
.site-main .page-header + .blog-list { margin-top: 0; }
