/* Frankie's Habits — frankieshabits.app
   Palette + type ramp derive from the app's own tokens (docs/tokens.json):
   cream UI chrome, warm-brown accents, Body/Mind/Routine category trio,
   and the happy-sky blue that Frankie lives under when things are going well. */

:root {
  --cream: #FFF8F0;
  --card: #FFFCF5;
  --ink: #2C160E;
  --ink-2: #6F4627;
  --brown: #8B5E3C;
  --border: #E7E5E4;
  --sky: #BBE0F2;
  --sky-deep: #A3D4EC;
  --grass-1: #8ED058;
  --grass-2: #6FBF44;
  --grass-3: #57A836;
  --body-gold: #C49A3D;
  --mind-teal: #3D8B8B;
  --routine-purple: #7B6E9E;
  --night: #0B1026;
  --bezel: #1C1A18;
  --display: "Fraunces", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root {
    --cream: #171310;
    --card: #201B17;
    --ink: #F3E9DF;
    --ink-2: #C9A886;
    --border: #33291F;
    --sky: #1A3A4D;
    --sky-deep: #14303F;
    --grass-1: #2E5A22;
    --grass-2: #26491C;
    --grass-3: #1E3A17;
  }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--brown); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--mind-teal);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* Tracked uppercase labels — same register as the app's BODY / MIND / ROUTINE headers */
.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brown);
}

/* ---------- header ---------- */

/* header: cream in light mode, the app's on-screen happy sky (#C3DFF1) in dark mode.
   Both are light backgrounds, so text colours are pinned dark. */
.site-header { background: #FFF8F0; }
@media (prefers-color-scheme: dark) {
  .site-header { background: #C3DFF1; }
}
.site-header .wordmark { color: #2C160E; }
.site-header .site-nav a { color: #6F4627; }
.site-header .site-nav a:hover { color: #8B5E3C; }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  padding-bottom: 20px;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--ink);
}
.wordmark img { width: 52px; height: auto; }
.wordmark span {
  font-family: var(--display);
  font-weight: 640;
  font-size: 28px;
  letter-spacing: 0.01em;
}
.site-nav { display: flex; gap: 22px; }
.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}
.site-nav a:hover { color: var(--brown); text-decoration: underline; }

/* ---------- hero: Frankie's world ---------- */

.hero {
  background: linear-gradient(var(--sky), var(--sky-deep));
  overflow: hidden;
  position: relative;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding-top: 56px;
  padding-bottom: 24px;
  position: relative;
  z-index: 2;
}
.hero-copy h1 {
  font-family: var(--display);
  font-weight: 640;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 14px 0 18px;
}
.hero-copy .lede {
  font-size: 18px;
  color: var(--ink);
  max-width: 46ch;
  margin-bottom: 26px;
}
.hero-copy .lede strong { color: var(--brown); }

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 999px;
  padding: 9px 22px 9px 10px;
  font-weight: 600;
  font-size: 15px;
}
/* the real compiled app icon, straight from the built app bundle */
.pill-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  flex-shrink: 0;
}
@media (prefers-color-scheme: dark) {
  .pill { background: var(--card); color: var(--ink); border: 1px solid var(--border); }
}
.cta-row .quiet { font-size: 15px; }

/* phone standing in the grass */
.phone {
  width: min(300px, 78vw);
  margin: 0 auto;
  background: var(--bezel);
  border-radius: 44px;
  padding: 12px;
  box-shadow: 0 24px 48px rgba(20, 30, 10, 0.28);
}
.phone > img, .phone > video {
  border-radius: 34px;
  width: 100%;
  aspect-ratio: 1320 / 2868;
  object-fit: cover;
  background: var(--cream);
}
.hero .phone { transform: rotate(1.5deg); }

/* scroll cue — sits on the grass, bobbing until you follow it */
.scroll-cue {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 20;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #FFFCF5;
  color: #6F4627;
  border: 1px solid #E7E5E4;
  box-shadow: 0 6px 18px rgba(20, 30, 10, 0.30);
  display: grid;
  place-items: center;
  animation: bob 1.8s ease-in-out infinite;
  transition: opacity 0.4s ease;
}
.scroll-cue:hover { color: #2C160E; }
.scroll-cue.gone { opacity: 0; pointer-events: none; }
@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(7px); }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-cue { animation: none; }
}

/* rolling hills — same flat-vector world as the Owner's Card */
.hills { display: block; width: 100%; margin-top: -8vw; position: relative; z-index: 1; }
.hills path.h1 { fill: var(--grass-1); }
.hills path.h2 { fill: var(--grass-2); }
.hills path.h3 { fill: var(--grass-3); }
.grass-band { background: var(--grass-3); height: 34px; margin-top: -2px; }

.clouds { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.cloud {
  position: absolute;
  fill: rgba(255, 255, 255, 0.85);
  animation: drift 60s linear infinite;
}
@media (prefers-color-scheme: dark) { .cloud { fill: rgba(255, 255, 255, 0.12); } }
.cloud.c2 { animation-duration: 90s; animation-delay: -30s; }
@keyframes drift {
  from { transform: translateX(-15vw); }
  to { transform: translateX(110vw); }
}
@media (prefers-reduced-motion: reduce) {
  .cloud { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- sections ---------- */

.section { padding: 72px 0; }
.section-head { max-width: 60ch; margin-bottom: 40px; }
.section-head h2 {
  font-family: var(--display);
  font-weight: 620;
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.15;
  margin: 10px 0 12px;
}
.section-head p { color: var(--ink-2); font-size: 17px; }

/* how it works — step rings echo the app's Body/Mind/Routine status rings */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  list-style: none;
}
.step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px;
}
.ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 6px solid var(--body-gold);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 16px;
  background: var(--cream);
}
.step:nth-child(2) .ring { border-color: var(--mind-teal); }
.step:nth-child(3) .ring { border-color: var(--routine-purple); }
.step h3 { font-size: 19px; margin-bottom: 8px; }
.step p { color: var(--ink-2); font-size: 15.5px; }

