/* ─────────────────────────────────────────────────────────────
   Motivational Mail — design tokens & base styles
   Calm, minimal, muted earthy tones, lots of whitespace.
───────────────────────────────────────────────────────────── */

:root {
  /* Default palette: "Off-white & Sage" — crisper, brighter */
  --bg:        #FBFAF6;
  --bg-2:      #F4F1EA;
  --surface:   #FFFFFF;
  --surface-2: #F1ECE2;
  --ink:       #2B2620;
  --ink-2:     #5A5147;
  --ink-3:     #8B8073;
  --rule:      #E4DECF;
  --rule-2:    #EDE8DB;

  --primary:   #6B7F66;     /* muted sage */
  --primary-2: #5B6F57;
  --primary-ink:#FAF7EE;

  --accent-1:  #C28A7E;     /* dusty rose */
  --accent-2:  #C9A24A;     /* warm gold */

  /* Type */
  --font-display: 'Newsreader', Georgia, serif;
  --font-body:    'Geist', ui-sans-serif, system-ui, sans-serif;
  --font-hand:    'Caveat', cursive;

  /* Shape */
  --radius-btn: 999px;       /* pill default */
  --radius-card: 14px;
  --radius-input: 10px;

  /* Layout */
  --gutter: clamp(20px, 4vw, 56px);
  --max-w: 1200px;
}

/* Dark mode tokens */
.dm-dark {
  --bg:        #1B1813;
  --bg-2:      #221E18;
  --surface:   #26221B;
  --surface-2: #2D2922;
  --ink:       #F1E9D7;
  --ink-2:     #C8BFAC;
  --ink-3:     #8A8273;
  --rule:      #3A352C;
  --rule-2:    #2F2B23;
  --primary:   #9BB295;
  --primary-2: #B0C6AA;
  --primary-ink:#1B1813;
  --accent-1:  #D9A89A;
  --accent-2:  #D8B86B;
}

/* Reset-ish */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.08;
  text-wrap: balance;
  margin: 0;
  color: var(--ink);
}
h1 { font-size: clamp(44px, 6.4vw, 92px); }
h2 { font-size: clamp(32px, 4vw, 54px); }
h3 { font-size: clamp(22px, 2.2vw, 30px); }
p  { text-wrap: pretty; margin: 0; }

/* Hand-written accent (use sparingly) */
.hand {
  font-family: var(--font-hand);
  font-weight: 400;
  color: var(--accent-1);
  font-size: 1.4em;
  line-height: 0.9;
}

/* ─────────────────────────────────────────────────────────────
   Layout primitives
───────────────────────────────────────────────────────────── */
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.wrap-narrow { max-width: 880px; margin: 0 auto; padding: 0 var(--gutter); }

.section {
  padding: clamp(60px, 10vh, 120px) 0;
}
.section-sm { padding: clamp(40px, 7vh, 80px) 0; }

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  display: block;
  width: 20px; height: 1px;
  background: var(--ink-3);
}

/* ─────────────────────────────────────────────────────────────
   Buttons
───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.005em;
  transition: transform .12s ease, background .15s ease, color .15s ease, border-color .15s ease;
  text-align: center;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-primary:hover { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-secondary:hover { background: var(--ink); color: var(--bg); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn-ghost:hover { border-color: var(--ink); }

.btn-sm { padding: 10px 18px; font-size: 14px; }
.btn-lg { padding: 18px 32px; font-size: 16px; }

/* ─────────────────────────────────────────────────────────────
   Cards
───────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  padding: 28px;
}
/* card style variants — set on <body data-card="..."> */
body[data-card="bordered"] .card { background: var(--surface); border: 1px solid var(--rule); box-shadow: none; }
body[data-card="shadow"]   .card { background: var(--surface); border: 1px solid var(--rule-2); box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 18px 40px -28px rgba(43,38,32,0.18); }
body[data-card="filled"]   .card { background: var(--surface-2); border: 1px solid transparent; box-shadow: none; }

/* ─────────────────────────────────────────────────────────────
   Inputs
───────────────────────────────────────────────────────────── */
.input, .textarea, .select {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-input);
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--ink);
  background: var(--bg);
}
.textarea { resize: vertical; min-height: 140px; }
.label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 8px;
}

/* ─────────────────────────────────────────────────────────────
   Image placeholders (labeled, mono)
───────────────────────────────────────────────────────────── */
.placeholder {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--surface-2);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0 12px,
    rgba(43,38,32,0.045) 12px 24px
  );
  color: var(--ink-3);
  border-radius: var(--radius-card);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow: hidden;
}
.placeholder::after {
  content: "";
  position: absolute; inset: 0;
  border: 1px dashed var(--rule);
  border-radius: inherit;
  pointer-events: none;
}
.placeholder-tag {
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: 6px 12px;
  border-radius: 999px;
}

