/* ============================================================
   grATTitude — editorial design system
   ============================================================
   Shared by every marketing page. Page-specific layout stays in
   the page itself. The logged-in app (journal / insights /
   library / settings) does NOT use this file and keeps its own
   dark theme until that redesign happens.
   ============================================================ */
/* ============================================================
   DESIGN TOKENS
   Everything below is driven by these. Swapping the brand
   look = changing values here, not hunting through markup.
   ============================================================ */
:root {
  /* -- Colour: paper & ink -- */
  --paper:            #F4F0EA;   /* warm creamy base */
  --paper-raised:     #FCFAEB;   /* soft card fill */
  --paper-white:      #FFFFFF;   /* crispest surface */
  --ink:              #2A2C31;   /* deep charcoal, never pure black */
  --ink-muted:        #787A80;   /* secondary text */
  --rule:             #DDD6CA;   /* hairline borders */

  /* -- Colour: accents --
     One warm neutral island (beige) + the existing sunrise orange.
     The old lemon was within a few points of the beige and read as a
     printing error rather than a second colour, so it's gone. Real
     contrast now comes from solid ultramarine tiles. */
  --blue:             #2221A6;   /* ultramarine — primary */
  --blue-deep:        #191878;   /* hover / pressed */
  --blue-wash:        rgba(34, 33, 166, 0.06);
  --beige:            #EBE2C8;   /* the single warm tonal island */

  /* Sunrise — carried over from the live site. Right for a morning journal. */
  --sunrise:          #E8663C;   /* solid, for text/badges on cream */
  --sunrise-soft:     #FEB47B;
  --sunrise-grad:     linear-gradient(135deg, #FF7E5F 0%, #FEB47B 100%);

  /* -- Type families -- */
  --font-display:     'Fraunces', Georgia, serif;
  --font-body:        'Source Serif 4', Georgia, serif;
  --font-mono:        'Courier Prime', ui-monospace, monospace;

  /* Micro-type: eyebrows, trust strip, attributions, captions, step numbers,
     badges. One token set so the whole family of small labels moves together. */
  --micro-family:     'Source Serif 4', Georgia, serif;
  --micro-style:      normal;
  --micro-case:       uppercase;
  --micro-track:      0.12em;
  --micro-weight:     600;

  /* -- Type scale -- */
  --size-display:     clamp(2.75rem, 6.5vw, 4.5rem);   /* 44 → 72 */
  --size-h2:          clamp(2rem, 4vw, 3rem);          /* 32 → 48 */
  --size-h3:          clamp(1.375rem, 2.2vw, 1.75rem); /* 22 → 28 */
  --size-lead:        clamp(1.0625rem, 1.4vw, 1.25rem);
  --size-body:        1.0625rem;  /* 17px — serif body needs a touch more than sans */
  --size-label:       0.8125rem;

  /* -- Space -- */
  --section-gap:      clamp(72px, 11vw, 120px);
  --gutter:           24px;
  --margin-page:      clamp(20px, 5vw, 64px);
  --container:        1240px;

  /* -- Shape -- */
  --radius:           8px;
  --radius-lg:        24px;

  /* -- Hero artwork -- */
  --sbw:              0px;    /* scrollbar width; set from JS so the bleed is exact */
  --hero-shade-img:   url("/assets/hero-journal-2-shadow.webp");
  --hero-shade:       0;      /* 0 = no shadow, 1 = as shot */
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Paper grain — the "tactile, not flat-digital" layer. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.22'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.018em;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }
img, svg { max-width: 100%; }

a { color: inherit; text-decoration: none; }

::selection { background: var(--blue); color: var(--paper); }

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

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--margin-page);
}

/* ============================================================
   SHARED COMPONENTS
   ============================================================ */

/* Section eyebrow */
.eyebrow {
  font-family: var(--micro-family);
  font-style: var(--micro-style);
  font-weight: var(--micro-weight);
  font-size: var(--size-label);
  text-transform: var(--micro-case);
  letter-spacing: var(--micro-track);
  color: var(--blue);
  display: inline-block;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  /* Elegant lift, not aggressive scale (per style guide) */
  transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary { background: var(--blue); color: var(--paper-raised); }
.btn-primary:hover { background: var(--blue-deep); }

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

/* Dappled leaf light — the tactile overlay from the mockup */
.dapple {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(ellipse 38% 30% at 14% 22%, rgba(42,44,49,0.055), transparent 65%),
    radial-gradient(ellipse 30% 42% at 6% 58%, rgba(42,44,49,0.045), transparent 70%),
    radial-gradient(ellipse 26% 22% at 30% 8%,  rgba(42,44,49,0.035), transparent 70%),
    radial-gradient(ellipse 34% 26% at 88% 78%, rgba(42,44,49,0.03),  transparent 70%);
}

section { position: relative; z-index: 2; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.nav.scrolled {
  background: rgba(244, 240, 234, 0.88);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--rule);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 22px;
}
.wordmark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--blue);
  letter-spacing: -0.02em;
}
.wordmark em { font-style: italic; }

