:root {
  --font-sans: Inter, Space Grotesk, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
  --background: 220 38% 98%;
  --foreground: 224 31% 10%;
  --card: 0 0% 100%;
  --card-foreground: 224 31% 10%;
  --popover: 0 0% 100%;
  --popover-foreground: 224 31% 10%;
  --primary: 221 83% 53%;
  --primary-foreground: 210 40% 98%;
  --secondary: 214 32% 91%;
  --secondary-foreground: 224 31% 10%;
  --muted: 214 32% 91%;
  --muted-foreground: 220 11% 38%;
  --accent: 189 94% 43%;
  --accent-foreground: 220 40% 10%;
  --destructive: 0 72% 51%;
  --destructive-foreground: 210 40% 98%;
  --success: 152 69% 38%;
  --success-foreground: 150 60% 98%;
  --warning: 38 92% 50%;
  --warning-foreground: 32 95% 10%;
  --info: 199 89% 48%;
  --info-foreground: 205 60% 98%;
  --border: 214 32% 84%;
  --input: 214 32% 84%;
  --ring: 221 83% 53%;
  --radius: 0.625rem;
  --shadow-sm: 0 1px 2px hsl(var(--foreground) / 0.05);
  --shadow-md: 0 4px 12px hsl(var(--foreground) / 0.08);
  --shadow-lg: 0 12px 32px hsl(var(--foreground) / 0.12);
  --shadow-elegant: 0 24px 80px hsl(var(--primary) / 0.22);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.dark {
  --background: 224 42% 5%;
  --foreground: 210 40% 96%;
  --card: 224 38% 9%;
  --card-foreground: 210 40% 96%;
  --popover: 224 38% 8%;
  --popover-foreground: 210 40% 96%;
  --primary: 190 95% 58%;
  --primary-foreground: 220 52% 8%;
  --secondary: 226 26% 16%;
  --secondary-foreground: 210 40% 96%;
  --muted: 226 26% 16%;
  --muted-foreground: 218 18% 72%;
  --accent: 263 90% 70%;
  --accent-foreground: 260 50% 8%;
  --destructive: 0 72% 58%;
  --destructive-foreground: 210 40% 98%;
  --success: 151 72% 46%;
  --success-foreground: 150 60% 8%;
  --warning: 42 96% 60%;
  --warning-foreground: 32 95% 10%;
  --info: 199 94% 62%;
  --info-foreground: 205 70% 9%;
  --border: 220 24% 20%;
  --input: 220 24% 20%;
  --ring: 190 95% 58%;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; background: hsl(var(--background)); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: hsl(var(--foreground));
  background:
    radial-gradient(circle at 20% 0%, hsl(var(--primary) / 0.18), transparent 32rem),
    radial-gradient(circle at 82% 14%, hsl(var(--accent) / 0.16), transparent 28rem),
    hsl(var(--background));
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: linear-gradient(hsl(var(--foreground) / 0.035) 1px, transparent 1px), linear-gradient(90deg, hsl(var(--foreground) / 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, hsl(0 0% 0% / 0.72), transparent 78%);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.7; }
::selection { background: hsl(var(--primary) / 0.35); color: hsl(var(--foreground)); }

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  transform: translateY(-160%);
  padding: 0.75rem 1rem;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  box-shadow: var(--shadow-md);
}
.skip-link:focus { transform: translateY(0); outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }

.section-container { width: min(100% - 2rem, 80rem); margin: 0 auto; }
.site-header {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0 1rem;
}
.nav-shell {
  width: min(100%, 80rem);
  min-height: 4rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 4px);
  background: hsl(var(--popover) / 0.78);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
}
.brand { display: inline-flex; align-items: center; gap: 0.75rem; font-weight: 700; letter-spacing: -0.04em; }
.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: radial-gradient(circle at 34% 30%, hsl(var(--primary-foreground)), hsl(var(--primary)) 38%, hsl(var(--accent)) 72%);
  box-shadow: 0 0 28px hsl(var(--primary) / 0.4);
}
.desktop-nav { display: none; align-items: center; gap: 1.5rem; color: hsl(var(--muted-foreground)); font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; }
.desktop-nav a { transition: color var(--transition-fast); }
.desktop-nav a:hover { color: hsl(var(--foreground)); }
.nav-actions { display: flex; align-items: center; gap: 0.5rem; }

