/* ============================================================
   TimeWork! — product page
   Design tokens
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:        #04060a;
  --bg-2:      #090d15;
  --surface:   rgba(255, 255, 255, 0.03);
  --hairline:  rgba(255, 255, 255, 0.09);
  --fg:        #f4f6fb;
  --fg-dim:    rgba(244, 246, 251, 0.62);
  --fg-faint:  rgba(244, 246, 251, 0.36);
  --accent-1:  #5ac8fa;
  --accent-2:  #9d7bff;
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h:     64px;
}

/* Section paging is driven by JS (wheel/keyboard) for a true
   "one gesture = next section" magnetic feel. No CSS snap. */

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Helvetica Neue", sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(90, 200, 250, 0.25);
  color: var(--fg);
}

/* Ambient gradient field */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(90vw 90vh at 72% 38%, rgba(90, 200, 250, 0.045), transparent 62%),
    radial-gradient(70vw 80vh at 18% 85%, rgba(157, 123, 255, 0.035), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 50%, var(--bg) 100%);
  pointer-events: none;
}

/* Film grain — subtle premium texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3.2vw;
  transition: background 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(4, 6, 10, 0.7);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom-color: var(--hairline);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.02rem;
  font-weight: 550;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}

.brand-mark { width: 26px; height: 26px; color: var(--fg-dim); }

.nav-brand em,
.footer-brand em {
  font-style: normal;
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  gap: 2.1rem;
}

.nav-links a {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--fg-dim);
  text-decoration: none;
  transition: color 0.25s ease;
}

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

/* Hamburger — only visible on mobile */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 42px;
  height: 42px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  width: 20px;
  height: 1.6px;
  background: var(--fg);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s ease;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(3.8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { transform: translateY(-3.8px) rotate(-45deg); }

/* ============================================================
   Stage — fixed canvas, right side
   ============================================================ */
.stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

.stage-glow {
  position: absolute;
  inset: 10% 8%;
  border-radius: 50%;
  background: radial-gradient(closest-side,
    rgba(90, 200, 250, 0.09) 0%,
    rgba(157, 123, 255, 0.05) 45%,
    transparent 72%);
  filter: blur(46px);
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ============================================================
   Narrative panels — left column
   ============================================================ */
.content {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

section.panel {
  min-height: 100vh;
  width: 100%;
  max-width: 52vw;
  padding: calc(var(--nav-h) + 3rem) 3vw 5rem 5vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

/* Frosted glass card — the exploding pieces travel underneath,
   visible but blurred so the copy stays readable */
.panel .reveal {
  background: rgba(6, 9, 15, 0.5);
  /* 14px blurs cost ~half of 22px and read almost identically */
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 26px;
  padding: 2.5rem 2.7rem;
  max-width: 35rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.38);
}

.eyebrow {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1.4rem;
}

.panel h1 {
  font-size: clamp(2.5rem, 4.4vw, 4.2rem);
  font-weight: 250;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 1.5rem;
}

.panel h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 350;
}

.panel h2 {
  font-size: clamp(2.1rem, 3.5vw, 3.4rem);
  font-weight: 280;
  letter-spacing: -0.028em;
  line-height: 1.08;
  margin-bottom: 1.25rem;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55);
}

.panel p {
  font-size: clamp(1rem, 1.15vw, 1.16rem);
  line-height: 1.68;
  color: var(--fg-dim);
  max-width: 40ch;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}

.panel p.lede {
  font-size: clamp(1.1rem, 1.35vw, 1.35rem);
  color: var(--fg);
  opacity: 0.88;
  max-width: 36ch;
}

.step {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.72rem;
  font-weight: 550;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 1.5rem;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.85rem;
  height: 1.85rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--fg);
  background: var(--surface);
}

/* Spec rows */
.specs {
  list-style: none;
  margin-top: 2.1rem;
  border-top: 1px solid var(--hairline);
  max-width: 30rem;
}

.specs li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.88rem 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.9rem;
}

.specs li span  { color: var(--fg-faint); letter-spacing: 0.02em; white-space: nowrap; }
.specs li strong { color: var(--fg); font-weight: 480; text-align: right; }

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 3.2rem;
  left: 5vw;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg-faint);
  animation: drift 2.6s ease-in-out infinite;
}

@keyframes drift {
  0%, 100% { transform: translateY(0);   opacity: 0.5; }
  50%      { transform: translateY(8px); opacity: 0.95; }
}

/* ============================================================
   Reveal animations
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(38px);
  transition: opacity 0.95s var(--ease), transform 0.95s var(--ease);
  will-change: opacity, transform;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.reveal .specs li {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.in .specs li { opacity: 1; transform: none; }
.reveal.in .specs li:nth-child(1) { transition-delay: 0.18s; }
.reveal.in .specs li:nth-child(2) { transition-delay: 0.28s; }
.reveal.in .specs li:nth-child(3) { transition-delay: 0.38s; }
.reveal.in .specs li:nth-child(4) { transition-delay: 0.48s; }
.reveal.in .specs li:nth-child(5) { transition-delay: 0.58s; }
.reveal.in .specs li:nth-child(6) { transition-delay: 0.68s; }

/* ============================================================
   Outro — specs sheet + footer
   ============================================================ */
