/* Foundry Variant 2: Story Driven
   Premium product launch aesthetic — Apple/Stripe
   Dark/light alternating sections, scroll-driven narrative
*/

:root {
  --bg: #FFFFFF;
  --bg-dark: #0A0A0F;
  --surface: #F8F7FC;
  --surface-dark: #15151F;
  --surface-elevated: #F0EEF8;
  --border-subtle: #E4E1EE;
  --border-strong: #C9C3D9;
  --text: #0A0A0F;
  --text-secondary: #4A4A5A;
  --text-muted: #8A8A9A;
  --text-inverse: #FFFFFF;
  --text-inverse-secondary: #B0B0C0;
  --text-inverse-muted: #6A6A7A;
  --primary: #6C2BD9;
  --primary-hover: #5A23B8;
  --primary-active: #4A1D9E;
  --secondary: #00C896;
  --secondary-hover: #00B085;
  --accent: #FFB800;
  --success: #00C896;
  --warning: #FFB800;
  --error: #FF4757;
  --max-width: 1100px;
  --reading-width: 720px;
  --nav-height: 64px;
}

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

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

body {
  font-family: 'General Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  transition: background 0.2s, box-shadow 0.2s;
}

.nav.scrolled {
  background: var(--bg);
  box-shadow: 0 1px 4px rgba(10,10,15,0.08);
}

.nav-transparent .nav-logo,
.nav-transparent .nav-links a {
  color: var(--text-inverse);
}

.nav-transparent .nav-links a:hover {
  color: var(--accent);
}

.nav.scrolled .nav-logo,
.nav.scrolled .nav-links a {
  color: var(--text);
}

.nav.scrolled .nav-links a:hover {
  color: var(--primary);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'Clash Display', 'General Sans', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text-inverse);
  transition: color 0.2s;
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
  list-style: none;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-inverse);
  transition: color 0.2s;
}

.nav-links a.nav-cta {
  padding: 8px 20px;
  border-radius: 12px;
  background: var(--primary);
  color: var(--text-inverse);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-inverse);
  margin: 5px 0;
  transition: 0.3s;
}

