/* First-paint CSS. Linked from index.html so the page is themed before JS. */
:root {
  --bg: #f4f1ea;
  --surface: #fffcf7;
  --surface-2: #ece7dc;
  --fg: #1c1f24;
  --muted: #5c6570;
  --subtle: #8a9199;
  --border: color-mix(in oklab, var(--fg) 12%, transparent);
  --border-strong: color-mix(in oklab, var(--fg) 22%, transparent);
  --primary: #2c5270;
  --primary-fg: #f4f1ea;
  --link: #2c5270;
  --code: #eae4d8;
  --ring: #2c5270;
  --ok: #2f6f4e;
  --warn: #8a5a20;
  --danger: #9b3a32;
  --shadow-border: 0 0 0 1px rgba(28, 31, 36, 0.08), 0 1px 2px -1px rgba(28, 31, 36, 0.06),
    0 2px 4px 0 rgba(28, 31, 36, 0.04);
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

html.dark {
  --bg: #0c0e11;
  --surface: #14181d;
  --surface-2: #1c2229;
  --fg: #e8eaee;
  --muted: #8b939e;
  --subtle: #6b7380;
  --border: color-mix(in oklab, var(--fg) 12%, transparent);
  --border-strong: color-mix(in oklab, var(--fg) 22%, transparent);
  --primary: #c5d4e0;
  --primary-fg: #0c0e11;
  --link: #b7c9d6;
  --code: #10141a;
  --ring: #c5d4e0;
  --ok: #7dba98;
  --warn: #d4b07a;
  --danger: #d98980;
  --shadow-border: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
}

body {
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Light lenurple splash until the Angular shell is in the DOM. */
#cs-boot {
  --boot-paper: #fbf7fd;
  --boot-mist: #f3e9fa;
  --boot-lenurple: #bd93d8;
  --boot-ink: #4a3260;
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(920px 620px at 50% 42%, #ead4f6 0%, var(--boot-mist) 42%, var(--boot-paper) 100%);
  color: var(--boot-ink);
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s linear;
}

.cs-boot__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.cs-boot__glow {
  position: absolute;
  width: 11rem;
  height: 11rem;
  border-radius: 999px;
  background: radial-gradient(circle, color-mix(in oklab, var(--boot-lenurple) 42%, transparent) 0%, transparent 70%);
  animation: cs-boot-breathe 2.4s ease-in-out infinite;
}

.cs-boot__logo {
  position: relative;
  z-index: 1;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.9rem;
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--boot-lenurple) 35%, transparent), 0 10px 28px color-mix(in oklab, var(--boot-lenurple) 28%, transparent);
  animation: cs-boot-rise 0.7s cubic-bezier(0.05, 0.7, 0.1, 1) both;
}

.cs-boot__title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--boot-ink);
  animation: cs-boot-rise 0.7s cubic-bezier(0.05, 0.7, 0.1, 1) 0.08s both;
}

.cs-boot__bar {
  position: relative;
  z-index: 1;
  width: 7.5rem;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in oklab, var(--boot-lenurple) 28%, white);
}

.cs-boot__bar::after {
  content: "";
  display: block;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: var(--boot-lenurple);
  animation: cs-boot-bar 0.9s ease-in-out infinite;
}

body:has(cs-header) #cs-boot {
  opacity: 0;
  visibility: hidden;
}

@keyframes cs-boot-breathe {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes cs-boot-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cs-boot-bar {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(280%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cs-boot__glow,
  .cs-boot__logo,
  .cs-boot__title,
  .cs-boot__bar::after {
    animation: none;
  }

  body:has(cs-header) #cs-boot {
    transition: none;
  }
}

/* SEO prerender is a direct child of app-root until Angular replaces it. */
app-root > main,
app-root > article {
  height: 100%;
  overflow: auto;
  padding-top: 3.5rem;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
}

app-root > main h1,
app-root > article h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--fg);
}

app-root > main h2,
app-root > article h2 {
  margin: 1.75rem 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--fg);
}

app-root > main p,
app-root > article p {
  margin: 0.75rem 0 0;
  line-height: 1.65;
  color: var(--muted);
}

app-root > main a,
app-root > article a {
  color: var(--link);
}

app-root > main ul,
app-root > article ul,
app-root > main ol,
app-root > article ol {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
}

.navbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: 3.5rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
}

.app-shell {
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
}

.app-shell__body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  padding-top: 3.5rem;
}

.lp {
  position: relative;
  isolation: isolate;
  width: 100%;
  padding: 0 1rem 4.5rem;
  overflow: clip;
}

.kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--subtle);
}

.hero {
  display: grid;
  gap: 2.5rem;
  min-height: calc(100dvh - 3.5rem);
  padding: 3.25rem 0 4rem;
  align-items: center;
}

.hero__copy h1 {
  margin: 0.8rem 0 0;
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 7.2vw, 6.75rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.lede {
  margin: 1.5rem 0 0;
  max-width: 36rem;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.65;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 3rem;
  padding: 0 1.25rem;
  border-radius: 999px;
  font-size: 0.95rem;
  text-decoration: none;
}

.btn--solid {
  background: var(--fg);
  color: var(--bg);
}

.btn--line {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--fg);
}

.hero__panel {
  padding: 1.25rem 1.35rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: color-mix(in oklab, var(--surface) 82%, transparent);
}

.prose {
  max-width: 52rem;
  padding: 2.5rem 1rem 4rem;
}

.prose h1 {
  margin: 0.4rem 0 0;
  font-family: var(--font-display);
  font-size: 2.75rem;
  letter-spacing: -0.03em;
}

.prose p {
  margin: 1rem 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
}

.prose a {
  color: var(--link);
}
