/* ============================================================
   tejas.decodes · home page (Oct 2026 redesign)
   Loaded by index.html, courses.html, resources.html and manuals.html,
   on top of styles.css. Classes start with h- (or bk- for the books),
   so nothing leaks into the manuals or the PYQ decoder.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@1,8..60,500;1,8..60,600&display=swap');

:root {
  --h-paper: 255 253 248;
  --h-mark: 252 227 154;
  --h-band: 22 24 29;
  --h-band-ink: 248 247 244;
  --h-band-ink-2: 185 189 198;
  --h-band-line: 44 48 64;
  --h-grid: rgb(22 24 29 / .03);
  --h-bar: 47 100 179;
  --h-ease: cubic-bezier(.22, .61, .36, 1);
}
:root[data-theme="dark"] {
  --h-paper: 23 26 34;
  --h-mark: 90 70 16;
  --h-band: 29 34 48;
  --h-band-ink: 232 233 236;
  --h-band-ink-2: 169 175 187;
  --h-band-line: 44 51 70;
  --h-grid: rgb(232 233 236 / .028);
  --h-bar: 91 143 217;
}

/* the whole home page sits on faint grid paper */
body.h-page {
  background-color: rgb(var(--c-bg));
  background-image: linear-gradient(var(--h-grid) 1px, transparent 1px), linear-gradient(90deg, var(--h-grid) 1px, transparent 1px);
  background-size: 56px 56px;
}
.h-wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.h-eb { font: 700 .75rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: rgb(var(--c-amber)); }
.h-h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: clamp(2.1rem, 4vw, 3.25rem); line-height: 1.06; letter-spacing: -.02em; color: rgb(var(--c-ink)); }
.h-lead { margin: 0; font-family: var(--serif); font-size: 1.25rem; line-height: 1.6; color: rgb(var(--c-ink-2)); max-width: 36em; }
.h-it { font-style: italic; font-weight: 500; }
.h-amber { color: rgb(var(--c-amber)); }
.h-sec { padding: 112px 0; position: relative; }
.h-sec--paper { background-color: rgb(var(--h-paper)); border-top: 1px solid rgb(var(--c-line)); border-bottom: 1px solid rgb(var(--c-line)); background-image: linear-gradient(var(--h-grid) 1px, transparent 1px), linear-gradient(90deg, var(--h-grid) 1px, transparent 1px); background-size: 56px 56px; }

/* highlighter: sweeps in from the left when its block is on screen */
.h-mark {
  color: inherit; padding: 0 .06em; background-color: transparent;
  background-image: linear-gradient(transparent 52%, rgb(var(--h-mark)) 52%, rgb(var(--h-mark)) 92%, transparent 92%);
  background-repeat: no-repeat; background-size: 0% 100%;
  transition: background-size .9s var(--h-ease) .25s;
}
.is-in .h-mark, .h-mark.is-in { background-size: 100% 100%; }

