/* ============================================================
   Gybio — base.css
   Shared structure + the V1 "Studio" baseline look.
   Theme files (themes/*.css) override the CSS variables and a
   few targeted rules. DOM/class names are a fixed contract:
   themes must not require HTML changes.
   ============================================================ */

:root {
  /* palette (V1 Studio defaults) */
  --bg:        #FAF8F4;
  --bg-alt:    #FCFAF6;
  --ink:       #15161B;
  --muted:     #5B5F6B;
  --primary:   #2563EB;
  --primary-d: #1D4FD8;
  --on-primary:#FFFFFF;
  --accent-1:  #E8572B;
  --accent-2:  #2FA866;
  --accent-3:  #F2C037;
  --grey-light:#C9CDD2;
  --grey-dark: #6E747C;
  --card:      #FFFFFF;
  --line:      rgba(0,0,0,0.08);

  /* shape + type tokens (themes may override) */
  --maxw: 1100px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(21,22,27,.06), 0 2px 8px rgba(21,22,27,.05);
  --shadow-md: 0 8px 24px rgba(21,22,27,.08), 0 2px 6px rgba(21,22,27,.05);
  --shadow-lg: 0 24px 60px rgba(21,22,27,.16);

  --font-head: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --h1: clamp(2.4rem, 7vw, 4rem);
  --h2: clamp(1.8rem, 4.4vw, 2.9rem);
  --weight-head: 800;
  --tracking-head: -0.02em;
  --section-pad: clamp(56px, 9vw, 104px);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- a11y ---------- */
.visually-hidden { 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: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; transition: top .2s ease; }
.skip-link:focus { top: 12px; text-decoration: none; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }
.narrow { max-width: 720px; }
.section { padding: var(--section-pad) 0; }
.section__head { max-width: 640px; margin-bottom: clamp(28px, 5vw, 48px); }

/* ---------- type ---------- */
h1, h2, h3 { line-height: 1.08; letter-spacing: var(--tracking-head); font-weight: var(--weight-head); font-family: var(--font-head); }
h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); margin-bottom: .4em; }
h3 { font-size: 1.22rem; letter-spacing: -0.01em; font-weight: 700; }
em { font-style: italic; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--primary); margin-bottom: 1rem; }
.lede { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 40ch; margin-top: 1.1rem; }
.reveal-name { margin-top: 1rem; color: var(--muted); font-size: .98rem; }
.reveal-name em { color: var(--ink); font-weight: 600; }
.prose { color: var(--muted); font-size: 1.1rem; max-width: 60ch; }
.prose em { color: var(--ink); font-weight: 600; font-style: italic; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; font-family: var(--font-body); font-weight: 600; font-size: 1rem; line-height: 1; padding: 14px 22px; border-radius: var(--radius-pill); border: 1.5px solid transparent; cursor: pointer; transition: transform .15s ease, background .15s ease, box-shadow .15s ease, color .15s ease; white-space: nowrap; text-decoration: none; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--primary-d); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: rgba(0,0,0,.03); }
.btn--lg { padding: 16px 28px; font-size: 1.05rem; }
.btn--sm { padding: 10px 16px; font-size: .92rem; }

