/* ==========================================================================
   Artem Cherbaev, portfolio. One stylesheet for every page; the runner and
   the CV add their own on top. Tokens first, then base, components, sections.
   ========================================================================== */

@font-face {
  font-family: 'Geist';
  src: url('../fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('../fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */

:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --bg-2: #efece4;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #101915;
  --ink-2: #3b4843;
  --ink-3: #5c6964;
  --line: #e2ded4;
  --line-2: #d2cdc1;
  --accent: #0b6e4f;
  --accent-hover: #085a40;
  --accent-soft: #e0f0e8;
  --accent-ink: #ffffff;
  --pass: #15803d;
  --pass-soft: #dcf3e3;
  --pass-ink: #0f6634;
  --fail: #c23a2b;
  --fail-soft: #fbe3df;
  --fail-ink: #a3291b;
  --parked: #b45309;
  --parked-soft: #fcefd5;
  --flaky: #7c3aed;
  --skip: #6b7280;
  --term-bg: #0c1411;
  --term-ink: #d6e2dc;
  --term-dim: #7f9189;
  --shadow-sm: 0 1px 2px rgb(16 25 21 / 0.06);
  --shadow-md: 0 1px 2px rgb(16 25 21 / 0.05), 0 8px 24px -12px rgb(16 25 21 / 0.18);
  --shadow-lg: 0 2px 4px rgb(16 25 21 / 0.04), 0 24px 48px -20px rgb(16 25 21 / 0.28);

  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;
  --section-y: clamp(72px, 9vw, 128px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0b110f;
    --bg-2: #0e1613;
    --surface: #121b18;
    --surface-2: #16211d;
    --ink: #e8efeb;
    --ink-2: #b9c6c0;
    --ink-3: #8d9b95;
    --line: #1f2e28;
    --line-2: #2b3d35;
    --accent: #5ad6a4;
    --accent-hover: #86e6bf;
    --accent-soft: #143328;
    --accent-ink: #03110b;
    --pass: #4ade80;
    --pass-soft: #11301f;
    --pass-ink: #4ade80;
    --fail: #ff8170;
    --fail-soft: #3a1814;
    --fail-ink: #ff8170;
    --parked: #fbbf24;
    --parked-soft: #33260b;
    --flaky: #a78bfa;
    --skip: #9ca3af;
    --term-bg: #070c0a;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 28px -14px rgb(0 0 0 / 0.7);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.3), 0 28px 56px -24px rgb(0 0 0 / 0.8);
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0b110f;
  --bg-2: #0e1613;
  --surface: #121b18;
  --surface-2: #16211d;
  --ink: #e8efeb;
  --ink-2: #b9c6c0;
  --ink-3: #8d9b95;
  --line: #1f2e28;
  --line-2: #2b3d35;
  --accent: #5ad6a4;
  --accent-hover: #86e6bf;
  --accent-soft: #143328;
  --accent-ink: #03110b;
  --pass: #4ade80;
  --pass-soft: #11301f;
  --pass-ink: #4ade80;
  --fail: #ff8170;
  --fail-soft: #3a1814;
  --fail-ink: #ff8170;
  --parked: #fbbf24;
  --parked-soft: #33260b;
  --flaky: #a78bfa;
  --skip: #9ca3af;
  --term-bg: #070c0a;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 28px -14px rgb(0 0 0 / 0.7);
  --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.3), 0 28px 56px -24px rgb(0 0 0 / 0.8);
}

/* ---------- base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2rem, 1.35rem + 2.3vw, 3rem);
  letter-spacing: -0.035em;
}

h3 {
  font-size: 1.1875rem;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

strong {
  font-weight: 600;
  color: var(--ink);
}

code,
kbd,
.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

[hidden] {
  display: none !important;
}

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

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip:focus {
  top: 12px;
  color: var(--bg);
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- small parts ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow .idx {
  color: var(--ink-3);
}

.lede {
  max-width: 62ch;
  margin-top: 18px;
  color: var(--ink-2);
  font-size: 1.125rem;
}

.section-head {
  margin-bottom: clamp(36px, 5vw, 56px);
}

.muted {
  color: var(--ink-3);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.84rem;
  line-height: 1.3;
  white-space: nowrap;
}

.chip.strong {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 500;
}

.dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--skip);
}

.dot.passed {
  background: var(--pass);
}

.dot.failed {
  background: var(--fail);
}

.dot.parked,
.dot.skipped {
  background: var(--parked);
}

.dot.live {
  box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 50%, transparent);
  animation: pulse 2.2s ease-out infinite;
}

.dot.live.passed {
  color: var(--pass);
}

.dot.live.failed {
  color: var(--fail);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent);
  }
  70%,
  100% {
    box-shadow: 0 0 0 7px transparent;
  }
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.96rem;
  font-weight: 550;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}

.btn-secondary {
  border-color: var(--line-2);
  background: var(--surface);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}

.btn-quiet {
  min-height: 38px;
  padding: 0 14px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.88rem;
}

.btn-quiet:hover {
  border-color: var(--line-2);
  color: var(--ink);
}

.btn .icon {
  width: 17px;
  height: 17px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--line-2);
  color: var(--ink);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 550;
  text-decoration: none;
}

.link-arrow .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}

.link-arrow:hover .icon {
  transform: translateX(3px);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  transition: border-color 0.2s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-name {
  font-size: 0.98rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.93rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}

.nav a:hover {
  color: var(--ink);
  background: var(--bg-2);
}

.nav a[aria-current='true'],
.nav a[aria-current='page'] {
  color: var(--ink);
  background: var(--bg-2);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 13px 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-decoration: none;
  white-space: nowrap;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    opacity 0.3s ease;
}

.status-pill:hover {
  border-color: var(--line-2);
  color: var(--ink);
}

.status-pill[hidden] {
  display: none;
}

.menu-btn {
  display: none;
}

.theme-toggle .sun {
  display: none;
}

:root[data-theme='dark'] .theme-toggle .sun {
  display: block;
}

:root[data-theme='dark'] .theme-toggle .moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .sun {
    display: block;
  }
  :root:not([data-theme='light']) .theme-toggle .moon {
    display: none;
  }
}

@media (max-width: 1020px) {
  .status-pill .pill-long {
    display: none;
  }
}

@media (max-width: 880px) {
  .menu-btn {
    display: inline-grid;
  }

  .nav {
    position: absolute;
    top: calc(var(--header-h) - 1px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 10px var(--gutter) 18px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    box-shadow: var(--shadow-md);
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
  }

  .header-tools {
    margin-left: auto;
  }
}

@media (max-width: 520px) {
  .brand-name {
    display: none;
  }

  .cv-btn .cv-long {
    display: none;
  }
}

/* ---------- sections ---------- */

.section {
  padding-block: var(--section-y);
}

.section.alt {
  background: var(--bg-2);
}

.section + .section:not(.alt) {
  border-top: 1px solid var(--line);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding-block: clamp(40px, 6vw, 84px) clamp(64px, 8vw, 112px);
  isolation: isolate;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 100%;
  background-image: radial-gradient(var(--line-2) 1px, transparent 1.2px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(120% 90% at 78% 12%, #000 10%, transparent 62%);
  mask-image: radial-gradient(120% 90% at 78% 12%, #000 10%, transparent 62%);
  opacity: 0.75;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: center;
  gap: clamp(40px, 6vw, 88px);
}

.hero h1 {
  margin: 0 0 22px;
  font-size: clamp(3rem, 1.6rem + 5.4vw, 5.6rem);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.hero h1 .last {
  color: var(--accent);
}

.hero-claim {
  max-width: 22ch;
  margin: 0 0 20px;
  color: var(--ink);
  font-size: clamp(1.3rem, 1rem + 1.1vw, 1.7rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.hero-text {
  max-width: 58ch;
  color: var(--ink-2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0 28px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.hero-meta li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-meta .icon {
  width: 15px;
  height: 15px;
}

/* the portrait, framed like a visual regression capture */
.hero-stage {
  position: relative;
  width: min(100%, 440px);
  margin-left: auto;
}

.capture {
  position: relative;
  margin: 0;
  padding: 22px;
}

.capture-img {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 1;
}

.capture-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.capture .corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 2px solid var(--accent);
  opacity: 0.85;
}

.capture .tl {
  top: 0;
  left: 0;
  border-right: 0;
  border-bottom: 0;
  border-top-left-radius: 10px;
}

.capture .tr {
  top: 0;
  right: 0;
  border-left: 0;
  border-bottom: 0;
  border-top-right-radius: 10px;
}

.capture .bl {
  bottom: 0;
  left: 0;
  border-right: 0;
  border-top: 0;
  border-bottom-left-radius: 10px;
}

.capture .br {
  bottom: 0;
  right: 0;
  border-left: 0;
  border-top: 0;
  border-bottom-right-radius: 10px;
}

.capture-label {
  position: absolute;
  top: -4px;
  left: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.capture-label .ok {
  color: var(--pass);
}

.run-card {
  position: absolute;
  left: -34px;
  bottom: -26px;
  z-index: 2;
  width: min(300px, 86%);
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--ink-2);
  font-size: 0.84rem;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

a.run-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
  color: var(--ink-2);
}

.run-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.run-card-head .when {
  margin-left: auto;
  color: var(--ink-3);
  letter-spacing: 0;
  text-transform: none;
}

.run-card-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--ink);
}

.run-card-total strong {
  font-size: 1.9rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.03em;
}

.spark {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 3px;
  height: 28px;
}

.spark span {
  flex: 1 1 0;
  min-width: 3px;
  max-width: 10px;
  border-radius: 2px;
  background: var(--pass);
  opacity: 0.85;
}

.spark span.failed {
  background: var(--fail);
}

.run-card-foot {
  display: block;
  margin-top: 10px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.run-card-foot .go {
  display: block;
  margin-top: 6px;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 550;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    order: -1;
  }

  .hero-stage {
    width: min(100%, 380px);
    margin: 0 auto 8px;
  }

  /* Below the photo rather than over it: on a narrow screen an overlap covers the face. */
  .run-card {
    position: relative;
    left: auto;
    bottom: auto;
    display: block;
    width: calc(100% - 44px);
    margin: -34px auto 0;
  }
}

/* ---------- proof band ---------- */

.proof {
  border-block: 1px solid var(--line);
  background: var(--surface);
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.proof-item {
  padding: 34px clamp(16px, 2.4vw, 32px);
}

.proof-item + .proof-item {
  border-left: 1px solid var(--line);
}

.proof-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--ink);
  font-size: clamp(1.9rem, 1.3rem + 1.8vw, 2.7rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.proof-value .arrow {
  color: var(--accent);
  font-weight: 500;
}

.proof-label {
  margin-top: 12px;
  color: var(--ink-3);
  font-size: 0.9rem;
  line-height: 1.45;
}

@media (max-width: 860px) {
  .proof-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .proof-item:nth-child(3) {
    border-left: 0;
  }

  .proof-item:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

/* ---------- cards ---------- */

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card-kind {
  margin: 0 0 12px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- work ---------- */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
}

.feature-body {
  padding: clamp(26px, 4vw, 48px);
}

.feature-body h3 {
  margin-bottom: 14px;
  font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.1rem);
  letter-spacing: -0.035em;
}

.feature-body > p {
  color: var(--ink-2);
}

.checklist {
  display: grid;
  gap: 10px;
  margin: 22px 0 26px;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 0.97rem;
}

.checklist li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
}

.checklist .icon {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  color: var(--pass);
  stroke-width: 2.3;
}

.feature-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.feature-live {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(24px, 3.4vw, 40px);
  border-left: 1px solid var(--line);
  background: var(--term-bg);
  color: var(--term-ink);
}

.live-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--term-dim);
}

.live-head .title {
  color: var(--term-ink);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.live-head .when {
  margin-left: auto;
}

.lanes-mini {
  display: grid;
  gap: 16px;
}

.lane-mini-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.lane-mini-top .count {
  color: var(--term-dim);
}

.cells {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.cell {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: #1f2e28;
}

.cell.passed {
  background: #3ccf8a;
}

.cell.failed {
  background: #ff7a66;
}

.cell.parked,
.cell.skipped {
  background: #f5b841;
}

.cell.flaky {
  background: #a78bfa;
}

.cell.missing {
  background: transparent;
  outline: 1px dashed #3a4c45;
  outline-offset: -1px;
}

.live-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid #1d2a25;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--term-dim);
}

.live-foot a {
  color: var(--term-ink);
  text-decoration: none;
}

.live-foot a:hover {
  color: #7fe3bb;
  text-decoration: underline;
}

.live-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 4px 0 0;
  border: 1px solid #1d2a25;
  border-radius: 10px;
  overflow: hidden;
  background: #1d2a25;
}

.live-stats:empty {
  display: none;
}

.live-stats div {
  padding: 10px 12px;
  background: var(--term-bg);
}

.live-stats dt {
  color: var(--term-dim);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.live-stats dd {
  margin: 2px 0 0;
  color: var(--term-ink);
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.live-slow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.live-slow p {
  margin: 0;
}

.slow-title {
  margin-bottom: 6px !important;
  color: var(--term-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.slow-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 4px 0;
  border-top: 1px dashed #1d2a25;
}

.slow-id {
  color: #7fe3bb;
}

.slow-t {
  overflow: hidden;
  color: var(--term-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slow-d {
  color: var(--term-dim);
}

@media (max-width: 460px) {
  .live-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.live-empty {
  color: var(--term-dim);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--term-dim);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend .cell {
  width: 10px;
  height: 10px;
}

.work-more {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.work-card {
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 34px);
}

.work-card h3 {
  margin-bottom: 10px;
  font-size: 1.35rem;
}

.work-card p {
  color: var(--ink-2);
  font-size: 0.98rem;
}

.work-card .chips {
  margin: 4px 0 22px;
}

.work-card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: auto;
}

@media (max-width: 960px) {
  .feature {
    grid-template-columns: 1fr;
  }

  .feature-live {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .work-more {
    grid-template-columns: 1fr;
  }
}

/* ---------- experience ---------- */

.role {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 72px);
}

.role-meta h3 {
  margin-bottom: 6px;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
}

.role-meta .company {
  margin-bottom: 4px;
  color: var(--ink);
  font-weight: 550;
}

.role-meta .company-note {
  color: var(--ink-3);
  font-size: 0.95rem;
}

.role-meta .when {
  display: inline-block;
  margin: 14px 0 22px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.role-meta > p {
  color: var(--ink-2);
}

.results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.result {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.result strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.result span {
  color: var(--ink-3);
  font-size: 0.86rem;
  line-height: 1.4;
}

.steps {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps::before {
  content: '';
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 13px;
  width: 2px;
  background: var(--line);
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 18px;
  padding-bottom: 28px;
}

.step:last-child {
  padding-bottom: 0;
}

.step-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--pass);
  border-radius: 50%;
  background: var(--bg);
  color: var(--pass);
}

.section.alt .step-mark {
  background: var(--bg-2);
}

.step-mark .icon {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

.step h4 {
  margin: 2px 0 6px;
  font-size: 1.06rem;
  letter-spacing: -0.01em;
}

.step p {
  color: var(--ink-2);
  font-size: 0.97rem;
}

.step .step-label {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

details.more {
  margin-top: 30px;
  border-top: 1px solid var(--line);
}

details.more > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 18px 0 4px;
  color: var(--accent);
  font-weight: 550;
  list-style: none;
  cursor: pointer;
}

details.more > summary::-webkit-details-marker {
  display: none;
}

details.more > summary .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

details.more[open] > summary .icon {
  transform: rotate(180deg);
}

.more-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 36px;
  padding-top: 18px;
}

.more-body h4 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.more-body p {
  color: var(--ink-2);
  font-size: 0.95rem;
}

.edu {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin-top: 40px;
  padding: 20px 24px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--ink-2);
}

.edu .mono {
  color: var(--ink-3);
  font-size: 0.82rem;
}

@media (max-width: 900px) {
  .role {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .more-body {
    grid-template-columns: 1fr;
  }
}

/* ---------- principles ---------- */

.principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.principle {
  padding: clamp(24px, 3vw, 34px);
}

.principle .num {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.principle h3 {
  margin-bottom: 12px;
  font-size: 1.28rem;
}

.principle p {
  color: var(--ink-2);
  font-size: 0.98rem;
}

@media (max-width: 760px) {
  .principles {
    grid-template-columns: 1fr;
  }
}

/* ---------- skills ---------- */

.daily {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px 28px;
  margin-bottom: 22px;
  padding: 22px 26px;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: var(--bg);
}

.daily-label {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.daily .chip {
  border-color: color-mix(in srgb, var(--bg) 22%, transparent);
  background: color-mix(in srgb, var(--bg) 8%, transparent);
  color: var(--bg);
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.skill-group {
  padding: 24px;
}

.skill-group h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 1.02rem;
}

.skill-group h3 .icon {
  color: var(--accent);
}

.skill-group .chip {
  font-size: 0.8rem;
  padding: 4px 10px;
  background: var(--surface-2);
}

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

@media (max-width: 640px) {
  .skill-grid {
    grid-template-columns: 1fr;
  }

  .daily {
    grid-template-columns: 1fr;
  }
}

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}

.about-body p {
  color: var(--ink-2);
  font-size: 1.08rem;
}

.about-body p:first-of-type {
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

.facts {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 6px 24px;
}

.facts div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.facts div:last-child {
  border-bottom: 0;
}

.facts dt {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-top: 3px;
}

.facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.97rem;
}

@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.contact-list {
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.contact-list li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  border-bottom: 1px solid var(--line);
}

.contact-list .k {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contact-list a {
  overflow-wrap: anywhere;
  font-weight: 500;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

a.copy-btn {
  font-weight: 400;
  text-decoration: none;
}

.copy-btn:hover {
  border-color: var(--line-2);
  color: var(--ink);
}

.copy-btn .icon {
  width: 14px;
  height: 14px;
}

.copy-btn.done {
  border-color: var(--pass);
  color: var(--pass);
}

.composer {
  padding: clamp(22px, 3vw, 34px);
}

.composer h3 {
  margin-bottom: 6px;
}

.composer .hint {
  margin-bottom: 22px;
  color: var(--ink-3);
  font-size: 0.92rem;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field label {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 550;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 0.98rem;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.composer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.composer-note {
  margin-top: 14px;
  color: var(--ink-3);
  font-size: 0.84rem;
}

.composer-status {
  min-height: 1.4em;
  color: var(--pass);
  font-size: 0.88rem;
}

@media (max-width: 900px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .contact-list li {
    grid-template-columns: 1fr auto;
    gap: 2px 12px;
    padding: 12px 0;
  }

  .contact-list .k {
    grid-column: 1 / -1;
  }
}

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

.site-footer {
  padding-block: 38px 46px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
}

.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.site-footer a {
  color: var(--ink-2);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.footer-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

/* ---------- sub pages ---------- */

.page-head {
  padding-block: clamp(40px, 6vw, 80px) clamp(28px, 4vw, 48px);
}

.page-head h1 {
  margin-bottom: 16px;
  font-size: clamp(2.4rem, 1.5rem + 3.6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.05em;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 26px;
  color: var(--ink-3);
  font-size: 0.92rem;
  text-decoration: none;
}

.back:hover {
  color: var(--ink);
}

.back .icon {
  width: 16px;
  height: 16px;
}

.not-found {
  display: grid;
  align-items: center;
  min-height: calc(100vh - var(--header-h));
  padding-block: 48px;
}

.not-found h1 {
  max-width: 16ch;
  font-size: clamp(2.4rem, 1.4rem + 4vw, 4.4rem);
  font-weight: 700;
  letter-spacing: -0.05em;
}

/* ---------- reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.6s ease,
    transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- print ---------- */

@media print {
  .site-header,
  .site-footer,
  .skip,
  .hero-actions,
  .feature-live,
  .composer {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
