/* ===========================
   Cloudskill — Design System
   =========================== */

:root {
  /* Light theme (default) */
  --bg: #fafaf9;
  --bg-elevated: #ffffff;
  --bg-subtle: #f5f5f4;
  --text: #0a0a0a;
  --text-muted: #57534e;
  --text-subtle: #78716c;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;
  --accent: #c2410c;
  --accent-hover: #9a3412;
  --accent-bg: #fff7ed;
  --code-bg: #f5f5f4;
  --code-text: #44403c;

  /* Typography */
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', 'Menlo', 'Monaco', monospace;

  /* Type scale */
  --text-xs: 13px;
  --text-sm: 14px;
  --text-base: 17px;
  --text-lg: 19px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-3xl: 36px;
  --text-4xl: 48px;
  --text-5xl: 64px;
  --text-6xl: 80px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* Layout */
  --max-w: 1200px;
  --max-w-prose: 720px;

  /* Transitions */
  --transition: 150ms ease;
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-elevated: #1c1917;
  --bg-subtle: #1c1917;
  --text: #fafaf9;
  --text-muted: #a8a29e;
  --text-subtle: #78716c;
  --border: #292524;
  --border-strong: #44403c;
  --accent: #fb923c;
  --accent-hover: #fdba74;
  --accent-bg: #1c1410;
  --code-bg: #1c1917;
  --code-text: #d6d3d1;
}

/* Reset + base */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition), color var(--transition);
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

code {
  font-family: var(--font-mono);
  background: var(--code-bg);
  color: var(--code-text);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

/* ============ Layout ============ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.container-prose {
  max-width: var(--max-w-prose);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

section {
  padding: var(--space-9) 0;
  border-top: 1px solid var(--border);
}

section:first-of-type {
  border-top: none;
}

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 249, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .site-header {
  background: rgba(10, 10, 10, 0.85);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--text);
  letter-spacing: -0.01em;
}

.logo-mark {
  width: 28px;
  height: 28px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  font-family: var(--font-mono);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.nav-link {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--transition);
}

.nav-link:hover { color: var(--text); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background-color var(--transition);
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--bg-subtle);
}

/* Hide one icon in each theme */
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
.icon-sun { display: none; }
.icon-moon { display: block; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), transform 100ms ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.btn-primary:hover {
  background: var(--text-muted);
  color: var(--bg);
  border-color: var(--text-muted);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
}

.btn-accent {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
.btn-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-lg {
  padding: 14px 24px;
  font-size: var(--text-base);
}

/* ============ Hero ============ */
.hero {
  padding: var(--space-10) 0 var(--space-9);
  text-align: left;
  border-top: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 6px 12px;
  border-radius: 100px;
  margin-bottom: var(--space-5);
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}

.hero-eyebrow-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.hero h1 {
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin: 0 0 var(--space-5);
  max-width: 900px;
}

.hero-sub {
  font-size: var(--text-xl);
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 0 var(--space-7);
  letter-spacing: -0.01em;
}

.hero-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ============ Sections — generic ============ */
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 var(--space-4);
  font-weight: 500;
}

h2 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0 0 var(--space-5);
  max-width: 720px;
}

h3 {
  font-size: var(--text-xl);
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin: 0 0 var(--space-3);
}

.section-intro {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 0 var(--space-7);
  line-height: 1.5;
}

/* ============ Problem ============ */
.problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-7);
}

.problem-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.problem-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.problem-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* ============ How it works ============ */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-7);
}

@media (max-width: 768px) {
  .steps { grid-template-columns: 1fr; }
}

.step {
  position: relative;
}

.step-number {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent);
  font-weight: 500;
  margin-bottom: var(--space-3);
}

.step h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.step p {
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
  margin: 0;
}

/* ============ Features ============ */
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-7) var(--space-6);
  margin-top: var(--space-7);
}

@media (max-width: 768px) {
  .features { grid-template-columns: 1fr; }
}

.feature {
  padding-left: var(--space-5);
  border-left: 2px solid var(--border-strong);
}

.feature h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.feature p {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin: 0;
  line-height: 1.6;
}

/* ============ Code preview ============ */
.code-preview {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-top: var(--space-6);
  overflow-x: auto;
}

.code-preview pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--code-text);
}

.code-comment { color: var(--text-subtle); }
.code-key { color: var(--accent); }
.code-string { color: var(--code-text); }

