/* ============================================================
   Matt Treiber — personal site
   Dark editorial, built on Auto-LT tokens.
   ============================================================ */

/* Force dark palette; tokens.css ships light by default. */
:root {
  --bg-canvas:    var(--slate-1000);
  --bg-surface:   var(--slate-900);
  --bg-raised:    var(--slate-800);
  --bg-sunken:    #06080c;
  --bg-inverse:   var(--slate-50);

  --fg-primary:   #f0f3f7;
  --fg-secondary: #c4cad3;
  --fg-tertiary:  var(--slate-500);
  --fg-disabled:  var(--slate-600);
  --fg-on-accent: #ffffff;

  --border-subtle:  rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.10);
  --border-strong:  rgba(255, 255, 255, 0.18);

  --accent-primary-soft: rgba(40, 114, 238, 0.16);

  --shadow-md: 0 4px 12px -2px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
  --shadow-lg: 0 12px 32px -8px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06);

  --radius-card:    var(--radius-lg);
  --container-pad:  32px;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: clip;
}
body {
  margin: 0;
  background: var(--bg-canvas);
  color: var(--fg-primary);
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overflow-x: clip;
}

img, svg, pre { max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* Only wrap long tokens (URLs, identifiers) in body copy — not headings. */
p, dd, .repo-desc, .skill-row dd, code { overflow-wrap: anywhere; }

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-emphasized),
              transform var(--dur-fast) var(--ease-emphasized),
              box-shadow var(--dur-base) var(--ease-emphasized),
              border-color var(--dur-base) var(--ease-emphasized);
  white-space: nowrap;
}
.label-short { display: none; }
.btn:active { transform: scale(0.97); }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-primary {
  background: var(--blue-500);
  color: #fff;
}
.btn-primary:hover { background: var(--blue-600); }
.btn-ghost {
  background: transparent;
  color: var(--fg-primary);
  border-color: var(--border-default);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--border-strong);
}

/* ---------- NAV ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  display: flex;
  align-items: center;
  background: rgba(10, 12, 16, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-base) var(--ease-emphasized),
              background var(--dur-base) var(--ease-emphasized);
}
.nav.scrolled {
  border-bottom-color: var(--border-subtle);
  background: rgba(10, 12, 16, 0.78);
}
.nav-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 15px;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}
.nav-links {
  display: flex;
  gap: 22px;
  font-size: 14px;
  color: var(--fg-secondary);
}
.nav-links a {
  position: relative;
  padding: 4px 0;
  transition: color var(--dur-base) var(--ease-emphasized);
}
.nav-links a:hover { color: var(--fg-primary); }
.nav-cta {
  display: flex;
  gap: 10px;
  align-items: center;
}
@media (max-width: 980px) {
  .nav-links { display: none; }
}
@media (max-width: 600px) {
  .nav-inner { padding: 0 16px; gap: 12px; }
  .nav-brand { gap: 8px; min-width: 0; }
  .brand-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-cta { gap: 8px; flex-shrink: 0; }
  .nav-cta .btn-ghost { display: none; }
  .nav-cta .btn-primary { height: 38px; padding: 0 14px; }
  .label-full { display: none; }
  .label-short { display: inline; }
}
@media (max-width: 360px) {
  .brand-text { display: none; }
  .nav-inner { padding: 0 12px; }
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  padding: 88px 0 72px;
  overflow: hidden;
}
.hero-grid {
  position: absolute;
  inset: -10% -10% -30% -10%;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(40,114,238,0.18), transparent 60%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: block;
}
.hero-copy { min-width: 0; }
.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 12px;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  margin-bottom: 32px;
}
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green-500);
  box-shadow: 0 0 0 3px rgba(21,168,95,0.18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(21,168,95,0.18); }
  50% { box-shadow: 0 0 0 6px rgba(21,168,95,0.04); }
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0 0 32px;
  max-width: 17ch;
  overflow-wrap: anywhere;
}
.hero-line { display: block; }
.hero-line.dim { color: var(--fg-tertiary); }
.hero-line .accent {
  color: var(--fg-primary);
  text-decoration: underline;
  text-decoration-color: rgba(40, 114, 238, 0.55);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.12em;
  text-decoration-skip-ink: none;
}
.hero-sub {
  max-width: 60ch;
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.55;
  color: var(--fg-secondary);
  margin: 0 0 40px;
}
.ilink {
  color: var(--fg-primary);
  border-bottom: 1px solid var(--border-strong);
  transition: border-color var(--dur-base) var(--ease-emphasized),
              color var(--dur-base) var(--ease-emphasized);
}
.ilink:hover {
  color: var(--blue-400);
  border-bottom-color: var(--blue-400);
}
.hero-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

/* Stats */
.hero-strip {
  margin-top: 16px;
  padding-top: 28px;
  border-top: 1px solid var(--border-subtle);
}
.hero-strip-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin: 0 0 20px;
  max-width: 80ch;
}
.hero-strip-meta .caption { color: var(--blue-400); }
.hero-strip-sub {
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-secondary);
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 0;
  padding: 0;
}
.stat {
  padding: 8px 24px 8px 0;
  border-right: 1px solid var(--border-subtle);
}
.stat:last-child { border-right: none; }
.stat dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-secondary);
  margin-bottom: 8px;
  line-height: 1.35;
}
.stat dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.02em;
  font-weight: 700;
  line-height: 1;
}
.stat .num-suffix {
  color: var(--blue-400);
}
@media (max-width: 800px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-right: none; border-bottom: 1px solid var(--border-subtle); padding: 16px 0; }
  .stat:nth-last-child(-n+2) { border-bottom: none; }
}

