/* ============================================================
   AI Day Plan — "Chaos to Calm"
   Bricolage Grotesque (display) + Inter (body), via Bunny fonts
   ============================================================ */

:root {
  /* Calm side */
  --indigo: #4F46E5;
  --indigo-deep: #3730A3;
  --indigo-soft: #EEF0FF;
  --indigo-ink: #1E1B4B;

  /* Chaos side (muted greys) */
  --grey-900: #2B2B30;
  --grey-700: #4A4A52;
  --grey-500: #7C7C86;
  --grey-300: #C9C9D0;
  --grey-150: #E4E4EA;
  --grey-100: #ECECF1;

  /* Surfaces */
  --paper: #FFFFFF;
  --calm-bg: #FBFBFE;
  --ink: #15131F;
  --muted: #5C5A6B;

  /* Chaos sticky-note tints (desaturated) */
  --note-a: #DCDAD2;
  --note-b: #D6D9DC;
  --note-c: #DEDAD8;
  --note-d: #D3D6D0;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-soft: 0 10px 40px -18px rgba(30, 27, 75, 0.35);
  --shadow-lift: 0 18px 50px -20px rgba(30, 27, 75, 0.45);

  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--calm-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: clamp(20px, 5vw, 56px);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--indigo);
}

.visually-hidden, .skip-link {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ---------- Accessibility ---------- */
.skip-link:focus-visible {
  position: fixed;
  left: 16px; top: 16px;
  width: auto; height: auto;
  clip: auto; margin: 0;
  padding: 12px 18px;
  background: var(--indigo);
  color: #fff;
  border-radius: var(--radius-sm);
  z-index: 100;
  font-weight: 600;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--indigo);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 251, 254, 0.82);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--grey-150);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--indigo);
  box-shadow: 0 4px 14px -4px rgba(79, 70, 229, 0.7);
}
.brand-dot {
  width: 11px; height: 11px;
  border-radius: 4px;
  background: #fff;
  transform: rotate(8deg);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 30px);
  font-size: 0.95rem;
  font-weight: 500;
}
.site-nav a { color: var(--muted); transition: color 0.2s ease; }
.site-nav a:hover { color: var(--ink); }
.nav-cta {
  padding: 9px 18px;
  background: var(--indigo);
  color: #fff !important;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.2s var(--ease), background 0.2s ease;
}
.nav-cta:hover { background: var(--indigo-deep); transform: translateY(-1px); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.btn-primary {
  background: var(--indigo);
  color: #fff;
  box-shadow: 0 12px 28px -12px rgba(79, 70, 229, 0.8);
}
.btn-primary:hover { background: var(--indigo-deep); transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: var(--indigo-deep);
  border-color: var(--grey-300);
}
.btn-ghost:hover { border-color: var(--indigo); color: var(--indigo); transform: translateY(-2px); }

/* ---------- Section scaffolding ---------- */
section { position: relative; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head-center { margin-inline: auto; text-align: center; }
.section-head h2 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  margin-top: 12px;
}
.section-lead {
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 56ch;
  margin-inline: auto;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding-top: clamp(40px, 7vw, 84px);
  padding-bottom: clamp(50px, 7vw, 90px);
  background:
    radial-gradient(1200px 480px at 85% -10%, rgba(79,70,229,0.10), transparent 60%),
    var(--calm-bg);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero-copy { max-width: 560px; }
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.3rem);
  font-weight: 800;
  margin-top: 18px;
}
.hero-accent {
  display: block;
  color: var(--indigo);
  background: linear-gradient(100deg, var(--indigo), #7C74F0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  margin-top: 24px;
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 46ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}
.hero-note {
  margin-top: 18px;
  font-size: 0.9rem;
  color: var(--grey-500);
}

/* ---------- Hero split stage ---------- */
.hero-stage { perspective: 1200px; }
.stage-rail {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(10px, 2vw, 22px);
}
.stage-side {
  position: relative;
  border-radius: var(--radius);
  padding: 20px 16px 16px;
  min-height: 320px;
}
.stage-chaos {
  background: linear-gradient(180deg, #F1F1F4, #E7E7EC);
  border: 1px solid var(--grey-150);
  overflow: hidden;
}
.stage-calm {
  background: var(--paper);
  border: 1px solid var(--indigo-soft);
  box-shadow: var(--shadow-soft);
}
.stage-tag {
  position: absolute;
  top: 14px; left: 14px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey-500);
  background: rgba(255,255,255,0.7);
  padding: 4px 9px;
  border-radius: 999px;
  z-index: 5;
}
.stage-tag-calm { color: var(--indigo); background: var(--indigo-soft); }
.stage-arrow {
  color: var(--grey-300);
  display: grid;
  place-items: center;
}

/* Chaotic pile of notes */
.pile {
  position: relative;
  height: 280px;
  margin-top: 14px;
}
.note {
  position: absolute;
  width: 116px;
  min-height: 78px;
  padding: 12px 12px 14px;
  border-radius: 4px 4px 8px 8px;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--grey-700);
  background: var(--note-a);
  box-shadow: 0 8px 18px -8px rgba(43,43,48,0.5);
  filter: grayscale(1) saturate(0.6) brightness(0.99);
}
.note::before {
  content: "";
  position: absolute;
  top: -6px; left: 50%;
  width: 26px; height: 12px;
  transform: translateX(-50%) rotate(var(--tape-rot, -4deg));
  background: rgba(255,255,255,0.45);
  border: 1px solid rgba(0,0,0,0.04);
}
.note:nth-child(5n+1) { background: var(--note-a); }
.note:nth-child(5n+2) { background: var(--note-b); }
.note:nth-child(5n+3) { background: var(--note-c); }
.note:nth-child(5n+4) { background: var(--note-d); }