.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-links a {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.nav-links a:hover { color: var(--blue); border-bottom-color: var(--blue); }

.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-links { display: none; }
}
/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--beige);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: relative;
  z-index: 2;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
  align-items: flex-start;
  padding-block: clamp(48px, 7vw, 88px);
}
.footer .wordmark { color: var(--blue); display: block; margin-bottom: 12px; }
.footer-copy { font-size: 0.875rem; color: var(--ink-muted); max-width: 30ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px 32px; }
.footer-links a {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  transition: color 0.25s ease;
}
.footer-links a:hover { color: var(--blue); }

/* ============================================================
   SECTION HEADINGS
   ============================================================ */
.section-head { text-align: center; margin-bottom: 56px; }
.section-head h2 { font-size: var(--size-h2); margin-block: 14px 16px; }
.section-head p { color: var(--ink-muted); max-width: 54ch; margin-inline: auto; }

/* ============================================================
   ARTICLE / PROSE — about, privacy, terms, blog posts
   ============================================================ */
.page-head {
  padding-block: clamp(48px, 8vw, 96px) clamp(24px, 4vw, 40px);
}
.page-head h1 {
  font-size: var(--size-display);
  color: var(--blue);
  margin-block: 16px 20px;
}
.page-head .lede {
  font-size: var(--size-lead);
  color: var(--ink-muted);
  max-width: 60ch;
  line-height: 1.6;
}

.prose {
  max-width: 68ch;
  padding-bottom: var(--section-gap);
}
.prose > * + * { margin-top: 1.25em; }
.prose h2 {
  font-size: var(--size-h2);
  margin-top: 1.8em;
  margin-bottom: 0.55em;
}
.prose h3 {
  font-size: var(--size-h3);
  margin-top: 1.6em;
  margin-bottom: 0.4em;
}
.prose p,
.prose li { color: var(--ink-muted); line-height: 1.75; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.25s ease;
}
.prose a:hover { color: var(--blue-deep); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.5em; }
.prose blockquote {
  border-left: 2px solid var(--blue);
  padding-left: 20px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--size-lead);
  color: var(--ink);
}
.prose hr { border: 0; border-top: 1px solid var(--rule); margin-block: 2.5em; }
.prose img { border-radius: var(--radius); }

/* Pull-out note, e.g. the callout on /about */
.callout {
  background: color-mix(in srgb, var(--beige) 55%, transparent);
  border: 1px solid var(--beige);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 36px);
}
.callout p { color: var(--ink); }

/* Byline / meta line under a page title */
.meta {
  font-family: var(--micro-family);
  font-style: var(--micro-style);
  font-weight: var(--micro-weight);
  font-size: 0.8125rem;
  text-transform: var(--micro-case);
  letter-spacing: var(--micro-track);
  color: var(--ink-muted);
}

/* ============================================================
   ARTICLE OPENER ARTWORK — landers and blog posts
   ============================================================
   The dark builds ran text over the painting behind a near-black
   scrim. On cream that inverts badly, so the painting becomes a
   full-bleed band beneath the title instead: still the first thing
   you see, but the type stays on paper where it's readable.
   ============================================================ */
.article-art {
  position: relative;
  width: calc(100vw - var(--sbw));
  margin-left: calc(-1 * (max((100vw - var(--sbw) - var(--container)) / 2, 0px) + var(--margin-page)));
  margin-bottom: clamp(40px, 6vw, 72px);
  overflow: hidden;
}
.article-art img {
  display: block;
  width: 100%;
  height: clamp(220px, 34vw, 420px);
  object-fit: cover;
}
/* Dissolve the bottom edge into the paper so it reads as printed-in
   rather than a photo dropped on the page. */