/* ---------- SECTIONS ---------- */
.section {
  padding: 96px 0;
  position: relative;
}
.section-alt {
  background: var(--bg-sunken);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.section-head {
  margin-bottom: 48px;
  max-width: 720px;
}
.section-head .caption {
  display: block;
  margin-bottom: 16px;
  color: var(--fg-tertiary);
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0 0 16px;
}
.section-sub {
  font-size: 17px;
  color: var(--fg-secondary);
  margin: 0;
  max-width: 60ch;
}

/* ---------- ROLE / EXPERIENCE ---------- */
.role {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 64px;
  padding: 56px 0;
  border-top: 1px solid var(--border-subtle);
}
.role:last-child { border-bottom: 1px solid var(--border-subtle); }
.role-head {
  display: contents;
}
.role-meta .caption.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--fg-tertiary);
  text-transform: none;
  margin-bottom: 16px;
  display: block;
}
.role-co {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 4px;
}
.role-title {
  color: var(--fg-secondary);
  margin: 0;
  font-size: 15px;
}
.role-pitch {
  font-size: 19px;
  line-height: 1.5;
  color: var(--fg-primary);
  margin: 0 0 32px;
  letter-spacing: -0.005em;
}
.role-bullets {
  grid-column: 2;
  list-style: none;
  margin: 0;
  padding: 0;
}
.role-bullets li {
  padding: 20px 0;
  border-top: 1px solid var(--border-subtle);
}
.role-bullets li:first-child { border-top: none; padding-top: 0; }
.bullet-title {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: -0.005em;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--fg-primary);
}
.role-bullets p {
  margin: 0;
  color: var(--fg-secondary);
  font-size: 15px;
  line-height: 1.6;
}
.role-bullets strong {
  color: var(--fg-primary);
  font-weight: 700;
}
.tag-row {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.tag {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--fg-secondary);
  letter-spacing: 0;
}
@media (max-width: 800px) {
  .role { grid-template-columns: 1fr; gap: 32px; }
  .role-bullets, .tag-row { grid-column: 1; }
}

