/* CabinetCare landing — brand tokens from DESIGN.md / brand identity */
:root {
  --paper: #f7f1e6;
  --paper-deep: #efe6d5;
  --card: #fffdf8;
  --ink: #0c2a4e;
  --ink-muted: #4d6079;
  --blue: #1a6bff;
  --blue-deep: #0f4fd6;
  --teal: #0db3aa;
  --teal-deep: #078f88;
  --amber: #d99a2b;
  --line: rgba(12, 42, 78, 0.14);
  --radius-panel: 22px;
  --font-display: "Lexend", sans-serif;
  --font-body: "Atkinson Hyperlegible", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

main { position: relative; z-index: 2; width: 100%; max-width: 100%; overflow-x: clip; }

h1, h2, h3, .nav-brand, .btn { font-family: var(--font-display); }

/* ---- fixed 3D canvas + grain ---- */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.05 0 0 0 0 0.16 0 0 0 0 0.31 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- nav: floating glass pill ---- */
.nav {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 34px);
  padding: 10px 12px 10px 18px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid rgba(12, 42, 78, 0.1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px -18px rgba(12, 42, 78, 0.35);
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: -0.01em;
}
.nav-brand em { font-style: normal; color: var(--blue); }
.nav-links { display: flex; gap: clamp(10px, 2.4vw, 26px); }
.nav-links a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.25s ease;
}
.nav-links a:hover { color: var(--blue); }
.nav-cta {
  white-space: nowrap;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 999px;
  transition: background 0.25s ease, transform 0.25s ease;
}
.nav-cta:hover { background: var(--blue); transform: translateY(-1px); }

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
  padding: 17px 34px;
  font-size: 1.05rem;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(100deg, var(--teal) 0%, var(--blue) 55%, var(--blue-deep) 100%);
  box-shadow: 0 18px 42px -14px rgba(26, 107, 255, 0.55);
}
.btn-primary:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 26px 54px -14px rgba(26, 107, 255, 0.65); }
.btn-primary .arrow { transition: transform 0.35s ease; }
.btn-primary:hover .arrow { transform: translateX(5px); }
.btn-ghost {
  color: var(--ink);
  border: 1.5px solid rgba(12, 42, 78, 0.28);
  background: rgba(255, 253, 248, 0.5);
}
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--ink); }
.btn-xl { padding: 22px 46px; font-size: 1.3rem; }

