/* ============================================================
   JasBooks Design System v3 — Editorial Finance Aesthetic
   Reference: Mercury Bank, Ramp, Stripe Docs, Monocle, FT Digital
   ============================================================ */

:root {
  /* CORE PALETTE — locked, do not deviate */
  --teal: #0F4C5C;          /* primary anchor */
  --teal-deep: #0A3743;     /* darker teal for dark sections */
  --teal-darker: #062028;   /* near-black teal */
  --teal-tint: #1F5D6E;     /* hover state */
  --ink: #1A2E2E;           /* near-black headline ink */
  --cream: #FAF6F1;         /* warm cream background */
  --cream-warm: #F2EBE0;    /* slightly deeper cream */
  --cream-deeper: #EBE2D2;  /* darker cream for section variation */
  --terracotta: #C84B31;    /* accent — emphasis only */
  --terracotta-deep: #A53A23;
  --gold: #C9A96E;          /* tertiary accent — ribbons, labels */
  --gold-soft: #E5D4A8;     /* gold tint backgrounds */
  --forest: #2E7D5B;        /* success state — never kelly green */
  --gray: #6B7280;          /* body text muted */
  --gray-soft: #9AA0A6;     /* captions */
  --rule: #E5DFD6;          /* warm rule lines */

  /* TYPOGRAPHY */
  --serif: 'Fraunces', 'Source Serif 4', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* SCALE */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* SHADOWS — soft, warm, editorial */
  --shadow-xs: 0 1px 2px rgba(26,46,46,0.04);
  --shadow-sm: 0 2px 8px rgba(26,46,46,0.05);
  --shadow: 0 8px 24px rgba(26,46,46,0.06), 0 2px 6px rgba(26,46,46,0.04);
  --shadow-lg: 0 24px 48px rgba(26,46,46,0.10), 0 8px 16px rgba(26,46,46,0.06);
  --shadow-xl: 0 40px 80px rgba(26,46,46,0.16), 0 16px 32px rgba(26,46,46,0.08);

  /* ANIMATION TIMINGS */
  --t-fast: 150ms;
  --t: 240ms;
  --t-slow: 400ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1); /* gentle out-quart */
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

/* RESET */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  font-size: 17px; line-height: 1.62;
  font-weight: 400;
  letter-spacing: -0.005em;
  overflow-x: hidden;
}
img, svg { display:block; max-width:100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 2px; border-radius: 4px; }

/* PAPER TEXTURE OVERLAY — subtle warmth on cream sections */
.paper-texture {
  position: relative;
}
.paper-texture::before {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 320 320' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.51 0 0 0 0 0.42 0 0 0 0 0.31 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.15'/%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 0;
}
.paper-texture > * { position: relative; z-index: 1; }

/* TYPOGRAPHY UTILITIES */
.serif { font-family: var(--serif); font-weight: 800; letter-spacing: -0.025em; }
.serif-italic { font-family: var(--serif); font-weight: 800; font-style: italic; letter-spacing: -0.02em; }
.eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow-light { color: var(--gold-soft); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 800; letter-spacing: -0.025em; line-height: 1.05; color: var(--ink); }
h1 { font-size: clamp(48px, 8vw, 92px); line-height: 0.98; letter-spacing: -0.04em; }
h2 { font-size: clamp(36px, 5.5vw, 64px); line-height: 1.04; letter-spacing: -0.03em; }
h3 { font-size: clamp(22px, 2.8vw, 30px); line-height: 1.15; letter-spacing: -0.02em; }
h4 { font-size: clamp(18px, 2vw, 22px); line-height: 1.25; }

p { color: var(--ink); font-size: 17px; line-height: 1.65; }
.lede { font-size: 19px; line-height: 1.55; color: var(--gray); max-width: 620px; }
.muted { color: var(--gray); }

em.gold { font-style: italic; color: var(--gold); font-family: var(--serif); }
em.terracotta { font-style: italic; color: var(--terracotta); font-family: var(--serif); }
em.cream-italic { font-style: italic; color: var(--cream); font-family: var(--serif); }

/* CONTAINER */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--space-6); }
.wrap-narrow { max-width: 880px; margin: 0 auto; padding: 0 var(--space-6); }

/* SECTIONS */
.section { padding: var(--space-9) 0; position: relative; }
.section-lg { padding: var(--space-10) 0; }
.section-cream { background: var(--cream); }
.section-cream-warm { background: var(--cream-warm); }
.section-cream-deeper { background: var(--cream-deeper); }
.section-dark {
  background: radial-gradient(ellipse 100% 80% at 70% 20%, var(--teal) 0%, var(--teal-deep) 50%, var(--teal-darker) 100%);
  color: var(--cream);
  position: relative;
  overflow: hidden;
}
.section-dark h1, .section-dark h2, .section-dark h3 { color: var(--cream); }
.section-dark p { color: rgba(250,246,241,0.78); }
.section-dark .eyebrow { color: var(--gold); }

