/* ==========================================================
   RNAtlas — project page styles
   ========================================================== */

:root {
  /* ---- Palette inputs: only these change per palette / theme ----
     --bg, --surface, --text, and four molecule colors --c1..--c4
     (c1 = main accent, c2/c3 = secondary accents, c4 = warm highlight) */
  --bg: #f6f3ec; --surface: #ffffff; --text: #1a1d29;
  --c1: #1f3fbf; --c2: #e5533d; --c3: #2a9d6f; --c4: #e0a21b;

  /* ---- Derived tokens ---- */
  --bg-alt: color-mix(in srgb, var(--bg) 95%, var(--text));
  --surface-2: color-mix(in srgb, var(--surface) 96%, var(--text));
  --border: color-mix(in srgb, var(--text) 12%, transparent);
  --muted: color-mix(in srgb, var(--text) 64%, var(--bg));
  --body: color-mix(in srgb, var(--text) 84%, var(--bg));
  --accent: var(--c1);
  --accent-soft: color-mix(in srgb, var(--c1) 11%, transparent);
  --accent-2: var(--c2);
  --accent-3: var(--c3);
  --shadow: 0 1px 2px color-mix(in srgb, var(--text) 5%, transparent), 0 6px 20px color-mix(in srgb, var(--text) 6%, transparent);

  /* Nucleotide colors (used for small accents) */
  --base-a: var(--c2);
  --base-u: var(--c4);
  --base-g: var(--c3);
  --base-c: var(--c1);

  --radius: 14px;
  --maxw: 1120px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.2; }

svg { stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

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

/* ---------------- NAV ---------------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
  transition: background .3s, padding .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
  padding: 12px 32px;
}
.nav__logo {
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem;
  color: var(--text); letter-spacing: -0.01em;
}
.nav__logo span { color: var(--accent); }
.nav__logo:hover { text-decoration: none; }
.nav__links { display: flex; gap: 28px; }
.nav__links a { color: var(--muted); font-size: .92rem; font-weight: 500; transition: color .2s; }
.nav__links a:hover, .nav__links a.is-active { color: var(--text); text-decoration: none; }
.nav__toggle { display: none; }

/* ---------------- HERO ---------------- */
.hero {
  position: relative; height: 100vh; min-height: 560px;
  display: flex; align-items: center; justify-content: center;
  text-align: center; overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 50%, color-mix(in srgb, var(--bg) 92%, transparent) 0%, color-mix(in srgb, var(--bg) 55%, transparent) 45%, transparent 80%),
    linear-gradient(color-mix(in srgb, var(--text) 5%, transparent) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(90deg, color-mix(in srgb, var(--text) 5%, transparent) 1px, transparent 1px) 0 0 / 36px 36px,
    var(--bg);
}
#rnaCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__content { position: relative; z-index: 2; padding: 0 20px; }
.hero__welcome { margin: 0; font-size: clamp(1.1rem, 2.2vw, 1.5rem); color: var(--text); opacity: .85; }
.hero__title {
  font-size: clamp(3.2rem, 9vw, 6.5rem); font-weight: 700; letter-spacing: -0.03em;
  margin: 4px 0 6px;
}
.hero__title span { color: var(--accent); }
.hero__phonetic { margin: 0; font-family: var(--font-mono); font-style: italic; color: var(--muted); font-size: 1rem; }
.hero__tagline { margin: 22px auto 0; max-width: 540px; color: var(--muted); font-size: 1.02rem; }
.hero__scroll {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--muted); font-size: .8rem; letter-spacing: .05em;
}
.hero__scroll:hover { color: var(--text); text-decoration: none; }
.hero__scroll svg { animation: bob 2s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ---------------- SECTIONS ---------------- */
.section { padding: 110px 0; }
.section--alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.eyebrow {
  margin: 0 0 10px; font-family: var(--font-mono); font-size: .8rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.section__title { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 600; letter-spacing: -0.02em; margin-bottom: 28px; }
.section__lead { color: var(--muted); margin: -12px 0 32px; }
.prose { max-width: 760px; color: var(--body); }
.prose p { margin: 0 0 18px; }
.prose strong { color: var(--text); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------------- OVERVIEW ---------------- */
.overview { display: grid; grid-template-columns: 1fr 260px; gap: 56px; align-items: start; }
.overview .targets { position: sticky; top: 110px; margin-top: 64px; }
.targets {
  list-style: none; margin: 0; padding: 24px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface);
  display: flex; flex-direction: column; gap: 14px;
}
.targets li { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 1.1rem; }
.targets__dot { width: 10px; height: 10px; border-radius: 50%; }
.targets__dot--a { background: var(--accent-2); box-shadow: 0 0 12px var(--accent-2); }  /* protein */
.targets__dot--g { background: var(--base-u); box-shadow: 0 0 12px var(--base-u); }      /* DNA */
.targets__dot--u { background: var(--accent); box-shadow: 0 0 12px var(--accent); }      /* RNA */
.targets .targets__note {
  font-family: var(--font-mono); font-size: .78rem; color: var(--muted);
  border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px;
}

/* ---------------- PIPELINE ---------------- */
.pipeline {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; counter-reset: step;
  position: relative;
}
.pipeline::before {
  content: ""; position: absolute; top: 34px; left: 8%; right: 8%; height: 1px;
  background: linear-gradient(90deg, var(--base-a), var(--base-u), var(--base-g), var(--base-c));
  opacity: .5;
}
.pipeline__step {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 20px 24px;
}
.pipeline__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--accent); color: var(--accent);
  font-family: var(--font-mono); font-size: .82rem; margin-bottom: 16px;
}
.pipeline__step h3 { font-size: 1.05rem; margin-bottom: 8px; }
.pipeline__step p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; }

