/* ================= styles.css ================= */

:root {
  --bg: #0b1220;
  --card: #0f172a;
  --muted: #94a3b8;
  --text: #e2e8f0;
  --brand: #22d3ee;
  --brand-2: #38bdf8;
  --accent: #a78bfa;
  --ok: #34d399;
  --danger: #f87171;
  --ring: 0 0 0 .125rem color-mix(in oklab, var(--brand) 35%, transparent);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Source Sans 3', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 800px at 80% -10%, #1e293b 0%, transparent 50%), var(--bg);
}

.h1, .h2, .h3 {
  font-family: 'Montserrat', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1200px; margin-inline: auto; padding: clamp(16px,2vw,24px); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: .2px;
  background: linear-gradient(135deg,var(--brand),var(--brand-2));
  color: #001018;
  border: 1px solid color-mix(in oklab, var(--brand) 40%, #000 60%);
  box-shadow: 0 10px 24px -10px color-mix(in oklab, var(--brand) 35%, transparent);
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px -12px color-mix(in oklab, var(--brand) 45%, transparent);
}
.btn.outline {
  background: transparent;
  color: var(--text);
  border: 1px solid color-mix(in oklab, var(--brand) 50%, #fff 10%);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .6rem;
  border-radius: 999px;
  font-size: .8rem;
  color: #0a1320;
  background: linear-gradient(135deg,var(--ok), #67e8f9);
}

/* Typography */
.kicker { font-size: .9rem; color: var(--muted); letter-spacing: .18em; text-transform: uppercase; }
.h1 { font-size: clamp(2.2rem, 3.8vw + .6rem, 4rem); line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
.h2 { font-size: clamp(1.6rem, 2.2vw + .4rem, 2.4rem); line-height: 1.2; font-weight: 800; }
.h3 { font-size: 1.2rem; font-weight: 700; }
.muted { color: var(--muted); }

/* Cards and layout */
.card {
  background: linear-gradient(180deg, color-mix(in oklab, #fff 2%, var(--card)), color-mix(in oklab, #000 5%, var(--card)));
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 20px;
}
.grid { display: grid; gap: 24px; }

/* Header */
header {
  position: sticky;
  top: 0;
  inset-inline: 0;
  z-index: 50;
  backdrop-filter: saturate(1.2) blur(12px);
  background: linear-gradient(180deg, color-mix(in oklab, var(--card) 80%, transparent), transparent);
}
nav { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: .75rem; font-weight: 800; letter-spacing: .2px; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: conic-gradient(from 200deg, var(--brand), var(--accent), var(--brand)); display: grid; place-items: center; box-shadow: inset 0 0 0 1px #0ea5b7; }
.logo svg { width: 20px; opacity: .95; }
.navlinks { display: flex; gap: 18px; }
.navlinks a { padding: .6rem .8rem; border-radius: 10px; color: var(--muted); }
.navlinks a:hover { background: #0b1220; color: var(--text); }
.hamburger { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; }

/* Hero */
.hero { position: relative; padding: 64px 0 36px; }
.hero .container { display: grid; gap: 30px; grid-template-columns: 1.1fr .9fr; align-items: center; }
.hero-visual { position: relative; isolation: isolate; }
.shoe { aspect-ratio: 4/3; border-radius: 18px; overflow: hidden; border: 1px solid #1f2a40; background: radial-gradient(800px 480px at 60% -20%, color-mix(in oklab, var(--brand) 8%, transparent), transparent), linear-gradient(180deg, #0b1220, #0a1422); }
.shoe::after { content: ""; position: absolute; inset: auto 10% 8% 10%; height: 46%; background: radial-gradient(closest-side, rgba(34,211,238,.18), transparent 70%); filter: blur(12px); z-index: -1; }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* Sections */
section { padding: 56px 0; }
.features { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.features .card { min-height: 180px; }
.two-col { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.partners { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 18px; place-items: center; }
.logo-tile { opacity: .7; filter: grayscale(1); transition: .2s; }
.logo-tile:hover { opacity: 1; filter: none; }

/* Testimonials */
.testi { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.quote { font-size: 1.05rem; line-height: 1.55; }

/* Footer */
footer { border-top: 1px solid #1f2937; padding: 32px 0; color: var(--muted); }

/* Inputs */
.input { width: 100%; margin-top: .35rem; padding: .85rem 1rem; border-radius: 12px; background: #0a1320; color: var(--text); border: 1px solid #1f2937; }
.input:focus { outline: none; box-shadow: var(--ring); }

/* Responsive */
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .navlinks { display: none; }
  .hamburger { display: inline-flex; }
  .nav-open .navlinks { display: flex; flex-direction: column; position: absolute; top: 56px; right: 16px; background: var(--card); padding: 10px; border: 1px solid #1f2937; border-radius: 12px; }
}


/* ================= main.js ================= */

// Mobile nav toggle
const hamburger = document.getElementById('hamburger');
const header = document.querySelector('header');
hamburger?.addEventListener('click', () => {
  header.classList.toggle('nav-open');
});

// Footer year
document.getElementById('year').textContent = new Date().getFullYear();

// Simple waitlist handler — stores to localStorage for now.
const form = document.getElementById('waitlist');
const msg = document.getElementById('form-msg');
form?.addEventListener('submit', (e) => {
  e.preventDefault();
  const data = Object.fromEntries(new FormData(form));
  const list = JSON.parse(localStorage.getItem('3dp_waitlist') || '[]');
  list.push({ ...data, ts: new Date().toISOString() });
  localStorage.setItem('3dp_waitlist', JSON.stringify(list));
  form.reset();
  msg.textContent = "Thanks! You're on the list. (This is a local demo — wire to Netlify when ready.)";
});

// Section reveal on scroll
const reveal = new IntersectionObserver((entries) => {
  entries.forEach(entry => {
    if (entry.isIntersecting) {
      entry.target.animate([
        { opacity: 0, transform: 'translateY(10px)' },
        { opacity: 1, transform: 'translateY(0)' }
      ], { duration: 500, easing: 'cubic-bezier(.2,.8,.2,1)', fill: 'forwards' });
      reveal.unobserve(entry.target);
    }
  });
}, { threshold: .12 });

document.querySelectorAll('section .card, .features .card, .testi .card').forEach(el => reveal.observe(el));