/* ============ CTA section ============ */
.cta-section {
  text-align: center;
  padding: var(--space-9) 0;
}

.cta-section h2 {
  margin-left: auto;
  margin-right: auto;
}

.cta-section .section-intro {
  margin-left: auto;
  margin-right: auto;
}

.cta-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-6);
}

/* ============ Footer ============ */
.footer {
  padding: var(--space-7) 0;
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--space-6);
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
  }
  .footer-brand { grid-column: 1 / -1; }
}

.footer-brand p {
  color: var(--text-muted);
  margin: var(--space-3) 0 0;
  max-width: 280px;
  font-size: var(--text-sm);
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 var(--space-3);
  font-weight: 500;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-col a {
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-subtle);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
}

@media (max-width: 768px) {
  .footer-bottom {
    flex-direction: column;
    gap: var(--space-3);
    align-items: flex-start;
  }
}

/* ============ Pricing page ============ */
.pricing-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  max-width: 480px;
  margin: var(--space-7) auto 0;
}

.pricing-tier {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 var(--space-2);
  font-weight: 500;
}

.pricing-name {
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-4);
}

.pricing-amount {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.pricing-amount .currency {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--text);
}

.pricing-amount .price {
  font-size: var(--text-5xl);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}

.pricing-amount .period {
  color: var(--text-muted);
  font-size: var(--text-base);
}

.pricing-billed {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}

.billing-toggle {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: var(--space-5);
}

.billing-toggle button {
  background: transparent;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  transition: background-color var(--transition), color var(--transition);
}

.billing-toggle button.active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.seat-selector {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  background: var(--bg-subtle);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.seat-selector label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 500;
  flex: 1;
}

.seat-input-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.seat-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  font-size: var(--text-base);
  font-weight: 500;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition);
}
.seat-btn:hover { background: var(--bg-subtle); }
.seat-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.seat-input {
  width: 56px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  color: var(--text);
  -moz-appearance: textfield;
}

.seat-input::-webkit-outer-spin-button,
.seat-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.pricing-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border);
  margin-bottom: var(--space-5);
}

.pricing-total-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.pricing-total-amount {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--text);
}

.pricing-includes {
  margin: var(--space-5) 0 0;
}

.pricing-includes h4 {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 var(--space-3);
  font-weight: 500;
}

.pricing-includes ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pricing-includes li {
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding-left: var(--space-5);
  position: relative;
  line-height: 1.5;
}

.pricing-includes li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 14px;
  height: 8px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

/* ============ FAQ ============ */
.faq {
  margin-top: var(--space-7);
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: var(--space-5) 0;
}

.faq-item:first-child { border-top: 1px solid var(--border); }

.faq-question {
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-3);
  color: var(--text);
}

.faq-answer {
  color: var(--text-muted);
  margin: 0;
  font-size: var(--text-base);
  line-height: 1.6;
  max-width: 720px;
}

/* ============ Prose pages (legal, security) ============ */
.page-header {
  padding: var(--space-9) 0 var(--space-7);
}

.page-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 var(--space-3);
  font-weight: 500;
}

.page-title {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin: 0 0 var(--space-4);
  max-width: 800px;
}

.page-lede {
  font-size: var(--text-xl);
  color: var(--text-muted);
  max-width: 620px;
  margin: 0;
  line-height: 1.5;
}

.prose h2 {
  font-size: var(--text-2xl);
  margin-top: var(--space-7);
  margin-bottom: var(--space-4);
}

.prose h3 {
  font-size: var(--text-xl);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.prose p {
  margin: 0 0 var(--space-4);
  line-height: 1.7;
  color: var(--text);
}

.prose ul, .prose ol {
  margin: 0 0 var(--space-5);
  padding-left: var(--space-5);
}

.prose li {
  margin-bottom: var(--space-2);
  line-height: 1.6;
  color: var(--text);
}

.prose strong {
  font-weight: 600;
  color: var(--text);
}

.prose code {
  font-size: 0.9em;
}

.prose-section {
  padding-bottom: var(--space-8);
}

.meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-subtle);
  margin-top: var(--space-7);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

/* ============ Animations ============ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeUp 600ms ease both;
}

.fade-up-delay-1 { animation-delay: 100ms; }
.fade-up-delay-2 { animation-delay: 200ms; }
.fade-up-delay-3 { animation-delay: 300ms; }