/* ---------------- FEATURES ---------------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; transition: transform .25s, border-color .25s, background .25s;
}
.feature:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c1) 40%, transparent); box-shadow: 0 10px 30px color-mix(in srgb, var(--text) 9%, transparent); }
.feature__icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 18px;
}
.feature__icon svg { width: 24px; height: 24px; }
.feature h3 { font-size: 1.12rem; margin-bottom: 10px; }
.feature p { margin: 0; color: var(--muted); font-size: .94rem; }

.extensions {
  margin-top: 36px; padding: 26px 28px; border-radius: var(--radius);
  border: 1px dashed var(--border);
}
.extensions__title { font-size: .95rem; font-family: var(--font-mono); font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.extensions ul { margin: 0; padding-left: 18px; color: var(--body); }
.extensions li { margin-bottom: 8px; }
.extensions li::marker { color: var(--accent); }

/* ---------------- LINKS ---------------- */
.links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.link-card {
  display: flex; align-items: center; gap: 16px; padding: 24px 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--font-display); font-size: 1.15rem; font-weight: 500;
  transition: border-color .25s, transform .25s;
}
.link-card svg { width: 28px; height: 28px; color: var(--accent); flex-shrink: 0; }
.link-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-3px); }
.link-card.is-disabled { cursor: default; opacity: .75; }
.link-card.is-disabled:hover { transform: none; border-color: var(--border); }
.badge {
  margin-left: auto; font-style: normal; font-family: var(--font-mono); font-size: .7rem;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--border); border-radius: 99px; padding: 4px 10px; white-space: nowrap;
}

/* ---------------- DELIVERABLES ---------------- */
.deliverables { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.deliverable {
  display: flex; align-items: center; gap: 18px; padding: 18px 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.deliverable__icon {
  width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--surface-2); color: var(--muted);
}
.deliverable__icon svg { width: 20px; height: 20px; }
.deliverable.is-ready .deliverable__icon { background: var(--accent-soft); color: var(--accent); }
.deliverable__body { flex: 1; min-width: 0; }
.deliverable__title { font-family: var(--font-display); font-weight: 500; font-size: 1rem; }
.deliverable__meta { font-family: var(--font-mono); font-size: .74rem; color: var(--muted); margin-top: 2px; }
.deliverable__action {
  font-family: var(--font-mono); font-size: .76rem; padding: 7px 14px; border-radius: 99px;
  border: 1px solid var(--accent); color: var(--accent); white-space: nowrap;
}
.deliverable__action:hover { background: var(--accent); color: var(--bg); text-decoration: none; }
.deliverable:not(.is-ready) { opacity: .7; }

/* ---------------- TEAM ---------------- */
.team__group {
  font-family: var(--font-mono); font-size: .82rem; font-weight: 500; color: var(--muted);
  text-transform: uppercase; letter-spacing: .12em; margin: 8px 0 18px;
}
.team { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; margin-bottom: 44px; }
.member { text-align: center; }
.member__avatar {
  width: 112px; height: 112px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--muted);
}
.member__avatar img { width: 100%; height: 100%; object-fit: cover; }
.member__name { font-family: var(--font-display); font-weight: 500; font-size: 1rem; }
.member__role { font-size: .84rem; color: var(--muted); }
.member__links { display: flex; justify-content: center; gap: 10px; margin-top: 6px; font-size: .8rem; }

