/* Custom styles + semantic component classes (design tokens match Tailwind config) */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --site-max: 1120px;
  --ink: #0b1220;
  --blue: #4f46e5;
  --blue-dark: #4338ca;
  --warm-50: #faf8f6;
  --warm-100: #f5f0eb;
  --shadow-card: 0 8px 32px rgba(11,18,32,.06);
  --shadow-panel: 0 16px 48px rgba(11,18,32,.08);
  --radius-2xl: 20px;
  --radius-3xl: 28px;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* ── Layout ── */
.site-container {
  max-width: var(--site-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
@media (min-width: 768px) {
  .site-container { padding-left: 1.5rem; padding-right: 1.5rem; }
}

/* ── Page hero (inner pages) ── */
.page-hero {
  padding-top: 5.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
@media (min-width: 768px) {
  .page-hero { padding-top: 6rem; padding-bottom: 2.5rem; }
}
.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.75rem 0;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
@media (min-width: 768px) { .page-title { font-size: 2.5rem; } }
@media (min-width: 1024px) { .page-title { font-size: 3.25rem; } }
.page-lead {
  font-size: 1.0625rem;
  color: rgba(11, 18, 32, 0.60);
  max-width: 64ch;
  line-height: 1.7;
  margin: 0;
}
@media (min-width: 768px) { .page-lead { font-size: 1.1875rem; } }

/* ── Prose section (two-column content) ── */
.prose-section {
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}
@media (min-width: 768px) { .prose-section { padding-top: 4.5rem; padding-bottom: 4.5rem; } }
@media (min-width: 1024px) { .prose-section { padding-top: 5.5rem; padding-bottom: 5.5rem; } }
.prose-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: start;
}
@media (min-width: 768px) {
  .prose-grid { grid-template-columns: 1fr 1fr; gap: 3rem; }
}
.prose-h2 {
  font-size: 1.3125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 2.5rem 0 0.75rem 0;
  line-height: 1.3;
}
.prose-h2:first-child { margin-top: 0; }
@media (min-width: 768px) {
  .prose-h2 { font-size: 1.4375rem; margin-top: 2.75rem; }
}
.prose-p {
  font-size: 0.9375rem;
  color: rgba(11, 18, 32, 0.64);
  line-height: 1.7;
  margin: 0 0 1rem 0;
}
.prose-p:last-child { margin-bottom: 0; }
@media (min-width: 768px) { .prose-p { font-size: 1rem; } }

/* ── Cards ── */
.card {
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-card);
  padding: 1.375rem;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.card:hover {
  box-shadow: 0 12px 40px rgba(11,18,32,.09);
  transform: translateY(-1px);
}
.card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.5rem 0;
}
.card-p, .card ul {
  font-size: 0.875rem;
  color: rgba(11, 18, 32, 0.60);
  line-height: 1.7;
  margin: 0;
}
.card ul { padding-left: 1.25rem; }
.card ul li + li { margin-top: 0.375rem; }
.card dl.comparison { margin: 0; }
.card dl.comparison dt {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(11, 18, 32, 0.42);
  margin: 0 0 0.375rem 0;
}
.card dl.comparison dt + dt { margin-top: 0.875rem; }
.card dl.comparison dd {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(11, 18, 32, 0.6);
  line-height: 1.7;
}
.card dl.comparison dd.code-line {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  color: rgba(11, 18, 32, 0.42);
  line-height: 1.6;
}
.card dl.comparison dd + dt { margin-top: 0.875rem; }
.card-quote {
  border-radius: var(--radius-3xl);
  padding: 1.5rem;
  border: 1px solid rgba(79, 70, 229, 0.12);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.3s ease;
}
.card-quote:hover {
  box-shadow: 0 12px 40px rgba(11,18,32,.09);
}
.card-quote p {
  font-size: 0.9375rem;
  color: rgba(11, 18, 32, 0.68);
  line-height: 1.7;
  margin: 0;
  font-style: italic;
}
@media (min-width: 768px) { .card-quote p { font-size: 1rem; } }
.card-quote .quote-by {
  font-size: 0.8125rem;
  color: rgba(11, 18, 32, 0.48);
  margin-top: 0.75rem;
  font-style: normal;
}
@media (min-width: 768px) { .card-quote .quote-by { font-size: 0.8125rem; } }

/* ── Buttons ── */
.btn-group { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: 0.875rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8125rem 1.25rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.25s ease;
  letter-spacing: -0.01em;
}
.btn-primary {
  background: linear-gradient(180deg, var(--blue), var(--blue-dark));
  color: #fff;
  border: 1px solid rgba(79, 70, 229, 0.15);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.20);
}
.btn-primary:hover {
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.28);
  transform: translateY(-1px);
}
.btn-secondary {
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.btn-secondary:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* ── Footer ── */
.site-footer {
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.site-footer p {
  margin: 0;
  font-size: 13px;
  color: rgba(11, 18, 32, 0.48);
}
.site-footer a { text-decoration: underline; text-decoration-color: rgba(11,18,32,0.2); text-underline-offset: 2px; }
.site-footer a:hover { text-decoration-color: rgba(11,18,32,0.4); }
.site-footer nav a { text-decoration: none; color: rgba(11, 18, 32, 0.56); }
.site-footer nav a:hover { color: var(--ink); }

/* ── Nav (shared) ── */
.nav-link {
  padding: 0.5rem 0.75rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  color: rgba(11, 18, 32, 0.64);
  transition: all 0.2s ease;
}
.nav-link:hover { background: rgba(0, 0, 0, 0.04); color: var(--ink); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1rem;
  border-radius: 9999px;
  border: 1px solid rgba(79, 70, 229, 0.15);
  background: rgba(79, 70, 229, 0.06);
  color: var(--blue);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}
.nav-cta:hover { background: rgba(79, 70, 229, 0.10); }
.card + .card,
.card + .card-quote,
.card-quote + .card { margin-top: 1rem; }
/* Inside grids the gap handles spacing — remove sibling margin */
.grid > .card + .card { margin-top: 0; }

/* ── Topbar backdrop ── */
.topbar-backdrop {
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

/* ── Home hero ── */
.hero-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
  min-height: 340px;
  border-radius: var(--radius-3xl);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow-panel);
}
@media (min-width: 768px) { .hero-panel { padding: 2.5rem; } }
@media (min-width: 1024px) { .hero-panel { padding: 3rem; min-height: 500px; } }

.hero-title {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin: 0 0 0.5rem 0;
}
@media (min-width: 768px) { .hero-title { font-size: 2.75rem; } }
@media (min-width: 1024px) { .hero-title { font-size: 3.25rem; } }
@media (min-width: 1280px) { .hero-title { font-size: 3.75rem; } }

.hero-subtitle {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--blue);
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem 0;
  opacity: 0.85;
}
@media (min-width: 768px) { .hero-subtitle { font-size: 1.25rem; } }

