/* =====================================================================
   styles.css — Focus Buddy marketing site
   Shares its design tokens with the real app (same jade/ember/amber
   mood colors, ink/paper/mist neutrals, Bricolage Grotesque display
   type) so the demo on this page looks like the actual product, not a
   mockup of it.
   ===================================================================== */

:root {
  --ink:   #17151C;
  --paper: #F5F3F8;
  --card:  #FFFFFF;

  --calm:  #2FB784;   /* jade    = focused / praise            */
  --ember: #FF5A4D;   /* coral   = drifting / escalation        */
  --amber: #FFB020;   /* amber   = the in-between "heads up"    */
  --mist:  #8B8794;   /* muted plum-grey secondary text/borders */

  --radius: 16px;
  --gap: 16px;
  --shadow: 0 10px 30px rgba(23, 21, 28, 0.12);

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Bricolage Grotesque", var(--font-ui);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:   #F3F0F7;
    --paper: #141218;
    --card:  #1E1B24;
    --mist:  #9C97A6;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

img, svg { max-width: 100%; display: block; }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; }

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  border-radius: 999px;
  padding: 13px 26px;
  cursor: pointer;
  border: 1.5px solid transparent;
  box-shadow: var(--shadow);
  transition: transform 120ms ease, filter 120ms ease;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.btn-primary { background: var(--calm); color: #fff; }
.btn-ghost   { background: transparent; color: var(--ink); border-color: color-mix(in srgb, var(--mist) 45%, transparent); box-shadow: none; }
.btn-card-primary   { background: #FFFFFF; color: #17151C; }
.btn-card-secondary { background: transparent; color: #FFFFFF; border-color: #FFFFFF; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------------------------------------------------------------------
   Header
   --------------------------------------------------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--mist) 18%, transparent);
}
header .wrap {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
}
.brand-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--calm);
  animation: pulse 2.4s ease infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--calm) 45%, transparent); }
  50% { box-shadow: 0 0 0 8px transparent; }
}

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */
.hero {
  padding: 76px 0 48px;
  text-align: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 820px;
  margin: 0 auto 20px;
}
.hero h1 .accent { color: var(--calm); }
.hero p.lede {
  max-width: 560px;
  margin: 0 auto 32px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--mist);
}
.hero-ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

/* Mini auto-playing preview frame */
.preview-frame {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(160deg, #2b2740, #1b1824 60%, #100e16);
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 8.5;
  border: 1px solid color-mix(in srgb, var(--mist) 22%, transparent);
}
.preview-frame .fake-chrome {
  height: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: rgba(0,0,0,0.25);
}
.fake-chrome span { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.25); }

.preview-stage {
  position: relative;
  flex: 1;
  height: calc(100% - 30px);
}
.preview-wash {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 0%, transparent 32%, rgba(11,10,16,0.72) 100%);
  opacity: 0;
  transition: opacity 900ms ease;
}
.preview-wash.dark {
  background: rgba(11,10,16,0.95);
  transition: opacity 400ms ease;
}
.preview-frame[data-stage="warning"] .preview-wash:not(.dark) { opacity: 1; }
.preview-frame[data-stage="takeover"] .preview-wash.dark,
.preview-frame[data-stage="praise"]   .preview-wash.dark { opacity: 0; }
.preview-frame[data-stage="takeover"] .preview-wash.dark { opacity: 1; }

