:root {
  --bg: #07060d;
  --panel: rgba(22, 19, 38, 0.55);
  --panel-solid: #14121f;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f1eefc;
  --muted: #a49fc0;
  --accent: #a78bfa;
  --accent-2: #7c3aed;
  --accent-3: #22d3ee;
  --accent-4: #f472b6;
  --glow: 0 0 24px rgba(124, 58, 237, 0.45);
  --card-radius: 18px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
::selection { background: rgba(124, 58, 237, 0.55); color: #fff; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  font-size: 17px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: #0b0a14; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--accent-2), var(--accent-3)); border-radius: 8px; border: 3px solid #0b0a14; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 780px; }

/* ---------- aurora background ---------- */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.aurora span {
  position: absolute; border-radius: 50%; filter: blur(110px); opacity: 0.5;
  animation: drift 26s ease-in-out infinite alternate;
}
.aurora .a1 { width: 55vw; height: 55vw; left: -12vw; top: -18vw; background: radial-gradient(circle, #6d28d9 0%, transparent 65%); }
.aurora .a2 { width: 48vw; height: 48vw; right: -14vw; top: 8vh; background: radial-gradient(circle, #0e7490 0%, transparent 65%); animation-delay: -8s; animation-duration: 32s; }
.aurora .a3 { width: 42vw; height: 42vw; left: 22vw; bottom: -22vw; background: radial-gradient(circle, #9d174d 0%, transparent 65%); animation-delay: -16s; animation-duration: 38s; }
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(6vw, -4vh) scale(1.12); }
  100% { transform: translate(-4vw, 5vh) scale(0.95); }
}
.noise {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.035;
  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.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- header ---------- */
header.site {
  border-bottom: 1px solid var(--line);
  background: rgba(7, 6, 13, 0.72);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  position: sticky; top: 0; z-index: 10;
}
.nav { display: flex; align-items: center; gap: 22px; padding: 15px 0; }
.nav .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 19px; color: var(--text); letter-spacing: 0.2px;
}
.nav .brand:hover { text-decoration: none; }
.nav .brand img { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 0 14px rgba(124, 58, 237, 0.6); }
.nav .tag { color: var(--muted); font-size: 13px; font-weight: 500; margin-left: 2px; }
.nav nav { margin-left: auto; display: flex; gap: 20px; align-items: center; }
.nav nav a { color: var(--muted); font-size: 15px; font-weight: 500; position: relative; }
.nav nav a:hover { color: var(--text); text-decoration: none; }
.nav nav a.cta {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  padding: 8px 18px; border-radius: 999px; font-weight: 700;
  box-shadow: 0 0 0 rgba(124, 58, 237, 0);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.nav nav a.cta:hover { box-shadow: var(--glow); transform: translateY(-1px); }

/* ---------- ticker ---------- */
.ticker {
  overflow: hidden; white-space: nowrap;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.16), rgba(34, 211, 238, 0.1), rgba(244, 114, 182, 0.12));
  font-size: 13px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
  padding: 9px 0; position: relative; z-index: 9;
}
.ticker .track { display: inline-block; animation: ticker 30s linear infinite; }
.ticker span { margin: 0 14px; color: #d8d2f5; }
.ticker b { color: var(--accent-3); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- hero ---------- */
.hero { padding: 84px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.hero h1 {
  font-size: clamp(32px, 5.4vw, 54px);
  line-height: 1.12; letter-spacing: -1px; margin-bottom: 20px;
}
.hero h1 .grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-3), var(--accent-4), var(--accent));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 7s linear infinite;
}
@keyframes shimmer { to { background-position: 300% 0; } }
.hero .sub { color: var(--muted); font-size: 19px; max-width: 560px; }
.hero .row { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.hero .chips { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.chip {
  font-size: 13px; font-weight: 700; color: var(--text);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04); backdrop-filter: blur(6px);
}
.chip b { color: var(--accent-3); }

/* ---------- terminal ---------- */
.terminal {
  border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: rgba(10, 8, 20, 0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), var(--glow);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13.5px; line-height: 1.75;
}
.terminal .bar {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}
.terminal .dot { width: 11px; height: 11px; border-radius: 50%; }
.terminal .dot.r { background: #ff5f57; } .terminal .dot.y { background: #febc2e; } .terminal .dot.g { background: #28c840; }
.terminal .bar .title { margin-left: 8px; color: var(--muted); font-size: 12px; }
.terminal .body { padding: 16px 18px 20px; min-height: 218px; color: #d9d5f2; }
.terminal .p { color: var(--accent-3); }
.terminal .ok { color: #4ade80; }
.terminal .dim { color: var(--muted); }
.terminal .cursor {
  display: inline-block; width: 8px; height: 15px; background: var(--accent-3);
  vertical-align: -2px; animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: 14px 28px; border-radius: 13px;
  font-weight: 700; font-size: 16px; border: 1px solid var(--line);
  position: relative; overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent) 60%, var(--accent-3));
  background-size: 160% 160%;
  color: #fff; border: none;
  box-shadow: 0 8px 26px rgba(124, 58, 237, 0.4);
}
.btn.primary:hover { box-shadow: 0 10px 38px rgba(124, 58, 237, 0.6); filter: brightness(1.08); }
.btn.primary::after {
  content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
}
.btn.primary:hover::after { animation: shine 0.9s ease; }
@keyframes shine { to { left: 130%; } }
.btn.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.btn.ghost:hover { border-color: rgba(167, 139, 250, 0.6); box-shadow: 0 0 20px rgba(124, 58, 237, 0.25); }
.btn.small { padding: 10px 20px; font-size: 14px; border-radius: 11px; }

/* ---------- cards ---------- */
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; margin-top: 30px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 30px; }
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  padding: 28px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(167, 139, 250, 0.55);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45), 0 0 30px rgba(124, 58, 237, 0.22);
}
.card h3 { font-size: 19px; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 15px; }
.card .pill {
  display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--accent);
  background: rgba(124, 58, 237, 0.16);
  border: 1px solid rgba(167, 139, 250, 0.35);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 14px;
}

/* featured card — animated conic border */
.card.featured { border-color: transparent; background-clip: padding-box; }
.card.featured::before {
  content: ""; position: absolute; inset: -1px; z-index: -1;
  border-radius: calc(var(--card-radius) + 1px);
  background: conic-gradient(from var(--ang, 0deg), var(--accent-2), var(--accent-3), var(--accent-4), var(--accent-2));
  animation: spin-border 5s linear infinite;
  opacity: 0.9;
}
.card.featured::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: var(--card-radius);
  background: linear-gradient(var(--panel-solid), var(--panel-solid));
}
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spin-border { to { --ang: 360deg; } }
.badge-float {
  position: absolute; top: -13px; right: 20px;
  background: linear-gradient(135deg, var(--accent-4), var(--accent-2));
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  padding: 5px 14px; border-radius: 999px;
  box-shadow: 0 4px 18px rgba(244, 114, 182, 0.5);
}

/* ---------- sections ---------- */
section.band { padding: 64px 0; }
section.band h2 { font-size: clamp(25px, 3.6vw, 36px); letter-spacing: -0.4px; margin-bottom: 10px; }
section.band h2 .grad2 {
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
section.band .lead { color: var(--muted); max-width: 640px; }
.band + .band { border-top: 1px solid var(--line); }

/* tips list */
.tip { display: flex; gap: 16px; margin-top: 26px; }
.tip .n {
  flex: 0 0 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 18px rgba(124, 58, 237, 0.45);
}
.tip h3 { font-size: 17px; margin-bottom: 4px; }
.tip p { color: var(--muted); font-size: 15px; }
.tip code, .reader code {
  background: rgba(124, 58, 237, 0.14);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 6px; padding: 1px 7px; font-size: 13.5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; color: #ddd6f9;
}

/* books */
.book { display: flex; flex-direction: column; gap: 8px; }
.book .price { color: var(--text); font-weight: 800; font-size: 24px; margin-top: auto; padding-top: 16px; }
.book .price s { color: var(--muted); font-weight: 500; font-size: 15px; margin-right: 8px; }
.book ul { margin: 8px 0 14px 18px; color: var(--muted); font-size: 14.5px; }
.book ul li { margin: 4px 0; }
.book .btn { margin-top: 10px; text-align: center; }

/* disclosure + footer */
.disclosure {
  font-size: 13px; color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px; padding: 12px 16px; margin-top: 34px;
  backdrop-filter: blur(8px);
}
footer.site {
  border-top: 1px solid var(--line);
  margin-top: 60px; padding: 34px 0 46px;
  color: var(--muted); font-size: 14px;
  background: rgba(255, 255, 255, 0.02);
}
footer.site .cols { display: flex; flex-wrap: wrap; gap: 40px; }
footer.site h4 { color: var(--text); font-size: 14px; margin-bottom: 10px; }
footer.site a { display: block; color: var(--muted); margin: 5px 0; }
footer.site a:hover { color: var(--accent); }
footer.site .fine { margin-top: 28px; font-size: 13px; color: #6f6a8c; }

/* ---------- reader (free pages) ---------- */
.reader { padding: 54px 0 30px; }
.reader .crumb { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.reader h1 {
  font-size: clamp(28px, 4.5vw, 42px); line-height: 1.2; margin-bottom: 8px;
  background: linear-gradient(90deg, var(--text), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.reader .deck { color: var(--muted); font-size: 18px; margin-bottom: 34px; }
.reader h2 { font-size: 24px; margin: 38px 0 10px; letter-spacing: -0.2px; }
.reader h3 { font-size: 18px; margin: 26px 0 8px; }
.reader p { color: #cfcbe6; margin: 14px 0; }
.reader ul, .reader ol { margin: 14px 0 14px 22px; color: #cfcbe6; }
.reader li { margin: 7px 0; }
.reader strong { color: var(--text); }
.reader .kbd {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: #1c1930; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; padding: 1px 7px; font-size: 14px;
}
.reader pre {
  background: rgba(10, 8, 20, 0.85);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 12px; padding: 16px 18px; overflow-x: auto; margin: 16px 0;
  box-shadow: inset 0 0 40px rgba(124, 58, 237, 0.08);
}
.reader pre code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13.5px; color: #d9d5f2; white-space: pre; }
.reader .tipbox {
  border: 1px solid rgba(167, 139, 250, 0.4);
  background: rgba(124, 58, 237, 0.12);
  border-radius: 12px; padding: 14px 18px; margin: 18px 0; font-size: 15px;
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.12);
}
.cta-strip {
  margin-top: 40px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.28), rgba(34, 211, 238, 0.14), rgba(244, 114, 182, 0.16));
  border: 1px solid rgba(167, 139, 250, 0.45);
  border-radius: var(--card-radius);
  padding: 28px 30px;
  box-shadow: 0 0 44px rgba(124, 58, 237, 0.2);
}
.cta-strip h3 { font-size: 21px; margin-bottom: 8px; }
.cta-strip p { color: var(--muted); margin-bottom: 18px; }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; } .reveal.d2 { transition-delay: 0.16s; } .reveal.d3 { transition-delay: 0.24s; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 640px) {
  .nav nav a:not(.cta) { display: none; }
  .hero { padding: 52px 0 44px; }
  .nav .tag { display: none; }
}
