/* charted landing page — editorial/liminal aesthetic
   Light sections: near-white frame, ink text, brand accents only on CTAs/links
   Dark gallery band: deep desaturated teal (#0f1a20), charts pop as vivid heroes
   Charts carry the color; chrome is restrained */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── RESET / BASE ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #fafafa;
  color: #1a2530;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: #5fab9e; text-decoration: none; }
a:hover { color: #2e4756; }

code, pre {
  font-family: 'JetBrains Mono', 'ui-monospace', 'SFMono-Regular', Menlo, monospace;
}

img { max-width: 100%; height: auto; display: block; }

/* ── LAYOUT SHELL ─────────────────────────────────────────────────────────── */
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── TOP NAV ──────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #e4e9ed;
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #2e4756;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.topbar-icon { width: 27px; height: 27px; position: relative; top: 2px; }

.topbar-wordmark { color: #2e4756; }

.topbar-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.topbar-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: #4a6070;
  transition: color 0.15s;
}

.topbar-links a:hover { color: #2e4756; }

/* ── HERO ─────────────────────────────────────────────────────────────────── */
.hero {
  background: #fff;
  padding: 5rem 0 4rem;
  border-bottom: 1px solid #edf0f2;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 4rem;
  align-items: center;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hero-headline {
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #1a2530;
  min-height: 2.2em; /* reserve two lines so the rotator never bounces the sub/CTA */
}

/* Hero headline rotator: payload word + caret cycle the three anchor colors. */
.hero-rotator { color: inherit; }
.hero-rotator .hr-tail { color: #5fab9e; } /* default; JS sets the live anchor */
.hero-rotator .hr-caret {
  display: inline-block;
  width: 0.085em;
  min-width: 3px;
  height: 0.86em;
  margin-left: 0.06em;
  vertical-align: -0.04em;
  background: #5fab9e;
  animation: hrBlink 1s steps(1) infinite;
}
@keyframes hrBlink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .hero-rotator .hr-caret { animation: none; }
}

.hero-sub {
  font-size: 1.1rem;
  color: #4a6070;
  line-height: 1.6;
  max-width: 38ch;
}

.hero-install {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f3f5f7;
  border: 1px solid #dde3e8;
  border-radius: 8px;
  padding: 0.5rem 0.875rem;
  width: fit-content;
}

.install-pill {
  font-size: 0.9rem;
  color: #2e4756;
  font-weight: 500;
  white-space: nowrap;
  background: none;
  padding: 0;
}

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #7a98a8;
  display: flex;
  align-items: center;
  padding: 0;
  transition: color 0.15s;
}

.copy-btn:hover { color: #5fab9e; }
.copy-btn.copied { color: #5fab9e; }

.hero-ctas {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1.5rem;
  background: #2e4756;
  color: #fff;
  border-radius: 7px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary:hover { background: #5fab9e; color: #fff; transform: translateY(-1px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1.25rem;
  border: 1.5px solid #dde3e8;
  color: #2e4756;
  border-radius: 7px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: border-color 0.15s, color 0.15s;
}

.btn-ghost:hover { border-color: #5fab9e; color: #5fab9e; }

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border: 1px solid #dde3e8;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #4a6070;
  white-space: nowrap;
}

.hero-chart {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(46, 71, 86, 0.10);
  border: 1px solid #edf0f2;
  background: #fff;
  padding-bottom: 1.5rem;
}

.hero-chart img { width: 100%; }

/* ── FADE-IN ──────────────────────────────────────────────────────────────── */
.fade-in {
  animation: fadeUp 0.7s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── SECTION TYPOGRAPHY ───────────────────────────────────────────────────── */
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #1a2530;
  text-align: center;
}

.section-sub {
  font-size: 1rem;
  color: #5a7385;
  text-align: center;
  max-width: 52ch;
  margin: 0.75rem auto 0;
  line-height: 1.65;
}

/* ── CODE DEMOS ───────────────────────────────────────────────────────────── */
.code-demos {
  background: #fafafa;
  padding: 5rem 0;
  border-bottom: 1px solid #edf0f2;
}

.demo-grid {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin-top: 3rem;
}

.demo-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: stretch;
}

.demo-pair:nth-child(even) {
  direction: rtl;
}
.demo-pair:nth-child(even) > * {
  direction: ltr;
}

.demo-code {
  background: #fff;
  border: 1px solid #e4e9ed;
  border-radius: 10px;
  overflow: auto;
  padding: 1.5rem;
  display: flex;
  align-items: center;
}

.demo-code pre {
  font-size: 0.82rem;
  line-height: 1.7;
  color: #2e4756;
  white-space: pre-wrap;
}

.demo-code .kw  { color: #5fab9e; font-weight: 600; }
.demo-code .st  { color: #db504a; }
.demo-code .nm  { color: #f58b51; }

.demo-chart {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e4e9ed;
  background: #fff;
  box-shadow: 0 2px 16px rgba(46, 71, 86, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 1.25rem;
}

.demo-chart img { width: 100%; }

/* ── GALLERY BAND ─────────────────────────────────────────────────────────── */
.gallery-band {
  background: #0f1a20;
  padding: 5rem 0 5.5rem;
}

.gallery-title { color: #e8f0f4; }
.gallery-sub   { color: #7a9aaa; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem 2.5rem;
  margin-top: 3rem;
}

/* Gallery cards are immersive — no white panels, charts sit directly on the
   dark band. A hairline border-bottom separates each card from its neighbours
   without introducing a white box. */
.gallery-card {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 1.5rem;
}

.gallery-card:hover .gallery-chart img {
  opacity: 0.92;
}

.gallery-chart {
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
}

.gallery-chart img { width: 100%; display: block; }

.gallery-meta {
  padding: 0.75rem 0 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.chart-type {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: #5fab9e;
  letter-spacing: 0.02em;
  width: fit-content;
}

.gallery-meta p {
  font-size: 0.82rem;
  color: #7a9aaa;
  line-height: 1.5;
  flex: 1;
}

.gallery-meta a {
  font-size: 0.78rem;
  font-weight: 500;
  color: #5fab9e;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.gallery-meta a:hover { opacity: 1; color: #5fab9e; }

/* ── FEATURES ─────────────────────────────────────────────────────────────── */
.features {
  background: #fff;
  padding: 5rem 0;
  border-top: 1px solid #edf0f2;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 3rem;
  margin-top: 3rem;
}

.feature-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.feature-icon {
  width: 22px;
  height: 22px;
  color: #5fab9e;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.feature-item strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a2530;
  margin-bottom: 0.2rem;
}

.feature-item p {
  font-size: 0.875rem;
  color: #5a7385;
  line-height: 1.6;
}

.feature-item code {
  font-size: 0.82em;
  background: #f3f5f7;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  color: #2e4756;
}

/* ── FOOTER CTA ───────────────────────────────────────────────────────────── */
.footer-cta {
  background: #1a2530;
  padding: 4rem 0 3rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  text-align: center;
}

.footer-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-top h2 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #e8f0f4;
}

.install-pill--dark {
  background: #243344;
  border: 1px solid #3a5060;
  color: #7ec8bc;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
}

.footer-links {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: #7a9aaa;
  transition: color 0.15s;
}

.footer-links a:hover { color: #5fab9e; }

.footer-copy {
  font-size: 0.8rem;
  color: #4a6070;
}

.footer-copy a { color: #5fab9e; }

/* ── SCROLL REVEAL ────────────────────────────────────────────────────────── */
/* Only suppress opacity when JS is running (body.js-reveal class added by
   the inline script). Without JS, items are fully visible — no hidden charts
   for static renders or crawlers. */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.js-reveal .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero { padding: 3rem 0 2.5rem; }

  /* Rotator: JS fits the font so the longest phrase sits on one line; nowrap +
     min-width:0 keep it there without blowing the column out of the viewport. */
  .hero-text { min-width: 0; }
  .hero-headline { min-height: 1.25em; overflow: hidden; }
  .hero-rotator { white-space: nowrap; }

  .demo-pair,
  .demo-pair:nth-child(even) {
    grid-template-columns: 1fr;
    direction: ltr;
  }

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

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

  .topbar-links { gap: 1.25rem; }

  .footer-links { gap: 1.5rem; }
}

@media (max-width: 480px) {
  .section-inner { padding: 0 1.25rem; }
  .topbar-inner  { padding: 0 1.25rem; }
  .hero-inner    { padding: 0 1.25rem; }

  .topbar-links a:nth-child(n+3) { display: none; }
}