.preview-creature {
  position: absolute;
  right: 22px; bottom: 20px;
  left: auto; top: auto;
  width: 40px; height: 40px;
  border-radius: 50% 50% 46% 46%;
  background: var(--calm);
  transition: background 300ms ease, transform 300ms ease, left 300ms ease, top 300ms ease, right 300ms ease, bottom 300ms ease;
}
/* Leaf sprout and two eyes, matching the app's buddy at a glance. */
.preview-creature::before {
  content: "";
  position: absolute;
  top: -5px; left: 19px;
  width: 7px; height: 8px;
  background: #3E9B57;
  border-radius: 0 100% 0 100%;
  transform: rotate(-12deg);
  transform-origin: bottom left;
}
.preview-creature::after {
  content: "";
  position: absolute;
  top: 14px; left: 11px;
  width: 6px; height: 7px;
  border-radius: 50%;
  background: #17151C;
  box-shadow: 12px 0 0 #17151C;
}
.preview-frame[data-stage="warning"] .preview-creature,
.preview-frame[data-stage="takeover"] .preview-creature {
  right: auto; bottom: auto;
  left: 50%; top: 38%;
  transform: translate(-50%, -50%) scale(2.4);
  background: var(--ember);
}
.preview-frame[data-stage="praise"] .preview-creature {
  background: var(--calm);
  transform: scale(1.3);
}
.preview-card {
  position: absolute; left: 50%; top: 74%;
  transform: translate(-50%, 20px);
  width: 76%;
  text-align: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 300ms ease, transform 300ms ease;
}
.preview-frame[data-stage="takeover"] .preview-card {
  opacity: 1;
  transform: translate(-50%, 0);
}
.preview-caption {
  position: absolute; left: 14px; bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
}

/* ---------------------------------------------------------------------
   Section shell
   --------------------------------------------------------------------- */
section { padding: 64px 0; }
.section-kicker {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--calm);
  margin-bottom: 10px;
  text-align: center;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(26px, 3.4vw, 36px);
  text-align: center;
  max-width: 640px;
  margin: 0 auto 12px;
  letter-spacing: -0.01em;
}
.section-lede {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 44px;
  color: var(--mist);
  font-size: 16px;
  line-height: 1.6;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.step-num {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--calm);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.step h3 { font-family: var(--font-display); font-size: 17px; margin-bottom: 8px; }
.step p { color: var(--mist); font-size: 14.5px; line-height: 1.55; }

/* ---------------------------------------------------------------------
   THE BIG INTERACTIVE DEMO
   --------------------------------------------------------------------- */
.demo-shell {
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 28px;
}
.demo-goal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}
.demo-goal-row input {
  flex: 1;
  min-width: 200px;
  font-family: var(--font-ui);
  font-size: 15px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid color-mix(in srgb, var(--mist) 35%, transparent);
  background: var(--paper);
  color: var(--ink);
}
.demo-goal-row input::placeholder { color: var(--mist); }

