/* ============================================================
   Vibe Hosting — design system (Floward brand)
   Teal #074e59 · rose #bc8a7e · sage #8baaad · warm cream bg
   Light-first (matches floward.com); dark = deep-teal night
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font: ui-sans-serif, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 16px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #faf8f7;
  --bg2: #ffffff;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-2: rgba(7, 78, 89, 0.06);
  --border: rgba(7, 78, 89, 0.15);
  --text: #00313c;
  --muted: #5f7377;
  --code-bg: #032e36; /* code blocks stay dark teal — better contrast */
  --shadow: 0 20px 50px rgba(0, 49, 60, 0.10);
  --glow: 0 0 40px rgba(7, 78, 89, 0.14);
  --accent1: #074e59;   /* Floward teal */
  --accent2: #bc8a7e;   /* Floward rose */
  --accent3: #8baaad;   /* sage */
  --ok: #2e8b6e;
  --grad: linear-gradient(120deg, #074e59, #bc8a7e);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #01191f;
  --bg2: #00313c;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.075);
  --border: rgba(240, 233, 224, 0.13);
  --text: #f0e9e0;      /* Floward cream */
  --muted: #9ab0b3;
  --code-bg: #02242c;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  --glow: 0 0 40px rgba(140, 201, 208, 0.18);
  --accent1: #4fa3ad;   /* teal, lightened for dark bg */
  --accent2: #d9a493;   /* rose, lightened */
  --accent3: #8baaad;
  --ok: #58c9a4;
  --grad: linear-gradient(120deg, #3f97a1, #d9a493);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

html[data-theme="dark"] .only-light { display: none; }
html[data-theme="light"] .only-dark { display: none; }

a { color: inherit; text-decoration: none; }
::selection { background: color-mix(in srgb, var(--accent2) 45%, transparent); }

/* ---------- aurora background ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; filter: blur(90px); opacity: .5; }
html[data-theme="light"] .aurora { opacity: .25; }
.aurora span { position: absolute; border-radius: 50%; will-change: transform; }
.aurora span:nth-child(1) { width: 46vw; height: 46vw; left: -8vw; top: -12vw;
  background: radial-gradient(circle, var(--accent1), transparent 65%);
  animation: drift1 26s ease-in-out infinite alternate; }
.aurora span:nth-child(2) { width: 38vw; height: 38vw; right: -6vw; top: 8vh;
  background: radial-gradient(circle, var(--accent2), transparent 65%);
  animation: drift2 32s ease-in-out infinite alternate; }
.aurora span:nth-child(3) { width: 34vw; height: 34vw; left: 30vw; bottom: -18vw;
  background: radial-gradient(circle, var(--accent3), transparent 65%);
  animation: drift3 38s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(10vw, 8vh) rotate(40deg); } }
@keyframes drift2 { to { transform: translate(-8vw, 14vh) scale(1.15); } }
@keyframes drift3 { to { transform: translate(-12vw, -8vh) scale(0.9); } }

/* ---------- reading progress ---------- */
.progressbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; }
.progressbar span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .1s linear; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .8rem clamp(1rem, 4vw, 2.5rem);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.05rem; letter-spacing: .2px; }
.brand svg { color: var(--accent2); }
.brand b { color: var(--accent2); }
.topnav { display: flex; align-items: center; gap: clamp(.6rem, 2vw, 1.4rem); font-size: .92rem; }
.topnav > a { color: var(--muted); transition: color .2s; }
.topnav > a:hover { color: var(--text); }
.pill-link {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .38rem .85rem; border-radius: 999px;
  background: var(--accent1); color: #fff !important; font-weight: 600;
  box-shadow: 0 4px 18px color-mix(in srgb, var(--accent1) 35%, transparent);
  transition: transform .2s, box-shadow .2s;
}
.pill-link:hover { transform: translateY(-1px); box-shadow: 0 8px 26px color-mix(in srgb, var(--accent1) 50%, transparent); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: background .2s, transform .2s;
}
.icon-btn:hover { background: var(--surface-2); transform: rotate(15deg); }

