/* ==========================================================================
   Fernielabs — main stylesheet
   Mad Scientist vibe: dark lab, blueprint grid, tesla-cyan sparks.
   ========================================================================== */

:root {
  --bg: #0a1016;
  --bg-2: #0f1820;
  --panel: #131f29;
  --panel-2: #182733;
  --line: #233645;
  --grid: rgba(125, 249, 255, 0.045);
  --text: #e4eff4;
  --muted: #8fa5b1;
  --accent: #7df9ff;          /* lab / tesla-coil cyan */
  --accent-ink: #03171b;
  --danger: #ff7b7b;

  --sunsite: #ffc53d;
  --sunfarm: #6bd968;
  --tassels: #c792ff;

  --app: var(--accent);       /* overridden per project page */

  --font-display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --container: 1160px;
  --header-h: 68px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
}

.theme-sunsite { --app: var(--sunsite); }
.theme-sunfarm { --app: var(--sunfarm); }
.theme-tassels { --app: var(--tassels); }

/* ---------- Reset / base ---------- */

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  /* blueprint grid */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

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

.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;
}

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 0.5rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }

.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-alt { background: rgba(15, 24, 32, 0.75); }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem;
}
.section-head h2 { margin: 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--app);
  margin: 0 0 0.75rem;
}

.lead { font-size: 1.2rem; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font: 600 0.98rem/1 var(--font-display);
  padding: 0.85em 1.35em;
  border-radius: 999px;
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--app); color: var(--accent-ink); box-shadow: 0 0 0 0 transparent; }
.btn-primary:hover { box-shadow: 0 0 24px -4px var(--app); }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--app); color: var(--app); }
.btn-sm { font-size: 0.88rem; padding: 0.6em 1em; }
.btn-block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Chips ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 0.4em;
  font: 500 0.75rem/1 var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.45em 0.7em; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: rgba(10, 16, 22, 0.6);
}
.status::before {
  content: ""; width: 0.55em; height: 0.55em; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.status-live { color: #6bf2a0; border-color: rgba(107, 242, 160, 0.35); }
.status-beta { color: #ffd166; border-color: rgba(255, 209, 102, 0.35); }
.status-lab  { color: #ff9ff3; border-color: rgba(255, 159, 243, 0.35); }

.exp-id { font: 500 0.78rem/1 var(--font-mono); letter-spacing: 0.1em; color: var(--muted); }

/* ---------- Header / navigation ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 16, 22, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }

.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--text); text-decoration: none;
  font: 700 1.1rem/1 var(--font-display); letter-spacing: 0.14em;
}
.brand svg { width: 30px; height: 30px; color: var(--accent); }
.brand:hover { text-decoration: none; color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 2rem; }
.site-nav > ul { list-style: none; display: flex; align-items: center; gap: 1.75rem; margin: 0; padding: 0; }
.site-nav a:not(.btn) { color: var(--text); text-decoration: none; font-weight: 500; }
.site-nav a:not(.btn):hover,
.site-nav a[aria-current="page"] { color: var(--accent); }

.nav-home { display: none; }

.has-dropdown { position: relative; display: flex; align-items: center; gap: 0.15rem; }
.dropdown-toggle {
  background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0.25rem;
  font-size: 0.8rem; line-height: 1; transition: transform 0.15s ease;
}
.has-dropdown.open .dropdown-toggle { transform: rotate(180deg); }
.dropdown {
  list-style: none; margin: 0; padding: 0.5rem;
  position: absolute; top: calc(100% + 0.6rem); left: -0.75rem; min-width: 200px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.dropdown::before { /* hover bridge */
  content: ""; position: absolute; left: 0; right: 0; top: -0.7rem; height: 0.7rem;
}
.has-dropdown:hover .dropdown,
.has-dropdown.open .dropdown,
.has-dropdown:focus-within .dropdown { opacity: 1; visibility: visible; transform: none; }
.dropdown a {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.7rem; border-radius: 6px;
}
.dropdown a:hover { background: var(--panel-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-sunsite { background: var(--sunsite); }
.dot-sunfarm { background: var(--sunfarm); }
.dot-tassels { background: var(--tassels); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); width: 44px; height: 44px; cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-open .nav-toggle .icon-open { display: none; }
.nav-open .nav-toggle .icon-close { display: block; }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 1rem;
    padding: 1rem 1.25rem 1.5rem;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .nav-open .site-nav { display: flex; }
  .site-nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav > ul > li { border-bottom: 1px solid var(--line); }
  .site-nav > ul > li > a { display: block; padding: 0.85rem 0; font-size: 1.1rem; }
  .nav-home { display: block; }
  .has-dropdown { flex-wrap: wrap; }
  .has-dropdown > a { flex: 1; }
  .dropdown-toggle { display: none; }
  .dropdown {
    position: static; opacity: 1; visibility: visible; transform: none;
    background: none; border: 0; box-shadow: none; padding: 0 0 0.75rem 0.75rem; width: 100%;
  }
  .dropdown::before { display: none; }
  .nav-cta { width: 100%; }
}

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 3rem 0 1.5rem; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.footer-grid h4 {
  font: 500 0.78rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted); margin-bottom: 1rem;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.footer-grid a { color: var(--text); text-decoration: none; }
.footer-grid a:hover { color: var(--accent); }
.footer-brand p { color: var(--muted); margin-top: 0.75rem; }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 1.25rem;
  font-size: 0.9rem; color: var(--muted);
}
.footer-bottom em { font-family: var(--font-mono); font-style: normal; font-size: 0.82rem; }

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---------- Home hero ---------- */

.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 5rem); position: relative; overflow: hidden; }
.hero::after { /* soft glow */
  content: ""; position: absolute; inset: auto -20% -60% 30%; height: 120%;
  background: radial-gradient(closest-side, rgba(125, 249, 255, 0.12), transparent);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3rem; align-items: center; position: relative; z-index: 1; }
.hero h1 { letter-spacing: 0.06em; margin-bottom: 0.15em; }
.hero h1 .rule { display: block; width: 4.5rem; height: 4px; background: var(--accent); margin: 0.35em 0 0.45em; box-shadow: 0 0 16px var(--accent); }
.hero-tagline { font: 500 1.35rem/1.3 var(--font-mono); color: var(--accent); margin-bottom: 1.25rem; }
.hero-manifesto { font-size: 1.25rem; color: var(--muted); max-width: 34ch; margin-bottom: 2rem; }
.hero-art { width: 100%; max-width: 520px; justify-self: center; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-art { order: -1; max-width: 360px; }
}

/* Lab illustration animation (respects reduced motion below) */
.lab-svg .bubble { animation: bubble 3.2s ease-in infinite; transform-box: fill-box; transform-origin: center; }
.lab-svg .bubble:nth-child(2) { animation-delay: 0.8s; animation-duration: 2.6s; }
.lab-svg .bubble:nth-child(3) { animation-delay: 1.6s; animation-duration: 3.6s; }
.lab-svg .bubble:nth-child(4) { animation-delay: 2.2s; animation-duration: 2.9s; }
.lab-svg .bubble:nth-child(5) { animation-delay: 0.4s; animation-duration: 3.3s; }
@keyframes bubble {
  0%   { transform: translateY(0) scale(0.6); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translateY(-120px) scale(1.15); opacity: 0; }
}
.lab-svg .spark { animation: spark 2.4s steps(1) infinite; }
.lab-svg .spark-b { animation-delay: 1.2s; }
@keyframes spark {
  0%, 100% { opacity: 0; }
  10%, 18% { opacity: 1; }
  22% { opacity: 0; }
  26%, 30% { opacity: 0.8; }
}
.lab-svg .liquid-glow { animation: glow 3s ease-in-out infinite alternate; }
@keyframes glow { from { opacity: 0.55; } to { opacity: 0.95; } }

/* ---------- Experiment cards (home) ---------- */

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 960px) { .card-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .card-grid { grid-template-columns: 1fr; } }