/* ---------------- FOOTER ---------------- */
.footer { border-top: 1px solid var(--border); padding: 56px 0 28px; background: var(--bg); }
.footer__inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer__brand p { color: var(--muted); max-width: 360px; font-size: .92rem; margin-top: 12px; }
.footer__col { display: flex; flex-direction: column; gap: 8px; }
.footer__col h4 { font-size: .9rem; margin-bottom: 6px; }
.footer__col a { color: var(--muted); font-size: .9rem; }
.footer__col a:hover { color: var(--text); }
.footer__bottom { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--muted); font-size: .82rem; }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 1000px) {
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .pipeline::before { display: none; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .team { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .container { padding: 0 16px; }
  .nav, .nav.is-scrolled { padding: 14px 16px; }
  .nav__toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 6px;
    width: 40px; height: 40px; background: none; border: 0; cursor: pointer; padding: 8px;
  }
  .nav__toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s; }
  .nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav__links {
    position: fixed; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: color-mix(in srgb, var(--bg) 97%, transparent); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav__links.is-open { max-height: 400px; }
  .nav__links a { padding: 14px 20px; border-top: 1px solid var(--border); }

  .section { padding: 76px 0; }
  .overview { grid-template-columns: 1fr; gap: 32px; }
  .pipeline, .features, .links, .deliverables { grid-template-columns: 1fr; }
  .team { grid-template-columns: repeat(2, 1fr); }
  .member__avatar { width: 92px; height: 92px; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
  .deliverable { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__scroll svg { animation: none; }
}

/* ---------------- Palette accents: rotate coral / violet / green ---------------- */
.feature:nth-child(3n+2) .feature__icon { background: color-mix(in srgb, var(--c2) 12%, transparent); color: var(--accent-2); }
.feature:nth-child(3n+3) .feature__icon { background: color-mix(in srgb, var(--c3) 12%, transparent); color: var(--accent-3); }
.feature:nth-child(3n+2):hover { border-color: color-mix(in srgb, var(--c2) 40%, transparent); }
.feature:nth-child(3n+3):hover { border-color: color-mix(in srgb, var(--c3) 40%, transparent); }
.pipeline__step:nth-child(2) .pipeline__num, .pipeline__step:nth-child(5) .pipeline__num { border-color: var(--accent-2); color: var(--accent-2); }
.pipeline__step:nth-child(3) .pipeline__num { border-color: var(--accent-3); color: var(--accent-3); }
.pipeline__step:nth-child(4) .pipeline__num { border-color: var(--base-u); color: var(--base-u); }
.member__avatar {
  border: 2px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              linear-gradient(135deg, var(--accent-2), var(--accent), var(--base-u)) border-box;
}
.link-card:nth-child(2) svg { color: var(--accent-2); }

/* ---------------- Light theme details ---------------- */
.pipeline__step, .feature, .link-card, .deliverable, .targets { box-shadow: var(--shadow); }
.section--alt .feature, .section--alt .deliverable, .section--alt .targets { background: var(--surface); }
.hero__welcome { color: var(--muted); }
.hero__phonetic { color: var(--muted); }
.pipeline::before { opacity: .35; }
.badge { background: var(--surface-2); }
.member__avatar { color: var(--text); }
.extensions { background: color-mix(in srgb, var(--surface) 45%, transparent); }

/* Logo: "RN" ink → gradient "A" → "tlas" cobalt */
.logo__rn { color: var(--text); }
.logo__a {
  background: linear-gradient(90deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--accent);
}
.logo__tlas { color: var(--accent); }
.nav__logo span, .hero__title span { color: inherit; }
.nav__logo .logo__tlas, .hero__title .logo__tlas { color: var(--accent); }
.nav__logo .logo__rn, .hero__title .logo__rn { color: var(--text); }

/* cursor-following RNA */
#cursorRna { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }
@media (hover: none), (prefers-reduced-motion: reduce) { #cursorRna { display: none; } }

/* ==========================================================
   PALETTES  (html[data-palette] × html[data-theme])
   ========================================================== */
/* 1 · Paper — cobalt / tomato / leaf / amber */
html[data-palette="paper"][data-theme="dark"]     { --bg: #12141c; --surface: #1a1d28; --text: #e9ebf2; --c1: #7b93ff; --c2: #ff7a63; --c3: #4cc796; --c4: #f2b84b; }

/* 2 · Botanical — forest / terracotta / mustard / plum */
html[data-palette="botanical"]                     { --bg: #f2f3ec; --surface: #ffffff; --text: #1d2a22; --c1: #2f6b4f; --c2: #c8553d; --c3: #7b4b94; --c4: #c99a1e; }
html[data-palette="botanical"][data-theme="dark"]  { --bg: #0f1612; --surface: #17211b; --text: #e5ece6; --c1: #6fc095; --c2: #ee8064; --c3: #b98ad6; --c4: #e3bc4c; }

/* 3 · Nordic — indigo / rose / sky / amber */
html[data-palette="nordic"]                        { --bg: #f4f5f8; --surface: #ffffff; --text: #16181d; --c1: #4f46e5; --c2: #e11d74; --c3: #0284c7; --c4: #f59e0b; }
html[data-palette="nordic"][data-theme="dark"]     { --bg: #0d0e13; --surface: #16171f; --text: #ecedf3; --c1: #8b85ff; --c2: #ff5ca8; --c3: #4cc3f5; --c4: #fbbf48; }

/* 4 · Editorial — burgundy / orange / navy / gold */
html[data-palette="editorial"]                     { --bg: #fbf4ec; --surface: #fffdf9; --text: #2a1f1a; --c1: #8c1c3a; --c2: #e0662a; --c3: #2b4c7e; --c4: #c9971a; }
html[data-palette="editorial"][data-theme="dark"]  { --bg: #17110f; --surface: #211916; --text: #f4e9e1; --c1: #ec6c8a; --c2: #ff9a55; --c3: #7fa4e3; --c4: #f0c14b; }

/* 5 · Signal — mono with international orange */
html[data-palette="signal"]                        { --bg: #f7f7f5; --surface: #ffffff; --text: #111111; --c1: #ff4f00; --c2: #2b59ff; --c3: #00a676; --c4: #e8a700; }
html[data-palette="signal"][data-theme="dark"]     { --bg: #0b0b0b; --surface: #151515; --text: #f2f2f2; --c1: #ff6a26; --c2: #6f8bff; --c3: #2fd29c; --c4: #ffc533; }

html[data-theme="dark"] .nav__logo .logo__rn, html[data-theme="dark"] .hero__title .logo__rn { color: var(--text); }
html[data-theme="dark"] { color-scheme: dark; }

/* ---------------- Theme controls in the nav ---------------- */
.nav__right { display: flex; align-items: center; gap: 22px; }
.theme-ctl { display: flex; align-items: center; gap: 8px; }
.palette-btn {
  height: 34px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  font: 500 .8rem var(--font-body); transition: border-color .2s;
}
.palette-btn:hover { border-color: var(--accent); }
.palette-btn { gap: 8px; padding: 0 12px 0 8px; }
.swatches { display: inline-flex; }
.swatches i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--surface); margin-left: -4px; }
.swatches i:first-child { margin-left: 0; }
.palette-wrap { position: relative; }
.palette-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  display: none; z-index: 60;
}
.palette-menu.is-open { display: block; }
.palette-menu button {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--text); font: 500 .88rem var(--font-body); cursor: pointer; text-align: left;
}
.palette-menu button:hover { background: var(--surface-2); }
.palette-menu button[aria-checked="true"] { background: var(--accent-soft); }
.palette-menu small { margin-left: auto; color: var(--muted); font-size: .72rem; }

@media (max-width: 760px) {
  .nav__right { gap: 8px; }
  .palette-btn .palette-label { display: none; }
  .palette-btn { padding: 0 8px; }
}

/* ---------------- Social icons on team cards ---------------- */
.member__links { margin-top: 10px; }
.social {
  width: 30px; height: 30px; border-radius: 8px; display: inline-grid; place-items: center;
  color: var(--muted); border: 1px solid var(--border); background: var(--surface);
  transition: color .2s, border-color .2s, transform .2s;
}
.social svg { width: 15px; height: 15px; }
.social:hover { color: #0a66c2; border-color: #0a66c2; transform: translateY(-2px); text-decoration: none; }
html[data-theme="dark"] .social:hover { color: #4d9de8; border-color: #4d9de8; }

/* ---------------- University logo in the hero ---------------- */
.hero__uni { position: absolute; top: 90px; right: 44px; z-index: 3; display: block; }
.hero__uni:hover { text-decoration: none; }
/* the seal sits in the corner like a faint watermark */
.hero__uni img {
  display: block; width: 160px; height: 160px;
  opacity: .42; filter: saturate(.85);
  transition: opacity .3s ease, transform .3s ease;
}
html[data-theme="dark"] .hero__uni img { opacity: .32; filter: saturate(.75) brightness(.95); }
.hero__uni:hover img { opacity: .85; transform: scale(1.03); }
@media (max-width: 760px) {
  .hero__uni { top: 76px; right: 16px; }
  .hero__uni img { width: 84px; height: 84px; }
}