/* ---------- hero ---------- */
.hero { display: grid; place-items: center; padding: clamp(4rem, 10vh, 8rem) 1.25rem 3rem; text-align: center; }
.hero-inner { max-width: 900px; }
.hero-badge {
  display: inline-block; padding: .35rem .95rem; border-radius: 999px; font-size: .85rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.hero h1 {
  margin: 1.2rem 0 1rem; font-size: clamp(2.3rem, 6vw, 4.2rem);
  line-height: 1.08; font-weight: 800; letter-spacing: -.02em;
}
.grad {
  background: linear-gradient(120deg, var(--accent1), var(--accent2), var(--accent1));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradShift 8s ease infinite;
}
@keyframes gradShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.hero-sub { max-width: 640px; margin: 0 auto; color: var(--muted); font-size: clamp(1rem, 2vw, 1.15rem); }
.hero-cta { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .72rem 1.35rem; border-radius: 12px; font-weight: 600; font-size: .95rem;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn-primary { background: var(--accent1); color: #fff; box-shadow: 0 6px 24px color-mix(in srgb, var(--accent1) 40%, transparent); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 34px color-mix(in srgb, var(--accent1) 55%, transparent); }
.btn-ghost { border: 1px solid var(--border); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-2); transform: translateY(-2px); }
.btn-sm { padding: .5rem .9rem; font-size: .85rem; width: 100%; justify-content: center; }

/* ---------- pipeline ---------- */
.pipeline {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  margin: 3.2rem auto 0; padding: 1.4rem 1.2rem; max-width: 720px;
  border: 1px solid var(--border); border-radius: 20px; background: var(--surface);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.pipe-node { display: flex; flex-direction: column; align-items: center; gap: .45rem; min-width: 74px; }
.pipe-node span { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.pipe-dot {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.4rem;
  border: 1px solid var(--border); background: var(--surface-2); position: relative;
}
.pipe-live .pipe-dot::after {
  content: ""; position: absolute; inset: -5px; border-radius: 20px;
  border: 2px solid var(--ok); opacity: 0; animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse { 0% { opacity: .8; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.25); } }
.pipe-line { flex: 1; height: 2px; min-width: 26px; position: relative; overflow: hidden;
  background: var(--border); border-radius: 2px; }
.pipe-line::after {
  content: ""; position: absolute; top: 0; left: -40%; width: 40%; height: 100%;
  background: var(--grad); animation: flow 2.4s linear infinite;
}
@keyframes flow { to { left: 110%; } }

/* ---------- stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem;
  max-width: 900px; margin: 1.5rem auto; padding: 0 1.25rem;
}
.stat {
  text-align: center; padding: 1.4rem 1rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
}
.stat b { display: block; font-size: 2.2rem; font-weight: 800; background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { color: var(--muted); font-size: .85rem; }

/* ---------- sections & cards ---------- */
main { display: block; }
.section-title { text-align: center; font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 800; letter-spacing: -.01em; }
.section-sub { text-align: center; color: var(--muted); margin-top: .5rem; }

.steps {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem;
  max-width: 1000px; margin: 3.5rem auto; padding: 0 1.25rem;
}
.step-card {
  padding: 1.6rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.step-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent1) 50%, transparent); box-shadow: var(--glow); }
.step-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.step-icon { font-size: 1.7rem; }
.step-n { font-family: var(--mono); color: var(--muted); font-size: .85rem; }
.step-card h3 { margin-bottom: .4rem; font-size: 1.08rem; }
.step-card p { color: var(--muted); font-size: .92rem; }

.guides-section { max-width: 1000px; margin: 4rem auto; padding: 0 1.25rem; }
.guide-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.1rem; margin-top: 2rem;
}
.guide-card {
  display: flex; flex-direction: column; gap: .45rem;
  padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.guide-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent2) 60%, transparent); box-shadow: var(--glow); }
.guide-card-top { display: flex; justify-content: space-between; align-items: center; }
.guide-icon { font-size: 1.6rem; }
.guide-num { font-family: var(--mono); font-size: .8rem; color: var(--muted);
  border: 1px solid var(--border); padding: .1rem .5rem; border-radius: 999px; }