/* Calm plan list */
.plan {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--indigo-soft);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--indigo);
}
.plan-time {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--indigo-deep);
  min-width: 44px;
}
.plan-task {
  font-size: 0.86rem;
  color: var(--indigo-ink);
  font-weight: 500;
}

/* ============================================================
   HOW IT WORKS
   ============================================================ */
.how {
  padding-block: clamp(60px, 9vw, 110px);
  background: var(--paper);
  border-top: 1px solid var(--grey-150);
  border-bottom: 1px solid var(--grey-150);
}
.steps {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 36px);
  counter-reset: step;
}
.step {
  position: relative;
  padding: 30px 26px;
  border-radius: var(--radius);
  background: var(--calm-bg);
  border: 1px solid var(--grey-150);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s ease;
}
.step:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
  border-color: var(--indigo-soft);
}
.step-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.4rem;
  color: var(--indigo);
  opacity: 0.85;
  line-height: 1;
}
.step h3 {
  font-size: 1.3rem;
  margin: 14px 0 10px;
}
.step p { color: var(--muted); font-size: 1rem; }

/* ============================================================
   SIGNATURE DEMO
   ============================================================ */
.demo {
  padding-block: clamp(70px, 11vw, 140px);
  background:
    radial-gradient(900px 400px at 15% 0%, rgba(79,70,229,0.07), transparent 55%),
    var(--calm-bg);
}
.demo-stage {
  position: relative;
  margin-top: 12px;
  border-radius: 24px;
  background: linear-gradient(180deg, #F4F4F7, #FFFFFF 60%);
  border: 1px solid var(--grey-150);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  padding: clamp(24px, 4vw, 48px);
}
.demo-track {
  position: relative;
  height: clamp(380px, 52vw, 460px);
}
/* Each demo note is positioned and transformed via JS-set custom props */
.demo-note {
  position: absolute;
  left: 50%;
  top: 0;
  width: 150px;
  min-height: 64px;
  padding: 12px 14px;
  border-radius: 5px 5px 9px 9px;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--grey-700);
  background: var(--note-a);
  box-shadow: 0 10px 24px -10px rgba(43,43,48,0.45);
  transform-origin: center;
  /* state driven by --p (progress 0..1) computed in JS into resolved transforms */
  transition: transform 0.65s var(--ease), background 0.65s ease,
              color 0.65s ease, filter 0.65s ease, box-shadow 0.65s ease,
              width 0.65s var(--ease), border-radius 0.65s ease;
  will-change: transform, filter;
}
.demo-note .dn-time {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  color: transparent;
  margin-right: 8px;
  opacity: 0;
  transition: opacity 0.5s ease, color 0.5s ease;
}
/* Chaotic visual: greyscale + jumbled (set by inline transform in JS) */
.demo-note.is-chaos {
  filter: grayscale(1) saturate(0.5);
}
/* Calm visual: aligned list rows, indigo */
.demo-note.is-calm {
  width: min(560px, 86%);
  background: var(--indigo-soft);
  color: var(--indigo-ink);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 18px -10px rgba(79,70,229,0.45);
  filter: none;
}
.demo-note.is-calm .dn-time {
  color: var(--indigo-deep);
  opacity: 1;
}
.demo-note:nth-child(4n+1) { background: var(--note-a); }
.demo-note:nth-child(4n+2) { background: var(--note-b); }
.demo-note:nth-child(4n+3) { background: var(--note-c); }
.demo-note:nth-child(4n)   { background: var(--note-d); }
.demo-note.is-calm:nth-child(n) { background: var(--indigo-soft); }