/* buttons */
.h-btn { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 24px; border-radius: 14px; font: 600 .95rem var(--sans); text-decoration: none; white-space: nowrap; transition: transform .2s var(--h-ease), box-shadow .2s ease, background-color .2s ease, color .2s ease; }
.h-btn svg { width: 18px; height: 18px; transition: transform .2s var(--h-ease); }
.h-btn:hover { transform: translateY(-2px); }
.h-btn:hover svg { transform: translateX(3px); }
.h-btn:active { transform: translateY(0) scale(.97); }
.h-btn--ink { background: rgb(var(--c-ink)); color: rgb(var(--c-bg)); border: 1px solid rgb(var(--c-ink)); }
.h-btn--ink:hover { color: rgb(var(--c-bg)); box-shadow: 0 14px 28px -14px rgb(16 20 30 / .5); }
.h-btn--out { background: transparent; color: rgb(var(--c-ink)); border: 1.5px solid rgb(var(--c-ink)); }
.h-btn--out:hover { color: rgb(var(--c-ink)); background: rgb(var(--c-surface)); }
.h-btn--amber { background: rgb(var(--c-amber)); color: #fff; border: 0; }
:root[data-theme="dark"] .h-btn--amber { color: rgb(15 17 21); }
.h-btn--amber:hover { color: #fff; box-shadow: 0 14px 28px -14px rgb(138 90 0 / .6); }
:root[data-theme="dark"] .h-btn--amber:hover { color: rgb(15 17 21); }
.h-btn--ghost { background: transparent; color: rgb(var(--h-band-ink)); border: 1.5px solid rgb(var(--h-band-line)); }
.h-btn--ghost:hover { color: rgb(var(--h-band-ink)); border-color: rgb(var(--h-band-ink-2)); }

/* ---------- hero ---------- */
.h-hero { padding: 88px 0 80px; position: relative; overflow: hidden; }
.h-hero__grid { display: flex; flex-wrap: wrap; gap: 56px; align-items: center; }
.h-hero__copy { flex: 999 1 520px; min-width: 0; }
.h-hero h1 { margin: 22px 0 0; font-family: var(--serif); font-weight: 600; font-size: clamp(3rem, 6.4vw, 5.5rem); line-height: .98; letter-spacing: -.035em; color: rgb(var(--c-ink)); }
.h-hero h1 .w { display: inline-block; }
.h-hero__lede { margin: 28px 0 0; font-family: var(--serif); font-size: 1.25rem; line-height: 1.6; color: rgb(var(--c-ink-2)); max-width: 34em; }
.h-hero__lede a { color: rgb(var(--c-accent)); }
.h-hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.h-hero__tz { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; font: 600 .95rem var(--sans); color: rgb(var(--c-ink)); text-decoration: none; }
.h-hero__tz svg { width: 16px; height: 16px; transition: transform .2s var(--h-ease); }
.h-hero__tz:hover svg { transform: translateX(4px); }
.h-byline { display: flex; align-items: center; gap: 14px; margin-top: 28px; font-size: .92rem; color: rgb(var(--c-ink-2)); }
.h-byline b { color: rgb(var(--c-ink)); }
.h-mono { width: 42px; height: 42px; border-radius: 999px; flex: none; background: rgb(var(--c-accent)); color: rgb(var(--c-bg)); font: 600 15px var(--serif); display: inline-flex; align-items: center; justify-content: center; }

/* the amendment card */
.h-card { flex: 1 1 420px; max-width: 520px; margin: 0; position: relative; padding: 34px 34px 30px; background: rgb(var(--h-paper)); border: 1px solid rgb(var(--c-line)); border-radius: 20px; box-shadow: 0 1px 0 rgb(var(--c-line-2)), 0 30px 60px -36px rgb(16 20 30 / .38); transform: rotate(1.2deg); }
.h-card__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.h-card__tag { font: 700 .72rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: rgb(var(--c-red-ink)); }
.h-card__cite { font: 600 .75rem var(--sans); color: rgb(var(--c-ink-3)); }
.h-card__sub { margin: 6px 0 0; font-size: .82rem; color: rgb(var(--c-ink-2)); }
.h-card blockquote { margin: 22px 0 0; font-family: var(--serif); font-size: 1.35rem; line-height: 1.55; color: rgb(var(--c-ink)); }
.h-tier { display: flex; align-items: center; gap: 14px; margin-top: 26px; padding: 16px 18px; border-radius: 14px; background: rgb(var(--c-bg)); border: 1px solid rgb(var(--c-line)); font: 600 .82rem var(--sans); color: rgb(var(--c-ink-2)); }
.h-tier__old { margin-left: auto; position: relative; white-space: nowrap; font: 600 1rem var(--serif); color: rgb(var(--c-red-ink)); }
.h-tier__old::after { content: ""; position: absolute; left: -2px; right: -2px; top: 52%; height: 2px; background: rgb(var(--c-red-ink)); transform-origin: left center; }
.h-tier svg { width: 18px; height: 18px; color: rgb(var(--c-ink-3)); flex: none; }
.h-tier__new { white-space: nowrap; font: 700 1rem var(--serif); color: rgb(var(--c-green-ink)); }
.h-card figcaption { margin-top: 20px; font-family: var(--serif); font-style: italic; font-size: 1rem; line-height: 1.6; color: rgb(var(--c-ink-2)); }
.h-stamp { position: absolute; right: -16px; top: -18px; transform: rotate(6deg); background: rgb(var(--c-amber)); color: #fff; font: 700 .72rem var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 8px 14px; border-radius: 8px; box-shadow: 0 10px 20px -10px rgb(0 0 0 / .4); }
:root[data-theme="dark"] .h-stamp { color: rgb(15 17 21); }

/* ---------- numbers ---------- */
.h-nums { background: rgb(var(--h-paper)); border-top: 1px solid rgb(var(--c-line)); border-bottom: 1px solid rgb(var(--c-line)); }
.h-nums__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.h-num { padding: 34px 28px; border-left: 1px solid rgb(var(--c-line)); }
.h-num:first-child { border-left: 0; padding-left: 0; }
.h-num b { display: block; font: 600 3rem/1 var(--serif); letter-spacing: -.02em; color: rgb(var(--c-ink)); font-variant-numeric: tabular-nums; }
.h-num span { display: block; margin-top: 8px; font-size: .92rem; color: rgb(var(--c-ink-2)); }

/* ---------- four ways in ---------- */
.h-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 40px; }
.h-idx { display: grid; grid-template-columns: 80px minmax(0, 1fr) minmax(0, 1.2fr) 56px; gap: 28px; align-items: center; padding: 30px 0; border-top: 1px solid rgb(var(--c-line)); text-decoration: none; color: rgb(var(--c-ink)); position: relative; isolation: isolate; transition: padding .3s var(--h-ease); }
.h-idx:last-child { border-bottom: 1px solid rgb(var(--c-line)); }
.h-idx::before { content: ""; position: absolute; inset: 0; background: rgb(var(--h-paper)); opacity: 0; transition: opacity .3s ease; z-index: -1; border-radius: 4px; }
.h-idx:hover { color: rgb(var(--c-ink)); padding-left: 16px; padding-right: 16px; }
.h-idx:hover::before { opacity: 1; }
.h-idx__n { font: 600 .95rem var(--sans); letter-spacing: .06em; color: rgb(var(--c-amber)); }
.h-idx h3 { margin: 0; font: 600 1.9rem/1.15 var(--serif); letter-spacing: -.01em; }
.h-idx p { margin: 0; font-size: 1rem; line-height: 1.55; color: rgb(var(--c-ink-2)); }
.h-idx__go { width: 52px; height: 52px; border-radius: 999px; border: 1.5px solid rgb(var(--c-line)); display: inline-flex; align-items: center; justify-content: center; transition: background-color .25s ease, color .25s ease, border-color .25s ease, transform .3s var(--h-ease); }
.h-idx__go svg { width: 20px; height: 20px; }
.h-idx:hover .h-idx__go { background: rgb(var(--c-ink)); color: rgb(var(--c-bg)); border-color: rgb(var(--c-ink)); transform: rotate(45deg); }

/* ---------- courses ---------- */
.h-courses { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 20px; margin-top: 52px; }
.h-course { display: flex; flex-direction: column; gap: 16px; padding: 28px; background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line)); border-radius: 20px; transition: transform .3s var(--h-ease), box-shadow .3s ease, border-color .3s ease; }
.h-course:hover { transform: translateY(-6px); box-shadow: 0 26px 50px -30px rgb(16 20 30 / .4); border-color: rgb(var(--c-ink-3)); }
.h-course--pick { border-color: rgb(var(--c-ink)); box-shadow: 0 0 0 1px rgb(var(--c-ink)); }
.h-course__top { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: rgb(var(--c-ink-2)); }
.h-code { font: 700 .75rem var(--sans); letter-spacing: .1em; color: rgb(var(--c-ink-2)); border: 1px solid rgb(var(--c-line)); border-radius: 999px; padding: 5px 11px; }
.h-course--pick .h-code { background: rgb(var(--c-ink)); color: rgb(var(--c-bg)); border-color: rgb(var(--c-ink)); }
.h-course h3 { margin: 0; font: 600 1.6rem/1.2 var(--serif); color: rgb(var(--c-ink)); }
.h-ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.h-ticks li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; font-size: .95rem; line-height: 1.5; color: rgb(var(--c-ink)); }
.h-ticks svg { width: 18px; height: 18px; margin-top: 3px; color: rgb(var(--c-green-ink)); }
.h-course__foot { margin-top: auto; padding-top: 18px; border-top: 1px solid rgb(var(--c-line-2)); display: flex; align-items: baseline; justify-content: space-between; }
.h-course__foot b { font: 700 1.9rem var(--serif); color: rgb(var(--c-ink)); }
.h-course__foot small { font-size: .85rem; color: rgb(var(--c-ink-2)); }
.h-course__foot a { font: 600 .92rem var(--sans); text-decoration: none; }
.h-combo { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 20px; padding: 22px 28px; border-radius: 20px; background: rgb(var(--c-amber-soft)); border: 1px solid rgb(var(--c-amber-line)); font-size: 1rem; color: rgb(var(--c-ink)); }
.h-combo .sep { width: 1px; height: 24px; background: rgb(var(--c-amber-line)); }
.h-combo s { color: rgb(var(--c-ink-3)); }
.h-combo .big { font: 700 1.4rem var(--serif); color: rgb(var(--c-amber)); }
.h-combo .h-btn { margin-left: auto; height: 48px; }

