:root {
  --ink:#07080D; --surface:#0C0E15; --raised:#12151F; --line:#1D2130; --line2:#2A2F42;
  --fg:#E8EAF2; --muted:#8C93A8; --faint:#5A6178;
  --violet:#8B5CF6; --cyan:#22D3EE; --red:#FF5470; --amber:#FFB547; --green:#3EE08F;
}
html, body { background: var(--ink); color: var(--fg); }
body {
  background:
    radial-gradient(900px 500px at -10% -20%, rgba(139,92,246,.14), transparent 60%),
    radial-gradient(700px 420px at 110% -10%, rgba(34,211,238,.08), transparent 60%),
    var(--ink);
}
.card { background: rgba(12,14,21,.82); border: 1px solid var(--line); border-radius: 16px; }
.hair { border-color: var(--line); }
.grad { background: linear-gradient(90deg, var(--violet), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chip { display:inline-flex; align-items:center; gap:.35rem; border:1px solid var(--line2); border-radius:999px; padding:.18rem .6rem; font-size:.74rem; white-space:nowrap; }
.btn { display:inline-flex; align-items:center; gap:.35rem; border:1px solid var(--line2); border-radius:8px; padding:.25rem .6rem; font-size:.75rem; color: var(--muted); }
.btn:hover:not(:disabled) { color: var(--fg); border-color: var(--faint); }
.btn:disabled { opacity: .45; cursor: default; }
.node { display:inline-flex; align-items:center; gap:.3rem; background: var(--raised); border:1px solid var(--line2); border-radius:7px; padding:.08rem .45rem; font-size:.74rem; white-space:nowrap; }
.dot { width:.5rem; height:.5rem; border-radius:999px; flex:none; }
abbr[data-g] { text-decoration: underline dotted rgba(140,147,168,.7); text-underline-offset: 3px; cursor: help; }
.md { line-height: 1.6; font-size: .9rem; }
.md p { margin: .45rem 0; } .md ul { list-style: disc; padding-left: 1.2rem; margin: .4rem 0; }
.md ol { list-style: decimal; padding-left: 1.3rem; margin: .4rem 0; } .md li { margin: .2rem 0; }
.md h1, .md h2, .md h3 { font-weight: 600; margin: .9rem 0 .35rem; color: #fff; } .md h1 { font-size: 1.05rem; } .md h2 { font-size: 1rem; } .md h3 { font-size: .92rem; }
.md strong { color: #fff; font-weight: 600; }
.md code { font-family: 'Geist Mono', monospace; font-size: .74rem; background: rgba(34,211,238,.08); color: #9BE7F4; padding: .05rem .3rem; border-radius: 5px; word-break: break-word; }
.md pre { background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: .6rem; overflow-x: auto; }
.md table { width: 100%; border-collapse: collapse; font-size: .8rem; margin: .5rem 0; display: block; overflow-x: auto; }
.md th { text-align: left; color: var(--muted); font-weight: 500; }
.md td, .md th { border-bottom: 1px solid var(--line); padding: .35rem .5rem; vertical-align: top; }
.md hr { border-color: var(--line); margin: .8rem 0; }
.scroll::-webkit-scrollbar { width: 8px; height: 8px; } .scroll::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 8px; }
.typing span { width:.35rem; height:.35rem; border-radius:999px; background: var(--cyan); display:inline-block; animation: b 1.2s infinite ease-in-out; }
.typing span:nth-child(2){ animation-delay:.15s } .typing span:nth-child(3){ animation-delay:.3s }
@keyframes b { 0%,80%,100% { opacity:.25; transform: translateY(0) } 40% { opacity:1; transform: translateY(-3px) } }
.pulse { animation: p 2s infinite; } @keyframes p { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.bar { height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; } .bar > i { display:block; height:100%; border-radius:99px; transition: width 1s linear; }
.fade-in { animation: f .25s ease-out; } @keyframes f { from { opacity: 0; transform: translateY(4px) } to { opacity: 1; transform: none } }
.clamp { max-height: 12rem; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.field { width: 100%; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: .45rem .6rem; font-size: .84rem; color: var(--fg); outline: none; }
.field:focus { border-color: rgba(34,211,238,.6); } .field[readonly], .field:disabled { color: var(--muted); }
#tour-spot { position: fixed; z-index: 60; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(3,4,8,.72); border: 2px solid var(--cyan); pointer-events: none; transition: all .25s ease; }
#tour-tip { position: fixed; z-index: 61; width: min(340px, calc(100vw - 32px)); }
/* Meet Fernwave */
.flow path { stroke-dasharray: 3 7; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -20; } }
.ptile { transition: transform .2s, border-color .2s; } .ptile:hover { transform: translateY(-3px); border-color: var(--line2); }
.node2 { border: 1px solid var(--line); border-radius: 14px; background: rgba(12,14,21,.85); padding: .7rem .85rem; }
/* swipe deck */
.deck { position: relative; width: min(370px, 100%); height: 510px; margin: 0 auto; touch-action: pan-y; user-select: none; }
.sc { position: absolute; inset: 0; perspective: 1600px; transform-origin: 50% 100%; transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .35s; will-change: transform; }
.sc.drag { transition: none; }
.sc-in { position: relative; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.2,.7,.2,1); transform-style: preserve-3d; }
.sc.on .sc-in { transform: rotateY(180deg); }
.sf { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 22px; overflow: hidden;
      border: 1px solid var(--line2); background: var(--surface); box-shadow: 0 30px 60px -20px rgba(0,0,0,.7); clip-path: inset(0 round 22px); }
.sf.back { transform: rotateY(180deg); }
.art { position: absolute; inset: 0; pointer-events: none; overflow: hidden; clip-path: inset(0 round 22px); }
.art svg { width: 100%; height: 100%; display: block; }
.veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7,8,13,.15) 0%, rgba(7,8,13,.55) 45%, rgba(7,8,13,.96) 75%); }
.stamp { position: absolute; top: 26px; padding: .2rem .6rem; border: 2px solid; border-radius: 8px; font: 700 .8rem 'Geist Mono', monospace;
         letter-spacing: .1em; opacity: 0; transform: rotate(-12deg); pointer-events: none; }
.tl { display: flex; gap: .35rem; }
.tl button { height: 6px; border-radius: 99px; background: var(--line2); flex: 1; transition: background .3s, flex .3s; }
.tl button.cur { background: linear-gradient(90deg, var(--violet), var(--cyan)); flex: 3; }
.mini { position: relative; padding-left: 1.05rem; }
.mini::before { content: ''; position: absolute; left: .2rem; top: .45rem; width: .4rem; height: .4rem; border-radius: 99px; background: var(--c, var(--cyan)); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 8px; }

/* Live CVEs */
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 6px;
  box-shadow: 0 0 0 0 rgba(255,84,112,.6); animation: live 1.8s infinite; vertical-align: middle; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(255,84,112,.55) } 70% { box-shadow: 0 0 0 7px rgba(255,84,112,0) } 100% { box-shadow: 0 0 0 0 rgba(255,84,112,0) } }
.lens-step { transition: transform .15s ease, border-color .15s ease; }
.lens-step:hover { transform: translateX(3px); }
.lens-bar { transition: width .6s cubic-bezier(.2,.8,.2,1); }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none } .lens-step, .lens-bar { transition: none } }
