@import "./tokens.css";

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }

/* Dark chrome sections: this site has no light/dark toggle, so the "dark
   section" look is a fixed design choice — pinned to tokens.css's dark-mode
   --color-chrome-bg value, not a data-theme switch. */
.section-dark {
  background: #161b24;
  color: #eceded;
}
.section-dark .muted { color: rgba(236, 237, 237, 0.68); }

.section-light { background: var(--color-bg); }

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

@media (max-width: 640px) {
  .wrap { padding: 0 var(--space-5); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.btn-primary {
  background: var(--color-accent-600);
  color: #fff;
  padding: var(--space-4) var(--space-6);
  font-size: 16px;
}
.btn-primary:hover { background: var(--color-accent-700); }
.btn-primary:active { transform: translateY(1px); }
.btn-nav {
  padding: var(--space-2) var(--space-5);
  font-size: 14px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav .wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  letter-spacing: 0.3px;
  text-decoration: none;
}
.nav-logo {
  width: 24px;
  height: 24px;
  display: block;
  border-radius: 5px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 40px 0;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 55% 45%;
  gap: var(--space-8);
  align-items: center;
}
@media (max-width: 1024px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
}

.pre-headline {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--color-accent-400);
  margin-bottom: var(--space-4);
  min-height: 1.2em;
}

.hero-headline {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 52px;
  line-height: 1.06;
  color: #fff;
  margin-bottom: var(--space-5);
}
@media (max-width: 640px) {
  .hero-headline { font-size: 36px; }
}
.hero-headline .line { display: block; min-height: 1.06em; }

.typing-cursor {
  display: inline-block;
  width: 3px;
  margin-left: 2px;
  background: var(--color-accent-400);
  animation: blink 650ms step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-sub {
  font-size: 18px;
  line-height: 1.6;
  color: rgba(236, 237, 237, 0.72);
  max-width: 480px;
  margin-bottom: var(--space-7);
}

.trust-block {
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: 14px;
  color: rgba(236, 237, 237, 0.68);
}
.trust-block li { display: flex; gap: var(--space-2); align-items: flex-start; }
.trust-block .tick { color: var(--color-accent-400); flex-shrink: 0; }

.hero-visual {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #0e1117;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}
.hero-visual canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.hero-visual .fallback-word {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 96px;
  height: 96px;
}
.hero-visual .fallback-word[hidden] {
  display: none;
}

/* ---------- Section headings ---------- */
.section-heading {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 36px;
  text-align: center;
  margin-bottom: var(--space-4);
}
.section-sub {
  font-size: 18px;
  color: var(--color-text-muted);
  text-align: center;
  max-width: 560px;
  margin: 0 auto var(--space-8);
  line-height: 1.6;
}

/* ---------- Value Pillars ---------- */
.pillars {
  position: relative;
  padding: 44px 0;
}
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
@media (max-width: 1024px) {
  .pillars-grid { grid-template-columns: 1fr; }
}
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
}
.pillar-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-accent-100);
  color: var(--color-accent-700);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
}
.pillar-icon svg { width: 22px; height: 22px; }
.card h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  margin-bottom: var(--space-3);
}
.card p { color: var(--color-text-muted); line-height: 1.55; font-size: 15px; }

/* ---------- Name the Enemy ---------- */
.enemy {
  padding: 44px 0;
}
.enemy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: stretch;
}
@media (max-width: 1024px) {
  .enemy-grid { grid-template-columns: 1fr; }
}
.enemy-col {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-7);
}
.enemy-col h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: var(--space-6);
}
.enemy-old { background: #fdf2f2; }
.enemy-old h3 { color: var(--color-text-muted); }
.enemy-new { background: var(--color-accent-100); }
.enemy-new h3 { color: var(--color-accent-700); }
.enemy-col ul { display: flex; flex-direction: column; gap: var(--space-4); }
.enemy-col li { display: flex; gap: var(--space-3); align-items: flex-start; font-size: 15px; line-height: 1.5; }
.enemy-col svg { flex-shrink: 0; margin-top: 2px; }
.enemy-old svg { color: var(--color-danger); }
.enemy-new svg { color: var(--color-accent-600); }

/* ---------- Pricing ---------- */
.pricing {
  position: relative;
  padding: 44px 0;
  background: var(--color-surface-raised);
}
.pricing-callout {
  background: var(--color-accent-600);
  color: #fff;
  text-align: center;
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-6);
  max-width: 640px;
  margin: 0 auto var(--space-8);
  font-size: 15px;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
@media (max-width: 1024px) {
  .pricing-grid { grid-template-columns: 1fr; }
}
.price-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-7) var(--space-6);
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.price-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
}
.price-card.featured { border: 2px solid var(--color-accent-600); }
.price-badge {
  position: absolute;
  top: -13px;
  right: var(--space-5);
  background: var(--color-accent-600);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}