/* ---------- PYQ decoder ---------- */
.h-split { display: flex; flex-wrap: wrap; gap: 64px; align-items: center; }
.h-split > div { flex: 1 1 420px; min-width: 0; }
.h-chart { flex: 1 1 480px; min-width: 0; margin: 0; padding: 30px 32px; background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line)); border-radius: 20px; }
.h-chart figcaption { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 22px; }
.h-chart figcaption span:first-child { font: 600 1.3rem var(--serif); color: rgb(var(--c-ink)); }
.h-chart figcaption span:last-child { font-size: .82rem; color: rgb(var(--c-ink-2)); }
.h-bars { display: flex; flex-direction: column; gap: 14px; }
.h-bar { display: grid; grid-template-columns: 72px minmax(0, 1fr) 56px; gap: 14px; align-items: center; font-size: .9rem; color: rgb(var(--c-ink)); }
.h-bar b { font-weight: 600; }
.h-bar__track { display: block; height: 14px; background: rgb(var(--c-line-2)); border-radius: 0 4px 4px 0; overflow: hidden; }
.h-bar__track i { display: block; height: 100%; width: var(--w); background: rgb(var(--h-bar)); border-radius: 0 4px 4px 0; transform-origin: left center; }
.h-bar__n { text-align: right; font-variant-numeric: tabular-nums; color: rgb(var(--c-ink-2)); }
.h-chart__foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid rgb(var(--c-line-2)); font-size: .82rem; color: rgb(var(--c-ink-2)); }

/* ---------- manuals: 3D books live in the BOOKS block at the end ---------- */

/* ---------- about ---------- */
.h-about { display: flex; flex-wrap: wrap; gap: 56px; align-items: flex-start; }
.h-about__intro { flex: 1 1 340px; }
.h-person { margin-top: 32px; padding: 28px; display: flex; gap: 18px; align-items: center; background: rgb(var(--h-paper)); border: 1px solid rgb(var(--c-line)); border-radius: 20px; transform: rotate(-1deg); box-shadow: 0 24px 44px -32px rgb(16 20 30 / .35); }
.h-person .h-mono { width: 72px; height: 72px; font-size: 26px; }
.h-person div b { display: block; font: 600 1.3rem var(--serif); color: rgb(var(--c-ink)); }
.h-person div span { display: block; margin-top: 3px; font-size: .88rem; color: rgb(var(--c-ink-2)); }
.h-facets { flex: 999 1 560px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.h-facet { padding: 32px; display: flex; flex-direction: column; gap: 14px; background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line)); border-radius: 20px; transition: transform .3s var(--h-ease), border-color .3s ease; }
.h-facet:hover { transform: translateY(-4px); border-color: rgb(var(--c-amber-line)); }
.h-facet .h-eb { color: rgb(var(--c-accent)); }
.h-facet h3 { margin: 0; font: 600 1.6rem/1.2 var(--serif); color: rgb(var(--c-ink)); }
.h-facet p { margin: 0; font-size: 1rem; line-height: 1.65; color: rgb(var(--c-ink-2)); }