.outro {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  background: var(--bg-2);
  border-top: 1px solid var(--hairline);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -40px 80px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.outro-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 7rem 6vw 3rem;
}

.outro h2 {
  font-size: clamp(2.4rem, 4.4vw, 4rem);
  font-weight: 260;
  letter-spacing: -0.03em;
  line-height: 1.06;
  margin-bottom: 3.4rem;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
  margin-bottom: 6rem;
}

.spec-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.5rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s var(--ease);
}

.spec-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-3px);
}

.spec-card span {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.spec-card strong {
  font-size: 1.02rem;
  font-weight: 460;
  letter-spacing: -0.01em;
  color: var(--fg);
  line-height: 1.4;
}

/* Stagger for spec cards */
.reveal .spec-card {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease),
              border-color 0.3s ease, background 0.3s ease;
}
.reveal.in .spec-card { opacity: 1; transform: none; }
.reveal.in .spec-card:nth-child(1)  { transition-delay: 0.05s; }
.reveal.in .spec-card:nth-child(2)  { transition-delay: 0.10s; }
.reveal.in .spec-card:nth-child(3)  { transition-delay: 0.15s; }
.reveal.in .spec-card:nth-child(4)  { transition-delay: 0.20s; }
.reveal.in .spec-card:nth-child(5)  { transition-delay: 0.25s; }
.reveal.in .spec-card:nth-child(6)  { transition-delay: 0.30s; }
.reveal.in .spec-card:nth-child(7)  { transition-delay: 0.35s; }
.reveal.in .spec-card:nth-child(8)  { transition-delay: 0.40s; }
.reveal.in .spec-card:nth-child(9)  { transition-delay: 0.45s; }
.reveal.in .spec-card:nth-child(10) { transition-delay: 0.50s; }
.reveal.in .spec-card:nth-child(11) { transition-delay: 0.55s; }
.reveal.in .spec-card:nth-child(12) { transition-delay: 0.60s; }

/* Footer */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 2.2rem;
  border-top: 1px solid var(--hairline);
}

.footer-brand {
  font-size: 1rem;
  font-weight: 550;
  letter-spacing: -0.01em;
}

.footer-note, .footer-copy {
  font-size: 0.8rem;
  color: var(--fg-faint);
  letter-spacing: 0.03em;
}

/* ============================================================
   Progress rail
   ============================================================ */
.progress-rail {
  position: fixed;
  top: 28%;
  right: 1.4vw;
  bottom: 28%;
  width: 2px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  overflow: hidden;
  z-index: 40;
}

.progress-fill {
  display: block;
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, var(--accent-1), var(--accent-2));
  opacity: 0.75;
}

/* ============================================================
   Loader
   ============================================================ */
#loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.9s ease;
}

#loader.hidden { opacity: 0; pointer-events: none; }

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
}

.loader-mark { width: 72px; height: 72px; }

.loader-check {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: drawCheck 1.6s var(--ease) forwards 0.2s;
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.loader-bar {
  width: 180px;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

#loader-fill {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  transition: width 0.3s ease;
}

.loader-count {
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  color: var(--fg-faint);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal .specs li, .reveal .spec-card {
    transition: none;
    opacity: 1;
    transform: none;
  }
  .scroll-hint { animation: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 880px) {
  .nav { padding: 0 5vw; }
  .nav-toggle { display: flex; }

  /* Dropdown menu under the nav bar */
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.4rem 5vw 0.9rem;
    background: rgba(4, 6, 10, 0.93);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--hairline);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.35s var(--ease);
  }

  .nav-links.open {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .nav-links a {
    padding: 0.85rem 0;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .nav-links a:last-child { border-bottom: none; }

  /* Larger product area on mobile */
  .stage {
    top: var(--nav-h);
    left: 0;
    width: 100vw;
    height: 50vh;
  }

  section.panel {
    max-width: 100%;
    min-height: auto;
    padding: calc(var(--nav-h) + 52vh) 7vw 14vh;
    justify-content: flex-start;
  }

  .panel .reveal {
    padding: 1.7rem 1.5rem;
    max-width: 100%;
  }

  .panel p { max-width: 100%; }
  .specs { max-width: 100%; }

  .scroll-hint { left: 7vw; bottom: 2rem; }

  .outro-inner { padding: 4.5rem 7vw 2.5rem; }
  .spec-grid { grid-template-columns: 1fr; gap: 0.8rem; margin-bottom: 4rem; }

  .footer { flex-direction: column; align-items: flex-start; gap: 0.6rem; }

  .progress-rail { display: none; }
}
