/* =========================================================
   ELEC-CORE — Design System
   Industrial · Typographic · Minimal
   ========================================================= */

/* ---------- Variables ---------- */
:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #1a1a1a;
  --border: #1f1f1f;
  --border-strong: #2a2a2a;
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.45);
  --text-dim: rgba(255, 255, 255, 0.25);
  --accent: #0066cc;
  --accent-hover: #1a7ad6;
  --accent-2: #00d4ff;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container: 1280px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

  --shadow-soft: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

/* Industrial grid backdrop — subtile, fixed */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 96px 96px;
  background-position: -1px -1px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at 50% 0%, rgba(0, 0, 0, 0.9), transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, rgba(0, 0, 0, 0.9), transparent 70%);
}

main, header, footer { position: relative; z-index: 1; }

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

button {
  font: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  color: inherit;
}

ul, ol { list-style: none; }

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

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

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--text);
}

h1 {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1;
}

h2 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 400;
  letter-spacing: -0.03em;
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h4 {
  font-size: 1rem;
  font-weight: 500;
}

p { color: var(--text-muted); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--text-muted);
}

.lead {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 56ch;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-feature-settings: 'tnum';
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: clamp(5rem, 10vw, 8rem) 0;
  position: relative;
}

.section--bordered {
  border-top: 1px solid var(--border);
}

.section-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: clamp(3rem, 6vw, 5rem);
  max-width: 720px;
}

@media (min-width: 900px) {
  .section-header--inline {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: none;
    align-items: end;
  }
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.brand-mark {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--text);
  position: relative;
  display: inline-block;
}

.brand-mark::after {
  content: '';
  position: absolute;
  inset: 4px;
  background: var(--accent);
}

.nav-list {
  display: none;
  align-items: center;
  gap: 2.25rem;
}

.nav-list a {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 450;
  position: relative;
  padding: 4px 0;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: var(--text);
}

.nav-list a[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 1px;
  background: var(--text);
}

.nav-cta {
  display: none;
}

@media (min-width: 900px) {
  .nav-list, .nav-cta { display: inline-flex; }
}

.nav-toggle {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s var(--ease);
}

.nav-toggle:hover { border-color: var(--border-strong); }

.nav-toggle-bar {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text);
  position: relative;
}

.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: '';
  position: absolute;
  left: 0;
  width: 16px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.25s var(--ease), top 0.25s var(--ease);
}

.nav-toggle-bar::before { top: -5px; }
.nav-toggle-bar::after  { top: 5px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after  { top: 0; transform: rotate(-45deg); }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
}

.mobile-menu {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.mobile-menu.is-open { display: block; }

.mobile-menu ul {
  display: flex;
  flex-direction: column;
  padding: 1rem var(--gutter) 1.5rem;
}

.mobile-menu a {
  display: block;
  padding: 0.875rem 0;
  font-size: 1rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.mobile-menu a:last-child { border-bottom: 0; }
.mobile-menu a:hover, .mobile-menu a[aria-current="page"] { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
  line-height: 1;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
}

.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn--ghost:hover {
  background: var(--surface);
  border-color: #3a3a3a;
}

.btn--ghost-sm {
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn--ghost-sm:hover { background: var(--surface); }

.btn-arrow {
  display: inline-block;
  width: 14px;
  transform: translateY(0.5px);
  transition: transform 0.2s var(--ease);
}

.btn:hover .btn-arrow { transform: translate(3px, 0.5px); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  margin-top: 2.5rem;
}

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.4rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(4rem, 8vw, 7rem) 0 clamp(5rem, 10vw, 8rem);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--hero-img, none);
  background-size: cover;
  background-position: center;
  opacity: 0.18;
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 102, 204, 0.18), transparent 70%),
    linear-gradient(180deg, transparent 0%, var(--bg) 95%);
  z-index: 0;
}

.hero > * { position: relative; z-index: 1; }

.hero-inner {
  max-width: 920px;
}

.hero-title {
  margin-top: 1.75rem;
  margin-bottom: 1.75rem;
}