/* ---------- closing band ---------- */
.h-band { border-radius: 28px; background-color: rgb(var(--h-band)); color: rgb(var(--h-band-ink)); padding: 72px 64px; display: flex; flex-wrap: wrap; gap: 32px; align-items: center; position: relative; overflow: hidden; }
.h-band__grid { position: absolute; inset: -56px; pointer-events: none; background-image: linear-gradient(rgb(255 255 255 / .07) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .07) 1px, transparent 1px); background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse 70% 90% at 80% 50%, #000 30%, transparent 100%); mask-image: radial-gradient(ellipse 70% 90% at 80% 50%, #000 30%, transparent 100%); animation: h-drift 28s linear infinite; }
.h-band__s { position: absolute; right: -10px; bottom: -70px; font: 700 300px/1 var(--serif); letter-spacing: -.04em; color: rgb(var(--h-band-line)); pointer-events: none; }
.h-band__copy { flex: 1 1 520px; position: relative; }
.h-band h2 { margin: 0; font: 600 clamp(2.2rem, 4.4vw, 3.6rem)/1.04 var(--serif); letter-spacing: -.02em; color: rgb(var(--h-band-ink)); }
.h-band p { margin: 18px 0 0; font-size: 1.05rem; line-height: 1.6; color: rgb(var(--h-band-ink-2)); max-width: 36em; }
.h-band__ctas { display: flex; flex-wrap: wrap; gap: 12px; position: relative; }
@keyframes h-drift { from { transform: translate(0, 0); } to { transform: translate(56px, 56px); } }

/* ============================================================
   Motion. Everything below is switched off for people who ask
   their device to reduce motion.
   ============================================================ */
