/* ===== Variables ===== */
:root {
  --bg: #050508;
  --bg-elevated: #0c0c10;
  --text: #f0f0f5;
  --text-muted: #8888a0;
  --text-dim: #5a5a70;
  --accent-sketch: #2d5a87;
  --accent-paint: #7c3aed;
  --accent-mix: #d97706;
  --glass-bg: rgba(12, 12, 16, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glow-sketch: rgba(45, 90, 135, 0.4);
  --glow-paint: rgba(124, 58, 237, 0.4);
  --glow-mix: rgba(217, 119, 6, 0.4);
  --font-display: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  position: relative;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
  z-index: 9999;
  animation: noise-shift 20s steps(10) infinite;
}
@keyframes noise-shift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(2px, -2px); }
  50% { transform: translate(-1px, 1px); }
  75% { transform: translate(1px, 2px); }
}
@media (prefers-reduced-motion: reduce) {
  body::before { opacity: 0.02; animation: none; }
}
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem 1.5rem;
  position: relative;
  overflow: hidden;
}
.hero .hero-gradient-orb {
  position: absolute;
  width: 50vw;
  height: 50vw;
  max-width: 400px;
  max-height: 400px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  pointer-events: none;
}
.hero .hero-gradient-orb.paint { background: radial-gradient(circle, var(--accent-paint) 0%, transparent 70%); top: -15%; right: -10%; }
.hero .hero-gradient-orb.sketch { background: radial-gradient(circle, var(--accent-sketch) 0%, transparent 70%); bottom: -15%; left: -10%; }
.hero .hero-gradient-orb.mix { background: radial-gradient(circle, var(--accent-mix) 0%, transparent 70%); top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: 0.06; }
@media (prefers-reduced-motion: reduce) {
  .hero .hero-gradient-orb { opacity: 0.06; }
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.4;
}
@media (prefers-reduced-motion: reduce) {
  .hero-canvas { display: none; }
}
.hero-content { position: relative; z-index: 1; text-align: center; max-width: 640px; }
.hero-content .reveal { opacity: 0; transform: translateY(24px); }
.hero-brand { font-family: var(--font-display); font-size: 0.875rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 0.5rem; }
.hero-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-bottom: 2rem; font-size: 0.8rem; color: var(--text-muted); }
.hero-pills span {
  padding: 0.4rem 0.75rem;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  border: 1px solid var(--glass-border);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
}
.hero-subtext { color: var(--text-muted); font-size: 1.125rem; margin: 0 0 1rem; }
.hero-nav { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.hero-nav a {
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.hero-nav a:hover { transform: translateY(-2px); }
.hero-nav .sketch { background: rgba(45, 90, 135, 0.25); border: 1px solid rgba(45, 90, 135, 0.5); }
.hero-nav .sketch:hover { box-shadow: 0 0 20px var(--glow-sketch); }
.hero-nav .paint { background: rgba(124, 58, 237, 0.25); border: 1px solid rgba(124, 58, 237, 0.5); }
.hero-nav .paint:hover { box-shadow: 0 0 20px var(--glow-paint); }
.hero-nav .mix { background: rgba(217, 119, 6, 0.25); border: 1px solid rgba(217, 119, 6, 0.5); }
.hero-nav .mix:hover { box-shadow: 0 0 20px var(--glow-mix); }

/* ===== Product sections (shared) ===== */
section {
  padding: 4rem 1.5rem;
  position: relative;
  overflow: hidden;
  scroll-margin-top: 4.5rem;
}
.showcase-slide.sketch-section { padding: 2rem 1.5rem; }
.showcase-slide.paint-section { padding: 2rem 1.5rem; }
.showcase-slide.mix-section { padding: 2rem 1.5rem; }
.sketch-section { background: linear-gradient(180deg, transparent, rgba(45, 90, 135, 0.06) 50%, transparent); }
.paint-section { background: linear-gradient(180deg, transparent, rgba(124, 58, 237, 0.06) 50%, transparent); }
.mix-section { background: linear-gradient(180deg, transparent, rgba(217, 119, 6, 0.06) 50%, transparent); }

.section-inner { position: relative; z-index: 1; max-width: 960px; margin: 0 auto; opacity: 0; transform: translateY(40px); }
.section-inner h2 { font-family: var(--font-display); font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 0.25rem; }
.section-inner .tagline { color: var(--text-muted); font-size: 1rem; margin: 0 0 2rem; }
.section-inner ul { list-style: none; padding: 0; margin: 0 0 2rem; }
.section-inner li { padding: 0.5rem 0; padding-left: 1.5rem; position: relative; color: var(--text-muted); opacity: 0; transform: translateY(12px); }
.section-inner li::before { content: '—'; position: absolute; left: 0; color: inherit; opacity: 0.6; }

/* CTA buttons (shared pattern) */
.cta {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cta:hover { transform: translateY(-1px); }
.cta-sketch { background: linear-gradient(135deg, #2d5a87, #3d6a9a); box-shadow: 0 0 24px var(--glow-sketch); }
.cta-sketch:hover { box-shadow: 0 0 32px var(--glow-sketch); }
.cta-paint { background: linear-gradient(135deg, #7c3aed, #8b5cf6); box-shadow: 0 0 24px var(--glow-paint); }
.cta-paint:hover { box-shadow: 0 0 32px var(--glow-paint); }
.cta-mix { background: linear-gradient(135deg, #d97706, #ea580c); box-shadow: 0 0 24px var(--glow-mix); }
.cta-mix:hover { box-shadow: 0 0 32px var(--glow-mix); }

/* ===== Pinned showcase ===== */
.showcase-pinned {
  position: relative;
}
.showcase-spacer {
  min-height: 100vh;
}
.showcase-pinned::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(45, 90, 135, 0.03) 16%,
    rgba(124, 58, 237, 0.03) 50%,
    rgba(217, 119, 6, 0.03) 83%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 0;
}
.showcase-slide {
  position: sticky;
  top: 0;
  height: 100vh;
  scroll-margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}
.showcase-slide .section-inner {
  position: relative;
  z-index: 1;
  max-width: 960px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 768px) {
  .showcase-slide .section-inner {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

/* ===== App mockup (reusable browser window) ===== */
.app-mockup {
  order: -1;
  margin-bottom: 0;
}
@media (min-width: 768px) {
  .app-mockup { order: 0; margin-bottom: 0; }
}
.mockup-browser {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0,0,0,0.4);
}
.sketch-mockup .mockup-browser { box-shadow: 0 24px 48px rgba(0,0,0,0.4), 0 0 40px rgba(45,90,135,0.15); }
.paint-mockup .mockup-browser { box-shadow: 0 24px 48px rgba(0,0,0,0.4), 0 0 40px rgba(124,58,237,0.15); }
.mix-mockup .mockup-browser { box-shadow: 0 24px 48px rgba(0,0,0,0.4), 0 0 40px rgba(217,119,6,0.15); }
.mockup-chrome {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid var(--glass-border);
}
.mockup-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
}
.mockup-dot:nth-child(1) { background: #ff5f56; }
.mockup-dot:nth-child(2) { background: #ffbd2e; }
.mockup-dot:nth-child(3) { background: #27ca40; }
.mockup-url {
  margin-left: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-dim);
}
.mockup-content {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: auto;
}
@media (min-width: 768px) {
  .mockup-browser { max-width: 420px; margin: 0 auto; }
  .mockup-content { min-height: 260px; padding: 2rem; }
}
.sketch-mockup .mockup-content { min-height: 220px; }
@media (min-width: 768px) {
  .sketch-mockup .mockup-content { min-height: 280px; }
}

/* ===== OpenSketch visual ===== */
.sketch-visual {
  width: 100%;
  max-width: 220px;
  height: 220px;
  margin: 0 auto;
  position: relative;
  min-height: 180px;
}
@media (min-width: 768px) {
  .sketch-visual { max-width: 260px; height: 260px; min-height: 260px; }
}
.sketch-visual canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  border-radius: 6px;
  cursor: grab;
}
.sketch-visual canvas:active { cursor: grabbing; }
.sketch-visual .sketch-fallback { display: none; width: 100%; height: 100%; opacity: 0.6; }
.sketch-visual.no-motion canvas { display: none; }
.sketch-visual.no-motion .sketch-fallback { display: block; }

/* ===== OpenPaint visual (before/after) ===== */
.paint-visual {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .paint-visual { max-width: 380px; }
}
.before-after {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 6px;
  overflow: hidden;
  cursor: col-resize;
}
.before-after-before,
.before-after-after {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #1a1a2e;
}
.before-after-before {
  background-image: url('https://images.unsplash.com/photo-1516035069371-29a1b244cc32?w=400&h=300&fit=crop');
}
.before-after-after {
  background-image: url('https://images.unsplash.com/photo-1516035069371-29a1b244cc32?w=400&h=300&fit=crop');
  filter: saturate(1.4) contrast(1.1) brightness(1.05);
  clip-path: inset(0 0 0 50%);
}
.before-after-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: col-resize;
  z-index: 2;
}
.before-after::after {
  content: '';
  position: absolute;
  top: 0;
  left: var(--slider-pct, 50%);
  width: 2px;
  height: 100%;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 0 8px rgba(0,0,0,0.3);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1;
  transition: left 0.05s ease-out;
}
.before-after-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  cursor: col-resize;
}
.before-after-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  cursor: col-resize;
  border: none;
}

/* ===== OpenMix visual ===== */
.mix-visual {
  width: 200px;
  height: 80px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (min-width: 768px) {
  .mix-visual { width: 240px; height: 100px; }
}
.mix-visualizer-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  height: 100%;
}
@media (min-width: 768px) {
  .mix-visualizer-bars { gap: 10px; }
}
.mix-visualizer-bars .bar {
  width: 10px;
  min-height: 8px;
  background: linear-gradient(180deg, #ea580c, #d97706);
  border-radius: 4px;
  opacity: 0.85;
  transition: box-shadow 0.3s, opacity 0.3s;
}
@media (min-width: 768px) {
  .mix-visualizer-bars .bar { width: 12px; }
}
.mix-visualizer-bars .bar:nth-child(1) { height: 20px; }
.mix-visualizer-bars .bar:nth-child(2) { height: 35px; }
.mix-visualizer-bars .bar:nth-child(3) { height: 50px; }
.mix-visualizer-bars .bar:nth-child(4) { height: 40px; }
.mix-visualizer-bars .bar:nth-child(5) { height: 55px; }
.mix-visualizer-bars .bar:nth-child(6) { height: 30px; }
.mix-visualizer-bars .bar:nth-child(7) { height: 45px; }
@media (prefers-reduced-motion: no-preference) {
  .mix-visualizer-bars .bar { animation: eq-bounce 2s ease-in-out infinite; }
  .mix-visualizer-bars .bar:nth-child(1) { animation-delay: 0s; }
  .mix-visualizer-bars .bar:nth-child(2) { animation-delay: 0.1s; }
  .mix-visualizer-bars .bar:nth-child(3) { animation-delay: 0.2s; }
  .mix-visualizer-bars .bar:nth-child(4) { animation-delay: 0.15s; }
  .mix-visualizer-bars .bar:nth-child(5) { animation-delay: 0.25s; }
  .mix-visualizer-bars .bar:nth-child(6) { animation-delay: 0.05s; }
  .mix-visualizer-bars .bar:nth-child(7) { animation-delay: 0.2s; }
}
.mix-visual:hover .mix-visualizer-bars .bar {
  animation-duration: 0.8s;
  box-shadow: 0 0 12px rgba(217, 119, 6, 0.6);
  opacity: 1;
}
@keyframes eq-bounce { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.6); } }

/* ===== Why OpenLabs ===== */
.why-section { padding: 4rem 1.5rem; background: var(--bg); scroll-margin-top: 4.5rem; }
.why-heading { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; text-align: center; margin: 0 0 2rem; }
.why-grid {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 768px) {
  .why-grid { grid-template-columns: repeat(2, 1fr); }
}
.why-card {
  opacity: 0;
  transform: translateY(20px);
  padding: 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}
.why-card h3 { font-family: var(--font-display); font-size: 1.125rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 0.5rem; }
.why-card p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

/* ===== Footer ===== */
footer {
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.875rem;
  border-top: 1px solid var(--glass-border);
}
footer a { color: var(--text-muted); }
footer a:hover { color: var(--text); }
.footer-links { margin-bottom: 1rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 0.75rem; }

/* ===== Skip link & Sticky nav ===== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: #fff;
  color: #0a0a0a;
  font-weight: 600;
  z-index: 100;
  border-radius: 4px;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

.sticky-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}
@media (prefers-reduced-motion: reduce) {
  .sticky-nav { transition: none; }
}
.sticky-nav.visible { transform: translateY(0); }
.sticky-logo { font-family: var(--font-display); font-weight: 800; font-size: 0.95rem; letter-spacing: -0.02em; }
.sticky-links { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; }
@media (min-width: 768px) {
  .sticky-links { gap: 1.25rem; }
}
.sticky-links a { font-size: 0.875rem; color: var(--text-muted); }
.sticky-links a:hover { color: var(--text); }
