/* Kinista — deep-space lineage. Glass panels, aurora light, gold for ancestors. */
:root {
  --void: #06070D;
  --deep: #0B0E24;
  --panel: rgba(255, 255, 255, .045);
  --panel-strong: rgba(255, 255, 255, .075);
  --edge: rgba(255, 255, 255, .10);
  --edge-strong: rgba(255, 255, 255, .18);
  --ink: #EEF0FF;
  --muted: #A3A9CC;
  --faint: #6E7499;
  --violet: #7C5CFF;
  --violet-soft: #A78BFA;
  --cyan: #22D3EE;
  --gold: #F5B942;
  --leaf: #34D399;
  --clay: #FB7185;
  --aurora: linear-gradient(110deg, #F5B942 0%, #A78BFA 45%, #22D3EE 100%);
  --aurora-btn: linear-gradient(110deg, #7C5CFF 0%, #5B8CFF 50%, #22D3EE 100%);
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 24px;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --ui: "Manrope", system-ui, sans-serif;
  --read: "Manrope", system-ui, sans-serif;
  --line: rgba(124, 92, 255, .45);
  --ochre-ink: var(--gold);
  --indigo-soft: rgba(124, 92, 255, .16);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--void); color: var(--ink);
  font: 400 1rem/1.6 var(--ui);
  -webkit-font-smoothing: antialiased;
}
/* ambient aurora behind every page */
body::before {
  content: ""; position: fixed; inset: -20% -10% auto -10%; height: 90vh; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 50% at 15% 20%, rgba(124, 92, 255, .22), transparent 70%),
    radial-gradient(35% 45% at 85% 10%, rgba(34, 211, 238, .14), transparent 70%),
    radial-gradient(30% 40% at 60% 60%, rgba(245, 185, 66, .07), transparent 70%);
  filter: blur(10px);
}
body::after { /* fine grain so gradients don't band */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main { flex: 1; outline: none; }
main:focus, main:focus-visible { outline: none; }
a { color: inherit; }
img { max-width: 100%; display: block; }
::selection { background: rgba(124, 92, 255, .5); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--deep); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(720px, 100% - 32px); margin-inline: auto; }