.price-amount {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 40px;
  margin-bottom: var(--space-2);
}
.price-credits { color: var(--color-text-muted); font-size: 15px; margin-bottom: var(--space-6); }
.price-card .btn-primary { width: 100%; }

.objection-line {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
  margin-top: var(--space-5);
}
.trust-line {
  text-align: center;
  color: var(--color-text-faint);
  font-size: 13px;
  margin-top: var(--space-3);
}

/* ---------- Second CTA ---------- */
.cta2 { position: relative; padding: 40px 0; text-align: center; }
.cta2 h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 42px;
  color: #fff;
  margin-bottom: var(--space-4);
}
.cta2 .hero-sub { margin: 0 auto var(--space-7); text-align: center; }
.cta2 .trust-block { align-items: center; margin: var(--space-6) auto 0; }

/* ---------- Footer ---------- */
.footer { padding: var(--space-6) 0; }
.footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
}
.footer-links { display: flex; gap: var(--space-6); font-size: 14px; }
.footer-links a { color: rgba(236, 237, 237, 0.68); }
.footer-links a:hover { color: #fff; }
.footer-copy { font-size: 13px; color: rgba(236, 237, 237, 0.5); }
.footer-bottom { justify-content: center; padding-top: var(--space-3); }
.footer-social svg { width: 18px; height: 18px; color: rgba(236, 237, 237, 0.68); }
.footer-social a:hover svg { color: #fff; }
@media (max-width: 640px) {
  .footer .wrap { flex-direction: column; text-align: center; }
}

/* ---------- Section fades ----------
   Hard color cuts between dark-chrome and light sections read as jarring.
   Each boundary gets a gradient pseudo-element sized to fit inside that
   section's own top padding (z-index:-1, so it sits behind the section's
   own text) so colors blend instead of switching instantly. */
.hero + .pillars::before,
.enemy + .pricing::before,
.pricing + .cta2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: -1;
  pointer-events: none;
}
.hero + .pillars::before {
  height: 40px;
  background: linear-gradient(to bottom, #161b24, var(--color-bg));
}
.enemy + .pricing::before {
  height: 44px;
  background: linear-gradient(to bottom, var(--color-bg), var(--color-surface-raised));
}
.pricing + .cta2::before {
  height: 40px;
  background: linear-gradient(to bottom, var(--color-surface-raised), #161b24);
}

/* ---------- Scroll entrances ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 320ms ease, transform 320ms ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .typing-cursor { animation: none; }
  .card, .price-card { transition: none; }
}

/* ---------- Simple pages (privacy/terms/changelog) ---------- */
.doc-header { padding: 56px 0 32px; text-align: center; }
.doc-header h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 42px;
  margin-bottom: var(--space-3);
}
.doc-header p { color: var(--color-text-muted); font-size: 18px; }

.doc-body { padding: 0 0 72px; }
.doc-body .wrap { max-width: 720px; }
.doc-content { line-height: 1.7; font-size: 16px; }
.doc-content h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 22px;
  margin: var(--space-8) 0 var(--space-4);
}
.doc-content h2:first-child { margin-top: 0; }
.doc-content p { margin-bottom: var(--space-4); }
.doc-content ul { margin-bottom: var(--space-4); padding-left: var(--space-6); list-style: disc; }
.doc-content li { margin-bottom: var(--space-2); }
.doc-content strong { font-weight: 600; }
.doc-content h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 18px;
  margin: var(--space-6) 0 var(--space-3);
}
.doc-content table { width: 100%; border-collapse: collapse; margin-bottom: var(--space-4); font-size: 15px; }
.doc-content th, .doc-content td { text-align: left; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-border); }
.doc-content th { font-weight: 600; color: var(--color-text-faint); font-size: 13px; text-transform: uppercase; }
.doc-meta { color: var(--color-text-faint); font-size: 14px; margin-bottom: var(--space-6); }

.changelog-entry {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  padding: var(--space-7);
  margin-bottom: 40px;
  scroll-margin-top: 72px;
}
.entry-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.entry-header h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 22px;
  margin: 0;
}
.entry-header time { color: var(--color-text-faint); font-size: 14px; }
.entry-body h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--color-text-muted);
  margin: var(--space-5) 0 var(--space-3);
}
.entry-body h3:first-child { margin-top: 0; }
.entry-body ul { list-style: disc; padding-left: var(--space-6); display: flex; flex-direction: column; gap: var(--space-2); }
.entry-body li { font-size: 15px; line-height: 1.55; }