/* ---------- variant switcher bar ---------- */
.vbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 8px 14px; background: var(--ink); color: var(--bg); font-size: .8rem; }
.vbar__label { opacity: .7; margin-right: 4px; }
.vbar__link { color: var(--bg); opacity: .75; padding: 4px 9px; border-radius: 999px; font-weight: 600; }
.vbar__link:hover { opacity: 1; text-decoration: none; background: rgba(255,255,255,.12); }
.vbar__link.is-current { opacity: 1; background: rgba(255,255,255,.18); }
.vbar__all { margin-left: auto; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(150%) blur(10px); border-bottom: 1px solid var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
/* brand = wordmark + (optional) tagline beneath it. Tagline is hidden by
   default and revealed by the playful themes. */
.brand { display: inline-flex; flex-direction: column; gap: 1px; }
.brand__tag { display: none; }
.wordmark { display: inline-flex; align-items: center; gap: .55em; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; color: var(--ink); font-family: var(--font-head); }
.wordmark:hover { text-decoration: none; }
.wordmark__dot { width: 14px; height: 14px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.nav__links { display: flex; align-items: center; gap: 26px; }
.nav__links > a:not(.btn) { color: var(--ink); font-weight: 500; font-size: .98rem; }
.nav__links > a:not(.btn):hover { color: var(--primary); text-decoration: none; }
.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav__toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav__mobile { display: none; flex-direction: column; gap: 4px; padding: 12px 22px 18px; border-bottom: 1px solid var(--line); background: var(--bg); }
.nav__mobile a:not(.btn) { padding: 12px 4px; color: var(--ink); font-weight: 500; border-bottom: 1px solid var(--line); }
.nav__mobile .btn { margin-top: 10px; }
@media (max-width: 720px) {
  .nav__links { display: none; }
  .nav__toggle { display: flex; }
  .nav__mobile[data-open] { display: flex; }
}

/* ---------- animated brick backdrop (opt-in per theme) ----------
   Abstract brick silhouettes (rounded rect + two circular "studs") that
   app.js scatters like a pile, then settles into an ordered grid.
   Hidden by default; a theme reveals it via `.v-x .brickfield { display:block }`.
   Pure transform/opacity animation — GPU friendly, reduced-motion safe. */
.brickfield { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; display: none; }
.bf-piece { position: absolute; top: 0; left: 0; border-radius: 6px; background: currentColor; opacity: 0; will-change: transform, opacity; }
.bf-piece::before, .bf-piece::after { content: ""; position: absolute; top: -30%; width: 26%; height: 52%; border-radius: 50%; background: currentColor; }
.bf-piece::before { left: 16%; }
.bf-piece::after  { right: 16%; }
.bf-piece.bf-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .bf-piece { transition: none !important; } }

/* ---------- hero ---------- */
.hero { padding: clamp(40px, 7vw, 84px) 0 clamp(48px, 8vw, 96px); overflow: hidden; position: relative; }
.hero > .container { position: relative; z-index: 1; }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 60px); align-items: center; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.8rem; }
.hero__note { margin-top: 1.2rem; color: var(--muted); font-size: .95rem; }
.hero__visual { display: flex; justify-content: center; }
@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { order: -1; justify-self: center; }
  .lede { max-width: none; }
}