.demo-screen {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 15%, rgba(255,255,255,0.06), transparent 40%),
    linear-gradient(160deg, #2b2740, #1b1824 55%, #100e16);
  aspect-ratio: 16 / 9;
  border: 1px solid color-mix(in srgb, var(--mist) 22%, transparent);
}
/* 16:9 is too short on a phone to fit the card, reason box and buddy. */
@media (max-width: 600px) {
  .demo-screen { aspect-ratio: auto; min-height: 440px; }
}
.demo-fake-chrome {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 14px;
  background: rgba(0,0,0,0.28);
}
.demo-fake-chrome .dots { display: flex; gap: 6px; }
.demo-fake-chrome .dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.25); }
.demo-fake-chrome .url {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.demo-status {
  position: absolute;
  left: 16px; top: 46px;
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  max-width: 60%;
  transition: opacity 200ms ease;
}

.demo-wash-warning {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 0%, transparent 30%, rgba(11,10,16,0.72) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 900ms ease;
}
.demo-screen[data-stage="drifting"] .demo-wash-warning { opacity: 1; }

.demo-wash {
  position: absolute; inset: 0;
  background: rgba(11,10,16,0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease;
}
.demo-screen[data-stage="escalated"] .demo-wash { opacity: 1; pointer-events: auto; }

.demo-buddy {
  position: absolute;
  right: 5%; bottom: 8%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: right 320ms ease, bottom 320ms ease, left 320ms ease, top 320ms ease, transform 320ms ease;
}
.demo-screen[data-stage="drifting"] .demo-buddy,
.demo-screen[data-stage="escalated"] .demo-buddy {
  right: auto; bottom: auto;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
}

/* Same face as the app's buddy (its styles.css), scaled from 120px to 64px.
   The face is always dark: it sits on the creature's colored body, and
   --ink flips to near-white in dark mode. */
.demo-creature {
  --face: #17151C;
  position: relative;
  width: 64px; height: 64px;
  border-radius: 50% 50% 46% 46%;
  background-color: var(--calm);
  background-image:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.38), transparent 36%),
    radial-gradient(ellipse at 50% 115%, rgba(0, 0, 0, 0.22), transparent 62%);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35), inset 0 -3px 8px rgba(0, 0, 0, 0.10);
  transition: background-color 300ms ease, transform 200ms ease;
}
.demo-creature::before {
  content: "";
  position: absolute;
  top: -8px; left: 30px;
  width: 11px; height: 12px;
  background: #3E9B57;
  border-radius: 0 100% 0 100%;
  transform: rotate(-12deg);
  transform-origin: bottom left;
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.12);
}
.demo-screen[data-stage="drifting"] .demo-creature,
.demo-screen[data-stage="escalated"] .demo-creature {
  background-color: var(--ember);
  transform: scale(1.9);
  /* scale() doesn't move layout, so reserve the extra height (plus the
     leaf) or the grown buddy covers the card above it. */
  margin-top: 40px;
  animation: demo-shake 480ms ease infinite;
}
.demo-screen[data-stage="praise"] .demo-creature {
  animation: demo-bounce 600ms ease;
}
.demo-creature .eye {
  position: absolute; top: 22px;
  width: 11px; height: 13px;
  background: var(--face);
  border-radius: 50%;
  transition: height 150ms ease;
}
.demo-creature .eye.left { left: 16px; }
.demo-creature .eye.right { right: 16px; }
.demo-creature .cheek {
  position: absolute;
  top: 37px;
  width: 9px; height: 5px;
  border-radius: 50%;
  background: #FF8FB0;
  opacity: 0.8;
}
.demo-creature .cheek.left  { left: 9px; }
.demo-creature .cheek.right { right: 9px; }
.demo-creature .mouth {
  position: absolute;
  top: 37px; left: 50%;
  width: 10px; height: 5px;
  transform: translateX(-50%);
  border: 2px solid var(--face);
  border-top: none;
  border-radius: 0 0 7px 7px;
}
/* Calm: an occasional blink. */
.demo-screen[data-stage="idle"] .demo-creature .eye,
.demo-screen[data-stage="watching"] .demo-creature .eye { animation: demo-blink 5s ease-in-out infinite; }
/* Drifting: a worried "o". */
.demo-screen[data-stage="drifting"] .demo-creature .mouth {
  top: 40px; width: 7px; height: 7px; border: 2px solid var(--face); border-radius: 50%;
}
/* Escalated: wide eyes and a shocked "O". */
.demo-screen[data-stage="escalated"] .demo-creature .eye { height: 17px; }
.demo-screen[data-stage="escalated"] .demo-creature .mouth {
  top: 41px; width: 9px; height: 10px; border: none; background: var(--face); border-radius: 50%;
}
/* Praise: closed "^ ^" eyes and a big grin. */
.demo-screen[data-stage="praise"] .demo-creature .eye {
  height: 7px; background: transparent; border: 2px solid var(--face); border-bottom: none; border-radius: 7px 7px 0 0;
}
.demo-screen[data-stage="praise"] .demo-creature .mouth { width: 14px; height: 7px; background: var(--face); }
@keyframes demo-blink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
@keyframes demo-shake { 0%,100% { transform: scale(1.9) translateX(0); } 25% { transform: scale(1.9) translateX(-3px); } 75% { transform: scale(1.9) translateX(3px); } }
@keyframes demo-bounce { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-10px); } }

.demo-bubble {
  max-width: 220px;
  background: var(--card);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.3);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 200ms ease, transform 200ms ease;
}
.demo-bubble.show { opacity: 1; transform: translateY(0); }