.nav.scrolled .nav-toggle span {
  background: var(--text);
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.reading-container {
  max-width: var(--reading-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 80px 0; }
.section-lg { padding: 128px 0; }

.section-dark {
  background: var(--bg-dark);
  color: var(--text-inverse);
}

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

.section-surface {
  background: var(--surface);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Clash Display', 'General Sans', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h1 { font-size: clamp(36px, 7vw, 72px); }
h2 { font-size: clamp(28px, 5vw, 56px); }
h3 { font-size: 24px; margin-bottom: 12px; }
h4 { font-size: 20px; margin-bottom: 8px; }

p { margin-bottom: 20px; }

.lead {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.section-dark .lead { color: var(--text-inverse-secondary); }

.eyebrow {
  font-family: 'General Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  display: block;
}

/* Hero */
.hero-full {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--bg-dark);
  color: var(--text-inverse);
  position: relative;
  overflow: hidden;
}

.hero-full::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(108,43,217,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.hero-full h1 { margin-bottom: 24px; }

.hero-full .lead {
  max-width: 640px;
  margin-bottom: 40px;
  font-size: 20px;
  color: var(--text-inverse-secondary);
}

.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-sub {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-inverse-muted);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'General Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-ghost:hover { background: var(--surface); }

.btn-ghost-inverse {
  background: transparent;
  color: var(--text-inverse);
  border: 1px solid rgba(255,255,255,0.2);
}

.btn-ghost-inverse:hover { background: var(--surface-dark); }

.btn-on-dark {
  background: var(--text-inverse);
  color: var(--bg-dark);
}

.btn-on-dark:hover { box-shadow: 0 0 40px rgba(108,43,217,0.3); transform: translateY(-1px); }

.btn-full { width: 100%; justify-content: center; }

/* Problem cards */
.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.problem-card {
  padding: 32px;
  border-radius: 12px;
  background: var(--surface);
}

.problem-card .problem-num {
  font-family: 'Clash Display', sans-serif;
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 16px;
}

.problem-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

.problem-card p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Proof blocks */
.proof-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.proof-visual {
  border-radius: 20px;
  background: var(--surface-dark);
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.proof-visual::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 50% 50%, rgba(108,43,217,0.08) 0%, transparent 70%);
}

.proof-icon {
  font-size: 72px;
  position: relative;
  z-index: 1;
}

.proof-content .eyebrow {
  color: var(--accent);
}

.proof-content h3 {
  font-size: 28px;
  margin-bottom: 8px;
}

.proof-content .proof-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.proof-stat {
  font-family: 'Clash Display', sans-serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  color: var(--secondary);
  line-height: 1;
  margin-bottom: 12px;
}

.section-dark .proof-stat { color: var(--secondary); }

.proof-substat {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.section-dark .proof-substat { color: var(--text-inverse-secondary); }

.proof-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: gap 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.proof-link:hover { gap: 12px; }

.section-dark .proof-link { color: var(--accent); }

/* Differentiators */
.diff-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.diff-card {
  padding: 32px;
  border-radius: 12px;
  background: var(--surface-dark);
  border-left: 3px solid var(--primary);
}

.diff-card h3 {
  font-size: 20px;
  color: var(--text-inverse);
  margin-bottom: 12px;
}

.diff-card p {
  font-size: 15px;
  color: var(--text-inverse-secondary);
  margin: 0;
}

/* CTA band */
.cta-band {
  text-align: center;
  padding: 128px 0;
  background: var(--bg-dark);
  color: var(--text-inverse);
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(108,43,217,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.cta-band .container { position: relative; z-index: 1; }

.cta-band h2 { margin-bottom: 24px; }

.cta-band p {
  max-width: 540px;
  margin: 0 auto 32px;
  color: var(--text-inverse-secondary);
}

.cta-note {
  font-size: 14px;
  color: var(--text-inverse-muted);
  margin-top: 24px;
}

/* Tables */
.table-wrap { overflow-x: auto; margin: 24px 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
}

table th {
  font-family: 'General Sans', sans-serif;
  font-weight: 600;
  text-align: left;
  padding: 16px 20px;
  border-bottom: 2px solid var(--border-subtle);
  color: var(--text);
}

table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

table tr:last-child td { border-bottom: none; }

.section-dark table { background: var(--surface-dark); }
.section-dark table th { color: var(--text-inverse); border-bottom-color: rgba(255,255,255,0.1); }
.section-dark table td { border-bottom-color: rgba(255,255,255,0.05); color: var(--text-inverse-secondary); }

.before-after-table .change-col {
  font-weight: 700;
  color: var(--secondary);
}

/* Quotes */
.quote {
  border-left: 3px solid var(--primary);
  padding: 20px 28px;
  margin: 24px 0;
  font-style: italic;
  font-size: 18px;
  color: var(--text-secondary);
  background: var(--surface);
  border-radius: 0 12px 12px 0;
}

.section-dark .quote {
  color: var(--text-inverse-secondary);
  background: var(--surface-dark);
}

.quote cite {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  font-style: normal;
  color: var(--text-muted);
  font-family: 'General Sans', sans-serif;
}

.section-dark .quote cite { color: var(--text-inverse-muted); }

/* Savings cards */
.savings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.savings-card {
  padding: 32px;
  border-radius: 20px;
  background: var(--surface-dark);
}

.savings-card h4 {
  font-size: 18px;
  color: var(--text-inverse);
  margin-bottom: 16px;
}

.savings-card .savings-api {
  font-size: 15px;
  color: var(--text-inverse-muted);
  text-decoration: line-through;
  margin-bottom: 4px;
}

.savings-card .savings-foundry {
  font-size: 15px;
  color: var(--text-inverse-secondary);
  margin-bottom: 16px;
}

.savings-card .savings-annual {
  font-family: 'Clash Display', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--secondary);
}

/* Time cards */
.time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.time-card {
  padding: 32px;
  border-radius: 20px;
  background: var(--surface-dark);
}

.time-card h4 {
  font-size: 18px;
  color: var(--text-inverse);
  margin-bottom: 16px;
}

.time-card .time-before {
  font-size: 15px;
  color: var(--error);
  text-decoration: line-through;
  margin-bottom: 4px;
}

.time-card .time-after {
  font-size: 20px;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 8px;
}

.time-card .time-saved {
  font-family: 'Clash Display', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

/* Risk blocks */
.risk-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.risk-block {
  padding: 28px;
  border-radius: 12px;
  background: var(--surface);
  border-left: 3px solid var(--secondary);
}

.risk-block h4 {
  font-size: 17px;
  margin-bottom: 8px;
}

.risk-block p {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
}

/* ROI section */
.roi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

.roi-panel {
  padding: 40px;
  border-radius: 20px;
  background: var(--surface-dark);
}

.roi-panel h3 {
  font-size: 18px;
  color: var(--text-inverse-muted);
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.roi-panel .roi-total {
  font-family: 'Clash Display', sans-serif;
  font-size: 40px;
  font-weight: 700;
  color: var(--text-inverse);
  margin-top: 24px;
}

.roi-panel .roi-total.success { color: var(--secondary); }

.roi-panel .roi-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 15px;
  color: var(--text-inverse-secondary);
}

.roi-panel .roi-item:last-child { border-bottom: none; }

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.pricing-card {
  padding: 40px;
  border-radius: 20px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

.pricing-card.featured {
  border: 2px solid var(--primary);
  position: relative;
}

.pricing-card .badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: var(--text-inverse);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 999px;
  letter-spacing: 0.1em;
}

.pricing-card h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

.pricing-card .price {
  font-family: 'Clash Display', sans-serif;
  font-size: 40px;
  font-weight: 700;
  margin: 16px 0 4px;
}

.pricing-card .for-line {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.pricing-card ul {
  list-style: none;
  margin: 16px 0 24px;
  flex-grow: 1;
}

.pricing-card li {
  font-size: 15px;
  color: var(--text-secondary);
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  padding-left: 24px;
  position: relative;
}

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

.pricing-card li:last-child { border-bottom: none; }

/* FAQ */
.faq-item {
  border-bottom: 1px solid var(--border-subtle);
  padding: 24px 0;
}

.faq-item h4 {
  font-size: 17px;
  margin-bottom: 8px;
  cursor: pointer;
}

.faq-item p {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
}

/* Contact form */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  color: var(--text-inverse-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  font-size: 16px;
  font-family: 'General Sans', sans-serif;
  background: var(--surface-dark);
  color: var(--text-inverse);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group textarea { min-height: 120px; resize: vertical; }

/* Step timeline */
.step-sequence {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  margin: 32px 0;
}

.step-item {
  text-align: center;
}

.step-item .step-num {
  font-family: 'Clash Display', sans-serif;
  font-size: 40px;
  font-weight: 700;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}

.step-item .step-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-inverse);
  margin-bottom: 4px;
}

.step-item .step-time {
  font-size: 13px;
  color: var(--text-inverse-muted);
}

/* Cloud vs local */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.col-success {
  padding: 32px;
  border-radius: 16px;
  background: var(--surface);
  border-left: 3px solid var(--secondary);
}

.col-neutral {
  padding: 32px;
  border-radius: 16px;
  background: var(--surface);
  border-left: 3px solid var(--text-muted);
}

.col-success h4, .col-neutral h4 { margin-bottom: 16px; }

.col-success ul, .col-neutral ul {
  list-style: none;
  padding: 0;
}

.col-success li, .col-neutral li {
  padding: 8px 0;
  font-size: 15px;
  color: var(--text-secondary);
}

/* Stack diagram */
.stack-diagram {
  background: var(--surface-dark);
  padding: 32px;
  border-radius: 16px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
  color: var(--text-inverse-secondary);
}

/* Footer */
.footer {
  background: var(--bg-dark);
  color: var(--text-inverse-muted);
  padding: 64px 0 32px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  font-family: 'Clash Display', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-inverse);
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-inverse-muted);
  text-decoration: none;
}

.footer-links a:hover { color: var(--text-inverse); }

.footer-copy {
  font-size: 12px;
  color: var(--text-inverse-muted);
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.1);
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

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

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-dark);
    flex-direction: column;
    padding: 80px 24px 24px;
    gap: 20px;
    z-index: 99;
  }

  .nav-links.open { display: flex; }

  .nav-links a { color: var(--text-inverse); }

  .nav-toggle { display: block; }

  .problem-grid { grid-template-columns: 1fr; }
  .proof-block { grid-template-columns: 1fr; gap: 32px; }
  .diff-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .roi-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .risk-grid { grid-template-columns: 1fr; }
  .step-sequence { grid-template-columns: repeat(2, 1fr); }
  .savings-grid { grid-template-columns: 1fr; }
  .time-grid { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
  .section-lg { padding: 64px 0; }
}

@media (max-width: 640px) {
  .step-sequence { grid-template-columns: 1fr; }
  .hero-full { min-height: 80vh; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .scroll-indicator { animation: none; }
  * { transition: none !important; }
}