@keyframes h-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes h-card-in { from { opacity: 0; transform: translateY(28px) rotate(4deg); } to { opacity: 1; transform: rotate(1.2deg); } }
@keyframes h-strike { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes h-pop { 0% { opacity: 0; transform: rotate(6deg) scale(1.5); } 70% { opacity: 1; transform: rotate(6deg) scale(.94); } 100% { opacity: 1; transform: rotate(6deg) scale(1); } }
@keyframes h-fade-right { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

html.h-motion .h-hero [data-h-rise] { opacity: 0; animation: h-rise .8s var(--h-ease) forwards; animation-delay: calc(var(--d, 0) * 1ms); }
html.h-motion .h-hero h1 .w { opacity: 0; animation: h-rise .7s var(--h-ease) forwards; animation-delay: calc(120ms + var(--i, 0) * 70ms); }
html.h-motion .h-hero .h-mark { transition-delay: .95s; }
html.h-motion .h-card { opacity: 0; animation: h-card-in 1s var(--h-ease) .35s forwards; }
html.h-motion .h-tier__old::after { transform: scaleX(0); animation: h-strike .5s var(--h-ease) 1.5s forwards; }
html.h-motion .h-tier svg, html.h-motion .h-tier__new { opacity: 0; animation: h-fade-right .45s var(--h-ease) 1.9s forwards; }
html.h-motion .h-stamp { opacity: 0; animation: h-pop .5s var(--h-ease) 2.3s forwards; }
html.h-motion .h-bar__track i { transform: scaleX(0); transition: transform 1.1s var(--h-ease); transition-delay: calc(var(--i, 0) * 90ms); }
html.h-motion .is-in .h-bar__track i { transform: scaleX(1); }

@media (prefers-reduced-motion: reduce) {
  .h-mark { background-size: 100% 100% !important; transition: none !important; }
  .h-band__grid { animation: none !important; }
  .h-idx, .h-course, .h-facet, .h-btn { transition: none !important; }
}

/* ---------- smaller screens ---------- */
@media (max-width: 860px) {
  .h-wrap { padding: 0 20px; }
  .h-hero { padding: 48px 0 56px; }
  .h-hero__grid { gap: 40px; }
  .h-hero__ctas .h-btn { flex: 1 1 100%; justify-content: center; }
  .h-card { padding: 24px 22px; transform: none; }
  html.h-motion .h-card { animation-name: h-rise; }
  .h-card blockquote { font-size: 1.15rem; }
  .h-stamp { right: 12px; }
  .h-sec { padding: 72px 0; }
  .h-num { padding: 22px 0; border-left: 0; border-top: 1px solid rgb(var(--c-line)); }
  .h-num:first-child { border-top: 0; }
  .h-idx { grid-template-columns: 36px minmax(0, 1fr) 40px; gap: 6px 14px; padding: 22px 0; }
  .h-idx p { grid-column: 2; grid-row: 2; font-size: .92rem; }
  .h-idx h3 { font-size: 1.4rem; }
  .h-idx__go { grid-column: 3; grid-row: 1 / span 2; width: 40px; height: 40px; }
  .h-idx:hover { padding-left: 0; padding-right: 0; }
  .h-combo .h-btn { margin-left: 0; width: 100%; justify-content: center; }
  .h-combo .sep { display: none; }
  .h-band { padding: 40px 26px; border-radius: 22px; }
  .h-band__s { font-size: 200px; bottom: -50px; }
  .h-band__ctas .h-btn { flex: 1 1 100%; justify-content: center; }
}

/* ---------- fit with styles.css ---------- */
body.h-page section { padding: 0; }
body.h-page section + section { border-top: 0; }
body.h-page .h-sec { padding: 112px 0; }
body.h-page .h-hero h1, body.h-page .h-h2 { margin-bottom: 0; }
/* keep the shared fade-in, but let hover effects respond at once */
.h-idx[data-reveal], .h-course[data-reveal], .h-facet[data-reveal], .h-combo[data-reveal] {
  transition: opacity .55s var(--h-ease) calc(var(--reveal-i, 0) * 80ms), transform .4s var(--h-ease), box-shadow .3s ease, border-color .3s ease, padding .3s var(--h-ease);
}
@media (max-width: 860px) {
  body.h-page .h-sec { padding: 72px 0; }
}

/* ============================================================
   BOOKS · the manuals as 3D hardbacks
   Cover, page block and back board sit in real 3D space. At rest
   the book floats and shows its page edges; on hover (or focus)
   it turns toward you, the foil sheen sweeps and the cover opens
   to show the first page. When a book first scrolls in, its cover
   peeks open once, so phones get the effect without hover.
   ============================================================ */
.bk-shelf { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 40px; margin-top: 56px; }
.bk {
  --bk-h: 340px; --bk-t: 30px;
  --bk-c1: #2A5290; --bk-c2: #142C52; --bk-band: #D9B45F;
  display: block; position: relative; width: 100%; max-width: 280px; margin: 0 auto;
  height: calc(var(--bk-h) + 46px); perspective: 1500px; perspective-origin: 30% 40%;
  text-decoration: none; color: #F8F7F4; border-radius: 12px; -webkit-tap-highlight-color: transparent;
}
.bk:hover, .bk:focus-visible { color: #F8F7F4; }
.bk:focus-visible { outline: 2px solid rgb(var(--c-accent)); outline-offset: 6px; }
.bk--ca   { --bk-c1: #2A5290; --bk-c2: #132A4F; }
.bk--ibc  { --bk-c1: #8C6416; --bk-c2: #4F3707; --bk-band: #F0CF7E; }
.bk--comp { --bk-c1: #3A3F4B; --bk-c2: #1A1C22; }

.bk__float { position: absolute; left: 0; right: var(--bk-t); top: 0; height: var(--bk-h); display: block; }
/* Flat layers, not a preserve-3d scene: the book plane is tilted as one
   piece and the cover swings open inside it. Browsers draw this reliably;
   a true 3D scene with touching planes can lose parts of the cover. */
.bk__obj { position: absolute; inset: 0; display: block; perspective: 900px; perspective-origin: 0 50%; transform: rotateY(-18deg) rotateX(3deg); transition: transform .8s var(--h-ease); }
.bk__cover, .bk__back, .bk__leaf { position: absolute; inset: 0; display: block; border-radius: 3px 10px 10px 3px; }
.bk__back { transform: translate(calc(var(--bk-t) * .32), 6px); background: var(--bk-c2); box-shadow: 0 30px 50px -24px rgb(10 12 18 / .55); }
.bk__pages {
  position: absolute; top: 5px; bottom: 2px; right: calc(var(--bk-t) * -.3); width: calc(var(--bk-t) * .34 + 4px); display: block;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(90deg, rgb(0 0 0 / .22), transparent 40%, rgb(0 0 0 / .08)), repeating-linear-gradient(180deg, #F6F1E4 0 2px, #DCD3BE 2px 3px);
  clip-path: polygon(0 0, 100% 4px, 100% calc(100% - 2px), 0 100%);
}
.bk__leaf {
  top: 4px; bottom: 4px; right: 3px;
  background: linear-gradient(90deg, #E9E2D0 0, #FBF8F0 10%, #FFFDF8 100%); color: #3A3F4B;
  padding: 30px 22px 22px 30px; box-sizing: border-box; border-radius: 2px 6px 6px 2px;
}
.bk__leaf small { display: block; font: 700 .58rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #8A5A00; }
.bk__leaf i { display: block; height: 5px; margin-top: 11px; border-radius: 3px; background: #D9D4C7; }
.bk__leaf i:nth-of-type(1) { margin-top: 18px; width: 64%; height: 7px; background: #B9B2A2; }
.bk__leaf i:nth-of-type(3) { width: 88%; }
.bk__leaf i:nth-of-type(4) { width: 70%; background: linear-gradient(90deg, #D9D4C7 0 30%, #F3CF6B 30% 78%, #D9D4C7 78%); }
.bk__leaf i:nth-of-type(5) { width: 92%; }
.bk__leaf i:nth-of-type(6) { width: 52%; background: linear-gradient(#C4675D, #C4675D) 0 50% / 100% 1.5px no-repeat, #E3DCCD; }
.bk__leaf i:nth-of-type(7) { width: 80%; }
.bk__leaf i:nth-of-type(8) { width: 60%; }
.bk__ribbon {
  position: absolute; left: 64%; bottom: -26px; width: 12px; height: 36px; display: block;
  background: linear-gradient(90deg, #8A3028, #B0453A 50%, #8A3028); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  transition: height .5s var(--h-ease);
}
.bk__cover {
  transform-origin: left center; transition: transform .9s var(--h-ease);
  padding: 28px 22px 22px 36px; box-sizing: border-box; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
  background:
    radial-gradient(120% 70% at 15% 0%, rgb(255 255 255 / .16), transparent 60%),
    repeating-linear-gradient(45deg, rgb(255 255 255 / .022) 0 2px, transparent 2px 5px),
    linear-gradient(150deg, var(--bk-c1), var(--bk-c2));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08), inset -3px 0 0 rgb(0 0 0 / .18);
}
/* spine hinge with head and tail bands */
.bk__cover::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 18px;
  background:
    linear-gradient(transparent 8%, var(--bk-band) 8% 9.4%, transparent 9.4% 10.6%, var(--bk-band) 10.6% 11.2%, transparent 11.2% 88.8%, var(--bk-band) 88.8% 89.4%, transparent 89.4% 90.6%, var(--bk-band) 90.6% 92%, transparent 92%),
    linear-gradient(90deg, rgb(0 0 0 / .38), rgb(0 0 0 / .12) 70%, rgb(255 255 255 / .1));
  opacity: .95;
}
.bk__cover::after { content: ""; position: absolute; left: 18px; top: 0; bottom: 0; width: 2px; background: linear-gradient(90deg, rgb(0 0 0 / .3), rgb(255 255 255 / .16)); }
.bk__frame { position: absolute; inset: 12px 12px 12px 28px; border: 1px solid rgb(255 255 255 / .16); border-radius: 4px; pointer-events: none; }
.bk__frame::after { content: ""; position: absolute; inset: 4px; border: 1px solid rgb(255 255 255 / .07); border-radius: 2px; }
.bk__k { position: relative; font: 700 .66rem var(--sans); letter-spacing: .16em; text-transform: uppercase; opacity: .82; }
.bk__t { position: relative; font: 600 1.85rem/1.06 var(--serif); letter-spacing: -.01em; text-wrap: balance; }
.bk__foot { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.bk__t--long { font-size: 1.55rem; }
.bk__s { font-size: .78rem; line-height: 1.35; opacity: .86; max-width: 12em; }
.bk__seal {
  flex: none; width: 50px; height: 50px; border-radius: 999px; position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 1.25rem/1 var(--serif); color: #3D2A06; letter-spacing: -.02em;
  background: linear-gradient(120deg, #A8771F 0%, #F6E3A6 22%, #C9973A 42%, #FBEBB5 58%, #B5832A 78%, #E9C979 100%);
  background-size: 220% 100%; background-position: 100% 0;
  box-shadow: 0 2px 6px rgb(0 0 0 / .35), inset 0 1px 0 rgb(255 255 255 / .55), inset 0 -2px 3px rgb(90 60 0 / .35);
  transition: background-position 1.2s var(--h-ease);
}
.bk__seal::after { content: ""; position: absolute; inset: 4px; border-radius: 999px; border: 1px dashed rgb(80 52 0 / .45); }
.bk__sheen {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 38%, rgb(255 255 255 / .22) 48%, rgb(255 255 255 / .05) 54%, transparent 62%);
  background-size: 300% 100%; background-position: 100% 0; transition: background-position 1.2s var(--h-ease);
}
.bk__shadow {
  position: absolute; left: 4%; right: 2%; bottom: 6px; height: 22px; display: block; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(16 20 30 / .32), transparent); transform-origin: center;
}
:root[data-theme="dark"] .bk__shadow { background: radial-gradient(closest-side, rgb(0 0 0 / .6), transparent); }

/* hover / focus: turn, sheen, open */
.bk:hover .bk__obj, .bk:focus-visible .bk__obj { transform: rotateY(-6deg) rotateX(2deg) translateY(-10px); }
.bk:hover .bk__cover, .bk:focus-visible .bk__cover { transform: rotateY(-58deg); }
.bk:hover .bk__sheen, .bk:focus-visible .bk__sheen { background-position: 0 0; }
.bk:hover .bk__seal, .bk:focus-visible .bk__seal { background-position: 0 0; }
.bk:hover .bk__ribbon, .bk:focus-visible .bk__ribbon { height: 48px; }

/* idle float, the shadow breathing with it */
@keyframes bk-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes bk-shadow { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.9); opacity: .7; } }
@keyframes bk-peek {
  0% { transform: rotateY(0); }
  35%, 60% { transform: rotateY(-48deg); }
  100% { transform: rotateY(0); }
}
html.h-motion .bk__float { animation: bk-float 6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -2s); }
html.h-motion .bk__shadow { animation: bk-shadow 6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -2s); }
html.h-motion .bk.is-in .bk__cover { animation: bk-peek 1.9s var(--h-ease) backwards; animation-delay: calc(.35s + var(--i, 0) * .28s); }
html.h-motion .bk:hover .bk__cover, html.h-motion .bk:focus-visible .bk__cover { animation: none; }
.bk[data-reveal] { transition: opacity .6s var(--h-ease) calc(var(--reveal-i, 0) * 90ms), transform .6s var(--h-ease) calc(var(--reveal-i, 0) * 90ms); }

@media (prefers-reduced-motion: reduce) {
  .bk__obj, .bk__cover, .bk__sheen, .bk__seal, .bk__ribbon { transition: none !important; }
  .bk__float, .bk__shadow, .bk__cover { animation: none !important; }
}
@media (hover: none) {
  .bk:hover .bk__obj { transform: rotateY(-18deg) rotateX(3deg); }
  .bk:hover .bk__cover { transform: none; }
}

/* phones: the home shelf becomes a swipeable row, the next book peeking in */
@media (max-width: 860px) {
  .bk { --bk-h: 300px; --bk-t: 24px; }
  .bk__t { font-size: 1.6rem; }
  .bk__t--long { font-size: 1.35rem; }
  .bk-shelf {
    display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    margin: 36px -20px 0; padding: 8px 20px 12px; scrollbar-width: none;
  }
  .bk-shelf::-webkit-scrollbar { display: none; }
  .bk-shelf .bk { flex: 0 0 68%; max-width: 260px; scroll-snap-align: center; margin: 0; }
}

/* ---------- Manual cards (replace the book shelf) ---------- */
.mc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.mc-grid--hero { margin-top: 28px; }
.mc-grid--home { margin-top: 40px; }
.mc {
  --mc-a: #2A5290;
  position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0;
  padding: 20px 20px 18px; border-radius: 14px; text-decoration: none; color: rgb(var(--c-ink));
  background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line));
  box-shadow: inset 0 3px 0 var(--mc-a);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.mc--ca   { --mc-a: #2A5290; }
.mc--ibc  { --mc-a: #B0821F; }
.mc--comp { --mc-a: #3A3F4B; }
.mc--llp  { --mc-a: #2F7A5B; }
.mc--ica  { --mc-a: #8A3A2B; }
:root[data-theme="dark"] .mc--ca   { --mc-a: #6F95D6; }
:root[data-theme="dark"] .mc--comp { --mc-a: #9AA0AD; }
:root[data-theme="dark"] .mc--llp  { --mc-a: #55B18A; }
:root[data-theme="dark"] .mc--ica  { --mc-a: #D87A68; }
.mc--soon {
  --mc-a: rgb(var(--c-line));
  background: transparent; border-style: dashed; border-width: 1.5px; box-shadow: none;
  opacity: .78; cursor: default;
}
.mc--soon:hover { transform: none; border-color: rgb(var(--c-line)); box-shadow: none; }
.mc__soon { font: 700 .64rem/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; background: rgb(var(--c-ink) / .06); color: rgb(var(--c-ink-3)); border: 1px solid rgb(var(--c-line)); margin-left: auto; }

/* ---------- General Laws dropdown group ---------- */
.mc-group {
  margin-top: 22px; border-radius: 18px;
  border: 1px solid rgb(var(--c-line)); background: rgb(var(--c-surface) / .65);
  overflow: hidden; transition: border-color .2s ease, box-shadow .2s ease;
}
.mc-group[open] {
  background: rgb(var(--c-surface));
  box-shadow: 0 18px 38px -28px rgb(10 12 18 / .28);
}
.mc-group__sum {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 18px 22px; transition: background-color .18s ease;
}
.mc-group__sum::-webkit-details-marker { display: none; }
.mc-group__sum:hover { background: rgb(var(--c-ink) / .025); }
.mc-group__k {
  font: 700 .72rem/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  color: rgb(var(--c-amber)); padding: 4px 10px; border-radius: 999px;
  background: rgb(var(--c-amber-soft)); border: 1px solid rgb(var(--c-amber-line));
}
.mc-group__t {
  font: 600 1.32rem/1.2 var(--serif); color: rgb(var(--c-ink)); letter-spacing: -.01em;
}
.mc-group__sub {
  font-size: .88rem; color: rgb(var(--c-ink-2));
}
.mc-group__r {
  margin-left: auto; display: inline-flex; align-items: center; gap: 10px;
}
.mc-group__pill {
  font: 600 .75rem/1 var(--sans); color: rgb(var(--c-ink-2));
  padding: 5px 10px; border-radius: 999px; background: rgb(var(--c-bg)); border: 1px solid rgb(var(--c-line));
}
.mc-group__chev {
  width: 32px; height: 32px; border-radius: 999px; border: 1px solid rgb(var(--c-line));
  display: inline-flex; align-items: center; justify-content: center;
  color: rgb(var(--c-ink-2)); background: rgb(var(--c-surface));
  transition: transform .25s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
}
.mc-group__chev svg { width: 16px; height: 16px; }
.mc-group__sum:hover .mc-group__chev { border-color: rgb(var(--c-amber)); color: rgb(var(--c-amber)); }
.mc-group[open] .mc-group__chev { transform: rotate(180deg); background: rgb(var(--c-amber-soft)); border-color: rgb(var(--c-amber-line)); color: rgb(var(--c-amber)); }
.mc-group__body {
  padding: 4px 22px 22px; border-top: 1px solid rgb(var(--c-line-2));
}
.mc-group__grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px;
}
@media (max-width: 960px) {
  .mc-group__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .mc-group__sum { padding: 16px; }
  .mc-group__sub { flex-basis: 100%; font-size: .82rem; }
  .mc-group__body { padding: 4px 16px 16px; }
  .mc-group__grid { grid-template-columns: 1fr; gap: 12px; }
}
.mc:hover { border-color: rgb(var(--c-amber-line)); transform: translateY(-2px); box-shadow: inset 0 3px 0 var(--mc-a), 0 14px 30px -20px rgb(10 12 18 / .35); }
.mc:focus-visible { outline: 2px solid rgb(var(--c-amber)); outline-offset: 2px; }
.mc__top { display: flex; align-items: center; gap: 8px; }
.mc__act { font: 700 .7rem/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: rgb(var(--c-ink) / .6); }
.mc__new { font: 700 .66rem/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 4px 7px; border-radius: 999px; background: rgb(var(--c-amber-soft)); color: rgb(var(--c-amber)); border: 1px solid rgb(var(--c-amber-line)); }
.mc__go { margin-left: auto; width: 30px; height: 30px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgb(var(--c-line)); color: rgb(var(--c-ink) / .7); transition: background .18s ease, color .18s ease, border-color .18s ease; flex: none; }
.mc__go svg { width: 15px; height: 15px; }
.mc:hover .mc__go { background: rgb(var(--c-amber)); border-color: rgb(var(--c-amber)); color: #fff; }
.mc__t { font: 600 1.2rem/1.25 var(--serif); letter-spacing: -.005em; }
.mc__d { font-size: .9rem; line-height: 1.5; color: rgb(var(--c-ink) / .72); flex: 1; }
.mc__meta { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 1px solid rgb(var(--c-line)); }
.mc__meta span { font: 600 .74rem/1 var(--sans); padding: 5px 8px; border-radius: 6px; background: rgb(var(--c-ink) / .05); color: rgb(var(--c-ink) / .75); }
.m-demo-wrap { margin-top: 40px; display: flex; justify-content: center; }
.m-demo-wrap > * { max-width: 100%; }
@media (max-width: 1080px) { .mc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .mc-grid { grid-template-columns: 1fr; gap: 12px; } .mc { padding: 18px 16px 16px; } .mc__t { font-size: 1.12rem; } }
@media (prefers-reduced-motion: reduce) { .mc, .mc__go { transition: none; } .mc:hover { transform: none; } }

/* ---------- Mobile app download showcase ---------- */
.h-hero__sublinks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 20px; }
.h-hero__sublinks .h-hero__tz { margin-top: 0; }
.h-hero__sep { color: rgb(var(--c-ink-3)); font-size: .9rem; user-select: none; }
.h-hero__app { color: rgb(var(--c-amber)); }

.h-app {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  border-radius: 24px; background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line));
  box-shadow: 0 1px 2px rgba(16, 20, 30, .04), 0 24px 48px -30px rgba(16, 20, 30, .2);
  overflow: hidden;
}
.h-app__main {
  padding: 44px 44px 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
}
.h-app__badge {
  display: inline-flex; align-items: center; gap: 12px; align-self: flex-start;
}
.h-app__icon {
  width: 42px; height: 42px; border-radius: 11px; flex: none;
  background: #161c1d; color: #d9a441; font: 700 1.05rem/1 var(--serif);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px -6px rgba(16, 20, 30, .35);
}
.h-app__icon span { color: #f8f7f4; }
.h-app__main h2 {
  margin: 14px 0 0; font: 600 clamp(1.85rem, 3.1vw, 2.55rem)/1.1 var(--serif);
  letter-spacing: -.02em; color: rgb(var(--c-ink)); max-width: 17ch; text-wrap: balance;
}
.h-app__lead {
  margin: 14px 0 0; font-size: 1rem; line-height: 1.62; color: rgb(var(--c-ink-2)); max-width: 44ch;
}
.h-app__ctas {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; padding-top: 4px;
}
.h-app__meta {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font: 600 .8rem/1.3 var(--sans); color: rgb(var(--c-ink-3));
}
.h-app__meta span {
  padding: 5px 10px; border-radius: 999px; background: rgb(var(--c-bg)); border: 1px solid rgb(var(--c-line)); color: rgb(var(--c-ink-2));
}
.h-app__guide {
  padding: 40px 42px; background-color: rgb(var(--h-paper));
  border-left: 1px solid rgb(var(--c-line));
  background-image: linear-gradient(var(--h-grid) 1px, transparent 1px), linear-gradient(90deg, var(--h-grid) 1px, transparent 1px);
  background-size: 44px 44px;
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
}
.h-app__gh {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 14px; border-bottom: 1px solid rgb(var(--c-line));
}
.h-app__gh b {
  font: 700 .74rem/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: rgb(var(--c-ink));
}
.h-app__gh span {
  font: 600 .74rem/1 var(--sans); padding: 5px 10px; border-radius: 999px;
  background: rgb(var(--c-amber-soft)); color: rgb(var(--c-amber)); border: 1px solid rgb(var(--c-amber-line));
}
.h-app__steps {
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px;
}
.h-app__step {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; align-items: start;
}
.h-app__no {
  width: 34px; height: 34px; border-radius: 10px;
  background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line));
  font: 700 .78rem/1 var(--sans); color: rgb(var(--c-amber));
  display: inline-flex; align-items: center; justify-content: center; margin-top: 1px;
}
.h-app__step div b {
  display: block; font: 600 .95rem/1.35 var(--sans); color: rgb(var(--c-ink)); margin-bottom: 3px;
}
.h-app__step div p {
  margin: 0; font-size: .88rem; line-height: 1.55; color: rgb(var(--c-ink-2)); max-width: none;
}
.h-app__step div em {
  font-style: normal; font-weight: 600; color: rgb(var(--c-ink));
  background: rgb(var(--c-amber-soft)); border: 1px solid rgb(var(--c-amber-line));
  padding: 1px 6px; border-radius: 5px; font-size: .82rem;
}
@media (max-width: 920px) {
  .h-app { grid-template-columns: minmax(0, 1fr); }
  .h-app__guide { border-left: 0; border-top: 1px solid rgb(var(--c-line)); }
}
@media (max-width: 600px) {
  .h-app__main, .h-app__guide { padding: 26px 22px; }
  .h-app__ctas .h-btn { width: 100%; justify-content: center; }
}