.button, .icon-button {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
  outline: none;
}
.button:focus-visible, .icon-button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}
.button:hover, .icon-button:hover { transform: translateY(-2px); }
.button-primary {
  padding: 0.75rem 1.25rem;
  color: hsl(var(--primary-foreground));
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
  box-shadow: var(--shadow-elegant);
}
.button-secondary {
  width: 100%;
  padding: 0.75rem 1rem;
  color: hsl(var(--secondary-foreground));
  background: hsl(var(--secondary));
  border-color: hsl(var(--border));
}
.button-ghost {
  padding: 0.75rem 1.25rem;
  color: hsl(var(--foreground));
  background: hsl(var(--card) / 0.48);
  border-color: hsl(var(--border));
}
.button-small { padding: 0.625rem 1rem; }
.icon-button { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); border-color: hsl(var(--border)); }

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom));
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--popover) / 0.88);
  backdrop-filter: blur(20px);
}
.bottom-nav a { min-height: 44px; display: grid; place-items: center; border-radius: calc(var(--radius) - 2px); color: hsl(var(--muted-foreground)); font-size: 0.875rem; font-weight: 500; }
.bottom-nav a:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }

.hero-section { position: relative; min-height: 100svh; display: grid; align-items: center; padding: 7rem 0 5rem; overflow: hidden; }
.ambient { position: absolute; border-radius: 999px; filter: blur(48px); opacity: 0.72; pointer-events: none; }
.ambient-one { width: 18rem; height: 18rem; left: -6rem; top: 8rem; background: hsl(var(--primary) / 0.28); }
.ambient-two { width: 20rem; height: 20rem; right: -8rem; bottom: 4rem; background: hsl(var(--accent) / 0.22); }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 3rem; align-items: center; }
.hero-copy { max-width: 46rem; }
.eyebrow { margin: 0 0 0.75rem; color: hsl(var(--muted-foreground)); font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 1.5rem; font-size: clamp(3rem, 12vw, 6.8rem); line-height: 0.92; letter-spacing: -0.08em; font-weight: 700; }
h2 { margin-bottom: 1rem; font-size: clamp(2rem, 6vw, 4rem); line-height: 1; letter-spacing: -0.06em; font-weight: 600; }
h3 { margin-bottom: 0.75rem; font-size: 1.25rem; line-height: 1.4; letter-spacing: -0.04em; font-weight: 600; }
.lead { max-width: 40rem; color: hsl(var(--muted-foreground)); font-size: 1.125rem; line-height: 1.75rem; }
.word { display: inline-block; overflow: hidden; vertical-align: top; }
.word span { display: inline-block; }
.hero-actions { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 2rem; }
.trust-strip { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; color: hsl(var(--muted-foreground)); font-size: 0.875rem; }
.trust-strip span { padding: 0.5rem 0.75rem; border: 1px solid hsl(var(--border)); border-radius: 999px; background: hsl(var(--card) / 0.5); }
.hero-visual { position: relative; min-height: 22rem; border-radius: calc(var(--radius) + 4px); background: radial-gradient(circle at 50% 50%, hsl(var(--primary) / 0.16), transparent 62%); }
#product-canvas { width: 100%; height: min(72vh, 38rem); min-height: 22rem; display: block; touch-action: pan-y; }
.scene-fallback { position: absolute; inset: 20%; display: grid; place-items: center; border-radius: 999px; background: hsl(var(--primary) / 0.12); color: hsl(var(--primary)); }
.visual-panel { position: absolute; padding: 0.75rem 1rem; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--card) / 0.62); backdrop-filter: blur(18px); box-shadow: var(--shadow-md); }
.visual-panel span { display: block; color: hsl(var(--muted-foreground)); font-size: 0.75rem; line-height: 1rem; }
.visual-panel strong { font-size: 1.25rem; line-height: 1.75rem; }
.panel-top { top: 1rem; right: 0; }
.panel-bottom { left: 0; bottom: 2rem; }