.exp-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.exp-card:hover { border-color: var(--app); transform: translateY(-3px); box-shadow: var(--shadow); }
.exp-card .media { aspect-ratio: 16 / 10; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.exp-card .media img { width: 100%; height: 100%; object-fit: cover; }
.exp-card .body { padding: 1.25rem 1.35rem 1.4rem; display: flex; flex-direction: column; gap: 0.7rem; flex: 1; }
.exp-card .meta { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.exp-card h3 { margin: 0; font-size: 1.35rem; }
.exp-card h3 a { color: var(--text); text-decoration: none; }
/* whole card clickable via stretched link; Launch button sits above it */
.exp-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.exp-card p { color: var(--muted); margin: 0; flex: 1; }
.exp-card .actions { display: flex; gap: 0.6rem; flex-wrap: wrap; position: relative; z-index: 2; }

/* ---------- How the lab works ---------- */

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps li {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; position: relative;
}
.steps .icon {
  width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(125, 249, 255, 0.08); color: var(--app); margin-bottom: 1rem; border: 1px solid rgba(125, 249, 255, 0.2);
}
.steps .icon svg { width: 28px; height: 28px; }
.steps h3 { margin-bottom: 0.3rem; }
.steps h3::before { counter-increment: step; content: "0" counter(step) " · "; font-family: var(--font-mono); color: var(--muted); font-size: 0.85em; }
.steps p { color: var(--muted); margin: 0; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Wanted banner ---------- */

.wanted {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border: 2px dashed rgba(125, 249, 255, 0.45); border-radius: var(--radius);
  background:
    repeating-linear-gradient(-45deg, rgba(125, 249, 255, 0.03) 0 12px, transparent 12px 24px),
    var(--panel);
}
.wanted h2 { letter-spacing: 0.04em; margin-bottom: 0.25rem; }
.wanted .roles { font-family: var(--font-mono); color: var(--accent); margin-bottom: 0.5rem; }
.wanted blockquote { margin: 0; color: var(--muted); font-style: italic; }

/* ---------- Page header (inner pages) ---------- */

.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 2rem; }
.page-head h1 { letter-spacing: 0.03em; }

.breadcrumb { font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); padding-top: 1.25rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: 0.4rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- Projects index ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 1.5rem; }
.filters .label { font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); margin-right: 0.25rem; }
.filter-btn {
  font: 500 0.88rem/1 var(--font-display); padding: 0.6em 1em; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--text); border: 1px solid var(--line);
}
.filter-btn:hover { border-color: var(--accent); }
.filter-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.exp-list { display: grid; gap: 1.25rem; }
.exp-row {
  display: grid; grid-template-columns: 320px 1fr; gap: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.2s ease;
}
.exp-row:hover { border-color: var(--app); }
.exp-row[hidden] { display: none; }
.exp-row .media { background: var(--bg-2); border-right: 1px solid var(--line); min-height: 200px; }
.exp-row .media img { width: 100%; height: 100%; object-fit: cover; }
.exp-row .body { padding: 1.5rem 1.75rem; display: flex; flex-direction: column; gap: 0.75rem; justify-content: center; }
.exp-row .meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.exp-row h2 { font-size: 1.5rem; margin: 0; }
.exp-row h2 .exp-id { margin-right: 0.5rem; }
.exp-row p { color: var(--muted); margin: 0; max-width: 60ch; }
.tag { font: 500 0.72rem/1 var(--font-mono); padding: 0.4em 0.6em; border-radius: 4px; background: var(--panel-2); color: var(--muted); }

