/* ============================================================
   Road to 40 — Olusegun Alabi
   Design tokens 1:1 from Figma "Road to Forty LP",
   layered with a world-class interaction system.
   ============================================================ */
:root {
  --mint:   #eff8f7;
  --ink:    #152e35;
  --green:  #228e7a;
  --green-2:#2fb097;
  --tint:   rgba(34, 142, 122, 0.05);
  --line:   rgba(21, 46, 53, 0.12);
  --shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 30px 60px -20px rgba(21, 46, 53, 0.35);
  --gutter: 100px;
  --maxw:   1440px;
  --serif:  "Cormorant Garamond", Georgia, serif;
  --sans:   "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--mint);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--green); color: var(--mint); }

/* subtle ambient background wash */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vw 60vw at 85% -10%, rgba(34,142,122,0.08), transparent 60%),
    radial-gradient(50vw 50vw at -10% 20%, rgba(34,142,122,0.05), transparent 60%);
}

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

/* ---------- reading progress ---------- */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--green), var(--green-2));
  z-index: 120; transition: width 0.1s linear;
}

/* ---------- sticky nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 110;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gutter);
  transition: padding .35s var(--ease), background .35s var(--ease),
              box-shadow .35s var(--ease), backdrop-filter .35s var(--ease);
}
.nav.scrolled {
  padding: 12px var(--gutter);
  background: rgba(239, 248, 247, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  box-shadow: 0 1px 0 var(--line);
}
.nav .brand {
  font-weight: 700; font-size: 14px; letter-spacing: 2.8px;
  text-transform: uppercase; color: var(--green); text-decoration: none;
}
.nav .links { display: flex; gap: 30px; align-items: center; }
.nav .links a {
  font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  text-decoration: none; opacity: .7; position: relative; transition: opacity .2s;
}
.nav .links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1.5px; width: 0;
  background: var(--green); transition: width .3s var(--ease);
}
.nav .links a:hover { opacity: 1; }
.nav .links a:hover::after { width: 100%; }
.nav .nav-cta {
  opacity: 0; transform: translateX(8px) scale(.96); pointer-events: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.nav.scrolled .nav-cta { opacity: 1; transform: none; pointer-events: auto; }
.nav-toggle { display: none; }

/* ---------- kicker / headings ---------- */
.kicker {
  font-weight: 500; font-size: 12px; letter-spacing: 2.4px;
  text-transform: uppercase; opacity: .7;
}
.kicker.green { color: var(--green); opacity: 1; }
h2.title {
  font-family: var(--serif); font-weight: 700; font-size: 44px;
  line-height: 1.02; letter-spacing: -1.76px;
}

/* ---------- buttons ---------- */
.btn {
  --bg: var(--ink);
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 20px 28px; min-width: 240px; border: none; cursor: pointer;
  font-family: var(--sans); font-weight: 500; font-size: 12px;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--mint);
  background: var(--bg); text-decoration: none;
  transition: transform .18s var(--ease), box-shadow .25s var(--ease), background .25s;
  will-change: transform;
}
.btn::after { /* sheen */
  content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-18deg); transition: left .6s var(--ease);
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -12px rgba(21,46,53,.5); }
.btn:hover::after { left: 130%; }
.btn:active { transform: translateY(-1px); }
.btn:disabled { opacity: .65; cursor: progress; transform: none; }
.btn.green { --bg: var(--green); }
.btn.green:hover { box-shadow: 0 16px 30px -12px rgba(34,142,122,.6); }
.btn.small { min-width: 0; padding: 12px 18px; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(21,46,53,.25); }
.btn.block { width: 100%; }

.price { display: inline-flex; gap: 10px; align-items: center; font-size: 16px; }
.price .amt { font-style: italic; font-weight: 500; }
.price .fmt { opacity: .7; }

/* ---------- section rhythm + reveal ---------- */
section { padding: 96px 0; position: relative; }
.section-head { display: flex; flex-direction: column; gap: 20px; max-width: 620px; margin-bottom: 44px; }