/* ---------- glass header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(16px, calc((100% - 1160px) / 2));
  background: rgba(6, 7, 13, .55); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--edge);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.05rem/1 var(--display); letter-spacing: .02em; }
.brand svg { color: var(--violet-soft); filter: drop-shadow(0 0 8px rgba(124, 92, 255, .7)); }
.topnav { display: flex; align-items: center; gap: 22px; }
.topnav > a:not(.btn) { text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem; }
.topnav > a:not(.btn):hover { color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 .98rem/1 var(--ui); padding: 14px 22px; border-radius: 999px;
  border: 0; background: var(--aurora-btn); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset, 0 8px 24px rgba(124, 92, 255, .35);
  transition: transform .2s, box-shadow .2s, filter .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(255, 255, 255, .2) inset, 0 12px 32px rgba(34, 211, 238, .35); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: progress; transform: none; }
.btn-small { padding: 9px 16px; font-size: .88rem; }
.btn-quiet { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--edge-strong) inset; }
.btn-quiet:hover { background: var(--panel-strong); box-shadow: 0 0 0 1px rgba(167, 139, 250, .6) inset, 0 0 24px rgba(124, 92, 255, .2); }
.btn-danger { background: transparent; color: var(--clay); box-shadow: 0 0 0 1px rgba(251, 113, 133, .5) inset; }
.btn-danger:hover { background: rgba(251, 113, 133, .1); box-shadow: 0 0 0 1px var(--clay) inset; }
.btn-link { background: none; border: 0; padding: 0; color: var(--cyan); text-decoration: underline; cursor: pointer; font: inherit; }

/* ---------- forms ---------- */
label { display: block; font-weight: 700; font-size: .86rem; margin-bottom: 6px; color: #D6DAF5; }
.hint { color: var(--faint); font-size: .84rem; font-weight: 500; }
input, select, textarea {
  width: 100%; font: 500 1rem/1.4 var(--ui); color: var(--ink);
  background: rgba(255, 255, 255, .035); border: 1px solid var(--edge); border-radius: var(--radius-s);
  padding: 12px 14px; transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
select option { background: var(--deep); }
textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(167, 139, 250, .8); background: rgba(124, 92, 255, .07); box-shadow: 0 0 0 4px rgba(124, 92, 255, .18); }
.field { margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
fieldset { border: 0; padding: 0; margin: 0 0 8px; }
legend { font: 600 1.05rem/1.3 var(--display); margin-bottom: 14px; padding: 0; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--violet); }
.error-box { background: rgba(251, 113, 133, .1); border: 1px solid rgba(251, 113, 133, .4); padding: 12px 16px; border-radius: var(--radius-s); margin: 12px 0; color: #FFD5DC; }
.ok-box { background: rgba(52, 211, 153, .08); border: 1px solid rgba(52, 211, 153, .4); padding: 12px 16px; border-radius: var(--radius-s); margin: 12px 0; color: #C9F7E5; }

/* ---------- glass surfaces ---------- */
.glass, .card, .result, .preview-card, .pay-card, .tile {
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .025));
  border: 1px solid var(--edge);
  border-radius: var(--radius-l);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; min-height: min(86vh, 820px); display: flex; align-items: center; padding: 64px 0 80px; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after { /* fade the constellation behind the copy on small screens */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(6, 7, 13, .85) 0%, rgba(6, 7, 13, .45) 45%, rgba(6, 7, 13, 0) 70%);
}
@media (max-width: 900px) { .hero::after { background: linear-gradient(180deg, rgba(6, 7, 13, .2), rgba(6, 7, 13, .78) 55%); } }
.hero .wrap { position: relative; z-index: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 8px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--edge-strong); font-size: .86rem; font-weight: 600; color: #D6DAF5; margin-bottom: 26px;
}
.pill .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--aurora); box-shadow: 0 0 14px rgba(167, 139, 250, .8); }
.hero h1 {
  font: 600 clamp(2.5rem, 6.4vw, 5.4rem)/1.0 var(--display); letter-spacing: -.035em; margin: 0 0 22px; max-width: 11ch;
  background: linear-gradient(180deg, #FFFFFF 30%, #B9B3FF 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); max-width: 46ch; margin: 0 0 34px; color: var(--muted); }
.searchbar {
  position: relative; display: flex; align-items: center; max-width: 640px; padding: 7px;
  background: rgba(10, 12, 30, .72); border-radius: 999px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.searchbar::before { /* animated aurora ring */
  content: ""; position: absolute; inset: -1.5px; border-radius: inherit; padding: 1.5px; z-index: -1;
  background: conic-gradient(from var(--spin, 0deg), #F5B942, #7C5CFF, #22D3EE, #7C5CFF, #F5B942);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 6s linear infinite;
}
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --spin: 360deg; } }
.searchbar svg { flex: none; margin-left: 14px; color: var(--muted); }
.searchbar input { border: 0; background: transparent; font-size: 1.1rem; padding: 14px 12px; color: var(--ink); }
.searchbar input:focus { box-shadow: none; background: transparent; }
.searchbar .btn { padding: 15px 26px; }
.hero .examples { margin-top: 18px; font-size: .92rem; color: var(--faint); }
.hero .examples button { background: var(--panel); border: 1px solid var(--edge); color: var(--ink); border-radius: 999px; padding: 4px 12px; margin: 0 2px; cursor: pointer; font: 600 .86rem var(--ui); }
.hero .examples button:hover { border-color: var(--violet-soft); }
.hero.compact { min-height: 0; padding: 40px 0 36px; }
.hero.compact h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); max-width: none; }
.hero.compact p.lede, .hero.compact .pill { display: none; }

