/* Routine Coach — landing site
   Palette + type ported from the app's design system (docs/DESIGN.md).
   Single source of truth for color lives in :root below. */

:root {
  --pine:      #2e6f6a;
  --pine-deep: #234f4c;
  --sage:      #8fbcb0;
  --sage-pale: #d8e8e2;
  --peach:     #fde5df;
  --peach-mid: #ffb4a8;
  --terra:     #dd6c4e;
  --blue:      #aac4db;
  --gold:      #e0a458;
  --cream:     #fbf8f3;
  --ink:       #263635;
  --ink-soft:  #5b6f6c;

  --maxw: 1120px;
  --radius-card: 14px;
  --radius-sheet: 20px;
  --shadow-sheet: 0 24px 60px -24px rgba(35,79,76,.4);
  --shadow-soft: 0 12px 32px -18px rgba(35,79,76,.35);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--sage-pale);
  color: var(--ink);
  line-height: 1.55;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ---------- Shared type primitives ---------- */
.eyebrow {
  font-size: 12px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--pine);
  font-weight: 500;
}

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--pine-deep);
  line-height: 1.02;
}
h1 em, h2 em { font-style: italic; color: var(--terra); font-weight: 500; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 15px;
  border-radius: 999px;
  padding: 14px 26px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.btn-primary { background: var(--terra); color: var(--cream); box-shadow: 0 10px 24px -12px rgba(221,108,78,.9); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(221,108,78,.9); }
.btn-ghost { background: transparent; color: var(--pine-deep); border-color: rgba(46,111,106,.35); }
.btn-ghost:hover { background: rgba(46,111,106,.08); transform: translateY(-1px); }

:focus-visible { outline: 3px solid var(--terra); outline-offset: 3px; border-radius: 6px; }

/* ---------- Top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(216,232,226,.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(46,111,106,.12);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 500; }
.brand img { width: 34px; height: 34px; }
.brand .brand-name { font-family: 'Fraunces', serif; font-size: 19px; color: var(--pine-deep); line-height: 1; }
.brand .brand-sub { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a.nav-link { font-size: 14.5px; color: var(--ink-soft); font-weight: 400; transition: color .15s; }
.nav-links a.nav-link:hover { color: var(--pine-deep); }

/* ---------- Hero ---------- */
.hero { padding: 60px 0 20px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(40px, 5.6vw, 66px); margin: 18px 0 0; }
.hero .lede { margin-top: 20px; max-width: 46ch; font-size: 17px; color: var(--ink-soft); font-weight: 300; }

.signup { margin-top: 30px; max-width: 440px; }
.signup .field-row { display: flex; gap: 10px; }
.signup input[type="email"] {
  flex: 1; min-width: 0;
  font-family: 'Outfit', sans-serif; font-size: 15px;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid rgba(46,111,106,.28);
  background: var(--cream);
  color: var(--ink);
}
.signup input[type="email"]::placeholder { color: #9aada9; }
.signup input[type="email"]:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px rgba(46,111,106,.15); }

.opts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; }
.opt { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-soft); cursor: pointer; }
.opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.opt .box {
  width: 19px; height: 19px; border-radius: 6px;
  border: 1.5px solid var(--sage);
  background: var(--cream);
  display: inline-grid; place-items: center;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
.opt .box::after { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--pine); transform: scale(0); transition: transform .15s ease; }
.opt input:checked + .box { border-color: var(--pine); }
.opt input:checked + .box::after { transform: scale(1); }
.opt input:focus-visible + .box { outline: 3px solid var(--terra); outline-offset: 2px; }

.signup .fineprint { margin-top: 14px; font-size: 12.5px; color: var(--ink-soft); }

/* inline error (our fault, not yours — see VOICE.md) */
.form-error {
  margin-top: 14px;
  font-size: 13.5px;
  color: #a83c22;
  background: var(--peach);
  border-left: 3px solid var(--terra);
  border-radius: 8px;
  padding: 10px 14px;
}
.final .form-error { max-width: 440px; margin-left: auto; margin-right: auto; text-align: left; }