.demo-card {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 300px;
  text-align: center;
}
.demo-screen[data-stage="escalated"] .demo-card { display: flex; }
.demo-screen[data-stage="escalated"] .demo-bubble { display: none; }
.demo-card-actions[hidden] { display: none; }
.demo-card-line {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  text-shadow: 0 2px 10px rgba(0,0,0,0.45);
}
.demo-card-actions { display: flex; gap: 8px; }
.demo-card-actions .btn { font-size: 12.5px; padding: 9px 16px; }

/* The reason box that replaces the two buttons after "Yeah, I need this". */
.demo-card-reason { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.demo-card-reason[hidden] { display: none; }
.demo-card-reason-hint { color: rgba(255, 255, 255, 0.75); font-size: 12.5px; }
.demo-card-reason input {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}
.demo-card-reason input::placeholder { color: rgba(255, 255, 255, 0.6); }
.demo-card-reason input:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.demo-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}
.demo-hint {
  font-size: 13px;
  color: var(--mist);
  margin-top: 12px;
  min-height: 18px;
}

/* ---------------------------------------------------------------------
   Comparison / positioning
   --------------------------------------------------------------------- */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 720px) { .compare { grid-template-columns: 1fr; } }
.compare-card {
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.compare-card.wall { background: var(--card); border: 1.5px dashed color-mix(in srgb, var(--mist) 45%, transparent); }
.compare-card.person { background: color-mix(in srgb, var(--calm) 10%, var(--card)); border: 1.5px solid color-mix(in srgb, var(--calm) 35%, transparent); }
.compare-card h3 { font-family: var(--font-display); font-size: 19px; margin-bottom: 10px; }
.compare-card ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.compare-card li { font-size: 14.5px; line-height: 1.5; color: var(--mist); padding-left: 20px; position: relative; }
.compare-card li::before { content: "—"; position: absolute; left: 0; }
.compare-card.person li { color: var(--ink); }
.compare-card.person li::before { content: "✓"; color: var(--calm); font-weight: 800; }

/* Feature grid */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 760px) { .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .features { grid-template-columns: 1fr; } }
.feature {
  background: var(--card);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.feature .dot { width: 10px; height: 10px; border-radius: 50%; margin-bottom: 12px; }
.feature h4 { font-size: 15px; margin-bottom: 6px; font-family: var(--font-display); }
.feature p { font-size: 13.5px; color: var(--mist); line-height: 1.5; }

/* Final CTA */
.cta-section {
  text-align: center;
  padding: 72px 0 96px;
}
.cta-box {
  background: linear-gradient(155deg, var(--calm), color-mix(in srgb, var(--calm) 70%, var(--amber)));
  border-radius: 24px;
  padding: 56px 32px;
  color: #fff;
  max-width: 720px;
  margin: 0 auto;
}
.cta-box h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 32px);
  margin-bottom: 12px;
}
.cta-box p { opacity: 0.92; margin-bottom: 26px; font-size: 15.5px; }
.cta-box .btn-primary { background: #fff; color: var(--calm); }
.cta-note { margin-top: 14px; font-size: 12.5px; opacity: 0.85; }
.cta-note a { color: inherit; text-decoration: underline; }

.download-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.download-btn { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.2; }
.download-btn span { display: block; font-size: 11.5px; font-weight: 600; opacity: 0.75; margin-top: 3px; }
.cta-box .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.7); }
.download-btn.is-soon { opacity: 0.6; pointer-events: none; }

.requirements { margin: 28px auto 0; max-width: 560px; text-align: left; font-size: 13.5px; }
.requirements summary { cursor: pointer; text-align: center; font-weight: 700; opacity: 0.92; }
.requirements summary:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
.requirements-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 16px; }
@media (max-width: 560px) { .requirements-grid { grid-template-columns: 1fr; } }
.requirements h3 { font-family: var(--font-display); font-size: 15px; margin-bottom: 6px; }
.requirements ul { padding-left: 18px; display: grid; gap: 4px; opacity: 0.92; line-height: 1.45; }
.requirements-foot { margin: 14px 0 0 !important; font-size: 12.5px !important; opacity: 0.85; }

footer {
  border-top: 1px solid color-mix(in srgb, var(--mist) 18%, transparent);
  padding: 28px 0;
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--mist);
}
