/* ============================================================================
   The Living Tree of Yoga — shared design system
   Adopts the Calibr visual language (tokens verbatim) under a yoga identity.
   Clean white ground · forest-green (pounamu) + brass accent · crisp hairlines.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,500&family=Inter:wght@400;500;600&family=Plus+Jakarta+Sans:wght@400;500;600&display=swap');

:root {
  /* colour tokens (Calibr, exact) */
  --ground: #FFFFFF;
  --surface: #F7F8F5;
  --ink: #1C1B18;
  --ink-muted: #5C5B54;
  --ink-faint: #9A988E;
  --hairline: #E8E7E2;
  --primary: #1A5440;
  --primary-bright: #237A57;
  --primary-surface: #EAF2E8;
  --primary-ink: #103327;
  --accent: #C0852B;
  --accent-soft: #F0E6CC;

  /* type */
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-accent: 'Fraunces', Georgia, serif;

  --radius-card: 14px;
  --wrap: 1080px;
  --gutter: 28px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

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

a { color: var(--primary-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ── Skip link ──────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--primary); color: #fff; padding: 8px 14px;
  border-radius: 8px; font-family: var(--font-body); font-size: 13px;
}
.skip-link:focus { left: 16px; }

/* ── Header + limb nav ──────────────────────────────────────────────────── */
.site-header {
  background: var(--ground);
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; z-index: 40;
}
.site-header__inner {
  max-width: var(--wrap); margin: 0 auto; padding: 14px var(--gutter);
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.wordmark { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.wordmark:hover { text-decoration: none; }
.wordmark__text { line-height: 1.05; }
.wordmark__title {
  font-family: var(--font-display); font-weight: 600; font-size: 17px;
  letter-spacing: -0.01em; color: var(--ink);
}
.wordmark__tag {
  font-family: var(--font-body); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-faint); font-weight: 500;
}

.limbnav {
  display: flex; align-items: stretch; gap: 4px; margin-left: auto;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; max-width: 100%;
}
.limbnav::-webkit-scrollbar { display: none; }
.limbnav__item {
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 7px 11px; border-radius: 10px; border: 1px solid transparent;
  font-size: 13px; color: var(--ink-muted); font-weight: 500;
}
.limbnav__item:hover { background: var(--surface); text-decoration: none; }
.limbnav__num {
  font-family: var(--font-body); font-size: 11px; font-weight: 600;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.limbnav__item--current {
  background: var(--primary-surface); border-color: #cfe0c8; color: var(--primary-ink);
}
.limbnav__item--current .limbnav__num { color: var(--primary); }

/* ── Typographic helpers ────────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--font-body); font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint);
}
.eyebrow--primary { color: var(--primary); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.015em; }

.display {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(30px, 5vw, 46px); line-height: 1.05; letter-spacing: -0.02em;
  color: var(--ink);
}
.lede { font-size: clamp(16px, 2vw, 19px); color: var(--ink-muted); max-width: 62ch; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero { padding: 56px 0 40px; }
.hero__word {
  font-family: var(--font-accent); font-style: italic; font-weight: 500;
  font-size: 20px; color: var(--primary); margin-top: 2px;
}
.hero__root { font-size: 14.5px; color: var(--ink-muted); margin-top: 14px; max-width: 60ch; }
.hero__root b { font-weight: 500; color: var(--ink); }

/* Sūtra epigraph — the one editorial (Fraunces) moment */
.epigraph {
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 20px; margin: 26px 0 0; max-width: 64ch;
}
.epigraph__sa {
  font-family: var(--font-accent); font-style: italic; font-weight: 500;
  font-size: clamp(17px, 2.4vw, 21px); line-height: 1.4; color: var(--ink);
}
.epigraph__en { font-size: 15px; color: var(--ink-muted); margin-top: 8px; }
.epigraph__ref {
  display: inline-block; margin-top: 10px; font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint);
}

/* ── Sections + prose ───────────────────────────────────────────────────── */
.section { padding: 40px 0; border-top: 1px solid var(--hairline); }
.section__eyebrow { margin-bottom: 10px; }
.section h2 { font-size: clamp(22px, 3vw, 28px); margin-bottom: 6px; }
.prose { max-width: 66ch; }
.prose p { margin-top: 16px; font-size: 16.5px; color: #33322d; }
.prose p:first-child { margin-top: 18px; }
.prose b, .prose strong { font-weight: 600; color: var(--ink); }
.prose em { font-style: italic; }

/* "In the Ashtanga tradition" — primary-surface band */
.tradition { background: var(--primary-surface); border-top: 1px solid #d8e6d2; border-bottom: 1px solid #d8e6d2; }
.tradition .section { border-top: none; }
.tradition h2 { color: var(--primary-ink); }
.tradition .prose p { color: #2c3f34; }
.tradition .eyebrow { color: var(--primary); }

/* ── Sub-limb cards (Yama / Niyama) ─────────────────────────────────────── */
.sublimbs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.sublimb {
  background: var(--ground); border: 1px solid var(--hairline);
  border-radius: var(--radius-card); padding: 22px 24px;
}
.sublimb__num {
  font-family: var(--font-body); font-weight: 600; font-size: 12px; color: var(--accent);
  letter-spacing: 0.1em;
}
.sublimb__name {
  font-family: var(--font-display); font-weight: 600; font-size: 20px;
  letter-spacing: -0.01em; margin-top: 3px;
}
.sublimb__en { font-size: 13.5px; color: var(--ink-faint); margin-top: 1px; }
.sublimb__body { font-size: 15px; color: #3a3934; margin-top: 12px; }
.sublimb__fruit {
  margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--hairline);
  font-family: var(--font-accent); font-style: italic; font-weight: 500;
  font-size: 14.5px; color: var(--primary-ink); line-height: 1.45;
}
.sublimb__fruit .ref {
  display: block; font-family: var(--font-body); font-style: normal; font-weight: 600;
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint); margin-top: 6px;
}

/* ── Saṃyama connective block ───────────────────────────────────────────── */
.samyama {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius-card); padding: 28px 28px 24px; margin-top: 24px;
}
.samyama__lines { display: grid; gap: 12px; margin-top: 16px; }
.samyama__line {
  font-family: var(--font-accent); font-style: italic; font-weight: 500;
  font-size: 15px; color: var(--ink); padding-left: 16px; border-left: 2px solid var(--accent-soft);
}
.samyama__line .ref { font-family: var(--font-body); font-style: normal; font-weight: 600; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-right: 8px; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-body);
  font-weight: 500; font-size: 15px; padding: 10px 18px; border-radius: 11px;
  border: 1px solid transparent; cursor: pointer; transition: background 0.18s, color 0.18s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-bright); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }

/* ── Prev / next limb ───────────────────────────────────────────────────── */
.prevnext {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 32px 0 8px; border-top: 1px solid var(--hairline);
}
.prevnext a { display: flex; flex-direction: column; gap: 3px; color: var(--ink); max-width: 46%; }
.prevnext a:hover { text-decoration: none; }
.prevnext a:hover .prevnext__name { color: var(--primary-bright); }
.prevnext__dir { font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
.prevnext__name { font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.prevnext__end { text-align: right; align-items: flex-end; }
.prevnext__empty { flex: 1; }

/* ── Āsana stage (the 3D player, the page's main component) ──────────────── */
.stage {
  position: relative; border: 1px solid var(--hairline); border-radius: var(--radius-card);
  overflow: hidden; background: var(--surface); margin-top: 24px;
}
.stage__frame { display: block; width: 100%; height: min(74vh, 720px); border: 0; }
.stage__bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--hairline); background: var(--ground);
  font-size: 13px; color: var(--ink-muted);
}
.stage__badge {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; padding: 3px 9px;
  border-radius: 20px; background: var(--primary-surface); color: var(--primary-ink);
}

/* ── Footer / provenance ────────────────────────────────────────────────── */
.site-footer { background: var(--ink); color: #cfc7b6; margin-top: 8px; }
.site-footer__inner {
  max-width: var(--wrap); margin: 0 auto; padding: 34px var(--gutter);
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.site-footer__word { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: #fff; }
.site-footer__line { display: flex; align-items: center; gap: 9px; margin-top: 10px; font-size: 14px; color: #a89e8a; max-width: 52ch; }
.site-footer__line .mk { color: var(--accent); }
.site-footer__links { display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer__links a { color: #cfc7b6; font-size: 14px; }
.site-footer__note { font-size: 12px; color: #837a68; margin-top: 14px; max-width: 60ch; line-height: 1.5; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .sublimbs { grid-template-columns: 1fr; }
  .site-header__inner { gap: 12px; }
  .limbnav { margin-left: 0; width: 100%; }
  .hero { padding: 40px 0 32px; }
}

/* ── The 80-card deck ───────────────────────────────────────────────────── */
.deck { display:grid; grid-template-columns:repeat(auto-fill, minmax(148px,1fr)); gap:14px; margin-top:20px; }
.deckhead { grid-column:1/-1; font-family:var(--font-display); font-weight:600; font-size:13px;
  letter-spacing:.06em; text-transform:uppercase; color:var(--ink-faint);
  padding:20px 0 4px; border-top:1px solid var(--hairline); margin-top:8px; }
.deckhead:first-child { border-top:none; margin-top:0; padding-top:0; }
.deckcard { display:flex; flex-direction:column; border:1px solid var(--hairline); border-radius:12px;
  overflow:hidden; background:var(--ground); color:var(--ink); text-decoration:none;
  transition:border-color .15s, transform .1s, box-shadow .15s; }
.deckcard:hover { text-decoration:none; }
a.deckcard { cursor:pointer; }
a.deckcard:hover { border-color:#cfe0c8; transform:translateY(-2px); }
.deckcard__img { position:relative; aspect-ratio:3/4; background:var(--surface);
  display:flex; align-items:center; justify-content:center; }
.deckcard__img img { width:100%; height:100%; object-fit:contain; }
.deckcard.is-gap { cursor:zoom-in; }
.deckcard.is-gap:hover { border-color:var(--accent-soft); transform:translateY(-2px); }

/* ── Lightbox (view a card full-size) ───────────────────────────────────── */
.lightbox { position:fixed; inset:0; z-index:100; background:rgba(28,27,24,.84);
  display:none; align-items:center; justify-content:center; padding:28px; cursor:zoom-out; }
.lightbox.open { display:flex; }
.lightbox img { max-width:min(92vw,540px); max-height:88vh; border-radius:14px; background:#fff; }
.lightbox__cap { position:absolute; left:0; right:0; bottom:22px; text-align:center;
  color:#fff; font-family:var(--font-body); font-size:14px; letter-spacing:.02em; }
.deckcard__num { position:absolute; top:6px; left:7px; font-family:var(--font-display); font-weight:600;
  font-size:12px; color:var(--ink-muted); background:#ffffffd0; border-radius:6px; padding:1px 6px; }
.deckcard__3d { position:absolute; top:6px; right:6px; font-size:9.5px; font-weight:600; letter-spacing:.05em;
  color:#fff; background:var(--primary); border-radius:20px; padding:2px 8px; }
.deckcard__cap { position:absolute; top:6px; right:6px; font-size:9.5px; font-weight:600; letter-spacing:.04em;
  color:#6b4a12; background:var(--accent-soft); border-radius:20px; padding:2px 8px; }
.deckcard__meta { padding:9px 11px 11px; border-top:1px solid var(--hairline); }
.deckcard__name { font-family:var(--font-display); font-weight:600; font-size:13.5px; line-height:1.2; letter-spacing:-.01em; }
.deckcard__en { font-size:11.5px; color:var(--ink-faint); margin-top:2px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