.exp-row.next {
  grid-template-columns: auto 1fr auto; align-items: center; gap: 1.25rem; padding: 1.25rem 1.75rem;
  border-style: dashed; background: transparent;
}
.exp-row.next .q {
  width: 56px; height: 56px; border-radius: 12px; border: 1px dashed var(--line);
  display: grid; place-items: center; font: 700 1.5rem/1 var(--font-mono); color: var(--muted);
}
.exp-row.next p { color: var(--text); }

@media (max-width: 760px) {
  .exp-row { grid-template-columns: 1fr; }
  .exp-row .media { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; aspect-ratio: 16 / 10; }
  .exp-row.next { grid-template-columns: auto 1fr; }
  .exp-row.next .btn { grid-column: 1 / -1; }
}

/* ---------- Project page ---------- */

.project-hero { padding: 2rem 0 clamp(3rem, 6vw, 4.5rem); }
.project-hero .hero-grid { grid-template-columns: 1fr 1.05fr; }
.project-hero h1 { color: var(--app); margin: 0.35rem 0 0.4rem; font-size: clamp(2.4rem, 5.5vw, 4rem); }
.project-hero .headline { font-size: clamp(1.25rem, 2.2vw, 1.6rem); font-weight: 600; line-height: 1.3; margin-bottom: 1rem; }
.project-hero .pitch { color: var(--muted); font-size: 1.1rem; margin-bottom: 1.75rem; max-width: 52ch; }
.project-hero .app-url { display: block; margin-top: 0.75rem; font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted); }
.project-hero .meta { display: flex; align-items: center; gap: 0.75rem; }
.hero-media {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-2);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, 0.02), 0 0 60px -30px var(--app);
}
.hero-media img { width: 100%; height: auto; }
.hero-media figcaption { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); padding: 0.6rem 1rem; border-top: 1px solid var(--line); }
@media (max-width: 860px) {
  .project-hero .hero-grid { grid-template-columns: 1fr; }
  .project-hero .hero-media { order: 0; }
}

