/* ============================================================
   MENDELIAN INHERITANCE SIMULATOR — Design System
   Light theme defaults (dark overrides in darkmode.css)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  /* Brand */
  --primary:      #16A34A;
  --primary-dark: #15803D;
  --primary-light:#22C55E;
  --primary-fg:   #FFFFFF;
  --secondary:    #0EA5E9;
  --accent:       #D97706;

  /* Surfaces */
  --bg:           #F8FAFC;
  --surface:      #FFFFFF;
  --surface-alt:  #F0FDF4;
  --surface-muted:#F1F5F9;

  /* Text */
  --text:         #1E293B;
  --text-muted:   #64748B;
  --text-subtle:  #94A3B8;

  /* Borders */
  --border:       #E2E8F0;
  --border-strong:#CBD5E1;
  --border-focus: #16A34A;

  /* Feedback */
  --error:   #DC2626;
  --success: #16A34A;
  --warning: #D97706;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow:    0 1px 3px rgba(0,0,0,.1),  0 1px 2px -1px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.05);

  /* Geometry */
  --r-sm:   6px;
  --r:      10px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-full: 9999px;

  /* Typography */
  --font-heading: 'Exo 2', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;

  /* Nav */
  --nav-h:      60px;
  --nav-bg:     rgba(255,255,255,.92);
  --nav-border: rgba(226,232,240,.9);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

p { color: var(--text-muted); line-height: 1.7; }
p + p { margin-top: .75em; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
button { font-family: var(--font-body); cursor: pointer; }

/* ── Navigation ───────────────────────────────────────────── */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background .3s, box-shadow .3s;
  /* gradient bottom border via pseudo-element */
}
.main-nav::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--primary) 35%, var(--secondary) 65%, transparent 100%);
  opacity: .45;
  transition: opacity .3s;
}
.main-nav.scrolled {
  box-shadow: 0 4px 24px rgba(0,0,0,.1);
}
.main-nav.scrolled::after { opacity: .7; }

.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  gap: 12px;
}

/* Brand — DNA icon + gradient text */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  transition: filter .2s;
}
.nav-brand:hover { text-decoration: none; filter: brightness(1.15); }

.nav-brand-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  /* icon has its own gradient, not clipped */
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-text-fill-color: initial; /* break out of parent clip */
}
.nav-brand-icon svg { width: 15px; height: 15px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; }

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  display: block;
  padding: 6px 13px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--r-full);
  white-space: nowrap;
  transition: color .18s, background .18s, transform .15s, box-shadow .18s;
  text-decoration: none;
  position: relative;
}
.nav-links a:hover {
  color: var(--text);
  background: var(--surface-alt);
  text-decoration: none;
  transform: translateY(-1px);
}
.nav-links a.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(22,163,74,.35);
}

.nav-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

/* Hamburger (mobile only) */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 9px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s, border-color .2s;
}
.nav-hamburger:hover { background: var(--surface-alt); border-color: var(--border-strong); }
.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
  transform-origin: center;
}
/* Animate to X when open */
.main-nav.nav-open .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.main-nav.nav-open .nav-hamburger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.main-nav.nav-open .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Dark mode toggle */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.btn-icon:hover {
  color: var(--primary);
  background: var(--surface-alt);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,163,74,.12);
}
.btn-icon svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .4s cubic-bezier(.34,1.56,.64,1);
}
.btn-icon:hover svg { transform: rotate(22deg) scale(1.1); }

/* Mobile nav drawer */
@media (max-width: 768px) {
  .nav-hamburger { display: flex; }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--nav-border);
    padding: 10px 16px 16px;
    gap: 3px;
    overflow-x: visible;
    overflow-y: auto;
    /* hidden by default */
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform .25s ease, opacity .2s ease;
    z-index: 199;
  }
  .nav-links::before {
    content: '';
    position: absolute;
    top: 0; left: 24px; right: 24px;
    height: 1px;
    background: var(--border);
  }
  .main-nav.nav-open .nav-links {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }
  .nav-links a {
    padding: 9px 14px;
    border-radius: var(--r);
    font-size: .9375rem;
  }
  .nav-links a:hover { transform: none; }
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1;
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font-body);
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(22,163,74,.35); }

.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--surface-alt); }

.btn-ghost-white { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); }
.btn-ghost-white:hover { background: rgba(255,255,255,.22); }

.btn-lg { padding: 13px 28px; font-size: 1.0625rem; border-radius: var(--r-lg); }
.btn-full { width: 100%; }

