/* ═══════════════════════════════════════════════════════════════════════
   cosmos.css — the 5D sky every Quintessence page lives in.

   Star, 11 November 2026: "I don't like the colors… it's gotta be fucking
   magical", "back-propagate the love", "make that 5D". This layer loads last
   and supersedes the October light signature (experience.css) on the night
   skies. Three night skies and one day:

     velvet    — Velvet Nebula (default): plum-black velvet, rose-magenta
                 glow, violet push, gold flow, pearl unison.
     rosegold  — Rose Gold Aurora: warm wine-dark, rose gold and champagne.
     midnight  — Midnight Gold: the synastry-film palette, midnight ink,
                 gold rings, lavender light.
     day       — the October daylight reading (experience.css), kept as a
                 courtesy.

   The meanings never change between skies: gold is flow, violet is the push
   (good friction, never fear), pearl is the same note. The accent family keeps
   its old token names (--lapis*) so every existing page re-skins at once.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Velvet Nebula (default night) ─────────────────────────────────────── */
html[data-theme="dark"],
html[data-theme="dark"][data-sky="velvet"] {
  --font-reading: 'Instrument Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --font-receipt: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;

  --bg-top: #1b0a26; --bg-mid: #0f0617; --bg-bottom: #07030b;
  --bg-solid: #0c0512; --void: #0c0512;
  --nav-ground: rgba(14, 6, 21, 0.62); --panel-ground: #170a20;

  --surface: rgba(255, 220, 245, 0.045);
  --surface-2: rgba(255, 220, 245, 0.07);
  --surface-light: rgba(255, 220, 245, 0.05);
  --surface-hover: rgba(255, 200, 238, 0.09);
  --surface-up: rgba(255, 220, 245, 0.07);
  --border: rgba(255, 190, 232, 0.13);
  --border-hover: rgba(255, 170, 222, 0.32);
  --hairline: rgba(255, 190, 232, 0.12);
  --hairline-soft: rgba(255, 190, 232, 0.07);

  --text-primary: #fdf3f9; --text: #ead9e6; --text-secondary: #ead9e6;
  --text-muted: #c3abc0; --text-dim: #c3abc0; --text-faint: #957d97;

  /* the accent family (old token names): rose-magenta, the living glow */
  --lapis: #ff6fb5; --lapis-bright: #ff9ccd; --lapis-deep: #b73a7f;
  --lapis-glow: rgba(255, 111, 181, 0.16); --lapis-dim: rgba(255, 156, 205, 0.5);
  --accent: var(--lapis); --accent-glow: var(--lapis-glow); --border-focus: var(--lapis-dim);

  --gold: #f6c978; --gold-soft: #ffe3a6; --gold-dim: #c9974a;
  --gold-muted: rgba(246, 201, 120, 0.16); --gold-glow: rgba(246, 201, 120, 0.22);

  --violet: #a983ff; --violet-bright: #c8adff; --violet-glow: rgba(169, 131, 255, 0.2);
  --magenta: #ff4fa3;
  --pearl: #f4e8ff; --pearl-soft: rgba(244, 232, 255, 0.6);
  --ring-apart: rgba(255, 200, 238, 0.13);

  --flow: var(--gold); --push: var(--violet); --same: var(--pearl);
  --negative: #ff8fb1; --positive: var(--gold); --success: #9fe3c4; --error: #ff8fb1;
  --rose: #ff9ccd; --sage: #9fe3c4; --lavender: #c8adff; --amber: #ffbe7a;

  /* the nebula the sky paints (cosmos.js reads these) */
  --neb-1: 255, 79, 163;   /* magenta */
  --neb-2: 132, 92, 255;   /* violet */
  --neb-3: 246, 186, 110;  /* gold dust */
  --neb-4: 70, 30, 120;    /* deep indigo */
  --star-tint: 255, 236, 250;

  --grad-hero: linear-gradient(100deg, #fff4fb 0%, #ffb3d9 38%, #d9b8ff 68%, #ffe3a6 100%);
  --grad-gate: linear-gradient(120deg, #ff4fa3 0%, #b06bff 55%, #f6c978 120%);
  --glow-gate: rgba(255, 79, 163, 0.45);
  color-scheme: dark;
}

/* ── Rose Gold Aurora ──────────────────────────────────────────────────── */
html[data-theme="dark"][data-sky="rosegold"] {
  --bg-top: #2a1016; --bg-mid: #160a0d; --bg-bottom: #0a0507;
  --bg-solid: #130809; --void: #130809;
  --nav-ground: rgba(22, 9, 12, 0.62); --panel-ground: #200d11;
  --surface: rgba(255, 228, 214, 0.045); --surface-2: rgba(255, 228, 214, 0.07);
  --surface-light: rgba(255, 228, 214, 0.05); --surface-hover: rgba(255, 210, 190, 0.09);
  --surface-up: rgba(255, 228, 214, 0.07);
  --border: rgba(255, 200, 178, 0.14); --border-hover: rgba(255, 190, 160, 0.34);
  --hairline: rgba(255, 200, 178, 0.12); --hairline-soft: rgba(255, 200, 178, 0.07);
  --text-primary: #fff5ef; --text: #f0dcd2; --text-secondary: #f0dcd2;
  --text-muted: #c9aca2; --text-dim: #c9aca2; --text-faint: #9a7d78;
  --lapis: #f49a86; --lapis-bright: #ffc3b1; --lapis-deep: #b45b4c;
  --lapis-glow: rgba(244, 154, 134, 0.17); --lapis-dim: rgba(255, 195, 177, 0.5);
  --gold: #ffd28c; --gold-soft: #ffe8bf; --gold-dim: #d2a05a;
  --gold-muted: rgba(255, 210, 140, 0.16); --gold-glow: rgba(255, 210, 140, 0.24);
  --violet: #d79bff; --violet-bright: #ebc4ff; --violet-glow: rgba(215, 155, 255, 0.2);
  --magenta: #ff6f8e;
  --pearl: #fff0e8; --pearl-soft: rgba(255, 240, 232, 0.6);
  --ring-apart: rgba(255, 210, 190, 0.13);
  --rose: #ffb7a5; --lavender: #ebc4ff; --negative: #ff9f9a; --error: #ff9f9a;
  --neb-1: 255, 120, 120; --neb-2: 214, 120, 200; --neb-3: 255, 206, 140; --neb-4: 90, 24, 40;
  --star-tint: 255, 238, 228;
  --grad-hero: linear-gradient(100deg, #fff5ef 0%, #ffc3b1 40%, #f0a8d8 70%, #ffe0a0 100%);
  --grad-gate: linear-gradient(120deg, #ff7a8e 0%, #f49a86 50%, #ffd28c 110%);
  --glow-gate: rgba(255, 122, 142, 0.45);
}

/* ── Midnight Gold (the synastry-film palette) ─────────────────────────── */
html[data-theme="dark"][data-sky="midnight"] {
  --bg-top: #16133a; --bg-mid: #0d0b22; --bg-bottom: #060512;
  --bg-solid: #0b0a1a; --void: #0b0a1a;
  --nav-ground: rgba(11, 10, 26, 0.62); --panel-ground: #141231;
  --surface: rgba(220, 210, 255, 0.045); --surface-2: rgba(220, 210, 255, 0.07);
  --surface-light: rgba(220, 210, 255, 0.05); --surface-hover: rgba(201, 184, 255, 0.09);
  --surface-up: rgba(220, 210, 255, 0.07);
  --border: rgba(201, 184, 255, 0.14); --border-hover: rgba(201, 184, 255, 0.34);
  --hairline: rgba(201, 184, 255, 0.12); --hairline-soft: rgba(201, 184, 255, 0.07);
  --text-primary: #f5f2ff; --text: #ddd6f2; --text-secondary: #ddd6f2;
  --text-muted: #aaa1c8; --text-dim: #aaa1c8; --text-faint: #7c7598;
  --lapis: #c9b8ff; --lapis-bright: #e2d8ff; --lapis-deep: #6e5bc4;
  --lapis-glow: rgba(201, 184, 255, 0.15); --lapis-dim: rgba(201, 184, 255, 0.5);
  --gold: #e8c27a; --gold-soft: #f6dca6; --gold-dim: #b8904a;
  --gold-muted: rgba(232, 194, 122, 0.15); --gold-glow: rgba(232, 194, 122, 0.24);
  --violet: #9d8cff; --violet-bright: #c4b9ff; --violet-glow: rgba(157, 140, 255, 0.2);
  --magenta: #e58cff;
  --pearl: #f1ecff; --pearl-soft: rgba(241, 236, 255, 0.6);
  --ring-apart: rgba(201, 184, 255, 0.13);
  --rose: #f0b3d8; --lavender: #c9b8ff; --negative: #f0a3c4; --error: #f0a3c4;
  --neb-1: 150, 110, 255; --neb-2: 70, 80, 200; --neb-3: 232, 194, 122; --neb-4: 30, 24, 90;
  --star-tint: 240, 236, 255;
  --grad-hero: linear-gradient(100deg, #f5f2ff 0%, #e2d8ff 45%, #e8c27a 100%);
  --grad-gate: linear-gradient(120deg, #9d8cff 0%, #c9b8ff 45%, #e8c27a 105%);
  --glow-gate: rgba(157, 140, 255, 0.45);
}

/* Day keeps the October reading surface, with the 5D meanings and fonts. */
html[data-theme="light"] {
  --font-reading: 'Instrument Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --font-receipt: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  --violet: #6b4fd8; --violet-bright: #5a3fc8; --violet-glow: rgba(107, 79, 216, 0.12);
  --magenta: #c2367c; --pearl: #8f84a8; --flow: var(--gold); --push: var(--violet); --same: var(--pearl);
  --neb-1: 255, 140, 200; --neb-2: 170, 140, 255; --neb-3: 255, 210, 150; --neb-4: 240, 230, 255;
  --star-tint: 140, 110, 180;
  --grad-hero: linear-gradient(100deg, #3a1f4f 0%, #b0306f 50%, #8a5a12 100%);
  --grad-gate: linear-gradient(120deg, #c2367c 0%, #7a4fd8 100%);
  --glow-gate: rgba(194, 54, 124, 0.3);
}

/* ══════════════════════════════ the sky itself ══════════════════════════ */
html[data-theme] { background: var(--bg-solid); }
html[data-theme] body {
  background: transparent;
  font-family: var(--font-reading);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}
#q-cosmos { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
#q-cosmos canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#q-nebula { filter: blur(38px) saturate(130%); opacity: 0.92; transform: scale(1.08); }
html[data-theme="light"] #q-nebula { opacity: 0.55; }
#q-cosmos::after {
  /* the tooth: film grain over velvet */
  content: ""; position: absolute; inset: 0; opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#q-cosmos::before {
  /* a vignette so the edges fall into velvet */
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(130% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}
html[data-theme="light"] #q-cosmos::before { background: none; }
html[data-theme] body.bg-drift { background: transparent; animation: pageIn 0.45s var(--ease) both; }

/* ══════════════════════════════ type ══════════════════════════════════ */
html[data-theme] :is(h1, h2, .page-title, .lt-title, .fc-title, .hero-name, .experience-intro h1,
  .connection-heading h1, .config-title, .q-display) {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 380;
  letter-spacing: -0.02em;
}
html[data-theme] h3 { font-family: var(--font-reading); }
html[data-theme] .q-sheen,
html[data-theme] .experience-intro h1,
html[data-theme] .hero-name,
html[data-theme] .connection-heading h1 {
  background: var(--grad-hero);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  background-size: 200% 100%;
  animation: q-sheen 14s ease-in-out infinite alternate;
}
.connection-heading h1 > span { -webkit-text-fill-color: var(--text-muted); }
@keyframes q-sheen { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
html[data-theme] .experience-intro h1 { font-size: clamp(40px, 6vw, 72px); line-height: 1.02; font-weight: 320; margin-bottom: 16px; }
html[data-theme] .experience-intro p { font-size: 16px; color: var(--text-secondary); max-width: 60ch; }
.q-eyebrow, .portrait-eyebrow, .path-question {
  font-family: var(--font-reading); font-size: 11px; font-weight: 600; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--lapis-bright);
}
html[data-theme] .receipt-table { font-family: var(--font-receipt); font-size: 12px; }
::selection { background: var(--lapis-glow); color: var(--text-primary); }

/* ══════════════════════════════ nav ═══════════════════════════════════ */
html[data-theme] .q-nav {
  background: var(--nav-ground);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid var(--hairline-soft);
}
html[data-theme] .q-nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--lapis-dim), var(--gold-dim), transparent);
  opacity: 0.55;
}
.q-nav-logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display) !important; font-weight: 400 !important; font-size: 21px !important; letter-spacing: 0.01em !important; color: var(--text-primary); }
.q-nav-logo .q-mark { display: inline-block; color: var(--gold); text-shadow: 0 0 14px var(--gold-glow); animation: q-mark-spin 18s linear infinite; }
@keyframes q-mark-spin { to { transform: rotate(360deg); } }
.q-beta {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 8px; border-radius: 99px;
  font: 600 10px/1 var(--font-reading); letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold-soft); background: var(--gold-muted); border: 1px solid var(--gold-glow); text-decoration: none;
  -webkit-text-fill-color: currentColor;
}
.q-beta::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); animation: q-pulse 2.4s ease-in-out infinite; }
@keyframes q-pulse { 50% { opacity: 0.35; transform: scale(0.8); } }
html[data-theme] .q-nav-links a { font-size: 14px; color: var(--text-muted); text-decoration: none !important; position: relative; transition: color 0.3s var(--ease); }
html[data-theme] .q-nav-links a:hover { color: var(--text-primary); }
html[data-theme] .q-nav-links a.active { color: var(--text-primary); font-weight: 500; }
html[data-theme] .q-nav-links a.active::after {
  content: ""; position: absolute; left: 8%; right: 8%; bottom: 6px; height: 2px; border-radius: 2px;
  background: var(--grad-gate); box-shadow: 0 0 12px var(--glow-gate);
}
.q-nav-tools { display: flex; align-items: center; gap: 8px; }
.q-tool {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary);
  cursor: pointer; transition: border-color 0.3s var(--ease), background 0.3s var(--ease), transform 0.3s var(--ease);
  font-size: 15px; line-height: 1;
}
.q-tool:hover { border-color: var(--lapis-dim); background: var(--surface-hover); transform: translateY(-1px); }
.q-tool[aria-pressed="false"] { opacity: 0.6; }
.q-sky-orb { width: 18px; height: 18px; border-radius: 50%; background: conic-gradient(from 210deg, var(--magenta), var(--violet), var(--gold), var(--magenta)); box-shadow: 0 0 12px var(--glow-gate); }
.q-sky-panel {
  position: fixed; top: calc(var(--nav-height, 72px) + 10px); right: clamp(12px, 3vw, 48px); z-index: 200;
  width: min(340px, calc(100vw - 24px)); padding: 18px; border-radius: 20px;
  background: var(--panel-ground); border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  opacity: 0; transform: translateY(-8px) scale(0.98); pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.q-sky-panel.open { opacity: 1; transform: none; pointer-events: auto; }
.q-sky-panel h4 { font: 600 11px/1 var(--font-reading); letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-muted); margin: 2px 0 12px; }
.q-sky-choice {
  display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: center; width: 100%;
  padding: 10px; border-radius: 14px; border: 1px solid transparent; background: none; color: var(--text-primary);
  text-align: left; cursor: pointer; font: inherit;
}
.q-sky-choice:hover { background: var(--surface-hover); }
.q-sky-choice[aria-checked="true"] { border-color: var(--lapis-dim); background: var(--lapis-glow); }
.q-sky-choice b { display: block; font-weight: 500; font-size: 14px; }
.q-sky-choice small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.q-swatch { width: 54px; height: 38px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.q-swatch.velvet { background: radial-gradient(circle at 30% 40%, #ff4fa3 0, transparent 45%), radial-gradient(circle at 70% 60%, #a983ff 0, transparent 50%), radial-gradient(circle at 80% 20%, #f6c978 0, transparent 30%), #0c0512; }
.q-swatch.rosegold { background: radial-gradient(circle at 30% 40%, #f49a86 0, transparent 45%), radial-gradient(circle at 70% 65%, #d79bff 0, transparent 45%), radial-gradient(circle at 80% 20%, #ffd28c 0, transparent 35%), #130809; }
.q-swatch.midnight { background: radial-gradient(circle at 30% 45%, #9d8cff 0, transparent 45%), radial-gradient(circle at 75% 30%, #e8c27a 0, transparent 35%), #0b0a1a; }
.q-swatch.day { background: radial-gradient(circle at 30% 40%, #ffd1e6 0, transparent 50%), radial-gradient(circle at 70% 60%, #e2d8ff 0, transparent 50%), #f8f6fb; }
.q-sky-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-secondary); }
.q-switch { position: relative; width: 44px; height: 26px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; flex: none; }
.q-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-muted); transition: transform 0.3s var(--ease), background 0.3s; }
.q-switch[aria-checked="true"] { background: var(--lapis-glow); border-color: var(--lapis-dim); }
.q-switch[aria-checked="true"]::after { transform: translateX(18px); background: var(--lapis); box-shadow: 0 0 10px var(--glow-gate); }
html[data-theme] .q-nav-user-btn {
  background: var(--grad-gate); color: #fff; border: 0; font-weight: 600; box-shadow: 0 0 18px var(--glow-gate);
}
html[data-theme] .q-nav-user-menu { background: var(--panel-ground); border-color: var(--border); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.q-appearance { display: none !important; }

/* ══════════════════════════════ surfaces ═══════════════════════════════ */
html[data-theme] :is(.connection-door, .config-card, .energy-hero, .narr-card, .system-card, .connection-contact,
  .q-card, .settings-card, .fc-day-card, .lt-card) {
  background: linear-gradient(160deg, var(--surface-2), var(--surface) 60%);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 60px -30px rgba(0, 0, 0, 0.7);
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
html[data-theme] :is(a.connection-door, .q-card.is-link):hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 30px 70px -28px var(--glow-gate);
}
html[data-theme] :is(select, input[type="text"], input[type="email"], input[type="search"], input[type="date"], input[type="time"], textarea,
  .seed-select, .page-person-select, .fc-person-select) {
  background-color: var(--surface-2); color: var(--text-primary); border: 1px solid var(--border); border-radius: 12px;
}
html[data-theme] :is(select, input, textarea):focus { border-color: var(--lapis-dim); box-shadow: 0 0 0 4px var(--lapis-glow); outline: none; }
html[data-theme] select option { background: var(--panel-ground) !important; color: var(--text-primary) !important; }

/* the one luminous gate */
.q-gate, html[data-theme] :is(.interpret-btn, .btn-primary, .save-btn, .submit-btn) {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 13px 28px; border: 0; border-radius: 99px; cursor: pointer;
  font: 600 15px/1 var(--font-reading); letter-spacing: 0.01em; color: #fff !important; text-decoration: none;
  background: var(--grad-gate) !important; background-size: 160% 100% !important;
  box-shadow: 0 12px 34px -12px var(--glow-gate), 0 0 0 1px rgba(255, 255, 255, 0.12) inset !important;
  overflow: hidden; isolation: isolate;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background-position 0.8s var(--ease);
}
.q-gate::after, html[data-theme] :is(.interpret-btn, .btn-primary)::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%); animation: q-gate-sheen 6s ease-in-out 1.5s infinite;
}
@keyframes q-gate-sheen { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.q-gate:hover, html[data-theme] :is(.interpret-btn, .btn-primary):hover { transform: translateY(-2px); background-position: 100% 0 !important; box-shadow: 0 18px 44px -12px var(--glow-gate), 0 0 0 1px rgba(255, 255, 255, 0.2) inset !important; }
.q-ghost {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-primary); text-decoration: none;
  font: 500 14px/1 var(--font-reading); cursor: pointer; transition: border-color 0.3s, background 0.3s;
}
.q-ghost:hover { border-color: var(--lapis-dim); background: var(--surface-hover); }

/* pills: forecast lenses, map categories, gender filters */
html[data-theme] :is(.gender-pill, .fc-lens, .lens-pill, .cat-pill, .category-pill, .model-btn, .preset-chip, .connection-method-buttons button) {
  border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary);
  transition: all 0.3s var(--ease);
}
html[data-theme] :is(.gender-pill, .fc-lens, .lens-pill, .cat-pill, .category-pill, .model-btn, .preset-chip):is(.active, [aria-pressed="true"]),
html[data-theme] .connection-method-buttons button[aria-pressed="true"] {
  color: var(--text-primary); border-color: var(--lapis-dim);
  background: linear-gradient(120deg, var(--lapis-glow), var(--violet-glow));
  box-shadow: 0 0 22px -6px var(--glow-gate);
}

/* the meanings, in every sky */
.ring-push, html[data-theme] .ring-push { stroke: var(--push); }
.ring-flow { stroke: var(--flow); }
.ring-same { stroke: var(--same); }
.state-push .ring-dot, .tone-friction, .sig-bar-shadow, .aura-bar-shadow { background: var(--push) !important; }
.state-push .rhythm-state, .shadow-val { color: var(--violet-bright) !important; }
html[data-theme] .ring { filter: drop-shadow(0 0 4px currentColor); }
html[data-theme] .energy-meter-fill { background: linear-gradient(90deg, var(--gold-dim), var(--gold), var(--gold-soft)); box-shadow: 0 0 16px var(--gold-glow); }
html[data-theme] .energy-meter, html[data-theme] .mini-meter, html[data-theme] .tone-bar { background: var(--surface-2); }
html[data-theme] .mini-fill.resonance { background: linear-gradient(90deg, var(--violet), var(--pearl)); }

/* details / disclosure */
html[data-theme] .experience-depth { border-color: var(--hairline-soft); }
html[data-theme] .experience-depth > summary, html[data-theme] details > summary { color: var(--lapis-bright); }

/* reveal on scroll (cosmos.js adds .q-in) */
.q-rise { opacity: 0; transform: translateY(18px); filter: blur(4px); transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease); }
.q-rise.q-in { opacity: 1; transform: none; filter: none; }

/* the beta note, kind and plain */
.q-beta-note {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 16px;
  background: linear-gradient(120deg, var(--gold-muted), transparent); border: 1px solid var(--gold-glow);
  font-size: 14px; line-height: 1.6; color: var(--text-secondary);
}
.q-beta-note b { color: var(--gold-soft); font-weight: 600; }
html[data-theme="light"] .q-beta-note b { color: var(--gold); }

/* footer line every page can carry */
.q-foot { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; padding: 48px 20px 40px; font-size: 12px; color: var(--text-faint); }
.q-foot a { color: var(--text-muted); text-decoration: none; }
.q-foot a:hover { color: var(--lapis-bright); }

@media (max-width: 860px) {
  .q-nav-tools .q-tool { width: 38px; height: 38px; }
  html[data-theme] .q-nav { grid-template-columns: 44px minmax(0, 1fr) auto !important; }
  .q-nav-logo { font-size: 19px !important; }
  .q-nav-logo .q-beta { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .q-rise { opacity: 1; transform: none; filter: none; }
  .q-nav-logo .q-mark, .q-beta::before { animation: none; }
}

/* ══════════════════ the rhythms, at full voice ══════════════════════════
   The rhythms ("in harmony", "the same note", "the push") are the heart of a
   connection. They keep their original reading face, Inter, and read larger
   than anything else on the page but the score. Nothing here may shrink them. */
html[data-theme] :is(.rhythms, .ring-key, .energy-key, .energy-line, .energy-row, .rhythm-facts,
  .contact-receipt, .atomic-cite, .dimension, .connection-theme-name) {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
html[data-theme] .rhythms { margin: 48px 0; }
html[data-theme] .rhythms h2 { font-size: clamp(28px, 3.4vw, 36px); margin-bottom: 10px; }
html[data-theme] .rhythms .section-lead { font-size: 16px; }
html[data-theme] .rhythm > summary { padding: 20px 0; gap: 18px; }
html[data-theme] .rhythm-name { font-size: 21px; font-weight: 500; letter-spacing: -0.01em; }
html[data-theme] .rhythm-reads { font-size: 15px; margin-top: 4px; }
html[data-theme] .rhythm-state { font-size: 16px; font-weight: 500; }
html[data-theme] .rhythm-line { font-size: 19px; line-height: 1.6; max-width: 64ch; }
html[data-theme] .rhythm-facts { font-size: 15px; line-height: 1.7; color: var(--text-secondary); }
html[data-theme] .rhythm-body { padding: 2px 0 26px 28px; }
html[data-theme] .ring-key-item { font-size: 15px; }
html[data-theme] .energy-key { font-size: 15px; line-height: 1.6; }
html[data-theme] .energy-line { font-size: 18px; line-height: 1.6; }
html[data-theme] :is(.contact-receipt p, .wink .contact-receipt, .atomic-cite) { font-size: 14px; }
@media (max-width: 640px) {
  html[data-theme] .rhythm-name { font-size: 19px; }
  html[data-theme] .rhythm-line { font-size: 17px; }
  html[data-theme] .rhythm-body { padding-left: 0; }
  html[data-theme] .rhythm > summary { grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px 14px; }
  html[data-theme] .rhythm > summary .ring-dot { grid-column: 1; grid-row: 1; }
  html[data-theme] .rhythm > summary .rhythm-head { grid-column: 2; grid-row: 1; }
  html[data-theme] .rhythm > summary .rhythm-state { grid-column: 3; grid-row: 1; white-space: nowrap; }
  html[data-theme] .rhythm > summary .tone-bar { grid-column: 2 / -1; grid-row: 2; }
}

/* ══════════════════ begin with you: the welcome cards ═══════════════════ */
.q-nav-add { color: var(--gold) !important; }
.q-welcome-card {
  position: relative; margin: 8px auto 36px; max-width: 760px; padding: 28px 30px;
  border: 1px solid var(--border); border-radius: 22px;
  background: color-mix(in srgb, var(--surface, rgba(255,255,255,0.04)) 85%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.q-welcome-card h2 { font-size: clamp(26px, 3.4vw, 34px); line-height: 1.12; margin: 8px 0 10px; }
.q-welcome-card p:not(.q-eyebrow) { font-size: 16px; line-height: 1.6; color: var(--text-secondary); max-width: 58ch; margin: 0 0 18px; }
.q-welcome-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.q-welcome-link { color: var(--lapis-bright) !important; text-decoration: none !important; font-weight: 500; font-size: 15px; }
.q-welcome-link:hover { text-decoration: underline !important; }
.q-add-row { display: flex; justify-content: flex-end; margin: 0 0 10px; }
@media (max-width: 640px) { .q-welcome-card { padding: 22px 20px; margin-bottom: 26px; } }
/* the welcome headline speaks at full size */
html[data-theme] .form-header h1 {
  font-family: var(--font-display); font-size: clamp(36px, 5.2vw, 56px); font-weight: 340;
  line-height: 1.05; letter-spacing: -0.01em; color: var(--text-primary); margin: 6px 0 14px;
}
html[data-theme] .form-header p:not(.q-eyebrow) { font-size: 17px; line-height: 1.6; max-width: 36em; margin: 0 auto; }
/* invite link: they add their own moment */
.q-invite {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin: 0 0 36px;
  padding: 20px 22px; border-radius: 18px; border: 1px solid var(--border, rgba(255,255,255,.14));
  background: var(--glass, rgba(255,255,255,.05)); backdrop-filter: blur(12px);
}
.q-invite-copy { flex: 1 1 260px; display: grid; gap: 4px; font-family: var(--font-reading); }
.q-invite-copy strong { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.q-invite-copy span { font-size: 15px; line-height: 1.5; color: var(--text-secondary); }
.q-invite-result { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.q-invite [hidden] { display: none !important; }
.q-invite-result input {
  flex: 1 1 240px; min-width: 0; padding: 12px 14px; border-radius: 12px; font: 14px var(--font-receipt);
  color: var(--text-primary); background: rgba(0,0,0,.25); border: 1px solid var(--border, rgba(255,255,255,.14));
}
.q-invite-result button { background: none; border: 0; cursor: pointer; padding: 6px 2px; font-size: 15px; }
.q-invite-result small { flex: 1 1 100%; color: var(--text-muted); font-size: 13px; }