.demo-replay {
  position: absolute;
  right: 16px; bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--indigo-deep);
  background: #fff;
  border: 1px solid var(--grey-300);
  border-radius: 999px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s var(--ease), border-color 0.2s ease;
}
.demo-replay.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.demo-replay:hover { border-color: var(--indigo); }

.demo-progress {
  margin-top: 18px;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
}

/* ============================================================
   WHY
   ============================================================ */
.why {
  padding-block: clamp(60px, 9vw, 110px);
  background: var(--paper);
  border-top: 1px solid var(--grey-150);
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(18px, 2.5vw, 28px);
}
.why-card {
  padding: 30px 28px;
  border-radius: var(--radius);
  background: var(--calm-bg);
  border: 1px solid var(--grey-150);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s ease;
}
.why-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--indigo);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s var(--ease);
}
.why-card:hover { transform: translateY(-3px); border-color: var(--indigo-soft); }
.why-card:hover::before { transform: scaleY(1); }
.why-card h3 { font-size: 1.25rem; margin-bottom: 10px; color: var(--indigo-ink); }
.why-card p { color: var(--muted); }

/* ============================================================
   CTA
   ============================================================ */
.cta {
  padding-block: clamp(70px, 10vw, 120px);
  background:
    radial-gradient(700px 360px at 50% 120%, rgba(79,70,229,0.18), transparent 60%),
    linear-gradient(160deg, var(--indigo-ink), var(--indigo-deep));
  color: #fff;
}
.cta-inner { max-width: 660px; margin-inline: auto; text-align: center; }
.cta h2 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  color: #fff;
}
.cta-sub {
  margin-top: 18px;
  font-size: 1.12rem;
  color: rgba(255,255,255,0.82);
}
.waitlist-form {
  margin-top: 34px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.waitlist-input {
  flex: 1 1 280px;
  max-width: 340px;
  padding: 14px 18px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
}
.waitlist-input::placeholder { color: rgba(255,255,255,0.55); }
.waitlist-input:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  background: rgba(255,255,255,0.16);
}
.cta .btn-primary {
  background: #fff;
  color: var(--indigo-deep);
  box-shadow: 0 14px 30px -14px rgba(0,0,0,0.5);
}
.cta .btn-primary:hover { background: #F0F0FF; }
.form-status {
  margin-top: 16px;
  min-height: 1.4em;
  font-size: 0.95rem;
  font-weight: 600;
  color: #C9F7D8;
}
.form-status.is-error { color: #FFD0D0; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--paper);
  border-top: 1px solid var(--grey-150);
  padding-block: 44px;
}
.footer-inner {
  display: grid;
  gap: 14px;
  text-align: center;
  justify-items: center;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
}
.footer-tag { color: var(--muted); max-width: 40ch; }
.footer-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 500;
}
.footer-nav a { color: var(--muted); transition: color 0.2s ease; }
.footer-nav a:hover { color: var(--indigo); }
.footer-legal { font-size: 0.82rem; color: var(--grey-500); }

/* ============================================================
   REVEAL ON SCROLL (generic, motion-gated)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { max-width: 100%; }
  .hero-stage { margin-top: 8px; }
  .steps { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .site-nav a:not(.nav-cta) { display: none; }
}

@media (max-width: 560px) {
  .stage-rail { grid-template-columns: 1fr; gap: 14px; }
  .stage-arrow { transform: rotate(90deg); }
  .stage-side { min-height: 250px; }
  .pile { height: 230px; }
  .demo-note { width: 128px; font-size: 0.78rem; }
  .demo-note.is-calm { width: 94%; }
  .hero-actions .btn { flex: 1 1 auto; }
  .demo-track { height: clamp(420px, 110vw, 520px); }
}

@media (max-width: 414px) {
  .wrap { padding-inline: 18px; }
  .hero h1 { font-size: clamp(2.1rem, 9vw, 2.6rem); }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .demo-replay { display: none; }
}