.hero-title em {
  font-style: normal;
  color: var(--text-muted);
  font-weight: 200;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.hero-meta strong {
  display: block;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat {
  padding: 2.5rem var(--gutter);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.stat:last-child { border-bottom: 0; }

.stat-value {
  font-size: clamp(3rem, 7vw, 4.5rem);
  font-weight: 200;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
  font-feature-settings: 'tnum';
}

.stat-value sup {
  font-size: 0.5em;
  vertical-align: top;
  margin-left: 0.15em;
  color: var(--accent-2);
  font-weight: 400;
}

.stat-label {
  margin-top: 0.875rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: -0.005em;
  max-width: 240px;
}

@media (min-width: 700px) {
  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .stat {
    border-bottom: 0;
    border-right: 1px solid var(--border);
    padding: 3rem 0;
    padding-left: var(--gutter);
  }
  .stat:first-child { padding-left: 0; }
  .stat:last-child { border-right: 0; }
}

/* ---------- Domain grid ---------- */
.grid-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

@media (min-width: 700px) { .grid-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .grid-cards { grid-template-columns: repeat(4, 1fr); } }

.grid-card {
  background: var(--bg);
  padding: 2rem 1.75rem;
  position: relative;
  transition: background 0.3s var(--ease);
}

.grid-card:hover { background: var(--surface); }

.grid-card-num {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  margin-bottom: 1.5rem;
  font-feature-settings: 'tnum';
}

.grid-card h3 {
  margin-bottom: 0.625rem;
}

.grid-card p {
  font-size: 0.875rem;
  line-height: 1.55;
}

/* ---------- Stack list ---------- */
.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.tech-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- Process / Services ---------- */
.process {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--border);
}

.process-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  padding: clamp(2rem, 4vw, 3rem) 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.process-num {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  font-feature-settings: 'tnum';
  padding-top: 0.5rem;
  min-width: 3rem;
}

.process-content h3 {
  margin-bottom: 0.875rem;
}

.process-content p {
  max-width: 60ch;
  margin-bottom: 1rem;
}

.process-meta {
  display: flex;
  gap: 1.5rem 2rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.process-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.process-meta span::before {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--accent-2);
  display: inline-block;
}

@media (min-width: 800px) {
  .process-step {
    grid-template-columns: 120px 1fr 240px;
    gap: 3rem;
  }
}

/* ---------- Project / Portfolio ---------- */
.project {
  padding: clamp(4rem, 8vw, 6rem) 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 80px;
}

.project-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2.5rem;
  align-items: end;
}

@media (min-width: 800px) {
  .project-header {
    grid-template-columns: auto 1fr auto;
    gap: 2.5rem;
  }
}

.project-num {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.project-title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.025em;
}

.project-tag {
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: -0.005em;
}

.project-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 900px) {
  .project-body { grid-template-columns: 1fr 1fr; gap: 4rem; }
}

.project-desc p { margin-bottom: 1rem; max-width: 55ch; }

.project-specs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--border);
}

.project-specs > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.project-specs dt {
  color: var(--text-muted);
  font-weight: 400;
}

.project-specs dd {
  color: var(--text);
  font-weight: 500;
  text-align: right;
}

/* ---------- Carousel (CSS pur, scroll-snap) ---------- */
.carousel {
  position: relative;
  margin: 0 calc(-1 * var(--gutter));
}

.carousel-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  padding: 0 var(--gutter) 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.carousel-track::-webkit-scrollbar { height: 6px; }
.carousel-track::-webkit-scrollbar-track { background: transparent; }
.carousel-track::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

.carousel-slide {
  flex: 0 0 calc(100% - var(--gutter));
  scroll-snap-align: start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  position: relative;
  aspect-ratio: 16 / 10;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85);
  transition: filter 0.4s var(--ease), transform 0.6s var(--ease);
}

.carousel-slide:hover img {
  filter: saturate(1);
  transform: scale(1.02);
}

.carousel-slide-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(180deg, transparent, rgba(10,10,10,0.9));
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 500;
}

@media (min-width: 700px) {
  .carousel-slide { flex-basis: calc(60% - var(--gutter)); }
}

@media (min-width: 1100px) {
  .carousel-slide { flex-basis: calc(45% - var(--gutter)); }
}

/* ---------- Blog ---------- */
.posts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 800px) { .posts { grid-template-columns: 1fr 1fr; } }

.post {
  background: var(--bg);
  padding: 2rem var(--gutter);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 1rem;
  transition: background 0.3s var(--ease);
}

.post:hover { background: var(--surface); }

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.post-meta time { font-feature-settings: 'tnum'; }

.post-meta-sep {
  width: 16px;
  height: 1px;
  background: var(--border-strong);
}

.post h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 500;
  line-height: 1.25;
}

