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

/* ─── Custom properties — pulled exactly from NoxTheme.swift ─── */
:root {
  --bg:           #0a0910;
  --bg-deep:      #070509;
  --surface:      rgba(255, 255, 255, 0.025);
  --surface-2:    rgba(255, 255, 255, 0.04);
  --amber:        #e8a44a;
  --amber-dim:    rgba(232, 164, 74, 0.14);
  --amber-glow:   rgba(232, 164, 74, 0.22);
  --amber-border: rgba(232, 164, 74, 0.20);
  --text:         #ede4d3;
  --secondary:    #79778a;
  --muted:        #3a394d;
  --faint:        #25243a;
  --border:       rgba(255, 255, 255, 0.06);
  --border-mid:   rgba(255, 255, 255, 0.09);

  --serif: ui-serif, 'New York', Georgia, 'Times New Roman', serif;
  --mono:  ui-monospace, 'SF Mono', Menlo, 'Courier New', monospace;
  --sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  --pad: clamp(20px, 5vw, 64px);
  --max: 1100px;
}

/* ─── Base ───────────────────────────────────────────────────── */
html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }

/* ─── Eyebrow — matches NoxTheme.monoLabelFont ───────────────── */
.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--secondary);
  line-height: 1.4;
}

/* ─── Reveal animation (hero only, above fold) ───────────────── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--d, 0s);
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}

/* ─── Section divider — matches NoxSectionDivider ────────────── */
.section-rule {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border) 20%, var(--border) 80%, transparent);
}

/* ─── Navigation ─────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 200;
  border-bottom: 1px solid transparent;
  transition: background 0.35s, backdrop-filter 0.35s, border-color 0.35s;
}

.nav.is-scrolled {
  background: rgba(10, 9, 16, 0.88);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-color: var(--border);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
}

.owl-mark { width: 26px; height: 26px; flex-shrink: 0; }

.nav-wordmark {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.02em;
}

/* Left cluster: caby.dev back button + Nox logo */
.nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-back {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #f1f1f1;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: border-color 0.2s, background 0.2s;
}
.nav-back b { color: #4ade80; font-weight: 500; }
.nav-back-arrow { color: var(--secondary); transition: transform 0.2s; }
.nav-back:hover { border-color: var(--border-mid); background: rgba(255, 255, 255, 0.04); }
.nav-back:hover .nav-back-arrow { transform: translateX(-2px); }

.nav-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
}

.nav-end {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-x {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--secondary);
  transition: color 0.2s;
}
.nav-x:hover { color: var(--text); }

.nav-badge {
  display: flex;
  align-items: center;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.nav-badge:hover { opacity: 1; }
.nav-badge img { width: auto; }

/* ─── Hero ───────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding-top: 56px;
}

.stars-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, 130vw);
  height: 600px;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(232,164,74,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 64px var(--pad) 80px;
  display: grid;
  grid-template-columns: 1fr 403px;
  align-items: center;
  gap: clamp(32px, 5vw, 64px);
}

/* Left: text */
.hero-text {}

.hero-h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 6.5vw, 76px);
  font-weight: 400;
  line-height: 1.08;
  color: var(--text);
  letter-spacing: -0.015em;
  margin-top: 20px;
}

.hero-h1 em {
  font-style: italic;
  color: var(--amber);
}

.hero-body {
  font-size: clamp(15px, 1.8vw, 17px);
  color: var(--secondary);
  line-height: 1.8;
  margin-top: 24px;
}

.hero-actions {
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.badge-hero {
  width: auto;
  height: 44px;
  opacity: 0.9;
  transition: opacity 0.2s;
}
.badge-hero:hover { opacity: 1; }

.link-x {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--secondary);
  transition: color 0.2s;
}
.link-x:hover { color: var(--text); }

/* Right: phone */
.hero-phone { flex-shrink: 0; }

.phone-mockup {
  width: 100%;
  display: block;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.55));
}

.phone-mockup--hero {
  filter:
    drop-shadow(0 32px 64px rgba(0,0,0,0.65))
    drop-shadow(0 0 40px rgba(232,164,74,0.08));
}

.phone-mockup--featured {
  filter:
    drop-shadow(0 32px 64px rgba(0,0,0,0.75))
    drop-shadow(0 0 60px rgba(232,164,74,0.14));
}

/* Arc line at hero bottom */
.hero-arc {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  pointer-events: none;
}
.hero-arc svg { width: 100%; height: 1px; display: block; }

/* ─── Pipeline ───────────────────────────────────────────────── */
.pipeline {
  padding: 100px 0 80px;
}

.pipeline-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.pipeline-header { max-width: 480px; }

.pipeline-h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
  margin-top: 12px;
}

.pipeline-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipeline-owl {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.75;
}

/* The three-panel card */
.pipeline-card {
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr;
  align-items: start;
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.panel {
  padding: 32px 28px 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  /* equal height so the card looks balanced */
  align-self: stretch;
}

.panel-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
}

.panel-label { display: block; }

/* Duration display — matches NoxHeroDuration (heroNumberFont) */
.p-duration {
  display: flex;
  align-items: baseline;
  gap: 0;
  line-height: 1;
}