.guide-card h3 { font-size: 1.05rem; }
.guide-card p { color: var(--muted); font-size: .9rem; flex: 1; }
.guide-meta { display: flex; align-items: center; justify-content: space-between;
  color: var(--muted); font-size: .8rem; margin-top: .4rem; }
.guide-card .go { opacity: 0; transform: translateX(-6px); transition: all .25s; color: var(--accent2); }
.guide-card:hover .go { opacity: 1; transform: translateX(0); }

.rules-section { max-width: 760px; margin: 4rem auto 5rem; padding: 0 1.25rem; }
.rules { list-style: none; margin-top: 1.6rem; display: grid; gap: .6rem; }
.rules li {
  padding: .85rem 1.1rem; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); font-size: .95rem;
}

/* ---------- guide pages ---------- */
.guide-layout {
  display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 2.5rem;
  max-width: 1150px; margin: 0 auto; padding: 2.2rem clamp(1rem, 3vw, 2rem) 4rem;
}
.sidebar { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 1rem; }
.sidebar-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.side-list { list-style: none; display: grid; gap: 2px; }
.side-list a {
  display: flex; align-items: center; gap: .55rem; padding: .48rem .7rem; border-radius: 10px;
  color: var(--muted); font-size: .88rem; transition: background .2s, color .2s;
}
.side-list a:hover { background: var(--surface-2); color: var(--text); }
.side-list .active a { background: var(--surface-2); color: var(--text); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent2); }
.side-icon { font-size: 1rem; }

.guide-main { min-width: 0; }
.guide-main.solo { max-width: 760px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.crumbs { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .85rem; margin-bottom: 1.6rem; }
.crumbs a:hover { color: var(--text); }
.read-time { margin-left: auto; border: 1px solid var(--border); border-radius: 999px; padding: .1rem .6rem; font-size: .75rem; }

.guide-content { font-size: .98rem; }
.guide-content h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); letter-spacing: -.01em; line-height: 1.2; margin-bottom: 1.2rem; }
.guide-content h2 { margin: 2.2rem 0 .8rem; font-size: 1.35rem; padding-top: .5rem; }
.guide-content h3 { margin: 1.6rem 0 .6rem; font-size: 1.08rem; }
.guide-content p, .guide-content ul, .guide-content ol { margin-bottom: .9rem; }
.guide-content ul, .guide-content ol { padding-left: 1.4rem; }
.guide-content li { margin-bottom: .35rem; }
.guide-content a { color: var(--accent2); border-bottom: 1px dashed color-mix(in srgb, var(--accent2) 50%, transparent); }
.guide-content a:hover { border-bottom-style: solid; }
.guide-content blockquote {
  border-left: 3px solid var(--accent1); background: var(--surface);
  padding: .8rem 1.1rem; border-radius: 0 12px 12px 0; margin-bottom: .9rem; color: var(--muted);
}
.guide-content blockquote p:last-child { margin-bottom: 0; }
.guide-content hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.guide-content code {
  font-family: var(--mono); font-size: .86em;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: .12em .38em; border-radius: 6px;
}

/* code blocks */
.guide-content pre {
  position: relative; background: var(--code-bg); color: #e3ebe7;
  border: 1px solid var(--border); border-radius: 14px;
  padding: 2.4rem 1.2rem 1.1rem; margin: 1.1rem 0 1.4rem;
  overflow-x: auto; font-size: .85rem; line-height: 1.55;
  box-shadow: var(--shadow);
}
.guide-content pre code { background: none; border: none; padding: 0; font-size: 1em; color: inherit; }
.code-lang {
  position: absolute; top: .6rem; left: 1rem; font-family: var(--mono);
  font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: #8b93a7;
}
.copy-btn {
  position: absolute; top: .5rem; right: .6rem; cursor: pointer;
  font-family: var(--mono); font-size: .72rem; color: #b8c1d4;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px; padding: .25rem .6rem; transition: background .2s;
}
.copy-btn:hover { background: rgba(255, 255, 255, .15); }
.copy-btn.copied { color: var(--ok); border-color: var(--ok); }