.story-section, .features-section, .stats-section, .case-section, .pricing-section, .contact-section { padding: 4rem 0; }
.section-heading { max-width: 48rem; margin-bottom: 3rem; }
.section-heading p:not(.eyebrow) { color: hsl(var(--muted-foreground)); font-size: 1.125rem; line-height: 1.75rem; }
.compact { margin-bottom: 0; }
.story-grid { display: grid; gap: 1rem; }
.story-panel { position: relative; min-height: 18rem; padding: 1.5rem; border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 4px); background: linear-gradient(145deg, hsl(var(--card) / 0.72), hsl(var(--card) / 0.36)); box-shadow: var(--shadow-sm); overflow: hidden; }
.story-panel p { color: hsl(var(--muted-foreground)); }
.story-index { display: inline-flex; width: 3rem; height: 3rem; align-items: center; justify-content: center; margin-bottom: 2rem; border-radius: 999px; background: hsl(var(--primary) / 0.12); color: hsl(var(--primary)); font-weight: 600; }

.features-grid, .pricing-grid, .stats-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.glass-card, .stat-card, .case-card, .pricing-card { border: 1px solid hsl(var(--border)); background: linear-gradient(145deg, hsl(var(--card) / 0.74), hsl(var(--card) / 0.42)); box-shadow: var(--shadow-sm); backdrop-filter: blur(20px); }
.feature-card { position: relative; min-height: 16rem; padding: 1.5rem; border-radius: calc(var(--radius) + 4px); overflow: hidden; transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth); }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: hsl(var(--primary) / 0.42); }
.feature-card p:not(.eyebrow) { color: hsl(var(--muted-foreground)); }
.card-orb { position: absolute; width: 7rem; height: 7rem; right: -2rem; top: -2rem; border-radius: 999px; background: hsl(var(--primary) / 0.14); filter: blur(8px); }
.stats-layout { display: grid; gap: 2rem; align-items: start; }
.stat-card { min-height: 10rem; padding: 1.5rem; border-radius: calc(var(--radius) + 4px); }
.stat-card strong { display: block; margin-bottom: 0.5rem; font-size: 2.25rem; line-height: 2.5rem; letter-spacing: -0.06em; }
.stat-card span { color: hsl(var(--muted-foreground)); }
.case-scroll { overflow-x: auto; padding-bottom: 1rem; scrollbar-width: thin; }
.case-track { display: flex; gap: 1rem; width: max-content; }
.case-card { width: min(82vw, 26rem); min-height: 24rem; display: flex; flex-direction: column; padding: 1.5rem; border-radius: calc(var(--radius) + 4px); }
.case-result { color: hsl(var(--foreground)); font-weight: 500; }
.case-card blockquote { margin: auto 0 1.5rem; color: hsl(var(--muted-foreground)); font-size: 1.125rem; line-height: 1.75rem; }
.case-person { color: hsl(var(--primary)); font-weight: 500; }
.pricing-card { display: flex; flex-direction: column; gap: 1.5rem; padding: 1.5rem; border-radius: calc(var(--radius) + 4px); transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth); }
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.pricing-card.is-featured { border-color: hsl(var(--primary) / 0.6); box-shadow: var(--shadow-elegant); }
.plan-description { color: hsl(var(--muted-foreground)); }
.price-row strong { display: block; font-size: 2.25rem; line-height: 2.5rem; letter-spacing: -0.06em; }
.price-row span { color: hsl(var(--muted-foreground)); }
.pricing-card ul { display: grid; gap: 0.75rem; padding: 0; margin: 0; list-style: none; color: hsl(var(--muted-foreground)); }
.pricing-card li { position: relative; padding-left: 1.5rem; }
.pricing-card li::before { content: '•'; position: absolute; left: 0; color: hsl(var(--primary)); }
.contact-grid { display: grid; gap: 2rem; align-items: start; }
.final-cta { padding: 2rem 0; }
.final-cta p:not(.eyebrow) { color: hsl(var(--muted-foreground)); font-size: 1.125rem; line-height: 1.75rem; }
.cta-proof { display: grid; gap: 0.75rem; margin-top: 2rem; }
.cta-proof span { padding: 1rem; border-radius: var(--radius); background: hsl(var(--primary) / 0.1); color: hsl(var(--primary)); font-weight: 500; }
.demo-form { display: grid; gap: 1rem; padding: 1rem; border-radius: calc(var(--radius) + 4px); transition: box-shadow var(--transition-smooth), border-color var(--transition-smooth), transform var(--transition-smooth); }
.demo-form.is-highlighted { border-color: hsl(var(--primary)); box-shadow: var(--shadow-elegant); transform: translateY(-2px); }
.demo-form label { display: grid; gap: 0.5rem; color: hsl(var(--foreground)); font-size: 0.875rem; font-weight: 500; }
.demo-form input, .demo-form textarea, .demo-form select {
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 1rem;
  border: 1px solid hsl(var(--input));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--background) / 0.72);
  color: hsl(var(--foreground));
  font-size: max(16px, 1rem);
  line-height: 1.5rem;
}
.demo-form textarea { resize: vertical; }
.form-note { margin: 0; color: hsl(var(--muted-foreground)); font-size: 0.875rem; line-height: 1.25rem; }
.site-footer { padding: 4rem 0 calc(6rem + env(safe-area-inset-bottom)); border-top: 1px solid hsl(var(--border)); background: hsl(var(--card) / 0.3); }
.footer-grid { display: grid; gap: 2rem; }
.footer-grid p { max-width: 24rem; color: hsl(var(--muted-foreground)); }
.footer-grid h2 { margin-bottom: 1rem; font-size: 1rem; line-height: 1.5rem; letter-spacing: 0; }
.footer-grid a:not(.brand) { display: block; min-height: 32px; color: hsl(var(--muted-foreground)); }
.footer-grid a:hover { color: hsl(var(--foreground)); }
.toast-region { position: fixed; right: 1rem; bottom: calc(5rem + env(safe-area-inset-bottom)); z-index: 80; display: grid; gap: 0.75rem; width: min(24rem, calc(100vw - 2rem)); }
.toast { transform: translateY(12px); opacity: 0; padding: 1rem; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--popover)); color: hsl(var(--popover-foreground)); box-shadow: var(--shadow-md); transition: opacity var(--transition), transform var(--transition); }
.toast.is-showing { transform: translateY(0); opacity: 1; }
.toast-success { border-color: hsl(var(--success) / 0.5); }
.toast-error { border-color: hsl(var(--destructive) / 0.5); }
.toast-info { border-color: hsl(var(--info) / 0.5); }

@media (min-width: 640px) {
  .hero-actions { flex-direction: row; }
  .features-grid, .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .demo-form { padding: 1.5rem; }
}

@media (min-width: 768px) {
  .desktop-nav { display: flex; }
  .bottom-nav { display: none; }
  .hero-section { padding: 8rem 0 6rem; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(22rem, 0.82fr); }
  .story-section, .features-section, .stats-section, .case-section, .pricing-section, .contact-section { padding: 6rem 0; }
  .story-grid { grid-template-columns: repeat(3, 1fr); }
  .pricing-grid { grid-template-columns: repeat(3, 1fr); align-items: stretch; }
  .stats-layout { grid-template-columns: 0.85fr 1.15fr; }
  .contact-grid { grid-template-columns: 1fr minmax(22rem, 28rem); }
  .site-footer { padding-bottom: 4rem; }
  .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); }
  .toast-region { bottom: 1rem; }
}

@media (min-width: 1024px) {
  .features-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-card strong { font-size: 3rem; line-height: 3.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; scroll-behavior: auto !important; transition-duration: 1ms !important; }
}
