/* ============================================================
   Cosmos website — local layout + component styles
   ============================================================ */

html { background: var(--bg-0); }
body { background: transparent; color: var(--fg-1); overflow-x: hidden; }
img { display: block; max-width: 100%; }

.container { max-width: var(--container-max); margin: 0 auto; padding: 0 32px; }
.container-narrow { max-width: 880px; }

@media (max-width: 768px) {
  .container { padding: 0 24px; }
}

/* ----- Reveal ----- */
[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 480ms var(--ease-out), transform 480ms var(--ease-out); }
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ----- Buttons (page-level overrides on top of tokens) ----- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px;
  font-family: var(--font-sans); font-size: 14px; font-weight: 500; line-height: 1;
  border: 1px solid transparent; cursor: pointer;
  transition: all var(--dur-fast) var(--ease-inout);
  text-decoration: none;
}
.btn svg { width: 16px; height: 16px; }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 12px; }
.btn-lg svg { width: 18px; height: 18px; }
.btn-primary {
  background: var(--accent, #F2EBDA); color: #1C1C20;
  position: relative;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.6), 0 0 0 3px var(--halo, #F2EBDA), 0 8px 20px rgba(0,0,0,0.55);
}
.btn-primary::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: var(--sheen, linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 38%, transparent 50%, rgba(255,255,255,0.03) 62%, transparent 100%)); pointer-events: none;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
[data-theme='light'] .btn-primary { background: var(--slate-0); color: var(--halo); box-shadow: 0 0 0 3px var(--halo), 0 0 0 4px var(--slate-0), 0 8px 20px rgba(0,0,0,0.25); }
[data-theme='light'] .btn-primary:hover { background: #2A2A30; }
.btn-secondary { background: var(--bg-2); color: var(--fg-1); border-color: var(--border-1); }
.btn-secondary:hover { border-color: var(--border-2); background: var(--bg-3); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: transparent; color: var(--fg-2); border: 1px solid transparent;
  cursor: pointer; transition: all var(--dur-fast) var(--ease-inout);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--bg-2); color: var(--fg-1); border-color: var(--border-1); }

/* ----- Brand pill — sticker style, mirrors logo halo ----- */
.gen-pill {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 999px;
  background: var(--slate-0, #1C1C20); color: var(--halo, #F2EBDA);
  border: 1.5px solid var(--halo, #F2EBDA);
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  box-shadow: 0 1px 0 rgba(0,0,0,0.4), 0 0 0 1px rgba(0,0,0,0.4) inset;
}

/* Accent text — flat */
.grad-text { color: var(--accent); }

/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: sticky; top: 12px; z-index: 50;
  padding: 0 32px;
}
.nav-inner {
  max-width: var(--container-max); margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  height: 56px; padding: 6px 6px 6px 18px;
  border: 1.5px solid var(--halo, #F2EBDA); border-radius: 999px;
  background: rgba(28, 28, 32, 0.85);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5) inset, 0 8px 24px rgba(0,0,0,0.4);
}
[data-theme='light'] .nav-inner { background: rgba(255, 255, 255, 0.7); }
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-brand img { height: 24px; width: auto; }
.nav-links { display: flex; gap: 22px; margin-left: 16px; }
.nav-links a { color: var(--fg-2); font-size: 14px; transition: color var(--dur-fast); }
.nav-links a:hover { color: var(--fg-1); }
.nav-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; height: 100%; }
.nav-actions .btn { padding: 0 16px; height: 100%; font-size: 13px; border-radius: 999px; line-height: 1; }
.nav-actions .icon-btn { height: 36px; width: 36px; border-radius: 999px; }
/* In-nav primary: no outer halo ring (the nav itself is the ring) — keep just a tight inner edge */
.nav-actions .btn-primary { box-shadow: 0 0 0 1px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.4); }
.nav-actions .btn-primary:hover { transform: none; }