/* NAV */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 var(--space-6);
  transition: background var(--t-slow) var(--ease), backdrop-filter var(--t-slow) var(--ease), box-shadow var(--t-slow) var(--ease);
}
.nav.over-dark { background: transparent; }
.nav.over-light, .nav.scrolled {
  background: rgba(250,246,241,0.88);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.nav-logo { font-family: var(--serif); font-weight: 900; font-size: 24px; letter-spacing: -0.04em; color: var(--cream); transition: color var(--t-slow) var(--ease); }
.nav.over-light .nav-logo, .nav.scrolled .nav-logo { color: var(--teal); }
.nav-links { display: flex; gap: var(--space-7); align-items: center; }
.nav-links > a:not(.btn) { font-size: 14px; font-weight: 500; color: rgba(250,246,241,0.85); transition: color var(--t) var(--ease); letter-spacing: 0.005em; }
.nav.over-light .nav-links > a:not(.btn), .nav.scrolled .nav-links > a:not(.btn) { color: var(--ink); }
.nav-links > a:not(.btn):hover { color: var(--cream); }
.nav.over-light .nav-links > a:not(.btn):hover, .nav.scrolled .nav-links > a:not(.btn):hover { color: var(--terracotta); }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px;
  font-size: 15px; font-weight: 600; letter-spacing: 0.005em;
  border-radius: var(--radius-sm);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease);
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--teal); color: var(--cream); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--teal-tint); box-shadow: var(--shadow); }
.btn-cream { background: var(--cream); color: var(--teal); box-shadow: var(--shadow-sm); }
.btn-cream:hover { box-shadow: var(--shadow); background: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-ghost-cream { background: transparent; color: var(--cream); border-color: rgba(250,246,241,0.32); }
.btn-ghost-cream:hover { border-color: var(--cream); background: rgba(250,246,241,0.06); }
.btn-terracotta { background: var(--terracotta); color: var(--cream); }
.btn-terracotta:hover { background: var(--terracotta-deep); }
.btn-lg { padding: 17px 30px; font-size: 16px; border-radius: 8px; }

/* CARDS */
.card {
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-elevated { box-shadow: var(--shadow); border-color: transparent; }

/* PROBLEM CARD — terracotta LEFT bar + gold square icon */
.problem-card {
  position: relative;
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-6) var(--space-6) calc(var(--space-6) + 6px);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
  overflow: hidden;
}
.problem-card::before {
  content: ''; position: absolute; left: 0; top: 24px; bottom: 24px;
  width: 4px;
  background: var(--terracotta);
  border-radius: 0 4px 4px 0;
}
.problem-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.problem-card-icon {
  width: 48px; height: 48px;
  background: var(--gold-soft);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-4);
  color: var(--teal);
}

/* LINE ICONS */
.icon { width: 24px; height: 24px; stroke-width: 1.75; stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 28px; height: 28px; }

/* MOCKUP */
.mockup-card {
  background: var(--cream);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(250,246,241,0.06);
}

/* STAT — editorial big number */
.stat-block {
  display: flex; flex-direction: column; gap: 6px;
}
.stat-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray);
}
.stat-number {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(56px, 9vw, 112px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  color: var(--terracotta);
}
.stat-sub {
  font-size: 14px; color: var(--gray); margin-top: 4px;
}

/* SPARKLINE — inline svg next to numbers */
.sparkline { width: 80px; height: 24px; }
.sparkline path { fill: none; stroke: var(--teal); stroke-width: 2; stroke-linecap: round; }
.sparkline circle { fill: var(--terracotta); }

/* ANIMATIONS */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUpSlow {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes floatIn {
  from { opacity: 0; transform: translateX(40px) rotate(2deg); }
  to { opacity: 1; transform: translateX(0) rotate(2deg); }
}
@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(2deg); }
  50% { transform: translateY(-12px) rotate(2deg); }
}
@keyframes pulse-soft {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* RESPECT REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* RIBBON for pricing */
.ribbon {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--gold);
  color: var(--ink);
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 6px 18px; border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

/* PRICING CARD */
.price-card {
  position: relative;
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--space-7) var(--space-6);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
  text-align: center;
}
.price-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.price-card.featured {
  background: var(--cream);
  border-color: var(--gold);
  border-width: 2px;
  box-shadow: var(--shadow);
}
.price-name {
  font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gray); margin-bottom: 14px;
}
.price-amount {
  font-family: var(--serif); font-weight: 900;
  font-size: 64px; line-height: 1;
  letter-spacing: -0.04em;
  color: var(--teal);
  margin-bottom: 6px;
}
.price-amount span { font-size: 18px; color: var(--gray); font-weight: 500; font-family: var(--sans); letter-spacing: 0; margin-left: 4px; }
.price-desc { font-size: 14px; color: var(--gray); margin-bottom: var(--space-5); }
.price-features { list-style: none; text-align: left; margin: var(--space-5) 0; display:flex; flex-direction: column; gap: 10px; }
.price-features li { font-size: 14px; color: var(--ink); padding-left: 24px; position: relative; line-height: 1.5; }
.price-features li::before {
  content: ''; position: absolute; left: 0; top: 7px;
  width: 14px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232E7D5B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") no-repeat center;
  background-size: 14px;
}

/* DECORATIVE BLOB SHAPES */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.blob-teal { background: rgba(15,76,92,0.4); }
.blob-gold { background: rgba(201,169,110,0.18); }
.blob-terracotta { background: rgba(200,75,49,0.12); }

/* RESPONSIVE */
@media (max-width: 880px) {
  .section { padding: var(--space-8) 0; }
  .section-lg { padding: var(--space-9) 0; }
  .nav-links { display: none; }
  .nav-links.mobile-open { display: flex; flex-direction: column; position: fixed; top: 72px; left: 0; right: 0; background: var(--cream); padding: var(--space-6); gap: var(--space-4); box-shadow: var(--shadow); }
  .nav-mobile-btn { display: block; background: none; border: none; font-size: 26px; cursor: pointer; color: var(--cream); }
  .nav.over-light .nav-mobile-btn, .nav.scrolled .nav-mobile-btn { color: var(--ink); }
}
@media (min-width: 881px) {
  .nav-mobile-btn { display: none; }
}