/* form success state */
.form-done {
  display: none;
  margin-top: 30px; max-width: 440px;
  background: var(--peach);
  border-left: 4px solid var(--terra);
  border-radius: 12px;
  padding: 18px 20px;
}
.form-done p { color: #7a4433; font-size: 15px; }
.form-done .big { font-family: 'Fraunces', serif; font-style: italic; font-size: 20px; color: var(--terra); display: block; margin-bottom: 2px; }
.signup.is-done { display: none; }
.form-done.is-shown { display: block; }

/* hero art */
.hero-art { position: relative; }
.hero-art .art-card {
  background: linear-gradient(160deg, var(--cream), var(--peach));
  border-radius: var(--radius-sheet);
  box-shadow: var(--shadow-sheet);
  padding: 26px 26px 20px;
  position: relative;
  overflow: hidden;
}
.hero-art .art-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% 0%, rgba(143,188,176,.35), transparent 60%);
}
.hero-art img.person { position: relative; width: 86%; margin: 0 auto; }
.hero-art .art-tag {
  position: absolute; left: 22px; bottom: 20px;
  background: var(--cream); border-radius: 999px;
  padding: 7px 14px; font-size: 12px; color: var(--pine-deep);
  box-shadow: var(--shadow-soft); display: flex; align-items: center; gap: 8px;
}
.hero-art .art-tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); }

/* ---------- Week ribbon (signature) ---------- */
.ribbon-section { padding: 30px 0 64px; }
.ribbon-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.ribbon-head .cap { font-size: 14.5px; color: var(--ink-soft); max-width: 40ch; }
.ribbon {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px;
}
.day {
  background: var(--cream);
  border: 1px solid var(--sage-pale);
  border-radius: var(--radius-card);
  padding: 16px 14px 18px;
  min-height: 128px;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.day:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }
.day.today { background: var(--pine); border-color: var(--pine); }
.day .dname { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); font-weight: 500; }
.day.today .dname { color: var(--sage-pale); }
.day .dnum { font-family: 'Fraunces', serif; font-size: 22px; color: var(--pine-deep); font-weight: 500; line-height: 1; }
.day.today .dnum { color: var(--cream); }
.day .dots { display: flex; gap: 7px; margin-top: auto; }
.dot-h { width: 11px; height: 11px; border-radius: 50%; }
.dot-h.nutrition { background: var(--gold); }
.dot-h.movement { background: var(--terra); }
.dot-h.alcohol { background: var(--pine-deep); }
.day.today .dot-h.alcohol { background: var(--sage-pale); }
.dot-h.open { background: transparent; border: 1.5px dashed #c3d6cf; }
.day.today .dot-h.open { border-color: rgba(216,232,226,.5); }

/* legend */
.legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 22px; }
.legend span { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-soft); }
.legend .dot-h { width: 10px; height: 10px; }

/* ---------- Section scaffolding ---------- */
section.band { background: var(--cream); }
section.band-pine { background: var(--pine); color: var(--sage-pale); }
.section-pad { padding: 84px 0; }
.section-head { max-width: 62ch; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); margin-top: 12px; }
.section-head p { margin-top: 16px; color: var(--ink-soft); font-size: 16.5px; }
section.band-pine .section-head h2 { color: var(--cream); }
section.band-pine .section-head p { color: rgba(216,232,226,.85); }
section.band-pine .eyebrow { color: var(--sage); }

/* ---------- Tracks ---------- */
.tracks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; }
.track {
  background: var(--cream);
  border: 1px solid var(--sage-pale);
  border-radius: var(--radius-sheet);
  padding: 28px 26px;
  border-top: 5px solid var(--track, var(--pine));
}
.track.nutrition { --track: var(--gold); }
.track.movement { --track: var(--terra); }
.track.alcohol { --track: var(--pine-deep); }
.track .tnum { font-family: 'Fraunces', serif; font-style: italic; font-size: 15px; color: var(--track); }
.track h3 { font-size: 24px; margin: 6px 0 10px; }
.track p { font-size: 15px; color: var(--ink-soft); }

/* ---------- Promise (pine band) ---------- */
.promise-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.promise-list { list-style: none; display: grid; gap: 16px; }
.promise-list li { display: flex; gap: 14px; align-items: flex-start; font-size: 16px; color: rgba(216,232,226,.92); }
.promise-list .mk { font-family: 'Fraunces', serif; color: var(--peach-mid); font-size: 20px; line-height: 1.2; flex-shrink: 0; }
.pullquote {
  background: rgba(35,79,76,.55);
  border: 1px solid rgba(143,188,176,.3);
  border-radius: var(--radius-sheet);
  padding: 32px 30px;
}
.pullquote p { font-family: 'Fraunces', serif; font-size: 25px; line-height: 1.28; color: var(--cream); }
.pullquote p em { font-style: italic; color: var(--peach-mid); }
.pullquote .attr { margin-top: 16px; font-family: 'Outfit', sans-serif; font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--sage); }

/* ---------- Blog teaser ---------- */
.blog-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; }
.post-card {
  display: flex; flex-direction: column;
  background: var(--cream);
  border: 1px solid var(--sage-pale);
  border-radius: var(--radius-sheet);
  padding: 26px 24px 22px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  height: 100%;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); border-color: var(--sage); }