.article-art::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(to bottom, transparent, var(--paper));
  pointer-events: none;
}
.article-art figcaption {
  position: absolute;
  right: var(--margin-page);
  bottom: 12px;
  z-index: 1;
  font-family: var(--micro-family);
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

@media (max-width: 900px) {
  .article-art {
    width: calc(100vw - var(--sbw));
    margin-inline: calc(-1 * var(--margin-page));
  }
}

/* ============================================================
   POST CARDS — blog index and "continue reading"
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gutter);
  padding-bottom: var(--section-gap);
}
.card-grid.narrow { max-width: 720px; }

.post-card {
  display: block;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.post-card:hover { transform: translateY(-3px); border-color: var(--blue); }
.post-card .thumb { height: 168px; overflow: hidden; }
.post-card .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}
.post-card:hover .thumb img { transform: scale(1.05); }
.post-card .card-body { padding: 18px 20px 22px; }
.post-card .kicker {
  font-family: var(--micro-family);
  font-style: var(--micro-style);
  font-weight: var(--micro-weight);
  font-size: 0.6875rem;
  text-transform: var(--micro-case);
  letter-spacing: var(--micro-track);
  color: var(--blue);
}
.post-card h3 {
  font-size: 1.0625rem;
  line-height: 1.28;
  margin-top: 8px;
  color: var(--ink);
}
.post-card p {
  margin-top: 8px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

/* "Continue reading" style heading */
.strap {
  font-family: var(--micro-family);
  font-style: var(--micro-style);
  font-weight: var(--micro-weight);
  font-size: 0.8125rem;
  text-transform: var(--micro-case);
  letter-spacing: var(--micro-track);
  color: var(--ink-muted);
  margin-bottom: 24px;
}

/* ============================================================
   FEATURED POST + CTA BAND — blog index
   ============================================================ */
.featured-card {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: clamp(48px, 7vw, 80px);
  transition: border-color 0.3s ease;
}
@media (min-width: 820px) { .featured-card { grid-template-columns: 1fr 1fr; } }
.featured-card:hover { border-color: var(--blue); }
.featured-card .thumb { overflow: hidden; min-height: 260px; }
.featured-card .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}
.featured-card:hover .thumb img { transform: scale(1.04); }
.featured-card .card-body {
  padding: clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.featured-card h2 {
  font-size: var(--size-h3);
  margin-block: 12px 14px;
}
.featured-card p { color: var(--ink-muted); margin-bottom: 18px; }

/* Closing call to action */
.cta-band {
  text-align: center;
  max-width: 620px;
  margin-inline: auto;
  padding-bottom: var(--section-gap);
}
.cta-band h2 { font-size: var(--size-h2); margin-block: 14px 14px; }
.cta-band p { color: var(--ink-muted); margin-bottom: 30px; }

/* ============================================================
   AUTH MODAL
   ============================================================
   Class names (.picker-overlay / .picker-sheet / .google-sign-in-btn)
   and every #auth* id are inherited from the live homepage — the auth
   module script binds to them, so they are kept exactly and only
   restyled. Do not rename without updating that script.
   ============================================================ */
.picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 44, 49, 0.5);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.picker-overlay.open { display: flex; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.picker-sheet {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 36px);
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  animation: sheetIn 0.3s ease;
}
@keyframes sheetIn { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

.auth-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.auth-head h3 { font-size: var(--size-h3); color: var(--blue); }
#authClose {
  background: none;
  border: none;
  color: var(--ink-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.25s ease;
}
#authClose:hover { color: var(--ink); }

.google-sign-in-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 13px 20px;
  background: var(--paper-white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.google-sign-in-btn:hover { border-color: var(--blue); transform: translateY(-1px); }

.auth-or {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-block: 20px;
  font-family: var(--micro-family);
  font-size: 0.75rem;
  color: var(--ink-muted);
}
.auth-or::before,
.auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }

.auth-field { display: block; margin-bottom: 14px; }
.auth-field span {
  display: block;
  font-family: var(--micro-family);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.auth-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--paper-white);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.2s ease;
}
.auth-field input:focus { border-color: var(--blue); }

.auth-alt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.auth-alt button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--ink-muted);
  transition: color 0.25s ease;
}
.auth-alt button:hover { color: var(--blue); }
.auth-alt button span { color: var(--blue); font-weight: 600; }

#authError, #authSuccess {
  font-size: 0.875rem;
  margin-top: 14px;
  display: none;
}
#authError { color: #B3261E; }
#authSuccess { color: #1B6B4A; }

/* ============================================================
   PRICING
   ============================================================ */

.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gutter);
  max-width: 780px;
  margin-inline: auto;
  padding-bottom: var(--section-gap);
}
.price-card {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 40px 34px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.price-card.featured { border-color: var(--blue); background: var(--paper-white); }
.price-card h3 { font-size: 1.5rem; }
.price-note { font-size: 0.875rem; color: var(--ink-muted); margin-top: 6px; }
.price-card.featured .price-note { color: var(--sunrise); }

.price-value {
  font-family: var(--font-display);
  font-size: 3.25rem;
  line-height: 1;
  margin-block: 26px 30px;
}
.price-value span {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.price-features { list-style: none; margin: 0 0 34px; padding: 0; display: grid; gap: 14px; }
.price-features li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}
.price-features svg { flex-shrink: 0; margin-top: 5px; color: var(--blue); }

.price-card .btn { margin-top: auto; width: 100%; }

.badge-save {
  position: absolute;
  top: -12px;
  right: 26px;
  background: var(--sunrise);
  color: #fff;
  font-family: var(--micro-family);
  font-weight: var(--micro-weight);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: 99px;
}
