/* ═══════════════════════════════════════════════════════
   Loom Website
   Canonical reference: design_system.md
   ═══════════════════════════════════════════════════════ */

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

:root {
  /* Backgrounds (design_system.md §2.1) */
  --bg-0: #0d0d0d;
  --bg-cinema: #000;

  /* Text (design_system.md §2.2) */
  --text-0: #f5f5f7;
  --text-1: rgba(255,255,255, 0.50);
  --text-2: rgba(255,255,255, 0.35);
  --text-3: rgba(255,255,255, 0.20);

  /* Accents (design_system.md §2.3) */
  --accent: #0A84FF;
  --accent-hover: #409CFF;

  /* System colors (design_system.md §2.5) */
  --indigo: #5e5ce6;
  --purple: #bf5af2;
  --cyan: #64d2ff;
  --green: #30d158;
  --warm: #ff9f0a;

  /* Glass (design_system.md §4.1) */
  --glass-bg: rgba(255,255,255, 0.06);
  --glass-border: rgba(255,255,255, 0.10);
  --glass-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 1px rgba(255,255,255,0.05);

  /* Radius (design_system.md §5) */
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 980px;

  /* Motion (design_system.md §7.1) */
  --spring: cubic-bezier(0.16, 1, 0.3, 1);

  /* Font (design_system.md §3.1) */
  --font: -apple-system, 'Inter', 'SF Pro Display', system-ui, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden;
}

::selection { background: rgba(10,132,255,0.25); color: #fff; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 3px; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.container { max-width: 980px; margin: 0 auto; padding: 0 40px; }
.container-mid { max-width: 640px; margin: 0 auto; padding: 0 40px; }


/* ═══════════════════════════════════════════════════════
   NAV — Glass bar (design_system.md §4.2 sidebar-style)
   ═══════════════════════════════════════════════════════ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(40px) saturate(120%);
  -webkit-backdrop-filter: blur(40px) saturate(120%);
  border-bottom: 1px solid transparent;
  z-index: 100;
  transition: background 300ms, border-color 300ms;
}

.nav.scrolled {
  background: rgba(13, 13, 13, 0.85);
  border-bottom-color: var(--glass-border);
}

.nav-inner {
  max-width: 980px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
}

.nav-logo {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-0);
}

.nav-links { display: flex; align-items: center; gap: 4px; }

.nav-link {
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-1);
  border-radius: 8px;
  transition: color 150ms, background 150ms;
}

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

.nav-link-cta {
  color: var(--text-0);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  font-weight: 500;
}

.nav-link-cta:hover { background: rgba(255,255,255,0.10); }

.nav-mobile-toggle {
  display: none;
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  color: var(--text-1);
}


/* ═══════════════════════════════════════════════════════
   HERO — Cinematic black (design_system.md: #000 for
   cinematic moments)
   ═══════════════════════════════════════════════════════ */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-cinema);
  overflow: hidden;
}

/* Subtle ambient glow — brand color, very restrained */
.hero-glow {
  position: absolute;
  top: 35%;
  left: 50%;
  width: 700px;
  height: 500px;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse at center,
    rgba(94, 92, 230, 0.08) 0%,
    rgba(191, 90, 242, 0.04) 40%,
    transparent 70%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 580px;
  padding: 0 32px;
}

/* Brand gradient on hero title (design_system.md §2.4) */
.hero-title {
  font-size: clamp(64px, 10vw, 96px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(135deg, #64d2ff 0%, #5e5ce6 40%, #bf5af2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.hero-tagline {
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 300;
  color: rgba(255,255,255,0.6);
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.hero-desc {
  font-size: 16px;
  color: var(--text-1);
  line-height: 1.65;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.hero-note {
  font-size: 12px;
  color: var(--text-3);
}

.hero-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 160px;
  background: linear-gradient(to bottom, transparent, var(--bg-0));
  pointer-events: none;
}


/* ── Buttons (design_system.md §5, §6) ── */

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: background 200ms, transform 150ms, box-shadow 300ms;
  box-shadow: 0 0 24px rgba(10,132,255,0.15);
}

.btn-hero:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 32px rgba(10,132,255,0.25);
}

.btn-hero:active { transform: scale(0.97); }


/* ═══════════════════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════════════════ */

.section {
  position: relative;
  padding: 120px 0;
}

.section-di { background: #000; }

.section-header { margin-bottom: 48px; }

.section-heading {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-0);
  margin-bottom: 8px;
}

.section-heading-lg {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.section-heading-center { text-align: center; }


/* ═══════════════════════════════════════════════════════
   FEATURE CARDS — Glass panels with specular highlight
   (design_system.md §4.2 cards/panels + §8 specular)
   ═══════════════════════════════════════════════════════ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.card {
  position: relative;
  padding: 24px 22px;
  background: rgba(255,255,255, 0.04);
  border: 1px solid rgba(255,255,255, 0.08);
  border-radius: var(--radius-lg);
  transition: border-color 300ms, background 300ms;
}

/* Specular highlight — design_system.md §8 */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(170deg, rgba(255,255,255,0.05) 0%, transparent 40%);
  pointer-events: none;
}

/* Top-edge highlight — design_system.md §4 tip */
.card::after {
  content: '';
  position: absolute;
  top: 0; left: 12px; right: 12px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  pointer-events: none;
}

.card:hover {
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
}

.card-icon {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--accent);
  opacity: 0.8;
}