/* ── Layout ───────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.page-body { padding: 36px 0 80px; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0F2027 0%, #203A43 45%, #2C5364 72%, #14532D 100%);
  padding: 88px 24px 100px;
  text-align: center;
  color: #fff;
}

.hero::before {
  content: '';
  position: absolute;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(34,197,94,.18) 0%, transparent 65%);
  top: -260px;
  left: 50%;
  transform: translateX(-50%);
  animation: heroGlow 7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes heroGlow {
  0%, 100% { opacity: .8; transform: translateX(-50%) scale(1); }
  50%       { opacity: 1;  transform: translateX(-50%) scale(1.1); }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: rgba(34,197,94,.18);
  border: 1px solid rgba(34,197,94,.35);
  border-radius: var(--r-full);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #86EFAC;
  margin-bottom: 24px;
}
.hero-eyebrow svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }

.hero h1 {
  color: #fff;
  font-size: clamp(2rem, 5.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #4ADE80, #38BDF8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  color: rgba(255,255,255,.72);
  font-size: 1.125rem;
  line-height: 1.75;
  max-width: 540px;
  margin: 0 auto 40px;
}

.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Trait Cards (Home) ───────────────────────────────────── */
.traits-section { padding: 64px 24px; }

.section-eyebrow {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--primary);
  margin-bottom: 8px;
}
.section-heading { font-size: 1.875rem; margin-bottom: 10px; }
.section-sub { color: var(--text-muted); font-size: 1.0625rem; max-width: 560px; }

.trait-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 36px;
}

.trait-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 18px 22px;
  text-align: center;
  transition: all .25s;
  text-decoration: none;
  display: block;
}
.trait-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(22,163,74,.08), var(--shadow-md);
  transform: translateY(-3px);
  text-decoration: none;
}

.trait-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.trait-icon svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.trait-card h3 { font-size: .9375rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.trait-card p  { font-size: .8rem; color: var(--text-muted); margin: 0; }

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, #0F2027 0%, #1e3a5f 60%, #14532D 100%);
  padding: 44px 24px;
  position: relative;
  overflow: hidden;
}
.page-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 78% 40%, rgba(34,197,94,.22) 0%, transparent 55%);
  pointer-events: none;
}
.page-header .container { position: relative; z-index: 1; }
.page-header h1 { color: #fff; font-size: clamp(1.5rem, 4vw, 2.375rem); font-weight: 800; margin-bottom: 6px; }
.page-header p  { color: rgba(255,255,255,.72); margin: 0; font-size: .9375rem; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 20px; }

/* ── Section title ────────────────────────────────────────── */
.sec-title {
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sec-badge {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--surface-alt);
  color: var(--primary);
  border: 1px solid rgba(22,163,74,.25);
}

/* ── Swatch Grid ──────────────────────────────────────────── */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 7px;
}

.swatch {
  height: 50px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .68rem;
  font-weight: 600;
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
  user-select: none;
  text-align: center;
  padding: 2px 4px;
  line-height: 1.2;
}
.swatch:hover { transform: scale(1.05); box-shadow: var(--shadow-md); }

/* ── Form ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
}

.form-select,
.form-input {
  width: 100%;
  padding: 9px 14px;
  font-family: var(--font-body);
  font-size: .9375rem;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}
.form-select:focus,
.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(22,163,74,.14);
}

.parent-panel {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  margin-bottom: 14px;
}
.parent-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--primary);
  margin-bottom: 10px;
}
.allele-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── Punnett Square ───────────────────────────────────────── */
.punnett-wrap { margin-top: 20px; }

.punnett-grid {
  display: grid;
  grid-template-columns: 60px 1fr 1fr;
  grid-template-rows: 34px auto auto;
  gap: 4px;
  font-size: .8rem;
  margin-top: 10px;
}
.punnett-corner { /* empty top-left cell */ }

.punnett-col-hdr {
  background: var(--secondary);
  color: #fff;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .72rem;
  text-align: center;
  padding: 4px 6px;
  word-break: break-all;
}
.punnett-row-hdr {
  background: var(--primary);
  color: #fff;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .72rem;
  text-align: center;
  padding: 4px 6px;
  min-height: 64px;
  word-break: break-all;
}
.punnett-cell {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 64px;
}
.punnett-genotype { font-family: 'Courier New', monospace; font-size: .68rem; color: var(--text-subtle); }
.punnett-phenotype { font-weight: 700; font-size: .78rem; color: var(--text); line-height: 1.25; }
.punnett-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); flex-shrink: 0; }

/* ── Results ──────────────────────────────────────────────── */
.results-box {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-top: 20px;
}
.results-hdr {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.results-hdr::before {
  content: '';
  display: block;
  width: 3px;
  height: 13px;
  background: var(--primary);
  border-radius: var(--r-full);
  flex-shrink: 0;
}

.child-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 9px;
}