@media (max-width: 880px) {
  .nav { padding: 0 16px; }
  .nav-links { display: none; }
  .nav-actions .btn span { display: none; }
  .nav-actions .btn svg { width: 16px; height: 16px; }
  .nav-actions .btn-primary span { display: inline; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  padding: 80px 0 96px;
  overflow: hidden;
  isolation: isolate;
}
.hero-glow {
  position: absolute; inset: -10% 0 0 0;
  background: var(--grad-hero-glow);
  pointer-events: none; z-index: -1;
}
.starfield {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  z-index: -2; opacity: 1; pointer-events: none;
}
.hero-inner {
  max-width: 980px; margin: 0 auto; padding: 0 32px;
  text-align: center;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 6px 6px 6px 6px; margin-bottom: 28px;
  border: 1px solid var(--border-1); border-radius: 999px;
  background: rgba(15, 15, 21, 0.6);
  font-family: var(--font-mono); font-size: 12px; color: var(--fg-2);
  padding-right: 16px;
}
.hero-title {
  font-family: var(--font-sans); font-weight: 600;
  font-size: clamp(40px, 7.4vw, 80px);
  line-height: 1.04; letter-spacing: -0.035em;
  margin: 0 0 24px; color: var(--fg-1);
}
.hero-sub {
  font-size: 18px; line-height: 1.6; color: var(--fg-2);
  max-width: 660px; margin: 0 auto 36px;
}
.hero-ctas {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 64px;
}

/* Hero terminal */
.terminal {
  max-width: 800px; margin: 0 auto;
  background: #0B0B11; border: 1px solid var(--border-1); border-radius: 14px;
  overflow: hidden; text-align: left;
  box-shadow: var(--shadow-lg);
}
[data-theme='light'] .terminal { background: #1A1A24; }
.term-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px; border-bottom: 1px solid var(--border-1);
  background: rgba(255, 255, 255, 0.02);
}
.term-dot { width: 11px; height: 11px; border-radius: 50%; }
.term-title { margin-left: 12px; font-family: var(--font-mono); font-size: 11px; color: #6E6E85; }
.term-body {
  padding: 16px 18px;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.7;
  min-height: 240px;
  color: #A0A0B5;
}
.term-line { display: flex; gap: 8px; }
.term-cmd { color: #F5F5FA; }
.term-prompt { color: var(--fg-4); user-select: none; flex-shrink: 0; }
.term-log { color: #6E6E85; }
.term-boot { color: var(--halo, #F2EBDA); }
.term-k { color: #F5F5FA; }
.term-caret {
  display: inline-block; width: 7px; height: 14px; margin-left: 4px;
  background: #F5F5FA; vertical-align: text-bottom;
  animation: caret 1.05s steps(2, end) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* ============================================================
   Sections
   ============================================================ */
.section { padding: 96px 0; }
.section-tinted { background: linear-gradient(180deg, transparent 0%, rgba(15, 15, 21, 0.5) 50%, transparent 100%); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.section-head .cs-eyebrow { margin-bottom: 14px; display: block; }
.section-head h2 { margin: 0 0 14px; }
.section-sub { font-size: 16px; line-height: 1.6; color: var(--fg-2); margin: 0; }

@media (max-width: 768px) {
  .section { padding: 64px 0; }
  .section-head { margin-bottom: 40px; }
}

/* Accent helpers — sticker treatment, mirrors logo */
.hero-accent {
  display: inline-block;
  background: var(--slate-0, #1C1C20); color: var(--halo, #F2EBDA);
  padding: 0 16px 4px;
  border-radius: 18px;
  box-shadow: 0 0 0 3px var(--halo, #F2EBDA), 0 0 0 4px var(--slate-0, #1C1C20), 0 8px 24px rgba(0,0,0,0.5);
  position: relative;
}
.hero-accent::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: var(--sheen, linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 38%, transparent 50%, rgba(255,255,255,0.03) 62%, transparent 100%)); pointer-events: none;
}
.era-title.hero-accent { background: transparent; color: var(--halo, #F2EBDA); padding: 0; box-shadow: none; }
.era-title.hero-accent::after { display: none; }

/* ============================================================
   Features
   ============================================================ */
.feature-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
@media (max-width: 1024px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }

.feature-card {
  position: relative;
  background: var(--bg-2); border: 1px solid var(--border-1); border-radius: 18px;
  padding: 26px 24px 24px;
  transition: border-color var(--dur-fast) var(--ease-inout), box-shadow var(--dur-fast), transform var(--dur-fast);
  overflow: hidden;
}
.feature-card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: var(--sheen, linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 38%, transparent 50%, rgba(255,255,255,0.03) 62%, transparent 100%)); pointer-events: none; opacity: 0.6;
}
.feature-card:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--accent-line, rgba(242,235,218,0.28)), 0 14px 28px rgba(0,0,0,0.45);
}
.feature-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--slate-0, #1C1C20);
  border: 1.5px solid var(--halo, #F2EBDA);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4) inset, 0 2px 0 rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  color: var(--halo, #F2EBDA); margin-bottom: 18px;
  position: relative; z-index: 1;
}
.feature-icon svg { width: 16px; height: 16px; }
.feature-title { font-size: 15px; font-weight: 600; color: var(--fg-1); margin: 0 0 6px; letter-spacing: -0.01em; }
.feature-desc { font-size: 13.5px; line-height: 1.55; color: var(--fg-2); margin: 0; }

/* ============================================================
   Timeline
   ============================================================ */
.timeline { list-style: none; padding: 0; margin: 0; max-width: 760px; margin: 0 auto; }
.era { display: grid; grid-template-columns: 56px 1fr; gap: 20px; padding-bottom: 48px; }
.era:last-child { padding-bottom: 0; }
.era-rail { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 6px; }
.era-node {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-3); border: 2px solid var(--border-2);
  flex-shrink: 0; z-index: 2;
}
.era-current .era-node {
  background: var(--halo, #F2EBDA); border-color: transparent;
  box-shadow: 0 0 0 3px var(--slate-0, #1C1C20), 0 0 0 4.5px var(--halo, #F2EBDA);
}
.era-line {
  position: absolute; top: 18px; bottom: -48px; left: 50%;
  width: 1px; transform: translateX(-50%);
  background: linear-gradient(180deg, var(--border-2), var(--border-1));
}
.era-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.era-tag {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  background: var(--bg-3); color: var(--fg-2); border: 1px solid var(--border-1);
  letter-spacing: 0.04em;
}
.era-tag-current {
  background: var(--slate-0, #1C1C20); color: var(--halo, #F2EBDA);
  border: 1.5px solid var(--halo, #F2EBDA); border-radius: 999px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.4);
}
.era-year { font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); }
.era-title { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 10px; color: var(--fg-1); }
.era-desc { font-size: 15px; line-height: 1.6; color: var(--fg-2); margin: 0; max-width: 580px; }

/* ============================================================
   Snippet (getting started)
   ============================================================ */
.snippet {
  background: #0B0B11; border: 1px solid var(--border-1); border-radius: 14px;
  overflow: hidden;
}
[data-theme='light'] .snippet { background: #1A1A24; }
.snippet-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-1);
  background: rgba(255, 255, 255, 0.02);
}
.snippet-lang { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); letter-spacing: 0.06em; text-transform: uppercase; }
.snippet-copy {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 6px;
  background: transparent; color: var(--fg-2); border: 1px solid var(--border-1);
  font-family: var(--font-sans); font-size: 12px; cursor: pointer;
  transition: all var(--dur-fast);
}
.snippet-copy:hover { color: var(--fg-1); border-color: var(--border-2); }
.snippet-copy svg { width: 13px; height: 13px; }
.snippet-body {
  margin: 0; padding: 20px 22px;
  font-family: var(--font-mono); font-size: 14px; line-height: 1.85;
  color: #F5F5FA;
  white-space: pre-wrap; word-break: break-all;
}
.tok-prompt { color: var(--fg-4); user-select: none; }
.tok-cmd { color: var(--halo, #F2EBDA); font-weight: 600; }
.tok-arg { color: var(--fg-1); }
.tok-val { color: var(--fg-1); font-weight: 500; }

.docs-link { text-align: center; margin-top: 32px; }
.docs-link a {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--fg-2); font-size: 14px;
  border-bottom: 1px solid transparent;
  transition: all var(--dur-fast);
  padding-bottom: 2px;
}
.docs-link a:hover { color: var(--fg-1); border-bottom-color: var(--border-2); }
.docs-link svg { width: 14px; height: 14px; }

/* ============================================================
   Projects (carousel of examples)
   ============================================================ */
.carousel {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}
.carousel-viewport {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-1);
  border-radius: 14px;
  background: var(--bg-2);
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset;
}
.carousel-zone {
  position: absolute;
  top: 0; bottom: 0;
  width: 50%;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 2;
}
.carousel-zone:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: -4px;
}
.carousel-zone-prev { left: 0; }
.carousel-zone-next { right: 0; }
.carousel-track {
  display: flex;
  transition: transform var(--dur-slow) var(--ease-out);
  will-change: transform;
}
.carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-3);
  overflow: hidden;
}
.carousel-slide img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.carousel-dots {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 16px;
}
.carousel-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border-2);
  padding: 0; cursor: pointer;
  transition: all var(--dur-fast) var(--ease-inout);
}
.carousel-dot:hover { border-color: var(--accent-line); }
.carousel-dot.is-active {
  background: var(--accent);
  border-color: var(--accent);
  width: 22px;
}
.carousel-dot:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ============================================================
   Contributors
   ============================================================ */
.avatar-wall {
  display: grid; grid-template-columns: repeat(9, 1fr); gap: 12px; max-width: 720px; margin: 0 auto;
}
@media (max-width: 720px) { .avatar-wall { grid-template-columns: repeat(6, 1fr); } }
.avatar {
  position: relative;
  display: block; aspect-ratio: 1; border-radius: 50%;
  background: var(--bg-3); border: 1px solid var(--border-1);
  transition: transform var(--dur-fast), border-color var(--dur-fast);
}
.avatar:hover { transform: scale(1.06); border-color: var(--accent); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; border-radius: 50%;
  font-family: var(--font-mono); font-size: 11px; color: var(--fg-3);
}
.avatar-gen3 { border-color: var(--halo, #F2EBDA); }
.avatar-badge {
  position: absolute; bottom: -2px; right: -2px;
  min-width: 18px; height: 16px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.05em;
  background: var(--halo, #F2EBDA); color: var(--slate-0, #1C1C20);
  border-radius: 999px; border: 1.5px solid var(--bg-0, #0A0A0F);
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
  pointer-events: none;
}

/* ============================================================
   Community links
   ============================================================ */
.link-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
@media (max-width: 880px) { .link-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .link-grid { grid-template-columns: 1fr; } }

.link-card {
  display: flex; align-items: center; gap: 14px;
  padding: 18px;
  background: var(--bg-2); border: 1px solid var(--border-1); border-radius: 14px;
  text-decoration: none; color: inherit;
  transition: all var(--dur-fast);
}
.link-card:hover { border-color: var(--border-2); }
.link-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: transparent; border: 1px solid var(--border-1);
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-1); flex-shrink: 0;
}
.link-icon svg { width: 16px; height: 16px; }
.link-text { flex: 1; min-width: 0; }
.link-text h3 { margin: 0 0 2px; font-size: 14px; font-weight: 600; color: var(--fg-1); }
.link-text p { margin: 0; font-size: 12.5px; color: var(--fg-2); line-height: 1.45; }
.link-arrow { color: var(--fg-3); display: flex; }
.link-arrow svg { width: 14px; height: 14px; }
.link-card:hover .link-arrow { color: var(--fg-1); transform: translateX(2px); }

/* ============================================================
   Footer
   ============================================================ */
.footer { border-top: 1px solid var(--border-1); padding: 64px 0 32px; }
.footer-inner {
  display: grid; grid-template-columns: 1fr 2fr; gap: 64px;
  padding-bottom: 48px;
}
@media (max-width: 768px) { .footer-inner { grid-template-columns: 1fr; gap: 32px; } }
.footer-brand img { height: 36px; margin-bottom: 14px; }
.footer-tagline { font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); margin: 0; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.footer-cols h4 {
  margin: 0 0 14px; font-family: var(--font-mono); font-size: 11px;
  color: var(--fg-3); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500;
}
.footer-cols a {
  display: block; padding: 5px 0; font-size: 14px; color: var(--fg-2);
  transition: color var(--dur-fast);
}
.footer-cols a:hover { color: var(--fg-1); }
.footer-fine {
  display: flex; justify-content: space-between; padding-top: 24px;
  border-top: 1px solid var(--border-1);
  font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-3);
}
@media (max-width: 600px) { .footer-fine { flex-direction: column; gap: 8px; } }