[data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  will-change: opacity, transform;
}
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal][data-reveal="left"] { transform: translateX(-30px); }
[data-reveal][data-reveal="right"] { transform: translateX(30px); }
[data-reveal].in { transform: none; }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center;
  padding-top: 172px; padding-bottom: 96px; min-height: 92vh;
}
.hero .copy { display: flex; flex-direction: column; gap: 34px; max-width: 460px; }
.hero .headline { display: flex; flex-direction: column; gap: 22px; }
.hero h1 {
  font-family: var(--serif); font-weight: 700; letter-spacing: -4.8px;
  line-height: 0.82; font-size: 150px;
}
.hero h1 .forty {
  background: linear-gradient(120deg, var(--green), var(--green-2) 60%, var(--green));
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: -7.2px; font-size: 190px;
  animation: shimmer 6s ease-in-out infinite;
}
@keyframes shimmer { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.hero .tagline { font-style: italic; font-size: 17px; opacity: .75; line-height: 1.45; }
.hero .qty-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.hero .trust { display: flex; gap: 18px; align-items: center; font-size: 12.5px; opacity: .6; }
.hero .trust span { display: inline-flex; align-items: center; gap: 6px; }
.hero .trust svg { width: 15px; height: 15px; stroke: var(--green); }

/* animated hero entrance */
.hero .anim { opacity: 0; transform: translateY(24px); animation: rise .9s var(--ease) forwards; }
.hero .anim.d1 { animation-delay: .05s; }
.hero .anim.d2 { animation-delay: .18s; }
.hero .anim.d3 { animation-delay: .32s; }
.hero .anim.d4 { animation-delay: .46s; }
.hero .anim.d5 { animation-delay: .6s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* cover with 3D tilt */
.cover-stage { perspective: 1200px; display: flex; justify-content: center; }
.cover-tilt {
  position: relative; transform-style: preserve-3d;
  transition: transform .2s var(--ease);
  animation: float 7s ease-in-out infinite;
}
.cover-tilt img { width: 100%; max-width: 640px; border-radius: 4px; box-shadow: var(--shadow-lg); }
.cover-tilt .glow {
  position: absolute; inset: 8% 6% -6% 6%; z-index: -1; filter: blur(50px);
  background: radial-gradient(closest-side, rgba(34,142,122,.4), transparent);
  opacity: .7;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ---------- countdown ---------- */
.countdown { background: var(--ink); color: var(--mint); text-align: center; padding: 84px 0; overflow: hidden; }
.countdown h2 { color: var(--mint); }
.countdown .kicker { color: var(--green-2); opacity: 1; }
.cd-grid { display: inline-flex; gap: 18px; margin-top: 34px; flex-wrap: wrap; justify-content: center; }
.cd-cell {
  min-width: 108px; padding: 22px 10px; border-radius: 10px;
  background: rgba(239,248,247,0.05); box-shadow: inset 0 0 0 1px rgba(239,248,247,0.08);
}
.cd-num { font-family: var(--serif); font-weight: 700; font-size: 60px; line-height: 1; color: var(--mint); font-variant-numeric: tabular-nums; }
.cd-lab { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; opacity: .6; margin-top: 8px; }
.countdown .live { margin-top: 26px; font-size: 13px; opacity: .7; }
.countdown .live b { color: var(--green-2); }

/* ---------- stats strip ---------- */
.stats { padding: 70px 0; }
.stats .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; text-align: center; }
.stat .n { font-family: var(--serif); font-weight: 700; font-size: 72px; line-height: 1; color: var(--green); font-variant-numeric: tabular-nums; }
.stat .l { font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; opacity: .7; margin-top: 10px; }

/* ---------- why-read ---------- */
.why .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; max-width: 1240px; }
.why p.body { opacity: .75; line-height: 1.7; }

/* ---------- TOC ---------- */
.toc { background: var(--tint); }
.toc .list { position: relative; margin-top: 12px; padding-left: 25px; }
.toc .list::before {
  content: ""; position: absolute; left: 25px; top: 30px; bottom: 30px; width: 1.5px;
  background: linear-gradient(var(--green), rgba(34,142,122,.15));
}
.toc .item {
  display: flex; align-items: center; gap: 22px; padding: 22px 18px; border-radius: 12px;
  transition: background .3s var(--ease), transform .3s var(--ease);
}
.toc .item:hover { background: rgba(255,255,255,.6); transform: translateX(6px); }
.toc .num {
  flex: 0 0 50px; width: 50px; height: 50px; border-radius: 50%;
  background: var(--mint); box-shadow: inset 0 0 0 1px rgba(34,142,122,.4);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 500; font-size: 30px; color: var(--green);
  transition: background .3s var(--ease), color .3s var(--ease), box-shadow .3s;
}
.toc .item:hover .num { background: var(--green); color: var(--mint); box-shadow: 0 10px 20px -8px rgba(34,142,122,.7); }
.toc .chap { font-family: var(--serif); font-weight: 500; font-size: 32px; letter-spacing: -1.28px; line-height: 1; }

/* ---------- excerpt ---------- */
.excerpt .chap-label { font-style: italic; font-size: 12px; opacity: .7; margin-top: 8px; }
.excerpt .paper {
  max-width: 940px; margin-top: 24px; background: #fff; border-radius: 14px;
  padding: 44px 48px; box-shadow: var(--shadow); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 24px;
}
.excerpt .paper p { opacity: .78; line-height: 1.75; }

/* ---------- pull quote ---------- */
.pullquote { background: var(--tint); text-align: center; }
.pullquote .inner { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 40px; align-items: center; }
.pullquote .mark { font-family: var(--serif); font-size: 130px; line-height: 0; height: 42px; color: var(--green); }
.pullquote blockquote { font-family: var(--serif); font-weight: 600; font-style: italic; font-size: 46px; line-height: 1.22; }
.pullquote cite { font-style: normal; }

/* ---------- author ---------- */
.author-sec .grid { display: grid; grid-template-columns: 505px 1fr; gap: 70px; align-items: center; }
.author-sec .photo-wrap { border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-lg); background: #fff; aspect-ratio: 505/520; }
.author-sec .photo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.author-sec .bio { max-width: 620px; }
.author-sec .bio p { opacity: .75; margin-top: 20px; line-height: 1.7; }

/* ---------- available now (dark CTA) ---------- */
.cta { background: var(--ink); color: var(--mint); text-align: center; overflow: hidden; }
.cta::before {
  content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background: radial-gradient(40vw 40vw at 50% 0%, rgba(34,142,122,.25), transparent 60%);
}
.cta h2 { color: var(--mint); }
.cta .cover { width: 355px; margin: 40px auto; filter: drop-shadow(var(--shadow-lg)); border-radius: 4px; }
.cta .buy { display: inline-flex; flex-direction: column; gap: 20px; align-items: center; }
.cta .price { color: var(--mint); }
.cta .mini-cd { margin-top: 8px; font-size: 13px; opacity: .7; }
.cta .mini-cd b { color: var(--green-2); font-variant-numeric: tabular-nums; }

/* ---------- footer ---------- */
footer.site {
  display: flex; justify-content: space-between; align-items: center;
  padding: 40px 0; opacity: .7;
}
footer.site .copy, footer.site .mark {
  font-weight: 500; font-size: 12px; letter-spacing: 2.4px; text-transform: uppercase;
}
footer.site .copy { display: inline-flex; align-items: center; gap: 10px; }

/* ---------- quantity stepper ---------- */
.qty { display: inline-flex; align-items: center; border: 1px solid rgba(21,46,53,.2); height: 57px; border-radius: 6px; overflow: hidden; }
.qty button { width: 46px; height: 100%; background: none; border: none; cursor: pointer; font-size: 20px; color: var(--ink); transition: background .2s; }
.qty button:hover { background: var(--tint); }
.qty input {
  width: 50px; height: 100%; text-align: center; border: none;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  font-family: var(--sans); font-size: 16px; background: none; color: var(--ink); -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- sticky mobile CTA ---------- */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  display: none; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: rgba(239,248,247,.9); backdrop-filter: blur(12px);
  box-shadow: 0 -1px 0 var(--line); transform: translateY(120%); transition: transform .4s var(--ease);
}
.mobile-bar.show { transform: none; }
.mobile-bar .price { font-size: 15px; }
.mobile-bar .btn { min-width: 0; flex: 1; padding: 15px 18px; }

/* ---------- back to top ---------- */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 100;
  width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--ink); color: var(--mint); display: grid; place-items: center;
  opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease), background .2s;
  box-shadow: var(--shadow-lg);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--green); }