.hero-lead {
  font-size: 1.0625rem;
  color: rgba(11, 18, 32, 0.58);
  line-height: 1.7;
  max-width: 52ch;
  margin: 0 0 1.5rem 0;
}
@media (min-width: 768px) { .hero-lead { font-size: 1.125rem; } }

.hero-tagline {
  font-size: 1.0625rem;
  line-height: 1.5;
  color: rgba(11, 18, 32, 0.72);
  margin: 0.375rem 0;
}
@media (min-width: 768px) { .hero-tagline { font-size: 1.125rem; } }

/* ── Home hero background ── */
.home-hero-bg {
  background: linear-gradient(
    180deg,
    rgba(79, 70, 229, 0.04) 0%,
    rgba(251, 191, 146, 0.04) 25%,
    rgba(255, 255, 255, 0.96) 50%,
    #fff 100%
  );
}

/* ── Page hero gradients ── */
.page-hero-bg {
  background:
    radial-gradient(1000px 520px at 50% 0%, rgba(79, 70, 229, 0.08), transparent 62%),
    radial-gradient(820px 520px at 10% 10%, rgba(129, 120, 248, 0.06), transparent 60%),
    radial-gradient(820px 520px at 90% 40%, rgba(251, 191, 146, 0.05), transparent 60%);
}

/* ── Canvas animation zone ── */
.canvas-zone-bg {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08));
}

/* ── Narrative block under canvas ── */
.narrative-bg {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.8));
}

/* ── Panel/card gradient ── */
.panel-bg {
  background:
    radial-gradient(1200px 420px at 20% 0%, rgba(79, 70, 229, 0.06), transparent 55%),
    radial-gradient(900px 420px at 90% 30%, rgba(251, 191, 146, 0.05), transparent 55%),
    rgba(255, 255, 255, 0.80);
}