.p-num {
  font-family: var(--serif);
  font-size: clamp(48px, 6vw, 80px);
  font-weight: 400;
  color: var(--text);
  line-height: 1;
}

.p-unit {
  font-family: var(--serif);
  font-size: clamp(22px, 2.5vw, 32px);
  font-weight: 400;
  font-style: italic;
  color: var(--secondary);
  padding: 0 8px 0 3px;
}

/* Arc line — matches NoxArcLine */
.p-arc {
  width: 100%;
  height: 22px;
  margin-top: -4px;
}

/* Time fields — matches NoxTimeField */
.p-times {
  display: flex;
  gap: 10px;
}

.p-time-field {
  flex: 1;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.p-time-label { color: var(--muted); }

.p-time-value {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  letter-spacing: 0.04em;
}

/* Shared panel note text */
.p-panel-note {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--secondary);
  margin-top: auto;
  padding-top: 4px;
}

/* Focus panel top row */
.p-focus-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.p-focus-score {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  color: var(--amber);
  line-height: 1;
}

/* Slider — matches NoxFocusSlider */
.p-slider {
  position: relative;
  padding: 10px 0;
}

.p-slider-track {
  position: relative;
  height: 2px;
  background: var(--border);
  border-radius: 999px;
}

.p-slider-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--amber);
  border-radius: 999px;
}

.p-slider-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background: var(--amber);
  border-radius: 50%;
  border: 2.5px solid var(--bg);
  box-shadow:
    0 0 0 1px rgba(232,164,74,0.35),
    0 0 14px rgba(232,164,74,0.45);
}

/* Qualifying badge — single dot + label */
.p-qualifying-badge {
  display: flex;
  align-items: center;
  gap: 9px;
}

.p-qualifying-text { color: var(--amber); }

/* Dots — shared */
.p-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  background: transparent;
  flex-shrink: 0;
}

.p-dot--amber {
  background: var(--amber);
  border-color: var(--amber);
}

.p-dot--glow {
  box-shadow: 0 0 6px rgba(232,164,74,0.55);
}

/* Seven dots row */
.p-seven-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Ideal result — matches NoxHeroDuration highlighted */
.p-ideal {
  display: flex;
  align-items: baseline;
  gap: 0;
  line-height: 1;
}

.p-num--amber { color: var(--amber); }
.p-unit--dim  { color: var(--secondary); }

/* ─── Screenshots ────────────────────────────────────────────── */
.screens {
  padding: 80px 0 80px;
  overflow: hidden;
}

.screens-track {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(14px, 2.5vw, 28px);
}

.phone-fig {
  flex: 1;
  max-width: 270px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.phone-fig.phone-center {
  max-width: 310px;
  transform: translateY(-40px);
}

.screen-cap { text-align: center; color: var(--muted); }


/* ─── Closing ────────────────────────────────────────────────── */
.close {
  padding: 120px var(--pad) 140px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.close::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}

.close-glow {
  position: absolute;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: min(700px, 110vw);
  height: 500px;
  background: radial-gradient(ellipse 60% 50% at 50% 100%, rgba(232,164,74,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.close-inner {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}


.close-h2 {
  font-family: var(--serif);
  font-size: clamp(52px, 9vw, 100px);
  font-weight: 400;
  line-height: 1.05;
  color: var(--text);
  letter-spacing: -0.015em;
  margin-top: -2px;
}

.close-sub { color: var(--muted); margin-top: -4px; }

.badge-close {
  width: auto;
  height: 50px;
  margin-top: 8px;
  opacity: 0.88;
  transition: opacity 0.2s;
}
.badge-close:hover { opacity: 1; }

/* ─── Footer ─────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 26px var(--pad);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-brand {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}

.footer-links { display: flex; gap: 24px; }

.footer-link {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  transition: color 0.2s;
}
.footer-link:hover { color: var(--secondary); }

/* ─── JS-driven scroll reveal ────────────────────────────────── */
.sr { opacity: 0; transform: translateY(20px); }
.sr.in-view { opacity: 1; transform: none; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-bottom: 64px;
  }

  .hero-phone {
    display: flex;
    justify-content: center;
  }

  .hero-phone img {
    width: clamp(200px, 55vw, 300px);
  }

  /* Pipeline: stack panels */
  .pipeline-card {
    grid-template-columns: 1fr;
  }

  .panel-divider {
    width: 100%;
    height: 1px;
    align-self: auto;
  }
}

@media (max-width: 640px) {
  .hero-actions { flex-direction: column; align-items: flex-start; gap: 14px; }

  .screens { padding: 60px 0; }

  .screens-track {
    padding: 0 20px 0 24px;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .screens-track::-webkit-scrollbar { display: none; }

  .phone-fig { flex: 0 0 auto; width: 195px; max-width: 195px; scroll-snap-align: center; }
  .phone-fig.phone-center { width: 215px; max-width: 215px; transform: translateY(-20px); }

  .close { padding: 80px var(--pad) 100px; }

  .nav-x { display: none; }
  .nav-sep { display: none; }
  .nav-left { gap: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .sr { transition: none !important; }
}