/* ─────────────────────────────────────────────────────────────
   Subtle scroll reveal
───────────────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ─────────────────────────────────────────────────────────────
   Nav
───────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--rule-2);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter);
  max-width: var(--max-w);
  margin: 0 auto;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.nav-logo-img {
  display: block;
  height: 44px;
  width: auto;
  /* logo is solid black on transparent — recolor to current ink for dark mode etc. */
  filter: brightness(0);
}
.dm-dark .nav-logo-img { filter: brightness(0) invert(1); }
.nav-logo-text {
  font-style: italic;
  font-size: 22px;
  letter-spacing: 0.005em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
}
.nav-link {
  font-size: 14.5px;
  color: var(--ink-2);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--ink); border-bottom-color: var(--ink); }
.nav-cta { margin-left: 8px; }

@media (max-width: 720px) {
  .nav-links .nav-link-hide-mobile { display: none; }
  .nav-logo-text { display: none; }
  .nav-logo-img { height: 38px; }
  .nav-inner { padding: 14px var(--gutter); }
  .nav-links { gap: 18px; }
}

/* ─────────────────────────────────────────────────────────────
   Footer
───────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--rule);
  background: var(--bg-2);
  padding: 56px 0 32px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--rule);
}
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  font-size: 14.5px;
  color: var(--ink-2);
  padding: 4px 0;
}
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  font-size: 13px;
  color: var(--ink-3);
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-grid .footer-col:first-child { grid-column: auto; }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
  }
}

/* ─────────────────────────────────────────────────────────────
   Responsive layout helpers
   Inline styles set the desktop grid; these collapse it on mobile.
───────────────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .mm-split {
    grid-template-columns: 1fr !important;
    gap: clamp(28px, 7vw, 48px) !important;
    align-items: start !important;
  }
  .mm-static { position: static !important; top: auto !important; }
}
@media (max-width: 620px) {
  .mm-ig { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ─────────────────────────────────────────────────────────────
   Accordion (FAQ)
───────────────────────────────────────────────────────────── */
.accordion {
  border-top: 1px solid var(--rule);
}
.accordion-item {
  border-bottom: 1px solid var(--rule);
}
.accordion-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 22px 0;
  background: transparent;
  border: 0;
  text-align: left;
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 26px);
  color: var(--ink);
  cursor: pointer;
}
.accordion-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  display: grid;
  place-items: center;
  transition: transform .25s ease, background .15s ease;
  color: var(--ink-2);
}
.accordion-item.open .accordion-icon {
  transform: rotate(45deg);
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.accordion-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .3s ease;
}
.accordion-item.open .accordion-content { grid-template-rows: 1fr; }
.accordion-content > div {
  overflow: hidden;
}
.accordion-content p {
  font-size: 16px;
  color: var(--ink-2);
  max-width: 64ch;
  padding-bottom: 22px;
}

/* ─────────────────────────────────────────────────────────────
   Testimonials carousel
───────────────────────────────────────────────────────────── */
.tcar { position: relative; }
.tcar-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px 4px 24px;
  scrollbar-width: none;
}
.tcar-track::-webkit-scrollbar { display: none; }
.tcar-card {
  flex: 0 0 min(440px, 88%);
  scroll-snap-align: start;
  padding: 36px;
}
.tcar-card .quote-mark {
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 0.5;
  color: var(--accent-1);
  margin-bottom: 12px;
}
.tcar-quote {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink);
  text-wrap: pretty;
  margin-bottom: 20px;
}
.tcar-attr {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--ink-2);
}
.tcar-avatar {
  width: 36px; height: 36px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 14px;
}
.tcar-controls {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}
.tcar-btn {
  width: 42px; height: 42px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
}
.tcar-btn:hover { border-color: var(--ink); }
.tcar-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ─────────────────────────────────────────────────────────────
   Newsletter
───────────────────────────────────────────────────────────── */
.newsletter {
  display: flex;
  gap: 8px;
  max-width: 460px;
}
.newsletter .input { padding: 14px 16px; }
.newsletter .btn { flex-shrink: 0; }

/* ─────────────────────────────────────────────────────────────
   Page transitions
───────────────────────────────────────────────────────────── */
.page {
  animation: pagein .35s ease both;
}
@keyframes pagein {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Visually hidden */
.sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
