:root {
  /* DNA-inspired palette */
  --base-a: #4CAF50;   /* Adenine — grounding green */
  --base-t: #F44336;   /* Thymine — urgent red */
  --base-c: #2196F3;   /* Cytosine — clear blue */
  --base-g: #FFEB3B;   /* Guanine — optimistic yellow */
  --backbone: #F5F5F5; /* Structural background */
  --bond: #BDBDBD;     /* Connective gray */

  /* Site-wide palette */
  --bg: #f9fafb;
  --fg: #1a1a1a;
  --muted: #555;
  --accent: var(--base-a);
  --accent-2: var(--base-c);
  --line: #ddd;
  --card: #ffffff;
  --code: #f4f4f4;
  --shadow: rgba(0, 0, 0, 0.08);
  --maxw: 1080px;
}

/* Typography and layout */
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  line-height: 1.7;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

header, main, footer {
  width: 100%;
}
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px;
}

/* Hero block */
.hero {
  padding: 56px 0 24px;
  display: grid;
  gap: 24px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0.2px;
  color: var(--base-a);
}
.hero p.subhead {
  margin: 0;
  color: var(--base-c);
  font-size: clamp(16px, 2.2vw, 20px);
}
.hero .media {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px var(--shadow);
}
.hero .media img {
  width: 100%;
  height: auto;
  display: block;
}

/* Pull quote */
.pull {
  padding: 14px 16px;
  border-left: 3px solid var(--base-t);
  background: #fbeaea;
  color: var(--fg);
  border-radius: 6px;
  margin: 8px 0 0;
  font-style: italic;
}

/* Breadcrumbs */
nav.breadcrumbs {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}
nav.breadcrumbs a {
  color: var(--muted);
}

/* Section rhythm */
section {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
section:first-of-type {
  border-top: none;
}
section:nth-of-type(even) {
  background: var(--backbone);
}

/* Headings */
h2 {
  font-size: clamp(22px, 3vw, 32px);
  margin: 0 0 6px;
  color: var(--base-c);
}
h3 {
  font-size: clamp(18px, 2.2vw, 22px);
  margin: 14px 0 6px;
}
p {
  margin: 10px 0 0;
  color: var(--fg);
}

/* Grid layout */
.grid {
  display: grid;
  gap: 18px;
}
@media (min-width: 900px) {
  .grid.two {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* Card block */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 10px 20px var(--shadow);
}

/* Lists */
ul, ol {
  margin: 10px 0 0 18px;
}
li {
  margin: 8px 0;
}

/* Fact block */
.fact {
  background: #f5f9ff;
  border: 1px solid #dce6f5;
  border-radius: 10px;
  padding: 14px 16px;
}

/* Inline code */
.kbd {
  background: var(--code);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95em;
}

/* CTA buttons */
.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f0f0f0;
  color: var(--fg);
  text-decoration: none;
}
.btn.primary {
  background: linear-gradient(180deg, var(--base-c), var(--accent-2));
  border-color: var(--accent-2);
  color: #fff;
}

/* Footer */
.small {
  font-size: 14px;
  color: var(--muted);
}
footer .links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}
footer {
  background: var(--backbone);
  border-top: 1px solid var(--bond);
  padding-top: 1rem;
  color: var(--muted);
}

/* DNA rhythm classes */
.pair {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  padding: 2rem 0;
}
.pair:nth-of-type(even) {
  flex-direction: row-reverse;
  background: var(--backbone);
}
.bond {
  border-top: 1px dashed var(--bond);
  margin: 2rem 0;
}
.helix {
  background: linear-gradient(to right, var(--base-a), var(--base-t), var(--base-c), var(--base-g));
  -webkit-background-clip: text;
  color: transparent;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
}

/* Semantic roles */
.signal { color: var(--base-t); }
.invitation { color: var(--base-g); }
.pillar { color: var(--base-c); }
.scaffold { background: var(--backbone); }
.topnav {
  background: var(--backbone);
  border-bottom: 1px solid var(--bond);
  padding: 12px 0;
}
.topnav .wrap {
  display: flex;
  gap: 18px;
  font-size: 15px;
}
.topnav a {
  color: var(--muted);
  text-decoration: none;
}
.topnav a:hover {
  color: var(--base-c);
}
.footer .links {
  display: flex;
  justify-content: center;
  gap: 1.5rem; /* optional spacing between links */
}
/* ── HIDE ON DESKTOP ─────────────────────────────────────────── */
.menu-toggle {
  display: none;               /* always hidden above 768px */
}

/* ── MOBILE (≤768px) ─────────────────────────────────────────── */
@media (max-width: 768px) {
  /* show the toggle */
  .menu-toggle {
    display: flex;
    background: transparent !important;
    border: none !important;
    padding: 0.5rem;           /* your preferred tap target */
    align-items: center;
    justify-content: center;
  }

  .menu-toggle .bar {
    display: block;
    width: 24px;
    height: 2px;
    margin: 4px 0;             /* tighter stack */
    background-color: #333;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  /* wrap: stack links and allow scroll within viewport */
  .topnav .wrap {
    flex-direction: column;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    gap: 0;                    /* no extra gap */
  }

  /* pills: slimmer, closer, slightly smaller text */
  .topnav .wrap a {
    display: none;
    width: 100%;
    padding: 0.35rem 0.7rem;   /* slimmer vertical and horizontal padding */
    font-size: 0.9rem;         /* minor reduction */
    line-height: 1.2;
    text-align: left;
    background: #fff;
    border-bottom: 1px solid #eee;
    margin: 0;                 /* guaranteed no extra gap */
    white-space: nowrap;
  }

  /* show when open */
  .topnav.open .wrap a {
    display: block;
  }

  /* morph to X when open */
  .topnav.open .menu-toggle .bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  .topnav.open .menu-toggle .bar:nth-child(2) {
    opacity: 0;
  }
  .topnav.open .menu-toggle .bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
}
@media (max-width: 768px) {
  .menu-toggle {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.5rem !important;
    background: transparent !important;
    border: none !important;
  }

  .menu-toggle .bar {
    display: block !important;
    width: 24px !important;
    height: 2px !important;
    margin: 4px 0 !important;
    background-color: #333 !important;
    transition: transform 0.3s ease, opacity 0.3s ease !important;
  }
}