/* ---- hero ---- */
.hero {
  min-height: 100vh; /* fallback for browsers without svh units */
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
}
.hero-eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal-deep);
  margin-bottom: 26px;
}
.hero-title {
  max-width: min(1100px, 94vw);
  font-size: clamp(2.35rem, 7.2vw, 5.7rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.hero-title .line { display: block; overflow: hidden; }
.hl-blue { color: var(--blue); }
.hl-teal { color: var(--teal-deep); }
.hero-sub {
  max-width: 560px;
  margin-top: 30px;
  font-size: 1.18rem;
  line-height: 1.6;
  color: var(--ink-muted);
}
.hero-ctas { display: flex; gap: 16px; margin-top: 42px; flex-wrap: wrap; justify-content: center; }
.hero-scroll-hint {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--ink-muted);
}
.hint-track {
  width: 26px; height: 42px;
  border: 1.5px solid rgba(12, 42, 78, 0.3);
  border-radius: 999px;
  display: flex; justify-content: center; padding-top: 7px;
}
.hint-dot {
  width: 5px; height: 9px; border-radius: 999px;
  background: var(--blue);
  animation: hintdrop 1.8s ease-in-out infinite;
}
@keyframes hintdrop {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}
.hint-label { font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; }

/* ---- pinned cabinet scene ---- */
/* Height sets how much scroll the 3D sequence is scrubbed across. 400vh left
   empty stretches at both ends (camera flying in, then pulling back out over a
   full screen of nothing). 285vh keeps every caption readable while cutting the
   dead scroll so no screen is ever just floating pills. */
.cabinet-scene { height: 285vh; position: relative; }
.cabinet-pin {
  position: sticky;
  top: 0;
  height: 100vh; /* fallback for browsers without svh units */
  height: 100svh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.caption-stack {
  position: relative;
  width: min(680px, 90vw);
  min-height: 190px;
  margin-bottom: clamp(30px, 7vh, 70px);
  text-align: center;
}
.scene-caption {
  position: absolute;
  inset: 0;
  opacity: 0;
  padding: 26px 30px;
  border-radius: var(--radius-panel);
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid rgba(12, 42, 78, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 24px 60px -30px rgba(12, 42, 78, 0.4);
}
.scene-caption h2 {
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.scene-caption h2 em { font-style: normal; color: var(--blue); }
.scene-caption p { color: var(--ink-muted); font-size: 1.08rem; line-height: 1.55; }

/* ---- sections shared ---- */
.section-title {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  letter-spacing: -0.025em;
  line-height: 1.08;
  text-align: center;
  max-width: 900px;
  margin: 0 auto clamp(50px, 7vw, 80px);
}
.features, .steps { padding: clamp(80px, 11vw, 150px) 24px; position: relative; }
/* Features follows the pinned cabinet scene: pull it up and trim its top padding
   so it rises into view right as the cabinet caption leaves, with no empty gap. */
.features { margin-top: -24vh; padding-top: clamp(30px, 4vw, 60px); }

/* Everything after the pinned 3D cabinet scene sits on a solid paper sheet, so the
   fixed 3D canvas only shows behind the hero and the cabinet scene. As Features
   scrolls up it covers the canvas like a curtain — the screen is never bare pills.
   The 3D backdrop is deliberately reserved for the two hero/cabinet acts. */
.features, .statement, .steps, .cta {
  position: relative;
  z-index: 2;
  background: var(--paper);
}
.footer { background: var(--paper); }

/* ---- bento (gapless: 4+2 / 2+4 on a 6-col grid, dense flow) ---- */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-flow: dense;
  gap: 18px;
  max-width: 1120px;
  margin: 0 auto;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 34px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.6s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 70px -30px rgba(12, 42, 78, 0.45);
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 0%), rgba(26, 107, 255, 0.07), transparent 45%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.card:hover::after { opacity: 1; }
.card-a, .card-d { grid-column: span 4; }
.card-b, .card-c { grid-column: span 2; }
.card-icon {
  width: 52px; height: 52px;
  border-radius: 15px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(13, 179, 170, 0.6);
}
.card-icon svg { width: 26px; height: 26px; }
.card h3 { font-size: 1.4rem; letter-spacing: -0.01em; }
.card p { color: var(--ink-muted); line-height: 1.6; font-size: 1.02rem; max-width: 52ch; }
.card-tag {
  margin-top: auto;
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal-deep);
  background: rgba(13, 179, 170, 0.1);
  border: 1px solid rgba(13, 179, 170, 0.25);
  padding: 7px 14px;
  border-radius: 999px;
}

/* ---- word-scrub statement ---- */
.statement {
  padding: clamp(90px, 12vw, 170px) 24px;
  display: flex;
  justify-content: center;
}
.statement-text {
  max-width: 1000px;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
  font-weight: 600;
  text-align: center;
}
.statement-text .w { opacity: 0.12; display: inline-block; }
.statement-text b { color: var(--blue); font-weight: 700; }

/* ---- stacking steps ---- */
.step-stack { max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }
.step {
  position: sticky;
  top: calc(15vh + var(--i) * 58px);
  display: flex;
  gap: 26px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 38px 40px;
  box-shadow: 0 30px 80px -40px rgba(12, 42, 78, 0.5);
}
.step-num {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  flex-shrink: 0;
}
.step-body h3 { font-size: 1.5rem; margin-bottom: 8px; letter-spacing: -0.01em; }
.step-body p { color: var(--ink-muted); line-height: 1.6; font-size: 1.05rem; max-width: 48ch; }
.step-art { flex-shrink: 0; width: 96px; height: 96px; border-radius: 24px; margin-left: auto; position: relative; }
.step-art-scan { background: linear-gradient(135deg, rgba(26,107,255,0.14), rgba(13,179,170,0.2)); }
.step-art-scan::before {
  content: ""; position: absolute; inset: 22px;
  border: 2.5px dashed var(--blue); border-radius: 12px;
}
.step-art-profile { background: linear-gradient(135deg, rgba(13,179,170,0.16), rgba(217,154,43,0.16)); }
.step-art-profile::before {
  content: ""; position: absolute; left: 50%; top: 20px; transform: translateX(-50%);
  width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--teal-deep);
}
.step-art-profile::after {
  content: ""; position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: 44px; height: 24px; border-radius: 12px 12px 4px 4px; border: 2.5px solid var(--teal-deep); border-bottom: none;
}
.step-art-chat { background: linear-gradient(135deg, rgba(26,107,255,0.12), rgba(15,79,214,0.18)); }
.step-art-chat::before {
  content: ""; position: absolute; inset: 24px 20px 30px;
  border: 2.5px solid var(--blue); border-radius: 12px 12px 12px 2px;
}

/* ---- marquee ---- */
.marquee {
  overflow: hidden;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--card);
  position: relative;
  z-index: 2;
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 34px;
  width: max-content;
  animation: marquee 26s linear infinite;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink-muted);
  white-space: nowrap;
}
.marquee-track i {
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  flex-shrink: 0;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---- CTA ---- */
.cta {
  padding: clamp(100px, 13vw, 190px) 24px clamp(90px, 12vw, 150px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cta-title {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  letter-spacing: -0.03em;
  line-height: 1.06;
}
.cta-sub { margin: 24px 0 40px; font-size: 1.15rem; color: var(--ink-muted); }
.cta-disclaimer { margin-top: 30px; font-size: 0.9rem; color: var(--ink-muted); opacity: 0.8; }

/* ---- footer ---- */
.footer {
  padding: 40px 24px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  background: var(--card);
  position: relative;
  z-index: 3;
}
.footer p { color: var(--ink-muted); font-size: 0.92rem; text-align: center; }

/* ---- reveal helper (JS adds .in) ---- */
.reveal { opacity: 0; transform: translateY(34px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1); }

/* ---- responsive ---- */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .card-a, .card-b, .card-c, .card-d { grid-column: span 6; }
  .step { flex-direction: column; align-items: flex-start; padding: 30px 26px; }
  .step-art { margin-left: 0; }
  .step { top: calc(11vh + var(--i) * 48px); }
}

/* reduced motion: canvas becomes a static hero illustration that scrolls away
   with the page instead of a fixed overlay following the user down the site */
.rm #scene,
.rm .grain {
  position: absolute;
  height: 100vh;
  height: 100svh;
}
.rm .hero-scroll-hint { display: none; }

/* static fallback when the 3D module can't boot (no WebGL / old browser / blocked CDN) */
.no3d #scene,
.no3d .grain,
.no3d .hero-scroll-hint { display: none; }
.no3d .cabinet-scene { height: auto; padding: 120px 24px; }
.no3d .cabinet-pin { position: static; height: auto; pointer-events: auto; align-items: center; }
.no3d .caption-stack { min-height: 0; margin-bottom: 0; display: flex; flex-direction: column; gap: 18px; }
.no3d .scene-caption { position: relative; opacity: 1; }
.no3d .reveal { opacity: 1; transform: none; }
.no3d .statement-text .w { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hint-dot, .marquee-track { animation: none; }
  .reveal { opacity: 1; transform: none; }
  .scene-caption { position: relative; opacity: 1; margin-bottom: 18px; }
  .cabinet-scene { height: auto; padding: 120px 0; }
}
