@import url('./tokens.css');

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--surface-app);
  min-height: 100vh;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

/* ---------- Layout ---------- */
.wrap {
  width: min(100% - var(--sp-12), var(--max-w));
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-strong);
  background: rgba(45, 45, 45, 0.92);
  backdrop-filter: blur(10px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}

.brand:hover { text-decoration: none; }

.brand img { width: 22px; height: 22px; }

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  margin-left: auto;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.site-nav a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-base) var(--ease-out);
}

.site-nav a:hover { color: var(--text-primary); text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  height: 38px;
  padding: 0 var(--sp-10);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}

.btn:hover { text-decoration: none; }

.btn--cta {
  color: var(--text-on-amber);
  background: var(--cta);
  box-shadow: var(--bevel-top);
}

.btn--cta:hover { background: var(--cta-hover); }
.btn--cta:active { background: var(--cta-active); transform: translateY(1px); }

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn--ghost {
  color: var(--text-primary);
  background: var(--gray-400);
  box-shadow: var(--bevel-top);
}

.btn--ghost:hover { background: #4b4b4b; }

.btn--quiet {
  color: var(--text-secondary);
  background: transparent;
  padding-inline: var(--sp-6);
}

.btn--quiet:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.04); }

/* ---------- Hero ---------- */
.hero {
  padding: var(--sp-32) 0 var(--sp-24);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-24);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
  padding: 4px 10px;
  border-radius: var(--radius-pill, 999px);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cta);
  background: rgba(232, 168, 74, 0.1);
  border: 1px solid rgba(232, 168, 74, 0.2);
}

.hero h1 {
  font-size: clamp(2.125rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-8);
}

.hero-lead {
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 34ch;
  margin-bottom: var(--sp-16);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-6);
  margin-bottom: var(--sp-12);
}

.hero-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.hero-note code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.install-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Sections ---------- */
.section {
  padding: var(--sp-24) 0;
  border-top: 1px solid var(--border-strong);
}

.section-head {
  margin-bottom: var(--sp-16);
}

.section-head h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-4);
}

.section-head p {
  color: var(--text-secondary);
  max-width: 52ch;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-8);
}

.feature-card {
  padding: var(--sp-10);
  background: var(--gray-50);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}

.feature-card:hover {
  border-color: var(--border-subtle);
  transform: translateY(-2px);
}

.feature-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-8);
  border-radius: var(--radius-sm);
  background: rgba(232, 168, 74, 0.12);
  color: var(--cta);
  font-size: 0.875rem;
}

.feature-card h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: var(--sp-4);
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-12);
  counter-reset: step;
}

.step {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.step::before {
  counter-increment: step;
  content: counter(step);
  flex: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-on-amber);
  background: var(--cta);
}

.step h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--sp-4);
}

.step p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Install */
.install-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-16);
  align-items: center;
  padding: var(--sp-16);
  background: linear-gradient(135deg, var(--gray-50) 0%, rgba(13, 42, 71, 0.35) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
}

.install-card h2 {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-6);
}

.install-card p {
  color: var(--text-secondary);
  margin-bottom: var(--sp-10);
  max-width: 48ch;
}

.install-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.install-steps li {
  display: flex;
  gap: var(--sp-4);
}

.install-steps strong { color: var(--text-primary); font-weight: 600; }

.install-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--sp-6);
}

/* Download form */
.download-panel {
  width: min(100%, 320px);
}

.download-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.download-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.download-input {
  width: 100%;
  padding: var(--sp-5) var(--sp-6);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.9375rem;
  transition: border-color var(--dur-base) var(--ease-out);
}

.download-input:focus {
  outline: none;
  border-color: var(--cta);
  box-shadow: 0 0 0 2px rgba(232, 168, 74, 0.2);
}

.download-consent {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
  cursor: pointer;
}

.download-consent input {
  margin-top: 3px;
  flex: none;
  accent-color: var(--cta);
}

.download-submit {
  width: 100%;
  justify-content: center;
}

.download-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.download-status {
  font-size: 0.8125rem;
  line-height: 1.45;
  margin: 0;
}

.download-status--error { color: #f08080; }
.download-status--success { color: #8fd48f; }

/* Footer */
.site-footer {
  padding: var(--sp-16) 0 var(--sp-20);
  border-top: 1px solid var(--border-strong);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-8);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: var(--sp-10);
}

.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text-secondary); text-decoration: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .demo-shell { order: -1; max-width: 100%; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; gap: var(--sp-10); }
  .install-card { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .site-nav { display: none; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero { padding-top: var(--sp-20); }
}
