:root {
  --ink: #121821;
  --slate: #1a2332;
  --mist: #e8eef5;
  --teal: #14b8a6;
  --teal-dim: #0f766e;
  --amber: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.55);
  --teal-glow: rgba(45, 212, 191, 0.45);
  --muted: #8b9bb0;
  --line: rgba(232, 238, 245, 0.12);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--mist);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.55;
  background: var(--ink);
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 55% 50% at 78% 32%, rgba(245, 158, 11, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 55% at 78% 18%, rgba(45, 212, 191, 0.16), transparent 58%),
    radial-gradient(ellipse 45% 40% at 72% 28%, rgba(245, 158, 11, 0.08), transparent 50%),
    radial-gradient(ellipse 60% 40% at 15% 80%, rgba(232, 184, 109, 0.06), transparent 50%),
    linear-gradient(165deg, #0d1219 0%, #121821 45%, #15202e 100%);
}

a {
  color: var(--teal);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--mist);
  letter-spacing: 0.02em;
}

.brand:hover {
  text-decoration: none;
  color: var(--teal);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  font-size: 0.95rem;
}

nav a {
  color: var(--muted);
}

nav a:hover {
  color: var(--mist);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem 2.5rem;
  align-items: center;
  min-height: calc(100vh - 5.5rem);
  padding: 1rem 0 3rem;
}

.mark {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--mist);
  line-height: 1.05;
}

.hero h1 {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 500;
  line-height: 1.35;
  color: var(--teal);
}

.lede {
  margin: 0 0 1.75rem;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.2rem;
  border-radius: 0.35rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:focus-visible,
nav a:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.btn:hover {
  text-decoration: none;
}

.btn.primary {
  background: var(--teal);
  color: var(--ink);
}

.btn.primary:hover {
  background: #5eead4;
}

.btn.ghost {
  border: 1px solid var(--line);
  color: var(--mist);
  background: transparent;
}

.btn.ghost:hover {
  border-color: var(--teal-dim);
  color: var(--teal);
}

.hero-mascot {
  position: relative;
  margin: 0;
  justify-self: center;
  width: min(100%, 460px);
  aspect-ratio: 1 / 1.02;
  isolation: isolate;
}

/* Local energy field — only behind the mascot, page atmosphere shows through */
.mascot-stage {
  position: absolute;
  inset: 8% 0 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 42% 48% 40% 45% / 38% 42% 48% 44%;
}

.mascot-glow {
  position: absolute;
  inset: 18% 10% 8%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse 70% 55% at 48% 42%, rgba(245, 158, 11, 0.34), transparent 58%),
    radial-gradient(ellipse 80% 60% at 55% 68%, rgba(45, 212, 191, 0.28), transparent 62%),
    radial-gradient(ellipse 50% 40% at 40% 75%, rgba(251, 191, 36, 0.18), transparent 55%);
  filter: blur(22px);
  opacity: 0.85;
}

.mascot-waves {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: -4%;
  width: 112%;
  height: 68%;
  opacity: 0.9;
}

.wave-layer path {
  stroke-linecap: round;
  stroke-dasharray: 12 10;
}

.wave-orbs .orb {
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.7));
}

.mascot-sprite {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  /* Transparent PNG — soft aura so it sits on the energy field */
  filter:
    drop-shadow(0 0 12px rgba(245, 158, 11, 0.28))
    drop-shadow(0 0 22px rgba(45, 212, 191, 0.22))
    drop-shadow(0 22px 40px rgba(13, 18, 25, 0.28));
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Ride the energy — gentle bob + slight sway */
@keyframes drift-ride {
  0%,
  100% {
    transform: translateY(0) translateX(0) rotate(-1.2deg);
  }
  25% {
    transform: translateY(-10px) translateX(4px) rotate(0.6deg);
  }
  50% {
    transform: translateY(-16px) translateX(0) rotate(1.4deg);
  }
  75% {
    transform: translateY(-8px) translateX(-4px) rotate(-0.4deg);
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes wave-flow-a {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-36px);
  }
}

@keyframes wave-flow-b {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(28px);
  }
}

