/* Copyright (c) 2026 Kaustubh Mani Tripathi. See LICENSE. */
:root {
  --ink: #0b1220;
  --ink-2: #141c2c;
  --mist: #9aa6b8;
  --line: rgba(255, 255, 255, 0.08);
  --paper: #e8eef7;
  --accent: #2dd4bf;
  --accent-hot: #ff7a3d;
  --accent-deep: #0d9488;
  --glow: rgba(45, 212, 191, 0.18);
  --font-display: "Syne", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--paper);
  font-family: var(--font-body);
  background: var(--ink);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--ink);
  padding: 0.5rem 0.75rem;
  z-index: 20;
}
.skip:focus { left: 0.75rem; top: 0.75rem; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1.1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(11, 18, 32, 0.82);
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  color: var(--paper);
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 1.25rem;
}
.nav a {
  color: var(--mist);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--accent); }

main { flex: 1; }

/* —— Hero (full-bleed, one composition) —— */
.hero {
  position: relative;
  min-height: calc(100vh - 4.2rem);
  display: grid;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

.hero-atmosphere {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 55% at 85% 10%, var(--glow), transparent 55%),
    radial-gradient(ellipse 50% 40% at 5% 90%, rgba(255, 122, 61, 0.12), transparent 50%),
    linear-gradient(165deg, var(--ink) 0%, var(--ink-2) 55%, #0a1628 100%);
  animation: drift 18s ease-in-out infinite alternate;
}

.hero-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  opacity: 0.55;
}

.hero-inner {
  padding: clamp(2.5rem, 8vh, 5rem) clamp(1.1rem, 4vw, 2.5rem) 4rem;
  max-width: 44rem;
  animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand-hero {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  letter-spacing: -0.045em;
  line-height: 0.95;
  color: var(--paper);
  text-shadow: 0 0 40px var(--glow);
}

.hero-headline {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--paper);
  max-width: 18ch;
}

.hero-lede {
  margin: 0 0 1.75rem;
  color: var(--mist);
  font-size: 1.05rem;
  max-width: 36ch;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.2rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 6px;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: var(--ink);
}
.btn-primary:hover { background: #5eead4; }
.btn-ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* —— Sections —— */
.section {
  padding: 2.5rem clamp(1.1rem, 4vw, 2.5rem) 3.5rem;
  max-width: 52rem;
}

.section-head h1 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
}
.section-head p {
  margin: 0 0 1.75rem;
  color: var(--mist);
}

.archive,
.doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.archive li,
.doc-list li {
  border-top: 1px solid var(--line);
}
.archive li:last-child,
.doc-list li:last-child { border-bottom: 1px solid var(--line); }

.archive a,
.doc-list a {
  display: grid;
  gap: 0.25rem;
  padding: 1.15rem 0.15rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease;
}
.archive a:hover,
.doc-list a:hover { background: rgba(45, 212, 191, 0.04); }

.archive-title,
.doc-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--paper);
}
.archive-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.85rem;
  font-size: 0.78rem;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}
.archive-meta time,
.article-meta time {
  color: var(--accent-deep);
}
.read-time {
  color: var(--mist);
}
.archive-meta .read-time::before {
  content: "·";
  margin-right: 0.85rem;
  color: var(--line);
}
.archive time {
  font-size: 0.78rem;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}
.archive-desc,
.doc-desc {
  color: var(--mist);
  font-size: 0.92rem;
}

/* —— Home below-fold (one section) —— */
.home-featured {
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(20, 28, 44, 0.55) 0%, var(--ink) 100%);
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}
.home-featured-inner {
  padding: 2.75rem clamp(1.1rem, 4vw, 2.5rem) 3.75rem;
  max-width: 44rem;
}
.home-featured .section-head h2 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  letter-spacing: -0.03em;
}
.why-line {
  margin: 0 0 1.5rem;
  color: var(--mist);
  font-size: 0.98rem;
  max-width: 40ch;
}

/* —— Docs Stripe-ish side / top nav —— */
.docs-layout {
  display: grid;
  grid-template-columns: minmax(10rem, 13rem) minmax(0, 1fr);
  gap: 1.75rem 2.25rem;
  max-width: 56rem;
  padding-top: 2rem;
}
.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  align-self: start;
  position: sticky;
  top: 4.5rem;
  padding-bottom: 1rem;
}
.docs-nav-label {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
}
.docs-nav a {
  display: block;
  padding: 0.42rem 0.55rem;
  margin: 0 -0.55rem;
  border-radius: 5px;
  color: var(--mist);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-left: 2px solid transparent;
}
.docs-nav a:hover { color: var(--paper); background: rgba(45, 212, 191, 0.05); }
.docs-nav a[aria-current="page"] {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(45, 212, 191, 0.06);
}
.docs-main { min-width: 0; }
.docs-layout .section-head { margin-bottom: 0; }
.docs-layout.section { max-width: 56rem; }

.article-head { margin-bottom: 1.75rem; }
.article-meta {
  display: flex;
  margin-bottom: 0.75rem;
}
.crumb {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
}
.crumb a { color: var(--accent); text-decoration: none; }
.article-head h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.article-head time {
  font-size: 0.8rem;
  color: var(--accent-deep);
}
.article-head .lede {
  margin: 0.35rem 0 0;
  color: var(--mist);
  font-size: 1.05rem;
  max-width: 42ch;
}

.prose {
  color: #c5cedc;
  font-size: 1.02rem;
}
.prose h1 { display: none; } /* title already in header */
.prose h2 {
  margin: 2rem 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--paper);
  letter-spacing: -0.02em;
}
.prose h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.05rem;
  color: var(--paper);
}
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose a { color: var(--accent); }
.prose code {
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
}
.prose pre {
  background: #070b14;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  margin: 0 0 1.25rem;
}
.prose pre code { background: none; padding: 0; }
.prose strong { color: var(--paper); }

.docs-hub .doc-list a {
  grid-template-columns: 1fr;
}

.site-footer {
  padding: 1.5rem clamp(1.1rem, 4vw, 2.5rem) 2rem;
  border-top: 1px solid var(--line);
  color: var(--mist);
  font-size: 0.82rem;
}
.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--paper);
}

.empty { color: var(--mist); padding: 1rem 0; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes drift {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(12deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-inner, .hero-atmosphere, .home-featured { animation: none; }
  .btn:hover { transform: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 760px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .docs-nav {
    position: static;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.35rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
    -webkit-overflow-scrolling: touch;
  }
  .docs-nav-label { display: none; }
  .docs-nav a {
    flex: 0 0 auto;
    border-left: none;
    border-bottom: 2px solid transparent;
    margin: 0;
    white-space: nowrap;
  }
  .docs-nav a[aria-current="page"] {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }
}
