/* ==========================================================================
   The Mind Parcel: shared styles (tokens, base, layout, header, footer,
   buttons, legal pages). Page-specific styles: home.css, product.css
   ========================================================================== */

/* ---------- Fonts (self-hosted, Latin subset incl. ₹) ---------- */
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/inter-Regular.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/inter-Medium.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/inter-SemiBold.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/inter-Bold.woff") format("woff"); }
@font-face { font-family: "Lora"; font-weight: 400 700; font-style: normal; font-display: swap; src: url("../fonts/lora-var.woff") format("woff"); }
@font-face { font-family: "Lora"; font-weight: 400 700; font-style: italic; font-display: swap; src: url("../fonts/lora-italic-var.woff") format("woff"); }

/* ---------- Design tokens ---------- */
:root {
  --ink: #0b1626;
  --ink-2: #12233a;
  --ink-3: #1c3354;
  --paper: #f6f3ec;
  --paper-2: #eee9dc;
  --white: #ffffff;

  --gold-text: #8f611b;      /* gold for text on light backgrounds (AA) */
  --gold: #c9973f;           /* rules, icons */
  --gold-light: #dcb674;     /* gold on dark backgrounds */
  --cta: #d9a84e;            /* primary button */
  --cta-hover: #e6b960;

  --text: #182131;
  --muted: #586376;
  --on-dark: #e9e6dd;
  --muted-dark: #a9b3c4;
  --line: #ddd6c6;
  --line-dark: rgba(220, 182, 116, 0.22);
  --ok: #2d7a55;
  --bad: #a3402f;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Lora", "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  --radius: 6px;
  --radius-lg: 10px;
  --gutter: clamp(20px, 5vw, 40px);
  --section: clamp(64px, 9vw, 116px);
  --maxw: 1160px;
  --header-h: 58px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
img { height: auto; }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; color: var(--ink); text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 3px; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius); z-index: 100; text-decoration: none; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * 0.65); }
.section--paper2 { background: var(--paper-2); }
.section--ink { background: var(--ink); color: var(--on-dark); }
.section--ink h1, .section--ink h2, .section--ink h3 { color: #fff; }

/* ---------- Type helpers ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold-text); margin-bottom: 1.1rem;
}
.eyebrow::before { content: ""; width: 34px; height: 1px; background: currentColor; opacity: 0.8; }
.section--ink .eyebrow, .on-dark .eyebrow { color: var(--gold-light); }
.h-display { font-size: clamp(2.2rem, 6.2vw, 4rem); line-height: 1.06; letter-spacing: -0.02em; }
.h-section { font-size: clamp(1.75rem, 4vw, 2.65rem); line-height: 1.12; }
.lede { font-size: clamp(1.05rem, 2.2vw, 1.28rem); line-height: 1.55; color: var(--muted); max-width: 40em; }
.section--ink .lede, .on-dark .lede { color: var(--muted-dark); }
.section-head { max-width: 46rem; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }
.section-head--center .lede { margin-inline: auto; }
.em-serif { font-family: var(--font-serif); font-style: italic; font-weight: 500; color: var(--gold-text); }
.section--ink .em-serif, .on-dark .em-serif { color: var(--gold-light); }
.num-serif { font-family: var(--font-serif); font-weight: 500; font-feature-settings: "lnum"; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0.8rem 1.5rem;
  font-weight: 600; font-size: 0.98rem; letter-spacing: 0.01em; text-decoration: none; text-align: center;
  border: 1.5px solid transparent; border-radius: var(--radius);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--cta); color: var(--ink); box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 8px 22px -10px rgba(217,168,78,.9); }
.btn--primary:hover { background: var(--cta-hover); transform: translateY(-1px); }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { background: var(--ink-3); }
.btn--ghost { border-color: currentColor; background: transparent; }
.btn--ghost:hover { background: rgba(127, 127, 127, 0.12); }
.btn--lg { min-height: 56px; padding: 1rem 2rem; font-size: 1.05rem; }
.btn--block { width: 100%; }
.btn .arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.text-link { font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; text-decoration-color: var(--gold); }
.text-link:hover { text-decoration-thickness: 2px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.site-header--dark { background: rgba(11, 22, 38, 0.95); border-bottom-color: var(--line-dark); color: #fff; }
.site-header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-serif); font-weight: 600; font-size: 1.16rem; letter-spacing: -0.01em; color: var(--ink); }
.site-header--dark .brand { color: #fff; }
.brand img { width: auto; height: 34px; flex: none; display: block; }
.nav { display: none; }
.nav__list { display: flex; align-items: center; gap: 30px; }
.nav__list a { text-decoration: none; font-size: 0.93rem; font-weight: 500; color: var(--muted); transition: color .2s; }
.nav__list a:hover, .nav__list a[aria-current="page"] { color: var(--ink); }
.header-cta { display: none; min-height: 42px; padding: 0.55rem 1.15rem; font-size: 0.92rem; }
.menu-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; background: none; border: 0; border-radius: var(--radius); }
.menu-btn span, .menu-btn span::before, .menu-btn span::after { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s var(--ease), background .2s; content: ""; position: relative; }
.menu-btn span::before { position: absolute; top: -6px; }
.menu-btn span::after { position: absolute; top: 6px; }
.menu-btn[aria-expanded="true"] span { background: transparent; }
.menu-btn[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }
.mobile-nav { position: fixed; inset: var(--header-h) 0 auto 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: 12px var(--gutter) 28px; transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .2s, transform .25s var(--ease), visibility .2s; z-index: 49; }
.mobile-nav.is-open { opacity: 1; transform: none; visibility: visible; }
.mobile-nav a:not(.btn) { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 500; }
.mobile-nav .btn { margin-top: 18px; width: 100%; }
@media (min-width: 880px) {
  .nav, .header-cta { display: block; }
  .header-cta { display: inline-flex; }
  .menu-btn, .mobile-nav { display: none; }
}
/* Landing-page header: price + CTA stay visible on every screen size */
.site-header--dark .header-cta { display: inline-flex; }
.header-price { display: none; font-size: .86rem; color: var(--muted-dark); }
@media (min-width: 560px) { .header-price { display: inline; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--muted-dark); padding-block: 56px 36px; font-size: 0.92rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.site-footer .brand { color: #fff; }
.footer-grid { display: grid; gap: 36px; margin-bottom: 40px; }
.footer-grid h4 { font-family: var(--font-sans); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-light); font-weight: 600; margin-bottom: 14px; }
.footer-grid li + li { margin-top: 8px; }
.footer-note { border-top: 1px solid var(--line-dark); padding-top: 24px; display: grid; gap: 10px; font-size: 0.8rem; line-height: 1.55; color: #8693a8; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; } }

/* Book mockup */
.book { position: relative; width: min(66vw, 330px); aspect-ratio: 827 / 1170; transform: perspective(1400px) rotateY(-16deg) rotateX(3deg); transform-origin: 30% 50%; box-shadow: 28px 38px 60px -10px rgba(0,0,0,.55), 6px 8px 18px rgba(0,0,0,.35); border-radius: 2px 7px 7px 2px; animation: bookfloat 7s ease-in-out infinite; }
.book img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.book::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(90deg, rgba(255,255,255,.2) 0, rgba(255,255,255,0) 3.5%, rgba(0,0,0,.18) 4.5%, rgba(0,0,0,0) 8%, rgba(0,0,0,0) 94%, rgba(0,0,0,.22) 100%); }
@keyframes bookfloat { 0%,100% { transform: perspective(1400px) rotateY(-16deg) rotateX(3deg) translateY(0); } 50% { transform: perspective(1400px) rotateY(-16deg) rotateX(3deg) translateY(-8px); } }
.book--flat { transform: none; animation: none; box-shadow: 0 24px 50px -16px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.25); }


/* ---------- Price ---------- */
.price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; }
.price-row strong { font-family: var(--font-serif); font-size: clamp(2.6rem, 11vw, 3.2rem); line-height: 1; font-weight: 600; color: var(--ink); }
.price-row s { font-size: 1.2rem; color: var(--muted); text-decoration-thickness: 1.5px; }
.save { align-self: center; font-style: normal; font-weight: 700; font-size: .74rem; letter-spacing: .03em; color: var(--ok); background: #e3f1ea; padding: 4px 11px; border-radius: 999px; }
.price-note { margin: 6px 0 0; font-size: .84rem; color: var(--muted); }
.on-dark .price-row strong { color: #fff; }
.on-dark .price-row s, .on-dark .price-note { color: var(--muted-dark); }
.on-dark .save { background: rgba(45,122,85,.28); color: #9ddcba; }

/* ---------- Buy buttons ---------- */
.btn svg { flex: none; }
.btn--buy { background: var(--ink); color: #fff; box-shadow: 0 14px 26px -14px rgba(11,22,38,.7); }
.btn--buy:hover { background: var(--ink-3); }
.btn--buy svg { color: var(--gold-light); }
.ticks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: .86rem; color: var(--muted); }
.ticks li { display: inline-flex; align-items: center; gap: 7px; }
.ticks svg { width: 16px; height: 16px; color: var(--ok); }
.tag { align-self: flex-start; font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-text); }
.hdr-link { font-size: .9rem; font-weight: 500; color: var(--muted); text-decoration: none; padding: 10px 0; }
.hdr-link:hover { color: var(--ink); }

/* ---------- Buy bar: always visible on product pages, never toggles ---------- */
.buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--ink); border-top: 1px solid var(--line-dark); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); }
.buybar__in { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.buybar__price { display: flex; align-items: baseline; gap: 8px; color: #fff; line-height: 1; white-space: nowrap; }
.buybar__price strong { font-family: var(--font-serif); font-size: 1.7rem; font-weight: 600; }
.buybar__price s { font-size: .92rem; color: var(--muted-dark); }
.buybar__price span { display: none; font-size: .78rem; color: var(--muted-dark); }
.buybar .btn { flex: 1; max-width: 260px; min-height: 48px; }
body.has-buybar { padding-bottom: calc(68px + env(safe-area-inset-bottom)); background: var(--ink); }
body.has-buybar main { background: var(--paper); }
@media (min-width: 700px) { .buybar__price span { display: inline; } .buybar .btn { flex: 0 0 auto; min-width: 220px; } }

/* ---------- Slim footer ---------- */
.foot { background: var(--ink); color: var(--muted-dark); padding: 34px 0 30px; font-size: .88rem; }
.foot a { text-decoration: none; }
.foot a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.foot .brand { color: #fff; }
.foot__top { display: flex; flex-direction: column; gap: 16px; }
.foot__links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot__note { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line-dark); font-size: .76rem; line-height: 1.6; color: #8693a8; }
.foot--min { padding: 20px 0; text-align: center; }
@media (min-width: 760px) { .foot__top { flex-direction: row; align-items: center; justify-content: space-between; } }

/* ---------- Reveal on scroll (progressive enhancement) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Legal / simple text pages ---------- */
.doc { padding-block: clamp(48px, 8vw, 96px); }
.doc__inner { max-width: 46rem; }
.doc h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 0.3em; }
.doc .meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 2.4rem; }
.doc h2 { font-size: 1.35rem; margin-top: 2.2em; }
.doc p, .doc li { color: #2b3547; }
.doc ul { list-style: disc; padding-left: 1.3em; margin-bottom: 1em; }
.doc li { margin-bottom: .4em; }
.doc a { color: var(--gold-text); text-underline-offset: 3px; }
.doc .note { background: var(--paper-2); border-left: 3px solid var(--gold); padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; font-size: .95rem; }