.child-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 11px 8px;
  text-align: center;
  animation: fadeUp .3s ease both;
}
.child-card:nth-child(1) { animation-delay:   0ms; }
.child-card:nth-child(2) { animation-delay:  40ms; }
.child-card:nth-child(3) { animation-delay:  80ms; }
.child-card:nth-child(4) { animation-delay: 120ms; }
.child-card:nth-child(5) { animation-delay: 160ms; }
.child-card:nth-child(6) { animation-delay: 200ms; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}

.child-num   { font-size: .63rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-subtle); margin-bottom: 5px; }
.child-dot   { width: 30px; height: 30px; border-radius: 50%; margin: 0 auto 6px; border: 2px solid rgba(0,0,0,.1); }
.child-label { font-size: .78rem; font-weight: 600; color: var(--text); line-height: 1.3; }

.results-summary {
  margin-top: 12px;
  padding: 10px 13px;
  background: var(--surface-alt);
  border-radius: var(--r);
  border: 1px solid var(--border);
  font-size: .8125rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Divider ──────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Home About section ───────────────────────────────────── */
.home-about {
  background: var(--surface-alt);
  padding: 64px 24px;
}
.home-about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 36px;
}
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
}
.info-card h3 { font-size: 1.0625rem; margin-bottom: 12px; }
.info-text { font-size: .9375rem; color: var(--text-muted); }
.info-text + .info-text { margin-top: .75em; }

.steps { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.step  { display: flex; gap: 12px; align-items: flex-start; }
.step-num {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.step-text { font-size: .9375rem; color: var(--text-muted); }

/* ── Mendel diagram (home page) ───────────────────────────── */
.diagram-wrap { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.diagram-wrap img { width: 100%; }

/* ── Info list ────────────────────────────────────────────── */
.info-list { display: flex; flex-direction: column; gap: 8px; }
.info-list-item {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: .9375rem;
  color: var(--text-muted);
  align-items: flex-start;
}
.info-list-item:last-child { border-bottom: none; }
.info-list-dot {
  width: 7px;
  height: 7px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: .45em;
}

/* ── Height result ────────────────────────────────────────── */
.height-result-card {
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-top: 20px;
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: var(--surface);
  position: relative;
  margin-top: 0;
}

/* Gradient top border matching the nav bottom border */
.site-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--primary) 35%, var(--secondary) 65%, transparent 100%);
  opacity: .45;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 52px 24px 40px;
}

/* Brand */
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  margin-bottom: 12px;
}
.footer-brand:hover { text-decoration: none; filter: brightness(1.15); }

.footer-brand-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-text-fill-color: initial;
}
.footer-brand-icon svg { width: 15px; height: 15px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; }

.footer-tagline {
  font-size: .875rem;
  color: var(--text-subtle);
  line-height: 1.65;
  max-width: 280px;
  margin: 0;
}

/* Columns */
.footer-col-heading {
  font-family: var(--font-heading);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.footer-links a {
  font-size: .875rem;
  color: var(--text-subtle);
  text-decoration: none;
  transition: color .15s, transform .15s;
  display: inline-block;
}
.footer-links a:hover {
  color: var(--primary);
  transform: translateX(3px);
  text-decoration: none;
}

.footer-built {
  font-size: .75rem;
  color: var(--text-subtle);
  margin: 0;
  opacity: .7;
}

/* Bottom bar */
.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  font-size: .8125rem;
  color: var(--text-subtle);
  gap: 12px;
  flex-wrap: wrap;
}
.footer-bar a { color: var(--primary); font-weight: 600; text-decoration: none; }
.footer-bar a:hover { text-decoration: underline; }
.footer-bar-right { font-family: var(--font-heading); font-size: .75rem; font-weight: 600; opacity: .5; }

@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; padding: 40px 20px 28px; }
  .footer-col:first-child { grid-column: 1 / -1; }
  .footer-tagline { max-width: none; }
  .footer-bar-right { display: none; }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .footer-bar { flex-direction: column; text-align: center; }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .trait-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .two-col           { grid-template-columns: 1fr; gap: 20px; }
  .trait-grid        { grid-template-columns: repeat(2, 1fr); }
  .home-about-grid   { grid-template-columns: 1fr; }
  .hero              { padding: 64px 20px 80px; }
  .traits-section    { padding: 44px 20px; }
  .page-header       { padding: 36px 20px; }
  .page-body         { padding: 24px 0 60px; }
  .home-about        { padding: 44px 20px; }
  .section-heading   { font-size: 1.5rem; }
}
@media (max-width: 480px) {
  .trait-grid    { grid-template-columns: 1fr 1fr; }
  .child-cards   { grid-template-columns: repeat(2, 1fr); }
  .swatch-grid   { grid-template-columns: repeat(3, 1fr); }
  .allele-row    { grid-template-columns: 1fr; }
  .hero-eyebrow  { font-size: .7rem; }
}