.prose { max-width: 70ch; }
.prose p { color: var(--muted); font-size: 1.1rem; }
.prose strong { color: var(--text); }

.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; list-style: none; margin: 0; padding: 0; counter-reset: how; }
.how-grid li {
  background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--app);
  border-radius: var(--radius-sm); padding: 1.25rem;
}
.how-grid h3 { font-size: 1.1rem; margin-bottom: 0.35rem; }
.how-grid h3::before {
  counter-increment: how; content: counter(how, decimal-leading-zero);
  display: block; font: 500 0.78rem/1 var(--font-mono); color: var(--app); margin-bottom: 0.6rem;
}
.how-grid p { color: var(--muted); font-size: 0.95rem; margin: 0; }

.spotlight { display: grid; gap: clamp(2.5rem, 5vw, 4rem); }
.spot { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.spot:nth-child(even) .spot-visual { order: 2; }
.spot-visual {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; padding: 1.25rem;
}
.spot-visual svg { width: 100%; height: 100%; }
.spot p { color: var(--muted); }
@media (max-width: 760px) {
  .spot { grid-template-columns: 1fr; }
  .spot:nth-child(even) .spot-visual { order: 0; }
}

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.tile .icon { color: var(--app); margin-bottom: 0.75rem; }
.tile .icon svg { width: 30px; height: 30px; }
.tile p { color: var(--muted); margin: 0; }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr; } }

.personas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.persona {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem;
  background: linear-gradient(160deg, color-mix(in srgb, var(--app) 9%, transparent), transparent 60%), var(--panel);
}
.persona .chip { color: var(--app); border-color: color-mix(in srgb, var(--app) 40%, transparent); margin-bottom: 0.9rem; }
.persona p { color: var(--muted); margin: 0; }
@media (max-width: 760px) { .personas { grid-template-columns: 1fr; } }

.lab-notes {
  border-left: 3px solid var(--app); padding: 1.25rem 1.5rem; background: var(--panel);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.lab-notes ul { margin: 0.75rem 0 0; padding-left: 1.2rem; color: var(--muted); }
.lab-notes li { margin-bottom: 0.4rem; }

.cta-band {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  padding: clamp(2rem, 5vw, 3rem);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 85% 50%, color-mix(in srgb, var(--app) 22%, transparent), transparent 55%),
    var(--panel);
  border: 1px solid color-mix(in srgb, var(--app) 35%, var(--line));
}
.cta-band p { font: 600 clamp(1.4rem, 3vw, 2rem)/1.2 var(--font-display); margin: 0; }

/* Mobile sticky launch bar */
.launch-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  background: rgba(10, 16, 22, 0.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  transform: translateY(110%); transition: transform 0.25s ease;
  display: none;
}
.launch-bar.visible { transform: none; }
@media (max-width: 760px) {
  .launch-bar { display: block; }
  .has-launch-bar .site-footer { padding-bottom: 6rem; }
}

/* ---------- Collaborate ---------- */