/* gallery — horizontally scrollable shelf of phones */
.shelf-zone { position: relative; max-width: 1060px; margin: 0 auto; }
.shelf-btn {
  position: absolute;
  top: 34%;
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #FFFCF5;
  color: #6F4627;
  border: 1px solid #E7E5E4;
  box-shadow: 0 6px 18px rgba(20, 30, 10, 0.25);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: opacity 0.25s ease;
}
.shelf-btn.prev { left: 2px; }
.shelf-btn.next { right: 2px; }
.shelf-btn:hover:not(:disabled) { color: #2C160E; }
.shelf-btn:disabled { opacity: 0.3; cursor: default; }
@media (max-width: 820px) {
  .shelf-btn { display: none; }
}
.shelf {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 236px;
  gap: 26px;
  overflow-x: auto;
  padding: 8px 24px 22px;
  max-width: 1060px;
  margin: 0 auto;
  scroll-snap-type: x proximity;
  scroll-padding: 0 24px;
  scrollbar-width: thin;
}
.shot { scroll-snap-align: start; }
.shot .phone {
  width: 100%;
  border-radius: 34px;
  padding: 9px;
  box-shadow: 0 14px 30px rgba(44, 22, 14, 0.18);
}
.shot .phone > img, .shot .phone > video { border-radius: 26px; }
.shot figcaption {
  margin-top: 12px;
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.45;
}
.shot figcaption strong { color: var(--ink); display: block; font-size: 15px; }

/* strikes — the stakes, in the Owner's Card's own language */
.strikes { padding: 72px 0 88px; text-align: center; }
.strikes .wrap { max-width: 620px; }
.strikes h2 {
  font-family: var(--display);
  font-weight: 620;
  font-size: clamp(26px, 3.6vw, 38px);
  margin: 10px 0 14px;
}
.strikes p:not(.eyebrow) { color: var(--ink-2); font-size: 17px; }
.strike-row { display: flex; gap: 14px; justify-content: center; margin-bottom: 22px; }
.strike-x {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #A4000E;
  border: 1px solid #A4000E;
  display: grid;
  place-items: center;
  color: #FFF8F0;
  font-weight: 700;
  font-size: 20px;
}

/* adoption band */
.adopt { background: var(--night); color: #F3E9DF; }
.adopt .wrap { padding-top: 72px; padding-bottom: 76px; }
.adopt .eyebrow { color: var(--body-gold); }
.adopt h2 {
  font-family: var(--display);
  font-weight: 620;
  font-size: clamp(26px, 3.6vw, 38px);
  margin: 10px 0 14px;
  max-width: 24ch;
}
.adopt .lede { max-width: 62ch; color: #D8C6B4; font-size: 17px; }
.adopt ul {
  list-style: none;
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px 32px;
  max-width: 720px;
}
.adopt li {
  padding-left: 30px;
  position: relative;
  color: #F3E9DF;
  font-size: 16px;
}
.adopt li::before {
  content: "🦴";
  position: absolute;
  left: 0;
  top: 1px;
  font-size: 15px;
}
.adopt .fine { margin-top: 26px; font-size: 14px; color: #A08B76; max-width: 62ch; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--border); }
.site-footer .wrap {
  padding-top: 34px;
  padding-bottom: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 32px;
  align-items: center;
  justify-content: space-between;
  font-size: 14.5px;
  color: var(--ink-2);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer a { color: var(--ink-2); }

/* ---------- inner pages (support / privacy) ---------- */

.page { max-width: 720px; margin: 0 auto; padding: 56px 24px 88px; }
.page h1 {
  font-family: var(--display);
  font-weight: 640;
  font-size: clamp(30px, 4.5vw, 42px);
  line-height: 1.12;
  margin: 12px 0 18px;
}
.page h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  margin: 36px 0 10px;
}
.page p, .page li { color: var(--ink); font-size: 16.5px; }
.page p + p { margin-top: 12px; }
.page ul { margin: 12px 0 12px 22px; }
.page .muted { color: var(--ink-2); }
.page .card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  margin: 22px 0;
}
.page .card a { font-weight: 600; }

/* guide-page figures — small phones floated beside their sections */
.guide-fig {
  float: right;
  width: 172px;
  margin: 6px 0 16px 26px;
}
.guide-fig .phone {
  width: 100%;
  border-radius: 26px;
  padding: 7px;
  box-shadow: 0 10px 24px rgba(44, 22, 14, 0.20);
}
.guide-fig .phone > img { border-radius: 20px; }
.guide-fig figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-2);
  text-align: center;
  line-height: 1.4;
}
.page h2 { clear: both; }
@media (max-width: 560px) {
  .guide-fig { float: none; width: 200px; margin: 18px auto; }
}

/* ---------- responsive ---------- */

@media (max-width: 820px) {
  .site-header .wrap { flex-wrap: wrap; gap: 6px 16px; }
  .wordmark img { width: 42px; }
  .wordmark span { font-size: 23px; }
  .hero .wrap { grid-template-columns: 1fr; padding-top: 40px; }
  .hero .phone { transform: none; margin-top: 8px; }
  .steps { grid-template-columns: 1fr; }
  .adopt ul { grid-template-columns: 1fr; }
  .hills { margin-top: -12vw; }
}