/* ── Quote card gradient ── */
.quote-bg {
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.04), rgba(255, 255, 255, 0.90));
}

/* ── card-quote semantic upgrade (figure + blockquote + figcaption) ── */
figure.card-quote { margin: 0; }
.card-quote blockquote { margin: 0; padding: 0; }
.card-quote figcaption.quote-by { display: block; }

/* ── Vision page hero (two-column with epigraph) ── */
.vision-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}
@media (min-width: 1024px) {
  .vision-hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 3.5rem;
    align-items: end;
  }
}
.vision-hero-lede .page-lead { max-width: 52ch; }

.vision-hero-epigraph {
  position: relative;
  padding-left: 1.125rem;
  border-left: 2px solid rgba(79, 70, 229, 0.32);
}
.vision-hero-epigraph figure { margin: 0; }
.vision-hero-epigraph blockquote { margin: 0; padding: 0; }
.vision-hero-epigraph blockquote p {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: rgba(11, 18, 32, 0.72);
  font-style: italic;
  letter-spacing: -0.005em;
  margin: 0;
}
@media (min-width: 768px) {
  .vision-hero-epigraph blockquote p { font-size: 1rem; line-height: 1.7; }
}
.vision-hero-epigraph figcaption {
  margin-top: 0.875rem;
  font-size: 0.8125rem;
  color: rgba(11, 18, 32, 0.5);
}
.vision-hero-epigraph figcaption cite { font-style: italic; }
.vision-hero-epigraph figcaption a {
  color: rgba(11, 18, 32, 0.62);
  text-decoration: none;
  border-bottom: 1px solid rgba(11, 18, 32, 0.18);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.vision-hero-epigraph figcaption a:hover {
  color: var(--blue);
  border-bottom-color: rgba(79, 70, 229, 0.5);
}

/* ── Section divider (softer) ── */
.section-soft-divider {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* ── Section with subtle warm background ── */
.section-warm-bg {
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.02), rgba(251, 191, 146, 0.02) 40%, rgba(255, 255, 255, 0.96) 70%, #fff);
}

/* ── Focus visible for a11y ── */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.42);
  outline-offset: 2px;
}

/* ── Prevent iOS zoom on input focus ── */
@media (max-width: 768px) {
  input.input-mobile {
    font-size: 16px;
  }
}

/* ── Smooth transitions for links ── */
a {
  transition: color 0.2s ease;
}

/* ── Warning banner (softer) ── */
.warning-banner {
  background-color: rgba(245, 158, 11, 0.08);
  color: #92400e;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(245, 158, 11, 0.20);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}
.warning-banner strong {
  color: #78350f;
}

/* ── External link icon ── */
.ext-icon {
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-left: 0.25em;
  vertical-align: baseline;
  opacity: 0.55;
  flex-shrink: 0;
}
a:hover .ext-icon { opacity: 0.9; }

/* ── Footer bottom row ── */
.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.625rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}
@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0;
  }
}
.site-footer .by-cvoya {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(11, 18, 32, 0.5);
  font-size: 0.8125rem;
  text-decoration: none;
}
.site-footer .by-cvoya:hover { color: var(--ink); }
.site-footer .by-cvoya img {
  height: 18px;
  width: auto;
  opacity: 0.9;
}

/* ── Hero ── */

/* Ambient drift */
.hero-ambient {
  position: relative;
  border-radius: var(--radius-3xl);
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
  box-shadow: var(--shadow-panel);
  min-height: 340px;
  background:
    radial-gradient(1100px 520px at 70% 20%, rgba(129, 120, 248, 0.10), transparent 60%),
    radial-gradient(900px 520px at 20% 80%, rgba(251, 191, 146, 0.08), transparent 60%),
    linear-gradient(180deg, #faf8ff 0%, #ffffff 60%, #fff 100%);
}
@media (min-width: 1024px) { .hero-ambient { min-height: 500px; } }
.hero-ambient canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero-ambient .hero-narration {
  position: absolute;
  /* top/left set inline by hero-ambient.js per line */
  top: 60%;
  left: 8%;
  right: auto;
  bottom: auto;
  max-width: 18rem;
  z-index: 2;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: rgba(11, 18, 32, 0.72);
  font-style: italic;
  letter-spacing: -0.005em;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}
@media (min-width: 768px) {
  .hero-ambient .hero-narration { font-size: 1.0625rem; max-width: 20rem; }
}