.post-card .kicker { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 500; margin-bottom: 12px; }
.post-card.k-nutrition .kicker { color: var(--gold); }
.post-card.k-movement .kicker { color: var(--terra); }
.post-card.k-mindset .kicker { color: var(--pine); }
.post-card h3 { font-size: 21px; line-height: 1.12; }
.post-card p { margin-top: 10px; font-size: 14.5px; color: var(--ink-soft); flex: 1; }
.post-card .readmore { margin-top: 18px; font-size: 13.5px; font-weight: 500; color: var(--pine-deep); display: inline-flex; align-items: center; gap: 6px; }
.post-card .readmore .arw { transition: transform .18s ease; }
.post-card:hover .readmore .arw { transform: translateX(4px); }
.blog-cta-row { margin-top: 36px; }

/* ---------- Final CTA ---------- */
.final { text-align: center; }
.final .section-head { margin: 0 auto; }
.final .signup { margin-left: auto; margin-right: auto; }
.final .opts { justify-content: center; }

/* ---------- Footer ---------- */
.footer { background: var(--pine-deep); color: rgba(216,232,226,.75); padding: 40px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer .brand .brand-name { color: var(--cream); }
.footer .brand .brand-sub { color: rgba(216,232,226,.6); }
.footer .foot-links { display: flex; gap: 22px; font-size: 14px; }
.footer .foot-links a:hover { color: var(--cream); }
.footer .copy { font-size: 12.5px; color: rgba(216,232,226,.55); width: 100%; }

/* ---------- Blog index page ---------- */
.page-hero { padding: 66px 0 30px; }
.page-hero h1 { font-size: clamp(38px, 5vw, 58px); margin-top: 14px; }
.page-hero p { margin-top: 16px; max-width: 52ch; color: var(--ink-soft); font-size: 17px; }
.blog-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding: 20px 0 90px; }

/* ---------- Article page ---------- */
.article { padding: 56px 0 90px; }
.article-inner { max-width: 680px; margin: 0 auto; }
.article .kicker { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; font-weight: 500; color: var(--terra); }
.article h1 { font-size: clamp(34px, 4.6vw, 50px); margin: 14px 0 16px; }
.article .meta { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 30px; }
.article-body { font-size: 17.5px; color: var(--ink); line-height: 1.7; }
.article-body p { margin: 0 0 20px; }
.article-body h2 { font-size: 27px; margin: 38px 0 12px; }
.article-body blockquote { border-left: 4px solid var(--terra); background: var(--peach); border-radius: 0 12px 12px 0; padding: 16px 22px; margin: 26px 0; }
.article-body blockquote p { margin: 0; font-family: 'Fraunces', serif; font-size: 20px; font-style: italic; color: #7a4433; }
.article-body strong { font-weight: 600; color: var(--pine-deep); }
.back-link { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--pine); margin-bottom: 26px; }

/* ---------- Entrance motion ---------- */
.rise { opacity: 0; transform: translateY(16px); animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards; }
.rise.d1 { animation-delay: .05s; }
.rise.d2 { animation-delay: .14s; }
.rise.d3 { animation-delay: .23s; }
.day.rise { animation: riseDay .6s cubic-bezier(.2,.7,.2,1) forwards; }
.day.rise:nth-child(1){animation-delay:.04s}
.day.rise:nth-child(2){animation-delay:.10s}
.day.rise:nth-child(3){animation-delay:.16s}
.day.rise:nth-child(4){animation-delay:.22s}
.day.rise:nth-child(5){animation-delay:.28s}
.day.rise:nth-child(6){animation-delay:.34s}
.day.rise:nth-child(7){animation-delay:.40s}

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

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-art { order: -1; max-width: 420px; }
  .promise-grid { grid-template-columns: 1fr; gap: 30px; }
  .tracks, .blog-strip, .blog-list { grid-template-columns: 1fr; }
  .section-pad { padding: 64px 0; }
}
@media (max-width: 620px) {
  .nav-links { gap: 14px; }
  .nav-links a.nav-link[href*="#how"] { display: none; }
  .btn { padding: 12px 18px; font-size: 14px; }
  .brand .brand-sub { display: none; }
  .brand .brand-name { font-size: 17px; }
  .ribbon { grid-template-columns: repeat(7, 1fr); gap: 6px; }
  .day { min-height: 96px; padding: 10px 8px 12px; }
  .day .dnum { font-size: 17px; }
  .day .dots { gap: 4px; }
  .dot-h { width: 8px; height: 8px; }
  .signup .field-row { flex-direction: column; }
  .signup .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .day.rise { animation: none; opacity: 1; transform: none; }
  .btn, .day, .post-card { transition: none; }
}