/* ---------- bento ---------- */
.section-head { margin: 88px 0 28px; max-width: 640px; }
.section-head h2 { font: 600 clamp(1.7rem, 3.4vw, 2.6rem)/1.1 var(--display); letter-spacing: -.02em; margin: 0 0 12px; }
.section-head p { color: var(--muted); margin: 0; font-size: 1.05rem; }
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.tile { padding: 26px; position: relative; overflow: hidden; min-height: 220px; }
.tile h3 { font: 600 1.15rem/1.25 var(--display); margin: 0 0 10px; letter-spacing: -.01em; }
.tile p { color: var(--muted); margin: 0; }
.tile .big { font: 600 3.2rem/1 var(--display); background: var(--aurora); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 12px; display: block; }
.tile::before { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; right: -90px; top: -110px; background: radial-gradient(circle, rgba(124, 92, 255, .28), transparent 65%); pointer-events: none; }
.tile.gold::before { background: radial-gradient(circle, rgba(245, 185, 66, .22), transparent 65%); }
.tile.cyan::before { background: radial-gradient(circle, rgba(34, 211, 238, .22), transparent 65%); }
.t-a { grid-column: span 3; } .t-b { grid-column: span 3; } .t-c { grid-column: span 2; } .t-d { grid-column: span 2; } .t-e { grid-column: span 2; }
@media (max-width: 900px) { .bento { grid-template-columns: 1fr 1fr; } .t-a, .t-b { grid-column: span 2; } .t-c, .t-d, .t-e { grid-column: span 1; } }
@media (max-width: 600px) { .bento { grid-template-columns: 1fr; } .t-a, .t-b, .t-c, .t-d, .t-e { grid-column: span 1; } }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding: 0; list-style: none; }
.tags li { white-space: nowrap; padding: 6px 12px; border-radius: 999px; font-size: .84rem; font-weight: 700; background: rgba(255, 255, 255, .05); border: 1px solid var(--edge); }
.tags li.momo { border-color: rgba(245, 185, 66, .45); color: #FFE2A6; }
.tags li.card { border-color: rgba(34, 211, 238, .45); color: #B6F2FB; }
.mini-history { list-style: none; padding: 0; margin: 18px 0 0; font-size: .86rem; }
.mini-history li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, .035); border: 1px solid var(--edge); margin-bottom: 6px; color: #D6DAF5; }
.mini-history li span:last-child { color: var(--cyan); font-weight: 700; }
.mini-tree { margin-top: 14px; width: 100%; height: auto; }
.cta-band {
  margin: 88px 0 40px; padding: clamp(32px, 6vw, 64px); border-radius: var(--radius-l); position: relative; overflow: hidden; text-align: center;
  background: radial-gradient(60% 120% at 50% 0%, rgba(124, 92, 255, .35), rgba(11, 14, 36, .9) 70%); border: 1px solid var(--edge-strong);
}
.cta-band h2 { font: 600 clamp(1.7rem, 3.6vw, 2.8rem)/1.1 var(--display); margin: 0 0 14px; letter-spacing: -.02em; }
.cta-band p { color: var(--muted); max-width: 52ch; margin: 0 auto 26px; }
.how { display: none; }

/* ---------- search results ---------- */
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 34px 0 16px; flex-wrap: wrap; }
.results-head h2 { font: 600 1.5rem/1.2 var(--display); margin: 0; letter-spacing: -.01em; }
.result { padding: 22px 24px; margin-bottom: 14px; display: grid; grid-template-columns: 1fr auto; gap: 12px 24px; align-items: start; transition: border-color .25s, transform .25s, box-shadow .25s; }
.result:hover { border-color: rgba(167, 139, 250, .55); box-shadow: 0 0 40px rgba(124, 92, 255, .15); }
.result h3 { font: 600 1.2rem/1.25 var(--display); margin: 0 0 4px; }
.result h3 a { text-decoration: none; }
.result h3 a:hover { color: var(--violet-soft); }
.origin { color: var(--muted); font-size: .94rem; margin: 0 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.chip { background: rgba(124, 92, 255, .12); border: 1px solid rgba(124, 92, 255, .3); border-radius: 999px; padding: 4px 12px; font-size: .86rem; font-weight: 600; }
.chip small { color: var(--muted); font-weight: 500; }
.result .count { text-align: right; color: var(--muted); font-size: .88rem; }
.result .count strong { display: block; font: 600 2rem/1 var(--display); background: var(--aurora); -webkit-background-clip: text; background-clip: text; color: transparent; }
.result details summary { cursor: pointer; color: var(--faint); }
.result details a { color: var(--cyan); }
@media (max-width: 560px) { .result { grid-template-columns: 1fr; } .result .count { text-align: left; } }
.empty { text-align: center; padding: 56px 16px; color: var(--muted); }
.empty h2 { color: var(--ink); font: 600 1.5rem/1.3 var(--display); }

/* ---------- tree page ---------- */
.tree-head { padding: 44px 0 24px; margin-bottom: 8px; }
.tree-head h1 { font: 600 clamp(1.9rem, 4.4vw, 3.2rem)/1.05 var(--display); margin: 0 0 10px; letter-spacing: -.03em; }
.tree-head .desc { max-width: 70ch; margin: 14px 0 0; color: #D6DAF5; }
.tree-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.tabs { display: inline-flex; gap: 4px; padding: 5px; margin-bottom: 24px; overflow-x: auto; max-width: 100%; background: var(--panel); border: 1px solid var(--edge); border-radius: 999px; }
.tabs button { background: none; border: 0; padding: 9px 18px; border-radius: 999px; font: 700 .92rem var(--ui); color: var(--muted); cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: #fff; background: var(--aurora-btn); box-shadow: 0 6px 18px rgba(124, 92, 255, .35); }

/* preview + paywall */
.paywall { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; margin: 20px 0 64px; align-items: start; }
@media (max-width: 860px) { .paywall { grid-template-columns: 1fr; } }
.preview-card, .pay-card { padding: 28px; }
.stats { display: flex; gap: 32px; margin: 4px 0 22px; flex-wrap: wrap; }
.stats div { font-size: .88rem; color: var(--muted); }
.stats strong { display: block; font: 600 2.2rem/1 var(--display); color: var(--ink); margin-bottom: 4px; }
.blurred-names { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.blurred-names li { padding: 10px 12px; border: 1px solid var(--edge); background: rgba(255, 255, 255, .03); border-radius: 12px; font-size: .94rem; font-weight: 600; }
.pay-card { position: relative; border-color: transparent; background: linear-gradient(rgba(12, 14, 34, .92), rgba(12, 14, 34, .92)) padding-box, var(--aurora) border-box; border: 1.5px solid transparent; box-shadow: 0 0 60px rgba(124, 92, 255, .22); }
.pay-card h2 { font: 600 1.5rem/1.2 var(--display); margin: 0 0 8px; }
.pay-card > p { color: var(--muted); }
.price { font: 600 3.6rem/1 var(--display); margin: 16px 0; letter-spacing: -.03em; }
.price small { font: 600 .95rem var(--ui); color: var(--muted); letter-spacing: 0; }
.pay-methods { display: flex; gap: 6px; margin: 18px 0; padding: 5px; background: var(--panel); border: 1px solid var(--edge); border-radius: 999px; }
.pay-methods button { flex: 1; padding: 11px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 700 .94rem var(--ui); cursor: pointer; }
.pay-methods button[aria-pressed="true"] { background: rgba(255, 255, 255, .1); color: var(--ink); box-shadow: 0 0 0 1px var(--edge-strong) inset; }
.fine { font-size: .85rem; color: var(--faint); }

/* family chart */
.chart-scroll { overflow-x: auto; padding: 28px 0 40px; margin: 0 -16px; padding-inline: 16px; border-radius: var(--radius-l);
  background: radial-gradient(70% 80% at 50% 0%, rgba(124, 92, 255, .10), transparent 70%); }
.chart, .chart ul { list-style: none; margin: 0; padding: 0; }
.chart { display: flex; gap: 36px; justify-content: flex-start; min-width: max-content; padding: 0 8px; }
.chart ul { display: flex; justify-content: center; padding-top: 26px; position: relative; }
.chart li { display: flex; flex-direction: column; align-items: center; position: relative; padding: 26px 10px 0; }
.chart > li { padding-top: 0; }
.chart ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 26px; border-left: 1.5px solid var(--line); }
.chart ul > li::before, .chart ul > li::after { content: ""; position: absolute; top: 0; height: 26px; width: 50%; border-top: 1.5px solid var(--line); }
.chart ul > li::before { right: 50%; }
.chart ul > li::after { left: 50%; border-left: 1.5px solid var(--line); }
.chart ul > li:only-child::before, .chart ul > li:only-child::after { border-top: 0; }
.chart ul > li:only-child::before { display: none; }
.chart ul > li:first-child::before, .chart ul > li:last-child::after { border-top: 0; }
.chart ul > li:first-child::after { border-radius: 10px 0 0 0; }
.chart ul > li:last-child::before { border-right: 1.5px solid var(--line); border-radius: 0 10px 0 0; }
.couple { display: flex; align-items: center; }
.couple .bond { width: 18px; height: 2px; background: var(--aurora); box-shadow: 0 0 10px rgba(245, 185, 66, .6); }
.node {
  display: flex; align-items: center; gap: 12px; min-width: 170px; max-width: 240px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .03));
  border: 1px solid var(--edge); border-radius: 14px; padding: 10px 14px 10px 10px;
  cursor: pointer; text-align: left; font: inherit; color: inherit; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.node:hover { border-color: rgba(167, 139, 250, .7); box-shadow: 0 0 28px rgba(124, 92, 255, .3); transform: translateY(-2px); }
.node .nm { font-weight: 700; font-size: .95rem; line-height: 1.2; display: block; }
.node .yr { font-size: .8rem; color: var(--muted); display: block; margin-top: 2px; }
.node.is-living { box-shadow: 0 0 0 1px rgba(52, 211, 153, .35) inset; }
.node.is-living .yr::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--leaf); box-shadow: 0 0 8px var(--leaf); margin-right: 6px; vertical-align: 1px; }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font: 600 .82rem var(--display); color: #fff; overflow: hidden;
  background: linear-gradient(135deg, rgba(124, 92, 255, .8), rgba(34, 211, 238, .6)); box-shadow: 0 0 16px rgba(124, 92, 255, .35); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 104px; height: 104px; font-size: 1.9rem; border-radius: 22px; }

