:root {
  color-scheme: dark;
  --bg: #07060f;
  --bg2: #0d0b1f;
  --ink: #ece9ff;
  --muted: #9b96c4;
  --line: rgba(160, 150, 230, 0.16);
  --card: rgba(24, 20, 48, 0.55);
  --accent: #b388ff;
  --accent2: #6ad7ff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(120% 90% at 50% -10%, #1a1340 0%, var(--bg2) 38%, var(--bg) 100%) fixed;
  color: var(--ink);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100%;
}
.aurora {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(40% 30% at 15% 20%, rgba(179, 136, 255, 0.18), transparent 70%),
    radial-gradient(35% 28% at 85% 25%, rgba(106, 215, 255, 0.16), transparent 70%),
    radial-gradient(45% 35% at 50% 100%, rgba(255, 120, 190, 0.12), transparent 70%);
  filter: blur(10px);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: translateY(-12px) scale(1); } to { transform: translateY(12px) scale(1.05); } }

.screen { position: relative; z-index: 1; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 20px; }

/* ---------- INTRO ---------- */
.intro-wrap { max-width: 640px; text-align: center; }
.logo { letter-spacing: 0.35em; font-weight: 700; color: var(--accent); font-size: 14px; margin-bottom: 26px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 26px; }
.brand-mark { width: 76px; height: 76px; filter: drop-shadow(0 6px 22px rgba(154,120,255,.35)); }
.brand-name { letter-spacing: 0.35em; font-weight: 700; color: var(--accent); font-size: 14px; }
/* small brand lockup on the results page */
.res-brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; margin-bottom: 18px; opacity: .95; transition: opacity .15s; }
.res-brand:hover { opacity: 1; }
.res-brand img { width: 30px; height: 30px; }
.res-brand span { letter-spacing: 0.3em; font-weight: 700; color: var(--accent); font-size: 12px; }
.title { font-family: 'Fraunces', serif; font-weight: 800; font-size: clamp(44px, 9vw, 88px); line-height: 1.04; letter-spacing: -0.02em; padding-bottom: 0.12em;
  background: linear-gradient(120deg, #fff, var(--accent) 55%, var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { color: var(--muted); font-size: 18px; line-height: 1.6; margin: 24px auto 28px; max-width: 540px; }
.lede b { color: var(--ink); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 34px; }
.chips span { font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; background: rgba(255,255,255,0.02); }
/* ---------- mode toggle ---------- */
.mode { margin: 4px auto 26px; max-width: 460px; }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; color: var(--muted); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 44px; height: 24px; border-radius: 99px; background: rgba(255,255,255,0.12); border: 1px solid var(--line); position: relative; flex: none; transition: .18s; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: .18s; }
.switch input:checked + .track { background: linear-gradient(120deg, var(--accent2), var(--accent)); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(20px); background: #fff; }
.switch .lbl { text-align: left; }
.names { margin-top: 14px; }
.namerow { display: flex; gap: 10px; justify-content: center; }
.names input { font: inherit; font-size: 15px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 11px 15px; width: 50%; max-width: 200px; }
.names input:focus { outline: none; border-color: var(--accent); }
.names input::placeholder { color: var(--muted); }
.pmethod { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; text-align: left; }
.pmethod label { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); cursor: pointer; padding: 9px 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,0.02); transition: .14s; }
.pmethod label:hover { border-color: var(--accent); }
.pmethod input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.pmethod input:checked + span { color: var(--ink); }