@keyframes orb-drift {
  0%,
  100% {
    transform: translate(0, 0);
    opacity: 0.55;
  }
  50% {
    transform: translate(10px, -14px);
    opacity: 1;
  }
}

@keyframes dash-crawl {
  to {
    stroke-dashoffset: -88;
  }
}

/* Motion is opt-in (modern a11y pattern) */
@media (prefers-reduced-motion: no-preference) {
  .hero-mascot {
    animation: float-in 0.9s ease-out both;
  }

  .mascot-sprite {
    animation: drift-ride 6.5s ease-in-out 0.6s infinite;
  }

  .mascot-glow {
    animation: pulse-glow 4.5s ease-in-out infinite;
  }

  .wave-a {
    animation: wave-flow-a 9s linear infinite;
  }

  .wave-b {
    animation: wave-flow-b 11s linear infinite;
  }

  .wave-layer path {
    animation: dash-crawl 3.8s linear infinite;
  }

  .orb.o1 { animation: orb-drift 5.2s ease-in-out infinite; }
  .orb.o2 { animation: orb-drift 6.1s ease-in-out 0.4s infinite; }
  .orb.o3 { animation: orb-drift 4.7s ease-in-out 0.9s infinite; }
  .orb.o4 { animation: orb-drift 5.8s ease-in-out 1.2s infinite; }
  .orb.o5 { animation: orb-drift 6.4s ease-in-out 0.2s infinite; }
}

@media (prefers-reduced-motion: reduce) {
  .mascot-sprite,
  .mascot-glow,
  .wave-a,
  .wave-b,
  .wave-layer path,
  .orb {
    animation: none !important;
  }
}

.band {
  padding: 3rem 0;
  border-top: 1px solid var(--line);
}

.band h2 {
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
}

.benefits,
.steps,
.news {
  margin: 0;
  padding-left: 1.25rem;
  max-width: 42rem;
  color: var(--mist);
}

.benefits li,
.steps li,
.news li {
  margin-bottom: 0.85rem;
}

.benefits strong,
.steps strong,
.news strong {
  color: var(--mist);
}

.concept {
  margin: 0 0 1.75rem;
  max-width: 40rem;
  font-size: 1.12rem;
  color: var(--muted);
}

.concept strong {
  color: var(--teal);
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.compare h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.compare ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--mist);
}

.code {
  margin: 0;
  padding: 1.25rem 1.35rem;
  overflow-x: auto;
  border-radius: 0.4rem;
  border: 1px solid var(--line);
  background: rgba(13, 18, 25, 0.85);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--mist);
}

.note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

footer .tiny {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  opacity: 0.85;
}

/* —— Documentation pages —— */
body.doc-page main {
  max-width: 760px;
  padding-top: 1.5rem;
  padding-bottom: 4rem;
}

.doc-kicker {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.doc-page h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--mist);
}

.doc-lede {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.doc-page h2 {
  margin: 2.25rem 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--mist);
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

.doc-page h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.doc-page p,
.doc-page li {
  color: var(--mist);
}

.doc-page ul,
.doc-page ol {
  padding-left: 1.25rem;
  max-width: 40rem;
}

.doc-page li {
  margin-bottom: 0.55rem;
}

.doc-table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
}

.doc-page table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.doc-page th,
.doc-page td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.doc-page th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.doc-page td a {
  font-weight: 500;
}

.doc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
  margin: 1rem 0 2rem;
}

.doc-card {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.doc-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.doc-card h3 a {
  color: var(--mist);
  text-decoration: none;
}

.doc-card h3 a:hover {
  color: var(--teal);
  text-decoration: underline;
}

.doc-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.doc-page code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--teal);
}

.doc-prose h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--mist);
}

.doc-prose h2 {
  margin: 2.25rem 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--mist);
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

.doc-prose h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.1rem;
  color: var(--mist);
}

.doc-prose hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.doc-prose pre.code {
  margin: 1rem 0 1.25rem;
}

@media (max-width: 860px) {
  .doc-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 1.5rem;
  }

  .hero-mascot {
    order: -1;
    width: min(100%, 300px);
  }

  .compare {
    grid-template-columns: 1fr;
  }

  .top {
    flex-direction: column;
    align-items: flex-start;
  }
}
