/* Life Apples – site styles. Colours and fonts match the ebook and cover. */
@font-face { font-family: 'Crimson Pro'; src: url('../fonts/CrimsonPro-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Crimson Pro'; src: url('../fonts/CrimsonPro-Italic.ttf') format('truetype'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Crimson Pro'; src: url('../fonts/CrimsonPro-SemiBold.ttf') format('truetype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('../fonts/Montserrat-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('../fonts/Montserrat-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('../fonts/Montserrat-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --paper: #f7f3ec;
  --paper-2: #efe8dc;
  --white: #fffdf9;
  --ink: #1d1d1b;
  --grey: #6b6660;
  --line: #e2d9ca;
  --red: #b22222;
  --red-dark: #8f1b1b;
  --green: #4c9a2a;
  --serif: 'Crimson Pro', Georgia, 'Times New Roman', serif;
  --sans: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  --radius: 10px;
  --wrap: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 1.25rem; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red-dark); }
h1, h2, h3 { font-family: var(--sans); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 4.4vw, 3.3rem); }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
h3 { font-size: 1.2rem; }
h1 em, h2 em { font-family: var(--serif); font-weight: 400; font-style: italic; color: var(--red); }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--grey); }
.small { font-size: .95rem; }
.lead { font-size: 1.4rem; color: #3b3935; }
.eyebrow { font-family: var(--sans); font-size: .78rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--red); margin-bottom: .8em; }
.eyebrow a { color: inherit; text-decoration: none; }
.sr-only, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; }
.todo { background: #fff4c2; border-left: 4px solid #e0b100; padding: 12px 16px; font-family: var(--sans); font-size: .95rem; }

/* Buttons */
.btn { display: inline-block; font-family: var(--sans); font-weight: 600; font-size: 1rem; background: var(--red); color: #fff; border: 2px solid var(--red); border-radius: 999px; padding: 14px 26px; text-decoration: none; cursor: pointer; transition: background .15s, transform .15s; white-space: nowrap; }
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; transform: translateY(-1px); }
.btn-small { padding: 8px 18px; font-size: .88rem; }
.btn-ghost { background: transparent; color: var(--red); }
.btn-ghost:hover { background: var(--red); color: #fff; }
.btn-light { background: #fff; color: var(--red); border-color: #fff; }
.btn-light:hover { background: var(--paper); border-color: var(--paper); color: var(--red-dark); }
.link-arrow { font-family: var(--sans); font-weight: 600; font-size: .95rem; text-decoration: none; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: rgba(247, 243, 236, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--sans); font-weight: 700; letter-spacing: .2em; text-transform: uppercase; font-size: .95rem; }
.logo:hover { color: var(--ink); }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.btn) { font-family: var(--sans); font-weight: 500; font-size: .95rem; color: var(--ink); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"] { border-color: var(--red); }
.menu-toggle { display: none; font-family: var(--sans); font-weight: 600; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: .9rem; color: var(--ink); cursor: pointer; }

/* Hero */
.hero { padding: 64px 0 40px; background: radial-gradient(ellipse at 75% 40%, #fffdf8 0%, var(--paper) 60%); }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero-img img { width: 100%; transform: scale(1.12); mix-blend-mode: multiply; -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%); }
.hero-optin { margin-top: 28px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; box-shadow: 0 10px 30px -18px rgba(60, 40, 20, .35); }
.hero-optin-title { margin-bottom: 12px; font-size: 1.15rem; }

/* Opt-in form */
.optin-fields { display: flex; gap: 10px; flex-wrap: wrap; }
.optin input[type="text"], .optin input[type="email"] { flex: 1 1 160px; min-width: 0; font-family: var(--sans); font-size: 1rem; padding: 13px 16px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); }
.optin input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(178, 34, 34, .15); }
.optin input.invalid { border-color: var(--red); }
.optin .btn { flex: 0 0 auto; }
.optin-note { font-family: var(--sans); font-size: .78rem; color: var(--grey); margin: 10px 0 0; }
.optin-note a { color: var(--grey); }
.optin-msg { font-family: var(--sans); font-size: .95rem; font-weight: 600; margin: 8px 0 0; color: var(--green); }
.optin-msg:empty { display: none; }
.optin-msg.error { color: var(--red); }
.optin.done .optin-fields { display: none; }

/* Names strip */
.names { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--white); padding: 18px 0; text-align: center; }
.names p { margin: 0; font-family: var(--sans); font-size: .92rem; font-weight: 500; line-height: 1.9; }
.names .dot { color: var(--red); margin: 0 4px; }

/* Quote of the day */
.quote-of-day { padding: 80px 0 40px; }
.quote-of-day .eyebrow { text-align: center; }
.quote-of-day figure { margin: 0; text-align: center; }
.quote-of-day blockquote { margin: 0 0 18px; font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.3; font-style: italic; }
.quote-of-day figcaption { font-family: var(--sans); font-weight: 600; font-size: 1rem; }
.quote-of-day figcaption a { color: var(--ink); text-decoration: none; }

/* Sections */
.section { padding: 64px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.center-head { display: block; text-align: center; max-width: 720px; margin: 0 auto 40px; }
.center-head h2 { margin-bottom: .4em; }

/* Cards */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -20px rgba(60, 40, 20, .45); }
.card-img img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; border-bottom: 1px solid var(--line); }
.card-body { padding: 20px 22px 18px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { margin-bottom: .5em; }
.card-body h3 a { color: var(--ink); text-decoration: none; }
.card-body h3 a:hover { color: var(--red); }
.card-quote { font-style: italic; color: #3b3935; flex: 1; }
.card .eyebrow { margin-bottom: .4em; }

/* Habits */
.habits { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.habit-grid { list-style: none; padding: 0; margin: 0 0 40px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.habit-grid li { display: grid; grid-template-columns: 34px 1fr; column-gap: 14px; align-items: center; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.habit-grid .apple { grid-row: span 2; }
.habit-month { font-family: var(--sans); font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--grey); }
.habit-name { font-size: 1.1rem; line-height: 1.25; }

/* About teaser */
.about-inner { display: grid; grid-template-columns: 320px 1fr; gap: 56px; align-items: center; }
.about-inner img, .about-page img { border-radius: 50%; border: 6px solid var(--white); box-shadow: 0 0 0 1px var(--line); background: #fff; }

/* YouTube band */
.yt-band { background: var(--red); color: #fff; padding: 48px 0; }
.yt-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.yt-band h2 { margin-bottom: .2em; }
.yt-band p { margin: 0; opacity: .92; }

/* Final CTA */
.final-cta { padding: 80px 0; }
.final-cta .optin { max-width: 620px; margin: 24px auto 0; text-align: left; }
.final-cta .optin-note { text-align: center; }

/* Page head */
.page-head { padding: 64px 0 8px; }
.page-head h1 { margin-bottom: .3em; }

/* Post */
.post-head { padding: 56px 0 24px; text-align: center; }
.post-head .narrow { margin: 0 auto; }
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; align-items: start; padding-bottom: 40px; }
.post-body { max-width: 720px; }
.post-img { border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 32px; width: 100%; }
.lesson { margin: 40px 0; }
.lesson h2 { margin: 0 0 12px; }
.num { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: #fff; font-size: 1.05rem; }
.lesson blockquote, .prose blockquote { margin: 0 0 16px; padding: 4px 0 4px 22px; border-left: 3px solid var(--red); font-size: 1.6rem; line-height: 1.35; font-style: italic; }
.lesson cite { display: block; margin-top: 8px; font-family: var(--sans); font-style: normal; font-weight: 600; font-size: .9rem; color: var(--grey); }
.outro { font-size: 1.35rem; font-weight: 600; border-top: 1px solid var(--line); padding-top: 28px; }
.video-box { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin: 32px 0; }
.video-box p { margin: 0; }
.inline-optin { background: var(--paper-2); border-radius: 16px; padding: 28px; margin-top: 32px; }
.post-side { position: sticky; top: 96px; }
.side-box { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.side-box img { margin: -6px auto 6px; mix-blend-mode: multiply; -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%); }
.side-box h3 { font-size: 1.1rem; margin-bottom: .3em; }
.side-box p { font-size: 1.05rem; }
.side-box .optin-fields { flex-direction: column; }
.side-box .optin input { flex: none; width: 100%; }
.side-box .btn { width: 100%; }
.more { background: var(--white); border-top: 1px solid var(--line); }

/* About page */
.about-page { display: grid; grid-template-columns: 300px 1fr; gap: 56px; align-items: start; }
.prose { max-width: 720px; }
.sign { font-style: italic; font-size: 1.4rem; }
.about-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* Footer */
.site-footer { background: var(--ink); color: #d8d2c8; padding: 48px 0 24px; margin-top: 0; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.site-footer .logo { color: #fff; }
.site-footer .muted { color: #a59e94; margin-top: 10px; }
.footer-nav { display: flex; flex-direction: column; gap: 8px; }
.footer-nav a { color: #d8d2c8; font-family: var(--sans); font-size: .92rem; text-decoration: none; }
.footer-nav a:hover { color: #fff; }
.copyright { font-family: var(--sans); font-size: .8rem; color: #8a837a; border-top: 1px solid #34332f; margin-top: 32px; padding-top: 18px; }

/* Responsive */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 8px; }
  .hero-img { order: -1; max-width: 460px; margin: 0 auto; }
  .hero-img img { transform: none; }
  .habit-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .post-layout { grid-template-columns: 1fr; }
  .post-side { position: static; max-width: 420px; }
}
@media (max-width: 760px) {
  body { font-size: 1.15rem; }
  .wrap { padding: 0 16px; }
  .menu-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 4px; background: var(--paper); border-bottom: 1px solid var(--line); padding: 12px 16px 20px; }
  .site-nav.open { display: flex; }
  .site-nav .btn { margin-top: 8px; }
  .hero { padding: 24px 0 32px; }
  .lead { font-size: 1.2rem; }
  .hero-optin { padding: 18px 16px; }
  .optin-fields { flex-direction: column; }
  .optin input[type="text"], .optin input[type="email"] { flex: none; width: 100%; }
  .optin .btn { width: 100%; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .habit-grid { grid-template-columns: 1fr; }
  .about-inner, .about-page { grid-template-columns: 1fr; gap: 24px; }
  .about-inner img, .about-page img { max-width: 220px; }
  .yt-inner, .video-box { flex-direction: column; align-items: flex-start; }
  .section { padding: 48px 0; }
  .section-head { flex-direction: column; gap: 4px; }
  .footer-inner { grid-template-columns: 1fr; }
  .lesson blockquote { font-size: 1.35rem; }
}

/* ---- v2: logo, 10-quote posts, blog search, legal pages ---- */
.logo-img { width: 40px; height: 40px; object-fit: contain; }
.logo-footer .logo-img { width: 34px; height: 34px; }
.img-fallback { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; aspect-ratio: 16 / 9; width: 100%; background: radial-gradient(ellipse at center, #fffdf8 0%, var(--paper-2) 100%); font-family: var(--sans); font-weight: 700; font-size: 1.3rem; color: var(--ink); text-align: center; }
.img-fallback .logo-img { width: 56px; height: 56px; }
.card-pic { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; border-bottom: 1px solid var(--line); }
.post-img.img-fallback { border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 32px; font-size: 2rem; }
.quote-list { list-style: none; counter-reset: q; padding: 0; margin: 40px 0; }
.quote-list li { counter-increment: q; position: relative; padding: 0 0 0 64px; margin: 0 0 34px; }
.quote-list li::before { content: counter(q); position: absolute; left: 0; top: 2px; width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: #fff; font-family: var(--sans); font-weight: 700; font-size: 1rem; display: flex; align-items: center; justify-content: center; }
.quote-list blockquote { margin: 0; font-size: 1.5rem; line-height: 1.38; font-style: italic; }
.quote-list .note { margin: 10px 0 0; color: #3b3935; }
.takeaway { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: var(--radius); padding: 22px 26px; margin: 8px 0 28px; }
.takeaway p:last-child { margin: 0; font-size: 1.3rem; font-weight: 600; }
.post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.post-nav a { display: flex; flex-direction: column; font-family: var(--sans); font-weight: 600; text-decoration: none; }
.post-nav a.next { text-align: right; }
.post-filter { margin-top: 12px; width: 100%; max-width: 420px; font-family: var(--sans); font-size: 1rem; padding: 13px 18px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); }
.post-filter:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(178, 34, 34, .15); }
.blog-list { padding-top: 32px; }
.legal h2 { font-size: 1.15rem; margin: 1.8em 0 .5em; }
.legal p { font-size: 1.1rem; }
@media (max-width: 760px) {
  .quote-list li { padding-left: 52px; }
  .quote-list li::before { width: 34px; height: 34px; font-size: .9rem; }
  .quote-list blockquote { font-size: 1.3rem; }
}
.card[hidden] { display: none; }

/* ---- v3: numbered habits, ebook sneak peek, non-sticky sidebar ---- */
.habit-grid li { grid-template-columns: 44px 1fr; }
.habit-num { grid-row: span 2; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--white); border: 2px solid var(--red); color: var(--red); font-family: var(--sans); font-weight: 700; font-size: .95rem; }
.peek { margin: 8px 0 40px; }
.peek-pages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; align-items: start; margin-top: 18px; }
.peek-pages figure { margin: 0; }
.peek-pages .page { width: 100%; background: #fff; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 18px 34px -16px rgba(60,40,20,.45); transition: transform .25s; }
.peek-pages figure:nth-child(odd) .page { transform: rotate(-1.6deg); }
.peek-pages figure:nth-child(even) .page { transform: rotate(1.4deg) translateY(10px); }
.peek-pages figure:hover .page { transform: rotate(0) translateY(-6px) scale(1.03); }
.peek-pages figcaption { font-family: var(--sans); font-size: .82rem; color: var(--grey); text-align: center; margin-top: 18px; }
.post-side { position: static; }
.mini-peek { display: flex; justify-content: center; margin: 4px 0 18px; padding: 0 6px; }
.mini-peek .page { width: 31%; background: #fff; border-radius: 3px; box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 10px 18px -10px rgba(60,40,20,.5); }
.mini-peek .page:nth-child(1) { transform: rotate(-6deg) translateX(10px); }
.mini-peek .page:nth-child(2) { transform: translateY(-6px); position: relative; z-index: 1; }
.mini-peek .page:nth-child(3) { transform: rotate(6deg) translateX(-10px); }
@media (max-width: 980px) { .peek-pages { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .peek-pages { gap: 16px; } .peek-pages figure:nth-child(even) .page { transform: rotate(1.4deg); } }
.side-box .mini-peek img { -webkit-mask-image: none; mask-image: none; mix-blend-mode: normal; margin: 0; }
.mini-peek .page { width: 34%; }

/* ---- centered sign-up pages (thank-you, welcome) ---- */
.center-page { text-align: center; padding-top: 56px; }
.center-page .wrap { margin: 0 auto; }
.center-page .logo-img { width: 72px; height: 72px; margin: 0 auto 12px; }
.center-page h1 { margin-bottom: .5em; }
.center-page .welcome-book { width: 100%; max-width: 440px; margin: 0 auto 8px; mix-blend-mode: multiply; -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%); }
.center-page .btn { white-space: normal; margin: 4px 0 12px; }
.center-page .sign { font-style: italic; font-size: 1.4rem; }

/* v4: SEO additions — facts box, topic links, quotes pages */
.post-sub { font-size: 1.25rem; color: #3b3935; margin: 0 auto 10px; max-width: 640px; }
.facts { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 26px; font-size: 1.1rem; }
.facts p { margin: 0 0 8px; }
.facts p:last-child { margin: 0; }
.topic-chips { font-family: var(--sans); font-size: .85rem; line-height: 2.4; }
.topic-chips strong { margin-right: 6px; }
.topic-chips a { display: inline-block; line-height: 1.5; padding: 3px 12px; margin: 0 6px 6px 0; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); text-decoration: none; white-space: nowrap; }
.topic-chips a:hover { border-color: var(--red); color: var(--red); }
.page-head .topic-chips { margin-top: 18px; }
.section .topic-chips.center { margin-top: 28px; }
.takeaway p.topic-chips:last-child { font-size: .85rem; font-weight: 400; }
.list-head { font-size: 1.5rem; margin: 34px 0 0; }
.takeaway h2.eyebrow { font-size: .78rem; margin: 0 0 .8em; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.topic-card { display: flex; flex-direction: column; gap: 4px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: var(--ink); font-family: var(--sans); }
.topic-card:hover { border-color: var(--red); }
.topic-card strong { color: var(--red); }
.az-head { margin: 54px 0 18px; font-size: 1.6rem; }
.az-list { list-style: none; padding: 0; columns: 3 260px; column-gap: 32px; }
.az-list li { break-inside: avoid; margin: 0 0 12px; line-height: 1.3; }
.az-list li span { display: block; }
.topic-quotes blockquote { font-size: 1.35rem; }