/* ---------- SYSTEMS ---------- */
.system-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.system-card {
  min-height: 280px;
  padding: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform var(--dur-base) var(--ease-emphasized),
              border-color var(--dur-base) var(--ease-emphasized),
              background var(--dur-base) var(--ease-emphasized);
}
.system-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-default);
  background: var(--bg-raised);
}
.system-card-featured {
  grid-column: span 2;
  min-height: 240px;
}
.system-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  color: var(--blue-400);
  letter-spacing: 0.02em;
}
.system-title {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -0.014em;
  font-weight: 700;
  margin: 0;
}
.system-card p {
  margin: 0;
  color: var(--fg-secondary);
  font-size: 15px;
  line-height: 1.6;
}
.system-list {
  list-style: none;
  margin: auto 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  gap: 10px;
}
.system-list li {
  position: relative;
  padding-left: 18px;
  color: var(--fg-secondary);
  font-size: 14px;
  line-height: 1.55;
}
.system-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--blue-500);
}
@media (max-width: 800px) {
  .system-grid { grid-template-columns: 1fr; }
  .system-card,
  .system-card-featured { grid-column: auto; min-height: auto; }
}

/* ---------- LEADERSHIP ---------- */
.leadership-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.leadership-card {
  padding: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
}
.leadership-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.012em;
  font-weight: 700;
  margin: 0 0 18px;
}
.proof-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.proof-list li {
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  color: var(--fg-secondary);
  font-size: 14px;
  line-height: 1.58;
}
.proof-list li:first-child {
  padding-top: 0;
  border-top: none;
}
@media (max-width: 1000px) {
  .leadership-grid { grid-template-columns: 1fr; }
}

/* ---------- OPEN SOURCE ---------- */
.featured-repo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  margin-bottom: 32px;
}
.featured-meta {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}
.featured-meta .caption {
  color: var(--blue-400);
}
.featured-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.featured-desc {
  color: var(--fg-secondary);
  font-size: 16px;
  line-height: 1.55;
  margin: 0;
}
.featured-stats {
  display: flex;
  gap: 16px;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-tertiary);
}
.featured-art {
  background: linear-gradient(160deg, #0d1018, #14171c 60%, #0a0c10);
  border-left: 1px solid var(--border-subtle);
  padding: 32px;
  overflow: hidden;
  position: relative;
}
.featured-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, #000 30%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent);
  pointer-events: none;
}
.code-block {
  margin: 0;
  position: relative;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg-secondary);
}
.c-com { color: var(--fg-tertiary); }
.c-kw  { color: #c084fc; }
.c-ty  { color: var(--blue-400); }
.c-fn  { color: #5eead4; }

@media (max-width: 800px) {
  .featured-repo { grid-template-columns: 1fr; }
  .featured-art { border-left: none; border-top: 1px solid var(--border-subtle); }
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}
.repo-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  min-height: 160px;
  transition: transform var(--dur-base) var(--ease-emphasized),
              border-color var(--dur-base) var(--ease-emphasized),
              background var(--dur-base) var(--ease-emphasized);
}
.repo-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-default);
  background: var(--bg-raised);
}
.repo-card.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 0%, var(--bg-raised) 50%, var(--bg-surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.repo-card.empty {
  background: transparent;
  border-style: dashed;
  align-items: center;
  justify-content: center;
  color: var(--fg-tertiary);
}
.repo-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--fg-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.repo-name .arr {
  color: var(--fg-tertiary);
  transition: transform var(--dur-base) var(--ease-emphasized), color var(--dur-base);
  font-weight: 400;
}
.repo-card:hover .arr {
  color: var(--blue-400);
  transform: translate(2px, -2px);
}
.repo-desc {
  font-size: 14px;
  color: var(--fg-secondary);
  line-height: 1.5;
  margin: 0;
  flex: 1;
}
.repo-meta {
  display: flex;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-tertiary);
  align-items: center;
}
.lang-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--blue-400);
  margin-right: 6px;
}
.repo-fallback {
  text-align: center;
  color: var(--fg-tertiary);
  margin-top: 32px;
}