.card-icon svg { width: 22px; height: 22px; }

.card-icon-purple { color: var(--purple); }
.card-icon-green  { color: var(--green); }
.card-icon-indigo { color: var(--indigo); }
.card-icon-cyan   { color: var(--cyan); }
.card-icon-warm   { color: var(--warm); }

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 5px;
}

.card-text {
  font-size: 14px;
  color: var(--text-1);
  line-height: 1.55;
}


/* ═══════════════════════════════════════════════════════
   DYNAMIC ISLAND SECTION
   ═══════════════════════════════════════════════════════ */

.di-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: start;
}

.di-text .section-heading { margin-bottom: 16px; }

.di-lead {
  font-size: 16px;
  color: var(--text-1);
  line-height: 1.65;
  margin-bottom: 16px;
}

.di-compat {
  font-size: 13px;
  color: var(--text-2);
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.di-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.di-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius);
  transition: background 200ms;
}

.di-item:hover {
  background: rgba(255,255,255, 0.04);
}

.di-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-2);
  margin-top: 1px;
}

.di-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 2px;
}

.di-item-desc {
  font-size: 13px;
  color: var(--text-1);
  line-height: 1.5;
}


/* ═══════════════════════════════════════════════════════
   LOOMIE — with brand orb (design_system.md §2.4)
   ═══════════════════════════════════════════════════════ */

.loomie-orb-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.loomie-orb {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, #5e5ce6, #bf5af2, #ff375f, #ff9f0a, #30d158, #64d2ff, #5e5ce6);
  animation: orbSpin 6s linear infinite;
  position: relative;
  box-shadow: 0 0 40px rgba(94,92,230,0.3), 0 0 80px rgba(191,90,242,0.15);
}

.loomie-orb::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--bg-0);
}

@keyframes orbSpin { to { transform: rotate(360deg); } }

.loomie-lead {
  font-size: 16px;
  color: var(--text-1);
  line-height: 1.65;
  text-align: center;
  margin-bottom: 40px;
}

.loomie-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.loomie-card {
  position: relative;
  padding: 22px 20px;
  background: rgba(255,255,255, 0.04);
  border: 1px solid rgba(255,255,255, 0.08);
  border-radius: var(--radius-lg);
}

.loomie-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(170deg, rgba(255,255,255,0.04) 0%, transparent 40%);
  pointer-events: none;
}

.loomie-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 5px;
}

.loomie-card-text {
  font-size: 14px;
  color: var(--text-1);
  line-height: 1.55;
}


/* ═══════════════════════════════════════════════════════
   DOWNLOAD — Cinematic black with glow
   ═══════════════════════════════════════════════════════ */

.section-dl {
  background: var(--bg-cinema);
  padding: 160px 0;
  overflow: hidden;
}

.dl-glow {
  position: absolute;
  top: 40%;
  left: 50%;
  width: 600px;
  height: 400px;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse at center,
    rgba(10, 132, 255, 0.06) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.dl-heading {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-0);
  margin-bottom: 10px;
}

.dl-sub {
  font-size: 17px;
  color: var(--text-1);
  margin-bottom: 36px;
}

.btn-hero-dl {
  padding: 16px 44px;
  font-size: 17px;
}

.dl-meta {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 16px;
}


/* ═══════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════ */

.footer {
  padding: 24px 40px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.15);
}

.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,0.12);
}


/* ═══════════════════════════════════════════════════════
   SCROLL REVEAL (design_system.md §7.3 fadeIn)
   ═══════════════════════════════════════════════════════ */

.reveal {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 600ms ease, transform 600ms var(--spring);
}

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


/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.nav-links-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 52px; left: 0; right: 0;
    background: rgba(13,13,13,0.97);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-bottom: 1px solid var(--glass-border);
    padding: 8px;
    gap: 2px;
  }
  .nav-links.nav-links-open .nav-link {
    padding: 10px 16px;
    font-size: 15px;
  }
  .nav-mobile-toggle { display: flex; }

  .container, .container-mid { padding: 0 24px; }
  .nav-inner { padding: 0 24px; }
  .footer { padding: 24px; }

  .card-grid { grid-template-columns: 1fr; }
  .loomie-grid { grid-template-columns: 1fr; }
  .di-layout { grid-template-columns: 1fr; gap: 40px; }
  .section { padding: 80px 0; }
  .section-dl { padding: 100px 0; }
  .hero-actions { flex-direction: column; gap: 12px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 52px; }
}