/* ---------- phone mockup (original abstract shapes only) ---------- */
.phone { position: relative; width: min(300px, 78vw); aspect-ratio: 9 / 18.5; background: #0f1014; border-radius: 40px; padding: 12px; box-shadow: var(--shadow-lg), inset 0 0 0 2px rgba(255,255,255,.06); }
.phone__notch { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 110px; height: 22px; background: #0f1014; border-radius: 0 0 14px 14px; z-index: 3; }
.phone__screen { position: relative; height: 100%; border-radius: 30px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; }
.viewfinder { position: relative; flex: 1 1 58%; background: radial-gradient(120% 80% at 50% 30%, #2b2f3a 0%, #15171d 70%); display: grid; place-items: center; }
.viewfinder__bar { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); color: #fff; font-size: .72rem; font-weight: 600; letter-spacing: .04em; background: rgba(0,0,0,.45); padding: 5px 12px; border-radius: 999px; }
.brick { width: 78px; height: 50px; border-radius: 8px; background: linear-gradient(180deg, #d4d8dd, #b4babf); position: relative; box-shadow: 0 10px 26px rgba(0,0,0,.4); }
.brick::before, .brick::after { content: ""; position: absolute; top: -9px; width: 22px; height: 12px; border-radius: 50%; background: linear-gradient(180deg, #e2e5e9, #c2c7cc); }
.brick::before { left: 14px; }
.brick::after { right: 14px; }
.reticle { position: absolute; width: 130px; height: 96px; border: 2px solid rgba(255,255,255,.55); border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0,0,0,.18); }
.result-card { flex: 0 0 auto; margin: 12px; padding: 12px; display: flex; gap: 12px; background: var(--card); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); border: 1px solid var(--line); }
.result-card__box { width: 56px; height: 56px; flex: none; border-radius: 9px; background: linear-gradient(135deg, var(--primary), #5b8cff); position: relative; overflow: hidden; }
.result-card__box::after { content: ""; position: absolute; inset: 10px; border-radius: 6px; background: rgba(255,255,255,.22); }
.result-card__meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.result-card__meta strong { font-size: .92rem; line-height: 1.2; color: var(--ink); }
.result-card__num { font-size: .72rem; color: var(--muted); }
.result-card__row { display: flex; align-items: center; gap: 7px; margin-top: 4px; }
.result-card__color { font-size: .72rem; color: var(--muted); }
.swatch { width: 16px; height: 16px; border-radius: 5px; flex: none; border: 1px solid rgba(0,0,0,.12); }
.swatch--lgray { background: var(--grey-light); }
.swatch--dgray { background: var(--grey-dark); }
.qty { margin-left: auto; font-size: .72rem; font-weight: 700; color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); padding: 3px 8px; border-radius: 999px; }

/* ---------- problem ---------- */
.section--problem { padding: clamp(40px, 7vw, 72px) 0; }

/* ---------- steps ---------- */
.steps { list-style: none; padding: 0; display: grid; gap: 22px; grid-template-columns: repeat(3, 1fr); }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow-sm); }
.step__num { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); font-weight: 800; font-size: 1.15rem; margin-bottom: 16px; }
.step h3 { margin-bottom: .4em; }
.step p { color: var(--muted); }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

/* ---------- why cards (2x2) ---------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 26px; box-shadow: var(--shadow-sm); }
.card h3 { margin-bottom: .4em; }
.card p { color: var(--muted); }
.card__icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: rgba(0,0,0,.04); font-size: 1.35rem; margin-bottom: 16px; }
.card__greys { display: flex; gap: 8px; margin-bottom: 16px; }
.card__greys .swatch { width: 30px; height: 30px; border-radius: 9px; }
@media (max-width: 720px) { .cards { grid-template-columns: 1fr; } }

/* ---------- who tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 22px 20px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-sm); }
.tile strong { font-size: 1.05rem; }
.tile span { color: var(--muted); font-size: .95rem; }
.tile:nth-child(1) { border-top: 3px solid var(--accent-1); }
.tile:nth-child(2) { border-top: 3px solid var(--accent-2); }
.tile:nth-child(3) { border-top: 3px solid var(--primary); }
.tile:nth-child(4) { border-top: 3px solid var(--accent-3); }
@media (max-width: 820px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px) { .tiles { grid-template-columns: 1fr; } }

/* ---------- early access ---------- */
.section--cta { text-align: center; }
.section--cta .prose { margin-inline: auto; margin-bottom: 28px; }
.waitlist { display: flex; gap: 10px; max-width: 480px; margin-inline: auto; flex-wrap: wrap; justify-content: center; }
.waitlist input { flex: 1 1 240px; font-family: var(--font-body); font-size: 1rem; padding: 15px 18px; border: 1.5px solid var(--line); border-radius: var(--radius-pill); background: var(--card); color: var(--ink); min-width: 0; }
.waitlist input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.waitlist input:focus-visible { border-color: var(--primary); outline-offset: 0; }
.waitlist .btn { flex: 0 0 auto; }
.waitlist__msg { flex-basis: 100%; min-height: 1.2em; margin-top: 6px; font-size: .95rem; font-weight: 600; }
.waitlist__msg[data-state="ok"] { color: var(--accent-2); }
.waitlist__msg[data-state="err"] { color: var(--accent-1); }

/* ---------- faq ---------- */
.faq { display: grid; gap: 12px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 20px; box-shadow: var(--shadow-sm); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 28px 16px 0; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 1.4rem; font-weight: 400; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); padding: 0 0 18px; max-width: 60ch; }

/* ---------- footer ---------- */
.footer { background: var(--card); border-top: 1px solid var(--line); padding: 48px 0 32px; }
.footer__inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.footer__tag { color: var(--muted); margin-top: 8px; font-size: .95rem; }
.footer__links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer__links a { color: var(--ink); font-weight: 500; font-size: .95rem; }
.footer__links a:hover { color: var(--primary); text-decoration: none; }
.footer__legal { padding-top: 24px; display: grid; gap: 10px; }
.disclaimer { color: var(--muted); font-size: .82rem; max-width: 72ch; }
.attribution, .copyright { color: var(--muted); font-size: .82rem; }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- comparison hub (index) ---------- */
.hub { padding: clamp(40px, 8vw, 90px) 22px; }
.hub__head { max-width: 640px; margin-bottom: clamp(32px, 6vw, 56px); }
.hub__head h1 { margin: 18px 0 12px; }
.hub__head p { color: var(--muted); font-size: 1.1rem; }
.hub__group { font-size: 1.05rem; letter-spacing: .02em; margin: 36px 0 16px; opacity: .85; }
.hub__group:first-of-type { margin-top: 8px; }
.hub__grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.hub__card a { display: flex; flex-direction: column; gap: 6px; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); color: var(--ink); transition: transform .15s ease, box-shadow .15s ease; }
.hub__card a:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-md); }
.hub__swatches { height: 56px; border-radius: 10px; margin-bottom: 10px; background: linear-gradient(90deg, var(--primary), var(--accent-2)); }
.hub__num { font-size: .75rem; font-weight: 700; letter-spacing: .1em; color: var(--muted); }
.hub__card strong { font-size: 1.2rem; }
.hub__tag { color: var(--muted); font-size: .92rem; }
.hub__go { margin-top: auto; padding-top: 8px; color: var(--primary); font-weight: 600; font-size: .92rem; }
.hub__foot { margin-top: clamp(40px, 7vw, 72px); padding-top: 24px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