/* ---------- ABOUT ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 96px;
}
.about-bio .caption { color: var(--fg-tertiary); display: block; margin-bottom: 16px; }
.about-bio .lead {
  font-size: 19px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  color: var(--fg-primary);
  margin: 0 0 24px;
}
.about-bio p {
  font-size: 16px;
  color: var(--fg-secondary);
  line-height: 1.65;
  margin: 0 0 20px;
}
.about-skills .caption {
  display: block;
  margin-bottom: 24px;
  color: var(--fg-tertiary);
}
.about-skills {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.about-panel {
  padding: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
}
.skill-list { margin: 0; padding: 0; }
.skill-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--border-subtle);
}
.skill-row:last-child { border-bottom: 1px solid var(--border-subtle); }
.skill-row dt {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-tertiary);
  letter-spacing: 0.02em;
  padding-top: 2px;
}
.skill-row dd {
  margin: 0;
  font-size: 14px;
  color: var(--fg-secondary);
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.education-list {
  display: grid;
  gap: 18px;
}
.education-item {
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}
.education-item:first-child {
  padding-top: 0;
  border-top: none;
}
.education-item h3 {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: -0.005em;
  font-weight: 700;
  margin: 0 0 6px;
}
.education-item p {
  margin: 0;
  color: var(--fg-secondary);
  font-size: 14px;
  line-height: 1.6;
}
@media (max-width: 1000px) {
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .skill-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- CONTACT ---------- */
.contact { padding: 160px 0; }
.contact-inner {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.contact-inner .caption { color: var(--fg-tertiary); }
.contact-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0;
}
.contact-title .dim { color: var(--fg-tertiary); }
.contact-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}

/* ---------- FOOTER ---------- */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 32px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 600ms var(--ease-emphasized), transform 600ms var(--ease-emphasized);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Responsive overrides
   ============================================================ */

@media (max-width: 600px) {
  /* Layout */
  .container { padding: 0 18px; }

  /* Hero */
  .hero { padding: 56px 0 48px; }
  .hero-meta { margin-bottom: 22px; max-width: 100%; }
  .hero-title {
    font-size: clamp(31px, 10.2vw, 44px);
    line-height: 1.05;
    margin-bottom: 22px;
    max-width: 100%;
  }
  .hero-sub { margin-bottom: 28px; line-height: 1.58; }
  .hero-actions { gap: 10px; margin-bottom: 34px; }
  .hero-actions .btn-lg,
  .contact-actions .btn-lg {
    height: 44px;
    padding: 0 16px;
    font-size: 14px;
    max-width: 100%;
  }
  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding-top: 20px;
  }
  .stat { min-width: 0; padding: 14px 10px 14px 0; }
  .stat dt { font-size: 10px; letter-spacing: 0.045em; overflow-wrap: anywhere; }
  .stat dd { font-size: clamp(24px, 9vw, 34px); }

  /* Sections */
  .section { padding: 72px 0; }
  .section-head { margin-bottom: 36px; }
  .section-title { font-size: clamp(31px, 9vw, 40px); }
  .section-sub { font-size: 16px; line-height: 1.6; }

  /* Role */
  .role { padding: 40px 0; gap: 24px; }
  .role-co { font-size: 28px; }
  .role-pitch { font-size: 17px; }

  /* Cards */
  .system-card, .leadership-card, .about-panel { padding: 22px; }
  .featured-meta, .featured-art { padding: 24px; }
  .featured-title { font-size: 26px; }
  .repo-meta, .featured-stats { flex-wrap: wrap; row-gap: 8px; }

  /* Contact + footer */
  .contact { padding: 92px 0; }
  .contact-title { font-size: clamp(36px, 11vw, 50px); }
  .contact-actions { width: 100%; }
  .contact-actions .btn-primary { width: 100%; white-space: normal; text-align: center; }
  .footer-inner { flex-direction: column; gap: 8px; }
}

@media (max-width: 430px) {
  .container { padding: 0 16px; }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .hero-actions .btn-lg { width: 100%; }
  .hero-stats { column-gap: 8px; }
  .stat { padding-right: 6px; }
  .tag { height: auto; min-height: 28px; padding: 6px 10px; line-height: 1.25; }
}

@media (max-width: 340px) {
  .container { padding: 0 14px; }
  .hero-title { font-size: 30px; }
  .hero-stats { grid-template-columns: 1fr; }
  .stat:nth-last-child(-n+2) { border-bottom: 1px solid var(--border-subtle); }
  .stat:last-child { border-bottom: none; }
}

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