.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.role {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column;
}
.role summary {
  list-style: none; display: flex; align-items: center; gap: 0.75rem;
  padding: 1.5rem 1.5rem 0.5rem; font: 700 1.15rem/1.2 var(--font-display); letter-spacing: 0.06em;
  text-transform: uppercase; cursor: default; pointer-events: none;
}
.role summary::-webkit-details-marker { display: none; }
.role summary .icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: rgba(125, 249, 255, 0.08); color: var(--accent); flex: none; }
.role summary .icon svg { width: 24px; height: 24px; }
.role summary .chev { display: none; margin-left: auto; transition: transform 0.2s ease; color: var(--muted); }
.role .role-body { padding: 0.5rem 1.5rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.role .role-body p { color: var(--muted); }
.role ul { margin: 0 0 1.5rem; padding-left: 1.1rem; flex: 1; }
.role li { margin-bottom: 0.3rem; }
.role li::marker { color: var(--accent); }

@media (max-width: 860px) {
  .role-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .role summary { padding: 1.1rem 1.25rem; cursor: pointer; pointer-events: auto; }
  .role summary .chev { display: block; }
  .role[open] summary .chev { transform: rotate(180deg); }
  .role .role-body { padding: 0 1.25rem 1.25rem; }
}

.matrix-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.matrix { width: 100%; border-collapse: collapse; min-width: 480px; }
.matrix th, .matrix td { padding: 0.9rem 1.1rem; text-align: center; border-bottom: 1px solid var(--line); }
.matrix tr:last-child td, .matrix tr:last-child th { border-bottom: 0; }
.matrix thead th { font: 500 0.78rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.matrix tbody th { text-align: left; font-weight: 600; }
.matrix tbody th .dot { display: inline-block; margin-right: 0.5rem; }
.seek, .open { display: inline-block; width: 14px; height: 14px; border-radius: 50%; }
.seek { background: var(--accent); box-shadow: 0 0 10px rgba(125, 249, 255, 0.6); }
.open { border: 2px solid var(--muted); }
.legend { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: 0.9rem; color: var(--muted); margin-top: 0.9rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.5rem; }

.form-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem); max-width: 820px;
}
.field { display: grid; grid-template-columns: 140px 1fr; gap: 0.5rem 1.25rem; align-items: start; margin-bottom: 1.25rem; }
.field > label, .field > .legend-label { padding-top: 0.7rem; font-weight: 600; }
fieldset.field { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
fieldset.field legend { float: left; width: 140px; padding-top: 0.15rem; font-weight: 600; }
fieldset.field .options { grid-column: 2; }
.options { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.option { position: relative; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option span {
  display: inline-block; padding: 0.55em 1em; border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer; font-size: 0.95rem; transition: all 0.15s ease; user-select: none;
}
.option input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.option span:hover { border-color: var(--accent); }

input[type="text"], input[type="email"], input[type="url"], textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(125, 249, 255, 0.15); }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); }
.error-msg { grid-column: 2; color: var(--danger); font-size: 0.9rem; margin: 0; display: none; }
.field.invalid .error-msg { display: block; }
.hint { grid-column: 2; color: var(--muted); font-size: 0.85rem; margin: 0; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 1.5rem; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-success { text-align: center; padding: 1.5rem 0; }
.form-success .flask { width: 64px; height: 64px; margin: 0 auto 1rem; color: var(--accent); }
.form-success h3 { font-size: 1.6rem; }
.form-success p { color: var(--muted); }

@media (max-width: 640px) {
  .field { grid-template-columns: 1fr; }
  .field > label { padding-top: 0; }
  fieldset.field legend { float: none; width: auto; margin-bottom: 0.5rem; }
  fieldset.field .options, .error-msg, .hint { grid-column: 1; }
  .form-actions .btn { width: 100%; }
}

/* ---------- 404 ---------- */

.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.notfound .code { font: 700 clamp(4rem, 14vw, 9rem)/1 var(--font-mono); color: var(--accent); text-shadow: 0 0 30px rgba(125, 249, 255, 0.4); }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .lab-svg .bubble, .lab-svg .spark { opacity: 0.8; }
}