.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.people .node { max-width: none; width: 100%; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar input { max-width: 360px; border-radius: 999px; }

.history { list-style: none; padding: 0; margin: 0; }
.history li { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 16px 18px; margin-bottom: 8px; border-radius: 14px; background: rgba(255, 255, 255, .035); border: 1px solid var(--edge); }
.history .when { color: var(--faint); font-size: .84rem; }
.history .what { font-weight: 700; }
.history .detail { grid-column: 1 / -1; font-size: .86rem; color: var(--muted); word-break: break-word; }
.history .reverted { text-decoration: line-through; opacity: .5; }

/* drawers & modals */
dialog.drawer {
  margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(580px, 100%);
  border: 0; border-left: 1px solid var(--edge-strong); padding: 0; color: var(--ink);
  background: linear-gradient(180deg, rgba(16, 18, 42, .96), rgba(8, 9, 20, .98));
  box-shadow: -30px 0 80px rgba(0, 0, 0, .5);
}
dialog.drawer[open] { animation: slidein .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
dialog::backdrop { background: rgba(3, 4, 10, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog.modal { border: 1px solid var(--edge-strong); border-radius: var(--radius-l); padding: 0; width: min(580px, 100% - 24px); color: var(--ink);
  background: linear-gradient(180deg, rgba(18, 20, 46, .97), rgba(10, 11, 26, .98)); box-shadow: 0 30px 100px rgba(0, 0, 0, .6), 0 0 60px rgba(124, 92, 255, .2); }
dialog.modal[open] { animation: pop .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.drawer-inner, .modal-inner { padding: 28px; }
.drawer-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 22px; }
.drawer-head h2, .modal-inner h2 { font: 600 1.6rem/1.15 var(--display); margin: 0 0 6px; letter-spacing: -.02em; }
.close { margin-left: auto; background: var(--panel); border: 1px solid var(--edge); width: 38px; height: 38px; border-radius: 50%; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--muted); }
.close:hover { color: var(--ink); border-color: var(--edge-strong); }
dl.facts { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0 0 20px; padding: 18px; border-radius: 16px; background: rgba(255, 255, 255, .03); border: 1px solid var(--edge); }
dl.facts dt { color: var(--faint); font-size: .86rem; font-weight: 600; }
dl.facts dd { margin: 0; font-weight: 600; }
@media (max-width: 480px) { dl.facts { grid-template-columns: 1fr; gap: 2px; } dl.facts dd { margin-bottom: 10px; } }
.story { line-height: 1.75; white-space: pre-wrap; color: #DADDF7; padding: 18px; border-radius: 16px; border: 1px solid var(--edge); background: rgba(245, 185, 66, .04); }
.relations { margin: 18px 0; }
.relations h3 { font: 700 .82rem var(--ui); color: var(--faint); margin: 16px 0 8px; text-transform: none; }
.relations ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.rel-pill { display: inline-flex; align-items: center; gap: 4px; background: rgba(124, 92, 255, .12); border: 1px solid rgba(124, 92, 255, .3); border-radius: 999px; padding: 5px 6px 5px 14px; font-size: .9rem; }
.rel-pill button { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 1rem; padding: 0 6px; }
.rel-pill .go { color: var(--ink); text-decoration: none; font-weight: 700; padding: 0; font: inherit; font-weight: 700; }
.rel-pill .go:hover { color: var(--violet-soft); }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--edge); }

.access-box { background: rgba(34, 211, 238, .06); border: 1px solid rgba(34, 211, 238, .3); border-radius: 14px; padding: 16px 18px; margin: 16px 0; }
.access-box code { display: block; word-break: break-all; font-size: .84rem; color: #B6F2FB; }

.page-title { font: 600 clamp(2rem, 4.4vw, 3rem)/1.08 var(--display); margin: 52px 0 10px; letter-spacing: -.03em; }
.page-intro { color: var(--muted); margin: 0 0 28px; max-width: 60ch; font-size: 1.05rem; }
.card { padding: 28px; margin-bottom: 20px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; margin: 36px auto; background: conic-gradient(from 0deg, transparent, var(--violet), var(--cyan)); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0); animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.center { text-align: center; }

.footer { border-top: 1px solid var(--edge); padding: 32px max(16px, calc((100% - 1160px) / 2)); color: var(--faint); font-size: .88rem; margin-top: 40px; }
.footer p { margin: 4px 0; }
.footer a { color: var(--muted); }

#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: rgba(16, 18, 42, .92); border: 1px solid var(--edge-strong); color: #fff; padding: 13px 20px; border-radius: 999px; font-weight: 600;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 10px 40px rgba(0, 0, 0, .5), 0 0 30px rgba(124, 92, 255, .25);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 100; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.mock-banner { background: rgba(245, 185, 66, .14); border-bottom: 1px solid rgba(245, 185, 66, .4); color: #FFE2A6; text-align: center; padding: 8px 12px; font-size: .86rem; font-weight: 700; }

/* reveal-on-scroll (GSAP sets these; without JS everything stays visible) */
.js-motion [data-reveal] { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .js-motion [data-reveal] { opacity: 1; }
}

@media (max-width: 520px) {
  .topnav { gap: 12px; }
  .topnav > a:not(.btn) { display: none; }
  .pill { font-size: .78rem; }
  .searchbar .btn { padding: 13px 18px; }
}