.to-top svg { width: 20px; height: 20px; stroke: currentColor; }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 84px; right: 24px; z-index: 130; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--ink); color: var(--mint); padding: 14px 18px; border-radius: 10px;
  font-size: 14px; box-shadow: var(--shadow-lg); max-width: 320px;
  transform: translateX(120%); opacity: 0; transition: transform .4s var(--ease), opacity .4s var(--ease);
}
.toast.show { transform: none; opacity: 1; }
.toast.err { background: #7d2b2b; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  :root { --gutter: 48px; }
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 132px; min-height: 0; }
  .cover-stage { order: -1; }
  .hero h1 { font-size: 104px; }
  .hero h1 .forty { font-size: 128px; }
  .why .cols { grid-template-columns: 1fr; }
  .author-sec .grid { grid-template-columns: 1fr; gap: 32px; }
  .nav .links { display: none; }
  .stats .row { grid-template-columns: 1fr; gap: 34px; }
}
@media (max-width: 640px) {
  :root { --gutter: 20px; }
  body { font-size: 15px; }
  section { padding: 64px 0; }
  .nav { padding: 16px var(--gutter); }
  .hero h1 { font-size: 74px; letter-spacing: -3px; }
  .hero h1 .forty { font-size: 92px; letter-spacing: -4px; }
  h2.title, .pullquote blockquote { font-size: 30px; }
  .toc .chap { font-size: 23px; }
  .toc .num { flex-basis: 44px; width: 44px; height: 44px; font-size: 24px; }
  .cd-num { font-size: 42px; } .cd-cell { min-width: 74px; padding: 16px 6px; }
  .stat .n { font-size: 56px; }
  .btn { min-width: 0; width: 100%; }
  .hero .qty-row { flex-direction: column; align-items: stretch; }
  .excerpt .paper { padding: 28px 22px; }
  footer.site { flex-direction: column; gap: 12px; text-align: center; }
  .mobile-bar { display: flex; }
  .to-top { display: none; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .cover-tilt { animation: none; }
}