/* syntax highlighting (self-contained hljs theme, tuned for the teal code bg) */
.hljs-comment, .hljs-quote { color: #6b8f95; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-type { color: #8fd3dc; }
.hljs-string, .hljs-regexp, .hljs-addition { color: #e8b9a5; }
.hljs-number, .hljs-symbol, .hljs-bullet { color: #e3c08d; }
.hljs-title, .hljs-section, .hljs-name, .hljs-function .hljs-title { color: #7ee0d2; }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable { color: #a9cdd6; }
.hljs-built_in, .hljs-builtin-name { color: #dfa9b8; }
.hljs-meta, .hljs-deletion { color: #e08d79; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* tables */
.guide-content table {
  width: 100%; border-collapse: collapse; margin: 1.1rem 0 1.4rem;
  display: block; overflow-x: auto; font-size: .9rem;
  border: 1px solid var(--border); border-radius: 12px;
}
.guide-content th, .guide-content td { padding: .55rem .85rem; border-bottom: 1px solid var(--border); text-align: left; }
.guide-content th { background: var(--surface-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.guide-content tr:last-child td { border-bottom: none; }
.guide-content tbody tr { transition: background .15s; }
.guide-content tbody tr:hover { background: var(--surface); }

/* interactive checklist */
.guide-content input[type="checkbox"] {
  width: 1.05em; height: 1.05em; margin-right: .45em; accent-color: var(--accent1);
  cursor: pointer; vertical-align: -2px;
}
.guide-content li:has(> input[type="checkbox"]) { list-style: none; margin-left: -1.2rem; padding: .2rem 0; }
.guide-content li:has(> input[type="checkbox"]:checked) { color: var(--muted); text-decoration: line-through; }
.check-progress {
  display: flex; align-items: center; gap: .8rem; margin: 1rem 0 1.4rem;
  padding: .8rem 1.1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  font-size: .9rem;
}
.check-progress .bar { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.check-progress .bar span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .4s ease; border-radius: 999px; }

/* pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; }
.pager-card {
  display: flex; flex-direction: column; gap: .25rem; padding: 1rem 1.2rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  transition: transform .2s, border-color .2s;
}
.pager-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent1) 50%, transparent); }
.pager-card span { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .8rem; }
.pager-card b { font-size: .95rem; }
.pager-next { text-align: right; align-items: flex-end; }

/* ---------- footer ---------- */
.footer {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 1.6rem clamp(1rem, 4vw, 2.5rem); border-top: 1px solid var(--border);
  color: var(--muted); font-size: .85rem;
}
.badge {
  display: inline-block; padding: .08rem .6rem; border-radius: 999px; font-size: .75rem;
  border: 1px solid var(--border); background: var(--surface);
}
.badge-ok { border-color: var(--ok); color: var(--ok); }
.env-badges { margin-left: .6rem; }
.footer-links a { color: var(--accent2); }

/* ---------- two paths (new app vs migration) ---------- */
.paths-section {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.1rem;
  max-width: 1000px; margin: 4rem auto; padding: 0 1.25rem;
}
.path-card {
  display: flex; flex-direction: column; gap: .6rem; padding: 1.8rem;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.path-card:hover { transform: translateY(-4px); box-shadow: var(--glow); }
.path-card h3 { font-size: 1.15rem; }
.path-card p { color: var(--muted); font-size: .93rem; flex: 1; }
.path-card .btn { align-self: flex-start; }
.path-card-alt { border-color: color-mix(in srgb, var(--accent2) 55%, transparent); }

/* ---------- intro animation (~2.2s, once per session) ---------- */
html.intro-lock { overflow: hidden; }
#intro {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: grid; place-items: center; cursor: pointer; overflow: hidden;
}
#intro.intro-out { opacity: 0; transition: opacity .45s ease; pointer-events: none; }
.intro-stage { position: relative; width: min(84vw, 560px); height: 340px; }
.intro-item {
  position: absolute; top: 50%; left: 50%;
  display: grid; place-items: center; border-radius: 50%; box-shadow: var(--shadow);
}
.intro-fl {
  width: 136px; height: 136px; margin: -68px 0 0 -68px; z-index: 2;
  background: #00313c; border: 2px solid color-mix(in srgb, #f1ceb3 40%, transparent);
  animation: intro-fl-in .9s cubic-bezier(.22, .8, .28, 1) both;
}
.intro-fl img { width: 74%; height: auto; }

/* the eye of the whirlwind: Floward spins up in the centre */
@keyframes intro-fl-in {
  from { transform: scale(.15) rotate(-260deg); opacity: 0; }
  30%  { opacity: 1; }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* orbital wrappers: rotate(angle) translateX(radius) spirals each badge in */
.whirl { position: absolute; top: 50%; left: 50%; width: 0; height: 0; }
.whirl1 { animation: whirl1 1.55s cubic-bezier(.3, .65, .25, 1) both; }
.whirl2 { animation: whirl2 1.55s cubic-bezier(.3, .65, .25, 1) both .08s; }
.whirl3 { animation: whirl3 1.55s cubic-bezier(.3, .65, .25, 1) both .16s; }

.intro-ai {
  position: absolute; top: -30px; left: -30px; width: 60px; height: 60px;
  display: grid; place-items: center; border-radius: 50%; box-shadow: var(--shadow);
  background: #fff; border: 1px solid rgba(0, 49, 60, .15);
}
.intro-ai svg { width: 58%; height: 58%; }
/* counter-rotation keeps each logo upright while its wrapper orbits */
.whirl1 .intro-ai { animation: counter1 1.55s cubic-bezier(.3, .65, .25, 1) both; }
.whirl2 .intro-ai { animation: counter2 1.55s cubic-bezier(.3, .65, .25, 1) both .08s; }
.whirl3 .intro-ai { animation: counter3 1.55s cubic-bezier(.3, .65, .25, 1) both .16s; }

/* final orbit slots: -90° (top), 30° (bottom-right), 150° (bottom-left);
   each spirals in from 1.5 extra turns out at 46vw radius */
@keyframes whirl1 { from { transform: rotate(-630deg) translateX(46vw); opacity: 0; } 10% { opacity: 1; } to { transform: rotate(-90deg) translateX(112px); opacity: 1; } }
@keyframes whirl2 { from { transform: rotate(-510deg) translateX(46vw); opacity: 0; } 10% { opacity: 1; } to { transform: rotate(30deg) translateX(112px); opacity: 1; } }
@keyframes whirl3 { from { transform: rotate(-390deg) translateX(46vw); opacity: 0; } 10% { opacity: 1; } to { transform: rotate(150deg) translateX(112px); opacity: 1; } }
@keyframes counter1 { from { transform: rotate(630deg); } to { transform: rotate(90deg); } }
@keyframes counter2 { from { transform: rotate(510deg); } to { transform: rotate(-30deg); } }
@keyframes counter3 { from { transform: rotate(390deg); } to { transform: rotate(-150deg); } }

/* tangential light trails sweeping behind each badge (wrappers spin clockwise,
   so "behind" is local -Y: the trail extends upward from the badge) */
.w-tail {
  position: absolute; left: -2px; bottom: 4px; width: 4px; height: 150px;
  border-radius: 999px; pointer-events: none; filter: blur(1px);
  background: linear-gradient(to top, color-mix(in srgb, var(--accent2) 75%, transparent), transparent);
  transform: rotate(6deg); transform-origin: bottom center;
  animation: intro-trail 1.55s ease-out both;
}
.whirl2 .w-tail { background: linear-gradient(to top, color-mix(in srgb, var(--accent1) 70%, transparent), transparent); }
@keyframes intro-trail { 0% { opacity: 0; } 10% { opacity: 1; } 80% { opacity: .8; } 100% { opacity: 0; } }

/* glow pulse when they meet */
.intro-fl::after {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent2) 70%, transparent);
  opacity: 0; animation: intro-pulse .7s ease-out 1.15s;
}
@keyframes intro-pulse { 0% { opacity: .9; transform: scale(.85); } 100% { opacity: 0; transform: scale(1.35); } }

.intro-skip {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  color: var(--muted); font-size: .8rem; opacity: 0; animation: intro-skip-in .4s ease .8s both;
}
@keyframes intro-skip-in { to { opacity: .8; } }

@media (prefers-reduced-motion: reduce) { #intro { display: none; } }

/* ---------- Vibee, the mascot robot ---------- */
#robot {
  position: fixed; z-index: 70; display: flex; flex-direction: column; align-items: center;
  gap: .3rem; max-width: 340px;
  transition: transform .7s cubic-bezier(.34, 1.56, .64, 1), opacity .5s ease;
  opacity: 0; pointer-events: none;
}
#robot.robot-in { opacity: 1; pointer-events: auto; transform: translate(0, 0) !important; }
#robot.from-top { flex-direction: column-reverse; }
.robot-figure { animation: robot-bob 2.6s ease-in-out infinite; cursor: default; filter: drop-shadow(0 10px 18px rgba(0, 49, 60, .25)); }
@keyframes robot-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.rb-arm-wave { transform-origin: 20px 78px; animation: robot-wave 1.6s ease-in-out infinite; }
@keyframes robot-wave { 0%, 100% { transform: rotate(0deg); } 40% { transform: rotate(-30deg); } 60% { transform: rotate(10deg); } }
.rb-antenna-tip { animation: robot-blink-tip 1.4s ease-in-out infinite; }
@keyframes robot-blink-tip { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.rb-eyes { animation: robot-blink 4.5s infinite; transform-origin: 60px 42px; }
@keyframes robot-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }

.robot-bubble {
  position: relative; background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: 16px; padding: .9rem 1rem .8rem; box-shadow: var(--shadow);
  font-size: .86rem; width: min(320px, 84vw);
}
.robot-say { margin: 0 1.2rem .6rem 0; font-weight: 600; line-height: 1.45; }
.robot-prompt {
  background: var(--code-bg); color: #e3ebe7; border-radius: 10px;
  padding: .6rem .7rem; font-family: var(--mono); font-size: .72rem; line-height: 1.5;
  max-height: 130px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
  margin: 0 0 .6rem;
}
.robot-copy {
  width: 100%; padding: .5rem .8rem; border: none; border-radius: 10px; cursor: pointer;
  background: var(--accent1); color: #fff; font-weight: 600; font-size: .84rem;
  font-family: var(--font); transition: transform .15s, background .2s;
}
.robot-copy:hover { transform: translateY(-1px); }
.robot-copy.copied { background: var(--ok); }
.robot-close {
  position: absolute; top: .35rem; right: .5rem; width: 26px; height: 26px;
  border: none; background: none; color: var(--muted); font-size: 1.15rem;
  cursor: pointer; border-radius: 50%; line-height: 1;
}
.robot-close:hover { background: var(--surface-2); color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  #robot { transition: opacity .3s ease; }
  .robot-figure, .rb-arm-wave, .rb-antenna-tip, .rb-eyes { animation: none; }
}

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease var(--d, 0ms), transform .6s ease var(--d, 0ms); }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .guide-layout { grid-template-columns: 1fr; gap: 1rem; }
  .sidebar { position: static; flex-direction: column; }
  .side-list { display: flex; overflow-x: auto; padding-bottom: .4rem; gap: .4rem; }
  .side-list li { flex: 0 0 auto; }
  .side-list a { white-space: nowrap; border: 1px solid var(--border); border-radius: 999px; }
  .side-list .active a { box-shadow: none; border-color: var(--accent2); }
  .sidebar .btn { display: none; }
  .pipeline { flex-wrap: wrap; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; align-items: flex-start; }
}

@media (max-width: 640px) {
  .topbar { padding: .7rem .9rem; }
  .brand span { font-size: .95rem; }
  .topnav { gap: .55rem; }
  .topnav > a:not(.pill-link) { display: none; }   /* keep it to: brand, AI Guide, theme */
  .pill-link { padding: .34rem .7rem; font-size: .82rem; }
  .hero { padding-top: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