.post-excerpt {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.post-link {
  font-size: 0.875rem;
  color: var(--text);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.post-link:hover { color: var(--accent-2); }

/* ---------- Article (long form) ---------- */
.article-body {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
}

.article-body h2 { margin: 3rem 0 1rem; font-size: 1.5rem; }
.article-body h3 { margin: 2rem 0 0.75rem; font-size: 1.125rem; }
.article-body p { margin-bottom: 1.25rem; color: inherit; }
.article-body ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin-bottom: 1.25rem;
}
.article-body ul li { margin-bottom: 0.5rem; }
.article-body code {
  background: var(--surface);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
  border: 1px solid var(--border);
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 900px) {
  .contact-grid { grid-template-columns: 1.2fr 1fr; gap: 5rem; }
}

.form {
  display: grid;
  gap: 1.25rem;
}

.field {
  display: grid;
  gap: 0.5rem;
}

.field label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: -0.005em;
}

.field input,
.field textarea,
.field select {
  font: inherit;
  font-size: 0.9375rem;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  width: 100%;
}

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

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 0;
  border-color: var(--accent);
  background: var(--surface-2);
}

.field input::placeholder,
.field textarea::placeholder { color: var(--text-dim); }

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 600px) {
  .form-row { grid-template-columns: 1fr 1fr; }
}

.contact-info {
  border-left: 1px solid var(--border);
  padding-left: clamp(1.5rem, 4vw, 3rem);
}

@media (max-width: 899px) {
  .contact-info { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); padding-top: 2.5rem; }
}

.contact-block {
  margin-bottom: 2.5rem;
}

.contact-block:last-child { margin-bottom: 0; }

.contact-block .eyebrow { margin-bottom: 1rem; }

.contact-block a {
  display: block;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.contact-block a:hover { color: var(--accent-2); }

.contact-block address {
  font-style: normal;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ---------- Values / Lab (about) ---------- */
.values {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 800px) { .values { grid-template-columns: repeat(3, 1fr); } }

.value {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

@media (min-width: 800px) {
  .value {
    padding: 3rem clamp(1.5rem, 3vw, 2.5rem) 3rem 0;
    border-bottom: 0;
    border-right: 1px solid var(--border);
  }
  .value:nth-child(2) { padding-left: clamp(1.5rem, 3vw, 2.5rem); }
  .value:nth-child(3) { padding-left: clamp(1.5rem, 3vw, 2.5rem); border-right: 0; }
}

.value-num {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  font-feature-settings: 'tnum';
  margin-bottom: 1.5rem;
  display: block;
}

.lab-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--border);
}

.lab-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.lab-item h4 {
  font-size: 1rem;
  font-weight: 500;
}

.lab-item p {
  grid-column: 1 / -1;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.lab-item-tag {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  font-family: ui-monospace, monospace;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
  background: var(--bg);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

@media (min-width: 700px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 3rem; }
}

.footer-col h4 {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.footer-col ul li { margin-bottom: 0.625rem; }

.footer-col a {
  font-size: 0.9375rem;
  color: var(--text-muted);
  font-weight: 400;
}

.footer-col a:hover { color: var(--text); }

.footer-brand p {
  margin-top: 1rem;
  font-size: 0.875rem;
  max-width: 36ch;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

@media (min-width: 700px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ---------- Reveal animations (IntersectionObserver) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
.reveal[data-delay="5"] { transition-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Utilities ---------- */
.flow > * + * { margin-top: 1rem; }
.text-muted { color: var(--text-muted); }
.text-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8125rem; letter-spacing: -0.01em; }
.divider { height: 1px; background: var(--border); margin: 2rem 0; }
.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;
}

/* ---------- Page header (sub-pages) ---------- */
.page-header {
  padding: clamp(4rem, 7vw, 6rem) 0 clamp(3rem, 5vw, 4rem);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.page-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 40% at 100% 0%, rgba(0, 102, 204, 0.12), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.page-header > * { position: relative; z-index: 1; }

.page-header .eyebrow { margin-bottom: 1.5rem; }
.page-header h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  margin-bottom: 1.25rem;
}
.page-header .lead { max-width: 60ch; }

/* ---------- Anchor list ---------- */
.anchor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.anchor-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  transition: all 0.2s var(--ease);
}

.anchor-list a:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.anchor-list a::before {
  content: '';
  width: 6px;
  height: 1px;
  background: var(--text-muted);
  display: inline-block;
}