/* partner link / upload screens */
.linkbox { width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; margin-bottom: 14px; resize: vertical; }
.linkbox:focus { outline: none; border-color: var(--accent); }
.hoff-err { color: #ff9bb0; font-size: 13.5px; margin-bottom: 14px; line-height: 1.5; }
.hoff-note { color: var(--muted); font-size: 12.5px; margin-top: 16px; line-height: 1.5; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 20px; border: 2px dashed var(--line); border-radius: 16px; cursor: pointer; transition: .15s; background: rgba(255,255,255,0.02); margin-bottom: 14px; }
.dropzone:hover { border-color: var(--accent); background: rgba(179,136,255,0.06); }
.dropzone.busy { opacity: .7; cursor: default; }
.dz-ico { font-size: 32px; }
.dz-main { font-size: 16px; font-weight: 600; color: var(--ink); }
.dz-sub { font-size: 12.5px; color: var(--muted); }

/* couple blend card */
.blend { text-align: center; margin-bottom: 16px; border-color: rgba(255,120,190,.3); background: linear-gradient(135deg, rgba(179,136,255,.12), rgba(255,120,190,.08)); }
.blend-label { font-size: 11px; letter-spacing: .16em; color: var(--accent2); margin-bottom: 8px; }
.blend-ship { font-family: 'Fraunces', serif; font-weight: 800; font-size: clamp(30px,6vw,46px); line-height: 1; padding-bottom: .08em; background: linear-gradient(120deg,#fff,var(--accent) 55%,#ff9bd0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.blend-title { font-family: 'Fraunces', serif; font-style: italic; font-size: 20px; color: var(--ink); margin-top: 4px; }
.blend-sub { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.blend-tag { color: #d8d2ff; font-size: 14.5px; margin-top: 10px; line-height: 1.5; }

/* share card */
.share .sharerow { display: flex; gap: 8px; margin: 8px 0 16px; }
.share .sharerow input { flex: 1; min-width: 0; font: inherit; font-size: 13px; color: var(--accent2); background: rgba(0,0,0,0.25); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.share .sharerow button, .share #dlImg { font: inherit; font-weight: 700; cursor: pointer; border: 0; border-radius: 10px; padding: 11px 20px; color: #140b22; background: linear-gradient(120deg, var(--accent2), var(--accent)); }
.share #dlImg:disabled { opacity: .7; cursor: default; }
.sharegrid { display: flex; gap: 18px; align-items: center; }
.qrwrap { background: #fff; padding: 8px; border-radius: 12px; line-height: 0; flex: none; }
.qrwrap img { width: 120px; height: 120px; display: block; }
.shareacts { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.qrhint { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
@media (max-width: 540px) { .sharegrid { flex-direction: column; align-items: stretch; } .qrwrap { align-self: center; } }

/* ---------- handoff ---------- */
.handoff-wrap { max-width: 520px; text-align: center; }
.handoff-wrap .brand-mark { width: 68px; height: 68px; filter: drop-shadow(0 6px 22px rgba(154,120,255,.35)); }
.hoff-check { width: 56px; height: 56px; margin: 18px auto 6px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; color: #0d0b1f; background: linear-gradient(120deg, var(--accent2), var(--accent)); }
.handoff-wrap h2 { font-family: 'Fraunces', serif; font-weight: 600; font-size: clamp(24px,4vw,32px); margin-bottom: 12px; }
.handoff-wrap p { color: var(--muted); font-size: 16px; line-height: 1.6; margin-bottom: 26px; }
.handoff-wrap p b { color: var(--ink); }

/* ---------- compatibility report ---------- */
.arc .amp { color: var(--accent); -webkit-text-fill-color: var(--accent); font-style: italic; }
.compat-score { display: flex; align-items: baseline; justify-content: center; gap: 14px; margin: 8px 0 12px; }
.cs-num { font-family: 'Fraunces', serif; font-weight: 800; font-size: 46px; background: linear-gradient(120deg,#fff,var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cs-num i { font-style: normal; font-size: 24px; }
.cs-vibe { font-size: 16px; color: var(--accent2); font-weight: 600; }
.cmeter { height: 8px; max-width: 520px; margin: 0 auto 18px; background: rgba(255,255,255,0.08); border-radius: 99px; overflow: hidden; }
.cmeter-fill { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent), #ff78be); border-radius: 99px; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.compat-people { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; text-align: center; }
.pname { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent2); margin-bottom: 8px; }
.pcard .parch { font-family: 'Fraunces', serif; font-weight: 700; font-size: 20px; line-height: 1.15; margin-bottom: 6px; }
.pcard .ptype { color: var(--ink); font-size: 14px; }
.pcard .pmeta { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.clist { list-style: none; display: grid; gap: 9px; }
.clist li { position: relative; padding-left: 26px; color: #c7c2ea; font-size: 15px; line-height: 1.5; }
.clist li::before { content: '✓'; position: absolute; left: 0; color: var(--accent2); font-weight: 700; }
.clist.plus li::before { content: '★'; color: var(--accent); }
.growth { display: grid; gap: 12px; margin-top: 12px; }
.grow { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; }
.gtitle { font-weight: 700; color: var(--ink); margin-bottom: 4px; font-size: 15px; }
.gtext { color: var(--muted); font-size: 14px; line-height: 1.55; }
.dualrow { margin: 12px 0; }
.dualrow .dl { font-size: 13.5px; color: var(--ink); font-weight: 600; margin-bottom: 6px; text-transform: capitalize; }
.dbars { display: grid; gap: 5px; }
.db { display: grid; grid-template-columns: 78px 1fr 30px; align-items: center; gap: 8px; }
.db .dn { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db .dt { height: 8px; background: rgba(255,255,255,0.06); border-radius: 99px; overflow: hidden; }
.db .dt i { display: block; height: 100%; border-radius: 99px; }
.db b { font-size: 12px; color: var(--ink); text-align: right; }
@media (max-width: 720px) { .compat-people { grid-template-columns: 1fr; } }

.cta {
  font: inherit; font-weight: 700; font-size: 17px; color: #140b22; cursor: pointer;
  padding: 16px 34px; border: 0; border-radius: 999px;
  background: linear-gradient(120deg, var(--accent2), var(--accent));
  box-shadow: 0 10px 40px -8px var(--accent); transition: transform .15s, box-shadow .15s;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 16px 50px -8px var(--accent); }
.meta { margin-top: 18px; font-size: 12.5px; color: var(--muted); }
.faqlink { display: inline-block; margin-top: 14px; font-size: 13px; color: var(--accent2); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .15s; }
.faqlink:hover { border-color: var(--accent2); }

/* ---------- QUIZ ---------- */
.quiz-wrap { width: 100%; max-width: 620px; }
.progress { height: 6px; border-radius: 99px; background: rgba(255,255,255,0.07); overflow: hidden; }
.progress .bar { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); transition: width .35s ease; }
.qcount { margin: 22px 0 10px; font-size: 13px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.qtext { font-family: 'Fraunces', serif; font-weight: 600; font-size: clamp(24px, 4.5vw, 34px); line-height: 1.25; margin-bottom: 30px; }
.likert { display: flex; flex-direction: column; gap: 10px; }
.lk { display: flex; align-items: center; gap: 14px; text-align: left; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 15px 18px; cursor: pointer; transition: .14s; }
.lk:hover { border-color: var(--accent); transform: translateX(3px); background: rgba(179,136,255,0.08); }
.lk .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); flex: none; transition: .14s; }
.lk.sel { border-color: var(--accent); background: rgba(179,136,255,0.14); }
.lk.sel .dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px var(--accent); }
.nav { display: flex; justify-content: space-between; margin-top: 24px; }
.nav button, .actions button { font: inherit; font-weight: 600; color: var(--ink); background: rgba(255,255,255,0.05);
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 22px; cursor: pointer; transition: .14s; }
.nav button:hover:not(:disabled) { border-color: var(--accent); }
.nav button:disabled { opacity: .35; cursor: default; }
.ghost { background: transparent !important; }

/* ---------- RESULTS ---------- */
.res { width: 100%; max-width: 1080px; }
.hero { text-align: center; margin-bottom: 30px; }
.badge { display: inline-block; font-size: 12px; letter-spacing: .15em; color: var(--accent2); border: 1px solid var(--line);
  padding: 6px 16px; border-radius: 999px; text-transform: uppercase; margin-bottom: 18px; background: rgba(106,215,255,.06); }
.arc { font-family: 'Fraunces', serif; font-weight: 800; font-size: clamp(30px, 5.6vw, 56px); line-height: 1.1; letter-spacing: -0.02em; padding-bottom: 0.1em;
  background: linear-gradient(120deg, #fff, var(--accent) 60%, var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.signature { font-family: 'Space Grotesk', monospace; color: var(--accent2); margin: 14px 0; font-size: 14.5px; letter-spacing: .02em; }
.narrative { color: var(--muted); font-size: 16.5px; line-height: 1.6; max-width: 720px; margin: 0 auto; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; backdrop-filter: blur(8px); }
.card.span2 { grid-column: span 2; }
.card h3 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 18px; margin-bottom: 12px; }
.card .big { font-family: 'Fraunces', serif; font-weight: 800; font-size: 40px; line-height: 1; background: linear-gradient(120deg,#fff,var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card .sub { color: var(--muted); font-size: 13.5px; margin: 6px 0 14px; }
.muted { color: var(--muted); font-size: 13px; margin-bottom: 8px; }

canvas#helix { width: 100%; height: 240px; display: block; }
canvas#constellation, canvas#sigil { width: 100%; height: 180px; display: block; margin-top: 8px; }

.genomestr { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; justify-content: center; }
.bp { font-family: monospace; font-weight: 700; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; font-size: 13px; }
.bp-G { background: rgba(106,215,255,.22); color: #9fe7ff; }
.bp-A { background: rgba(179,136,255,.22); color: #d4b8ff; }
.bp-T { background: rgba(255,160,120,.20); color: #ffc7a3; }
.bp-C { background: rgba(120,255,190,.18); color: #a3ffd2; }

.statrow { margin: 9px 0; }
.statlbl { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.statlbl b { color: var(--ink); }
.track { height: 9px; background: rgba(255,255,255,0.06); border-radius: 99px; overflow: hidden; }
.fill { height: 100%; border-radius: 99px; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 26px; }

.axis { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 10px 0; font-size: 12.5px; color: var(--muted); }
.axis span { white-space: nowrap; } .axis span.on { color: var(--ink); font-weight: 700; }
.axis .atrack { position: relative; width: 110px; height: 5px; background: rgba(255,255,255,0.08); border-radius: 99px; }
.axis .amark { position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%; background: var(--accent); transform: translate(-50%,-50%); box-shadow: 0 0 10px var(--accent); }

.enbars { display: flex; align-items: flex-end; gap: 6px; height: 90px; margin-top: 12px; }
.enbar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 4px; }
.enbar span { width: 100%; background: rgba(179,136,255,.3); border-radius: 5px 5px 0 0; transition: height .8s; }
.enbar.top span { background: linear-gradient(180deg, var(--accent2), var(--accent)); box-shadow: 0 0 12px var(--accent); }
.enbar i { font-style: normal; font-size: 11px; color: var(--muted); }
.enbar.top i { color: var(--ink); font-weight: 700; }

.meaning { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.55; color: #c7c2ea; }
.meaning b { color: var(--accent2); font-weight: 600; }

.nutshell { margin-top: 16px; border-color: rgba(106,215,255,.35); background: linear-gradient(135deg, rgba(179,136,255,.10), rgba(106,215,255,.06)); }
.nutshell h3 { color: var(--accent2); }
.nutshell p { color: var(--ink); font-size: 16px; line-height: 1.65; }

.verse { margin-top: 16px; text-align: center; border-color: rgba(179,136,255,.28); background: linear-gradient(135deg, rgba(106,215,255,.05), rgba(179,136,255,.07)); }
.verse .vtie { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent2); margin-bottom: 14px; }
.verse .vtext { font-family: 'Fraunces', serif; font-style: italic; font-size: 20px; line-height: 1.5; color: var(--ink); max-width: 720px; margin: 0 auto; }
.verse .vref { margin-top: 14px; font-size: 13.5px; color: var(--accent); font-weight: 600; }
.verse .vref span { color: var(--muted); font-weight: 400; }

/* info tooltips on card headers */
.card h3 { display: flex; align-items: center; gap: 8px; }
.info { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line);
  color: var(--muted); font-size: 11px; font-weight: 700; font-style: italic; font-family: 'Fraunces', serif; cursor: pointer;
  position: relative; flex: none; user-select: none; transition: .14s; }
.info:hover, .info:focus, .info.open { color: var(--accent2); border-color: var(--accent2); outline: none; }
.info .tip { display: none; position: absolute; top: calc(100% + 9px); left: 0; width: min(280px, 78vw); z-index: 40;
  background: #15122e; border: 1px solid rgba(106,215,255,.3); border-radius: 12px; padding: 12px 14px;
  font: 400 13px/1.5 'Space Grotesk', sans-serif; font-style: normal; color: #d8d2ff; text-transform: none; letter-spacing: 0;
  box-shadow: 0 16px 40px -10px rgba(0,0,0,.7); }
.info .tip::before { content: ''; position: absolute; top: -6px; left: 12px; width: 11px; height: 11px; background: #15122e;
  border-left: 1px solid rgba(106,215,255,.3); border-top: 1px solid rgba(106,215,255,.3); transform: rotate(45deg); }
.info:hover .tip, .info:focus .tip, .info.open .tip { display: block; }
/* keep right-column tooltips from overflowing the viewport edge */
.grid > .card:nth-child(even) .info .tip { left: auto; right: 0; }
.grid > .card:nth-child(even) .info .tip::before { left: auto; right: 12px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 30px 0 8px; }
#comparePartner { background: linear-gradient(120deg, #ff9bd0, var(--accent)) !important; color: #140b22 !important; border: 0 !important; font-weight: 700; }
.actions .btnlink { display: inline-flex; align-items: center; font: inherit; font-weight: 600; font-size: 15px; color: var(--ink); text-decoration: none; background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 10px 22px; transition: .14s; }
.actions .btnlink:hover { border-color: var(--accent2); color: var(--accent2); }
.actions button { font-size: 15px; }
#savepdf { background: linear-gradient(120deg, var(--accent2), var(--accent)) !important; color: #140b22 !important; border: 0 !important; font-weight: 700; }
#savepdf:disabled { opacity: .7; cursor: default; }
.foot { text-align: center; color: var(--muted); font-size: 12px; line-height: 1.6; max-width: 640px; margin: 18px auto 0; }

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .card.span2 { grid-column: span 1; }
  .stats { grid-template-columns: 1fr; }
}
