/* ============================================================
   tejas.decodes · courses, resources and manuals pages
   Loaded after home.css, which supplies the h- system (grid paper,
   highlighter, buttons, hero motion) and the 3D books (bk-).
   c- = courses, r- = resources, m- = manuals, p- = shared.
   ============================================================ */

/* shorter hero than the home page */
.p-hero { padding: 72px 0 88px; }
.p-hero h1 { font-size: clamp(2.6rem, 5.4vw, 4.6rem); line-height: 1.02; }
body.h-page .p-hero h1 { margin-bottom: 0; }
.h-page [id] { scroll-margin-top: 88px; }

/* ============================================================
   COURSES
   ============================================================ */
.c-ticket { flex: 1 1 360px; max-width: 440px; margin: 0; position: relative; padding: 28px 28px 24px; background: rgb(var(--h-paper)); border: 1px solid rgb(var(--c-line)); border-radius: 20px; box-shadow: 0 30px 60px -36px rgb(16 20 30 / .38); transform: rotate(-1deg); }
.c-ticket::before, .c-ticket::after { content: ""; position: absolute; top: 64px; width: 18px; height: 18px; border-radius: 999px; background: rgb(var(--c-bg)); border: 1px solid rgb(var(--c-line)); }
.c-ticket::before { left: -10px; clip-path: inset(0 0 0 50%); }
.c-ticket::after { right: -10px; clip-path: inset(0 50% 0 0); }
.c-ticket__top { display: flex; justify-content: space-between; align-items: center; padding-bottom: 18px; margin-bottom: 6px; border-bottom: 1.5px dashed rgb(var(--c-line)); font: 600 .78rem var(--sans); color: rgb(var(--c-ink-3)); }
.c-ticket__row { display: flex; align-items: baseline; gap: 12px; padding: 14px 0; border-bottom: 1px solid rgb(var(--c-line-2)); font-size: .98rem; color: rgb(var(--c-ink-2)); }
.c-ticket__row > span:first-child { margin-right: auto; }
.c-ticket__row b { font: 700 1.45rem var(--serif); color: rgb(var(--c-ink)); font-variant-numeric: tabular-nums; }
.c-ticket__was { position: relative; font: 500 .95rem var(--serif); color: rgb(var(--c-ink-3)); }
.c-ticket__was::after { content: ""; position: absolute; left: -2px; right: -2px; top: 55%; height: 1.5px; background: rgb(var(--c-red-ink)); transform-origin: left; }
.c-ticket__row--best { border-bottom: 0; color: rgb(var(--c-ink)); font-weight: 600; }
.c-ticket__row--best b { color: rgb(var(--c-amber)); font-size: 1.8rem; }
.c-ticket figcaption { margin-top: 10px; padding-top: 14px; border-top: 1.5px dashed rgb(var(--c-line)); font: italic 1rem/1.5 var(--serif); color: rgb(var(--c-ink-2)); }
.c-ticket__stamp { top: auto; bottom: -16px; right: -12px; transform: rotate(-5deg); }

.c-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; margin-top: 8px; }
.c-papers { display: flex; flex-direction: column; gap: 20px; }
.c-paper { position: relative; display: flex; flex-direction: column; gap: 16px; padding: 30px 32px; background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line)); border-radius: 20px; transition: border-color .3s ease, box-shadow .3s ease, transform .3s var(--h-ease); }
.c-paper:hover { border-color: rgb(var(--c-ink-3)); box-shadow: 0 26px 50px -34px rgb(16 20 30 / .4); }
.c-paper.is-picked { border-color: rgb(var(--c-ink)); box-shadow: 0 0 0 1px rgb(var(--c-ink)), 0 26px 50px -34px rgb(16 20 30 / .4); }
.c-paper__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; font-size: .84rem; color: rgb(var(--c-ink-2)); }
.c-paper__n { font: 600 .85rem var(--sans); letter-spacing: .06em; color: rgb(var(--c-amber)); }
.c-paper__in { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font: 700 .72rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: rgb(var(--c-green-ink)); background: rgb(var(--c-green-soft)); border: 1px solid rgb(var(--c-green-line)); padding: 4px 10px; border-radius: 999px; opacity: 0; transform: translateY(4px) scale(.95); transition: opacity .25s ease, transform .3s var(--h-ease); }
.c-paper__in svg { width: 13px; height: 13px; }
.c-paper.is-picked .c-paper__in { opacity: 1; transform: none; }
.c-paper.is-picked .h-code { background: rgb(var(--c-ink)); color: rgb(var(--c-bg)); border-color: rgb(var(--c-ink)); }
.c-paper h3 { margin: 0; font: 600 1.75rem/1.18 var(--serif); letter-spacing: -.01em; color: rgb(var(--c-ink)); }
.c-topics { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px !important; }
.c-paper__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 6px; padding-top: 20px; border-top: 1px solid rgb(var(--c-line-2)); }
.c-price { margin-right: auto; display: flex; align-items: baseline; gap: 8px; }
.c-price b { font: 700 1.9rem var(--serif); color: rgb(var(--c-ink)); }
.c-price small { font-size: .85rem; color: rgb(var(--c-ink-2)); }
.c-paper__btns { display: flex; flex-wrap: wrap; gap: 10px; }
.c-paper__btns .h-btn { height: 48px; padding: 0 20px; cursor: pointer; }
.c-add svg { width: 18px; height: 18px; }
.c-add .c-ico-check { display: none; }
.c-add[aria-pressed="true"] { background: rgb(var(--c-green-soft)); border-color: rgb(var(--c-green-ink)); color: rgb(var(--c-green-ink)); }
.c-add[aria-pressed="true"] .c-ico-plus { display: none; }
.c-add[aria-pressed="true"] .c-ico-check { display: block; }
.c-add:hover svg { transform: none; }
.c-add .c-ico-plus { transition: transform .3s var(--h-ease); }
.c-add:hover .c-ico-plus { transform: rotate(90deg); }

/* the package builder */
.c-builder { position: sticky; top: 92px; padding: 26px; background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line)); border-radius: 22px; box-shadow: 0 30px 60px -40px rgb(16 20 30 / .45); }
.c-builder__head { display: flex; justify-content: space-between; align-items: center; }
.c-builder__count { font: 600 .8rem var(--sans); color: rgb(var(--c-ink-3)); font-variant-numeric: tabular-nums; }
.c-builder__title { margin: 10px 0 0; font: 600 1.45rem/1.2 var(--serif); color: rgb(var(--c-ink)); }
.c-steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.c-steps li { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 10px 9px; border-radius: 12px; background: rgb(var(--c-bg)); border: 1px solid rgb(var(--c-line)); font-size: .78rem; color: rgb(var(--c-ink-3)); transition: background-color .3s ease, border-color .3s ease, color .3s ease, transform .3s var(--h-ease); }
.c-steps li b { font: 700 .72rem var(--sans); letter-spacing: .06em; text-transform: uppercase; }
.c-steps li b::after { content: " paper"; }
.c-steps li[data-step="2"] b::after, .c-steps li[data-step="3"] b::after { content: " papers"; }
.c-steps li span { font: 600 .98rem var(--serif); color: rgb(var(--c-ink-2)); }
.c-steps li.is-past { border-color: rgb(var(--c-line)); background: rgb(var(--c-line-2)); }
.c-steps li.is-on { background: rgb(var(--c-amber-soft)); border-color: rgb(var(--c-amber)); color: rgb(var(--c-amber)); transform: translateY(-2px); }
.c-steps li.is-on span { color: rgb(var(--c-ink)); }
.c-builder__list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.c-builder__list li { display: grid; grid-template-columns: auto minmax(0, 1fr) 36px; align-items: center; gap: 10px; padding: 8px 6px 8px 10px; border: 1px solid rgb(var(--c-line)); border-radius: 12px; font-size: .88rem; line-height: 1.3; color: rgb(var(--c-ink)); }
.c-builder [hidden] { display: none !important; }
.c-builder__list li:not([hidden]) { animation: c-in .35s var(--h-ease); }
.c-builder__list .h-code { font-size: .68rem; padding: 4px 8px; }
.c-x { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: rgb(var(--c-ink-3)); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.c-x:hover { background: rgb(var(--c-red-soft)); color: rgb(var(--c-red-ink)); }
.c-x svg { width: 16px; height: 16px; }
.c-builder__empty { margin: 16px 0 0; padding: 14px; border: 1.5px dashed rgb(var(--c-line)); border-radius: 12px; font-size: .88rem; line-height: 1.5; color: rgb(var(--c-ink-2)); max-width: none; }
.c-builder__sum { display: flex; align-items: baseline; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid rgb(var(--c-line-2)); }
.c-builder__lbl { margin-right: auto; font: 600 .85rem var(--sans); color: rgb(var(--c-ink-2)); }
.c-builder__was { font: 500 1rem var(--serif); color: rgb(var(--c-ink-3)); text-decoration: line-through; text-decoration-color: rgb(var(--c-red-ink)); }
.c-builder__sum b { font: 700 2.2rem/1 var(--serif); color: rgb(var(--c-ink)); font-variant-numeric: tabular-nums; display: inline-block; }
.c-builder.is-bump .c-builder__sum b { animation: c-bump .45s var(--h-ease); }
.c-save { margin: 8px 0 0; font: 600 .85rem var(--sans); color: rgb(var(--c-green-ink)); text-align: right; max-width: none; }
.c-builder__go { width: 100%; justify-content: center; margin-top: 18px; cursor: pointer; }
.c-builder__go:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.c-builder__note { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; font-size: .78rem; line-height: 1.45; color: rgb(var(--c-ink-3)); max-width: none; }
.c-builder__note svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
@keyframes c-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes c-bump { 0% { transform: scale(1); } 40% { transform: scale(1.08); color: rgb(var(--c-amber)); } 100% { transform: scale(1); } }

/* all packages */
.c-pkgs { margin-top: 40px; display: flex; flex-direction: column; gap: 12px; }
.c-pkg { display: grid; grid-template-columns: minmax(0, 1fr) auto 170px; gap: 24px; align-items: center; padding: 22px 26px; background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line)); border-radius: 18px; transition: transform .3s var(--h-ease), border-color .3s ease, opacity .55s var(--h-ease) calc(var(--reveal-i, 0) * 80ms) !important; }
.c-pkg:hover { border-color: rgb(var(--c-ink-3)); }
.c-pkg__what b { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font: 600 1.25rem var(--serif); color: rgb(var(--c-ink)); }
.c-pkg__what > span { display: block; margin-top: 4px; font-size: .9rem; line-height: 1.5; color: rgb(var(--c-ink-2)); }
.c-pkg__price { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.c-pkg__price s { font: 500 .95rem var(--serif); color: rgb(var(--c-ink-3)); text-decoration-color: rgb(var(--c-red-ink)); }
.c-pkg__price b { font: 700 1.6rem var(--serif); color: rgb(var(--c-ink)); }
.c-pkg .h-btn { justify-content: center; height: 48px; cursor: pointer; }
.c-pkg--best { background: rgb(var(--c-amber-soft)); border-color: rgb(var(--c-amber-line)); }
.c-pkg--best .c-pkg__price b { color: rgb(var(--c-amber)); }
.c-pill { font: 700 .68rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: rgb(var(--c-amber)); background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-amber-line)); border-radius: 999px; padding: 4px 10px; }

/* method */
.c-how { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0; counter-reset: none; border-top: 1px solid rgb(var(--c-line)); }
.c-how li { padding: 32px 28px 8px 0; position: relative; }
.c-how li + li { padding-left: 28px; border-left: 1px solid rgb(var(--c-line)); }
.c-how__n { display: block; font: 600 3.4rem/1 var(--serif); letter-spacing: -.03em; color: rgb(var(--c-amber)); opacity: .9; }
.c-how h3 { margin: 18px 0 0; font: 600 1.5rem/1.2 var(--serif); color: rgb(var(--c-ink)); }
.c-how p { margin: 10px 0 0; font-size: 1rem; line-height: 1.65; color: rgb(var(--c-ink-2)); }

/* questions */
.c-faq-wrap { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 64px; align-items: start; }
.c-faq { border-top: 1px solid rgb(var(--c-line)); }
.c-faq details { border-bottom: 1px solid rgb(var(--c-line)); }
.c-faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 44px; padding: 22px 0; font: 600 1.2rem/1.35 var(--serif); color: rgb(var(--c-ink)); }
.c-faq summary::-webkit-details-marker { display: none; }
.c-faq summary span { position: relative; flex: none; width: 32px; height: 32px; border-radius: 999px; border: 1.5px solid rgb(var(--c-line)); transition: transform .3s var(--h-ease), background-color .2s ease; }
.c-faq summary span::before, .c-faq summary span::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; margin: -1px 0 0 -6px; background: rgb(var(--c-ink)); border-radius: 2px; }
.c-faq summary span::after { transform: rotate(90deg); transition: transform .3s var(--h-ease); }
.c-faq details[open] summary span { background: rgb(var(--c-amber-soft)); border-color: rgb(var(--c-amber-line)); }
.c-faq details[open] summary span::after { transform: rotate(0); }
.c-faq details p { margin: 0 0 24px; font-size: 1rem; line-height: 1.7; color: rgb(var(--c-ink-2)); max-width: 40em; }
html.h-motion .c-faq details[open] p { animation: c-in .35s var(--h-ease); }

/* ============================================================
   RESOURCES
   ============================================================ */
.r-jump { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.r-jump a { flex: 1 1 220px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 12px; padding: 16px 20px; background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line)); border-radius: 16px; text-decoration: none; color: rgb(var(--c-ink)); transition: transform .25s var(--h-ease), border-color .25s ease, box-shadow .25s ease; }
.r-jump a:hover { color: rgb(var(--c-ink)); transform: translateY(-3px); border-color: rgb(var(--c-amber-line)); box-shadow: 0 18px 34px -24px rgb(16 20 30 / .45); }
.r-jump span { font: 600 1rem var(--sans); }
.r-jump b { grid-row: 1 / span 2; grid-column: 2; font: 600 2rem/1 var(--serif); color: rgb(var(--c-amber)); }
.r-jump small { font-size: .8rem; color: rgb(var(--c-ink-3)); }

.r-stack { flex: 1 1 360px; max-width: 460px; margin: 0; position: relative; padding: 0 0 24px 24px; }
.r-stack__sheet { position: relative; background: rgb(var(--h-paper)); border: 1px solid rgb(var(--c-line)); border-radius: 20px; }
.r-stack__sheet--3, .r-stack__sheet--2 { position: absolute; inset: 24px 24px 0 0; }
.r-stack__sheet--3 { transform: rotate(-6deg); opacity: .55; }
.r-stack__sheet--2 { transform: rotate(-3deg); opacity: .8; }
.r-stack__sheet--1 { padding: 28px; box-shadow: 0 30px 60px -36px rgb(16 20 30 / .38); transform: rotate(1deg); }
.r-stack__top { display: flex; justify-content: space-between; align-items: center; font: 600 .78rem var(--sans); color: rgb(var(--c-ink-3)); }
.r-stack__steps { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.r-stack__steps li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; align-items: start; font: 1.08rem/1.5 var(--serif); color: rgb(var(--c-ink)); }
.r-stack__steps b { width: 34px; height: 34px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: rgb(var(--c-ink)); color: rgb(var(--c-bg)); font: 700 .85rem var(--sans); }
.r-stack__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid rgb(var(--c-line-2)); }
.r-stack__tags span { font: 600 .78rem var(--sans); color: rgb(var(--c-ink-2)); border: 1px solid rgb(var(--c-line)); border-radius: 999px; padding: 5px 11px; background: rgb(var(--c-surface)); }
@keyframes r-fan3 { from { transform: rotate(0); } to { transform: rotate(-6deg); } }
@keyframes r-fan2 { from { transform: rotate(0); } to { transform: rotate(-3deg); } }
html.h-motion .r-stack { opacity: 0; animation: h-rise .9s var(--h-ease) .3s forwards; }
html.h-motion .r-stack__sheet--3 { animation: r-fan3 .9s var(--h-ease) .9s backwards; }
html.h-motion .r-stack__sheet--2 { animation: r-fan2 .9s var(--h-ease) .8s backwards; }
html.h-motion .r-stack__steps li { opacity: 0; animation: h-fade-right .5s var(--h-ease) forwards; }
html.h-motion .r-stack__steps li:nth-child(1) { animation-delay: 1.1s; }
html.h-motion .r-stack__steps li:nth-child(2) { animation-delay: 1.3s; }
html.h-motion .r-stack__steps li:nth-child(3) { animation-delay: 1.5s; }

.r-level__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 26px; border-bottom: 2px solid rgb(var(--c-amber) / .55); }
.r-level__count { text-align: right; }
.r-level__count b { display: block; font: 600 clamp(2.6rem, 5vw, 3.6rem)/1 var(--serif); letter-spacing: -.02em; color: rgb(var(--c-ink)); font-variant-numeric: tabular-nums; }
.r-level__count span { display: block; margin-top: 6px; font-size: .88rem; color: rgb(var(--c-ink-2)); }
.r-group { margin-top: 40px; }
.r-label { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font: 700 .8rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: rgb(var(--c-ink-2)); }
.r-tag { font: 700 .66rem var(--sans); letter-spacing: .08em; color: rgb(var(--c-amber)); background: rgb(var(--c-amber-soft)); border: 1px solid rgb(var(--c-amber-line)); border-radius: 999px; padding: 3px 9px; }
.r-tag--soon { color: rgb(var(--c-green-ink)); background: rgb(var(--c-green-soft)); border-color: rgb(var(--c-green-line)); }
.r-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.r-card { display: flex; flex-direction: column; gap: 12px; padding: 24px; background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line)); border-radius: 20px; text-decoration: none; color: rgb(var(--c-ink)); transition: transform .3s var(--h-ease), box-shadow .3s ease, border-color .3s ease, opacity .55s var(--h-ease) calc(var(--reveal-i, 0) * 80ms) !important; }
.r-card:hover { color: rgb(var(--c-ink)); transform: translateY(-5px); border-color: rgb(var(--c-amber-line)); box-shadow: 0 26px 50px -32px rgb(16 20 30 / .45); }
.r-card__top { display: flex; justify-content: space-between; align-items: center; }
.r-card__go { width: 40px; height: 40px; 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); }
.r-card__go svg { width: 18px; height: 18px; }
.r-card:hover .r-card__go { background: rgb(var(--c-ink)); color: rgb(var(--c-bg)); border-color: rgb(var(--c-ink)); transform: rotate(-45deg); }
.r-card__name { font: 600 1.3rem/1.25 var(--serif); min-height: 2.5em; }
.r-card__q { display: flex; align-items: baseline; gap: 8px; font-size: .9rem; color: rgb(var(--c-ink-2)); }
.r-card__q b { font: 600 2.2rem/1 var(--serif); letter-spacing: -.02em; color: rgb(var(--c-ink)); font-variant-numeric: tabular-nums; }
html.h-motion html.h-motion .is-in .r-card__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .84rem; color: rgb(var(--c-ink-3)); }
.r-card__meta span + span::before { content: "·"; margin-right: 14px; }
.r-card--next { background: transparent; border-style: dashed; border-width: 1.5px; justify-content: center; }
.r-card--next .r-card__name { min-height: 0; color: rgb(var(--c-ink-2)); }
.r-card--next:hover { transform: none; box-shadow: none; border-color: rgb(var(--c-line)); }
.r-soon { display: flex; gap: 16px; align-items: flex-start; padding: 22px 24px; border: 1.5px dashed rgb(var(--c-line)); border-radius: 18px; font-size: .98rem; line-height: 1.6; color: rgb(var(--c-ink-2)); max-width: 760px; }
.r-soon strong { color: rgb(var(--c-ink)); }
.r-soon a { color: rgb(var(--c-accent)); font-weight: 600; }
.r-soon__ico { flex: none; width: 40px; height: 40px; border-radius: 12px; background: rgb(var(--c-amber-soft)); color: rgb(var(--c-amber)); display: inline-flex; align-items: center; justify-content: center; }
.r-soon__ico svg { width: 20px; height: 20px; }

/* ============================================================
   MANUALS
   ============================================================ */
.m-spines { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; }
.m-spine { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px 0 24px; border-radius: 4px 12px 12px 4px; color: #F8F7F4; text-decoration: none; font: 600 .92rem var(--sans); box-shadow: 0 12px 22px -16px rgb(10 12 18 / .7); transition: transform .3s var(--h-ease); overflow: hidden; }
.m-spine::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 9px; background: linear-gradient(90deg, rgb(0 0 0 / .35), rgb(0 0 0 / .1)); }
.m-spine small { font: 600 .78rem var(--serif); opacity: .75; }
.m-spine:hover { color: #F8F7F4; transform: translateY(-3px) rotate(-1deg); }
@media (hover: none) { .m-spine:hover { transform: none; } }
.m-spine--ca { background: linear-gradient(150deg, #2A5290, #132A4F); }
.m-spine--ibc { background: linear-gradient(150deg, #8C6416, #4F3707); }
.m-spine--comp { background: linear-gradient(150deg, #3A3F4B, #1A1C22); }

.m-demo { transform: rotate(1deg); }
.m-old { position: relative; color: rgb(var(--c-red-ink)); }
.m-old::after { content: ""; position: absolute; left: -2px; right: -2px; top: 55%; height: 2px; background: rgb(var(--c-red-ink)); transform-origin: left; }
.m-new-w { color: rgb(var(--c-green-ink)); background: linear-gradient(transparent 52%, rgb(var(--h-mark)) 52%, rgb(var(--h-mark)) 92%, transparent 92%); padding: 0 .08em; font-weight: 600; }
html.h-motion .m-old::after { transform: scaleX(0); animation: h-strike .5s var(--h-ease) 1.4s forwards; }
html.h-motion .m-new-w { display: inline-block; opacity: 0; animation: h-fade-right .5s var(--h-ease) 1.85s forwards; }

.m-list .h-wrap { display: flex; flex-direction: column; }
.m-row { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 72px; align-items: center; padding: 56px 0; border-top: 1px solid rgb(var(--c-line)); }
.m-row:first-child { border-top: 0; padding-top: 8px; }
.m-row:last-child { padding-bottom: 0; }
.m-row--flip { grid-template-columns: minmax(0, 1fr) 320px; }
.m-row--flip .m-row__book { order: 2; }
.m-row__book .bk { --bk-h: 380px; --bk-t: 34px; max-width: 300px; }
.m-row__eb { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.m-row__eb .h-eb { color: rgb(var(--c-ink-2)); }
.m-new { font: 700 .68rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: rgb(var(--c-amber)); background: rgb(var(--c-amber-soft)); border: 1px solid rgb(var(--c-amber-line)); border-radius: 999px; padding: 3px 9px; }
.m-row__t { margin: 14px 0 0; font: 600 clamp(2rem, 3.4vw, 2.75rem)/1.08 var(--serif); letter-spacing: -.02em; color: rgb(var(--c-ink)); }
.m-row__copy > p { margin: 16px 0 0; font: 1.15rem/1.65 var(--serif); color: rgb(var(--c-ink-2)); max-width: 34em; }
.m-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.m-chips span { font: 600 .82rem var(--sans); color: rgb(var(--c-ink-2)); border: 1px solid rgb(var(--c-line)); border-radius: 999px; padding: 6px 12px; background: rgb(var(--c-surface)); }
.m-open { margin-top: 28px; }
html.h-motion .m-row__copy > * { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--h-ease), transform .6s var(--h-ease); }
html.h-motion .m-row__copy.is-in > * { opacity: 1; transform: none; }
html.h-motion .m-row__copy.is-in > :nth-child(2) { transition-delay: .08s; }
html.h-motion .m-row__copy.is-in > :nth-child(3) { transition-delay: .16s; }
html.h-motion .m-row__copy.is-in > :nth-child(4) { transition-delay: .24s; }
html.h-motion .m-row__copy.is-in > :nth-child(5) { transition-delay: .32s; }
/* the row's book also reacts when the reader hovers its text */
.m-row:hover .bk__obj { transform: rotateY(-6deg) rotateX(2deg) translateY(-10px); }
.m-row:hover .bk__cover { transform: rotateY(-58deg); animation: none; }
.m-row:hover .bk__sheen, .m-row:hover .bk__seal { background-position: 0 0; }
.m-row:hover .bk__ribbon { height: 48px; }

.m-layers { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.m-layer { display: flex; flex-direction: column; gap: 12px; padding: 30px; 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, opacity .55s var(--h-ease) calc(var(--reveal-i, 0) * 80ms) !important; }
.m-layer:hover { transform: translateY(-4px); border-color: rgb(var(--c-amber-line)); }
.m-layer__n { font: 600 .9rem var(--sans); letter-spacing: .06em; color: rgb(var(--c-amber)); }
.m-layer h3 { margin: 0; font: 600 1.55rem/1.2 var(--serif); color: rgb(var(--c-ink)); }
.m-layer p { margin: 0; font-size: 1rem; line-height: 1.65; color: rgb(var(--c-ink-2)); }
.m-layer__fig { margin-top: auto; padding: 16px; border-radius: 12px; background: rgb(var(--h-paper)); border: 1px solid rgb(var(--c-line-2)); display: flex; flex-direction: column; gap: 9px; }
.m-layer__fig i { display: block; height: 6px; border-radius: 3px; background: rgb(var(--c-line)); }
.m-layer__fig i:nth-child(2) { width: 86%; }
.m-layer__fig i:nth-child(3) { width: 62%; }
.m-layer__fig--amd i:nth-child(2) { background: linear-gradient(90deg, rgb(var(--c-line)) 0 35%, rgb(var(--h-mark)) 35% 75%, rgb(var(--c-line)) 75%); }
.m-layer__fig--amd i:nth-child(3) { background: linear-gradient(rgb(var(--c-red-ink)), rgb(var(--c-red-ink))) 0 50% / 100% 1.5px no-repeat, rgb(var(--c-line)); }
.m-layer__fig--rule i:nth-child(2), .m-layer__fig--rule i:nth-child(3) { margin-left: 18px; background: rgb(var(--c-accent) / .35); }
.m-layer__fig--rule i:nth-child(2) { width: calc(86% - 18px); }
.m-layer__fig--rule i:nth-child(3) { width: calc(62% - 18px); }

/* ============================================================
   Reduced motion and small screens
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .c-paper, .c-steps li, .c-paper__in, .c-pkg, .r-card, .r-jump a, .m-spine, .m-layer, .c-faq summary span, .c-faq summary span::after { transition: none !important; }
  .c-builder__list li, .c-builder.is-bump .c-builder__sum b { animation: none !important; }
}

@media (max-width: 1060px) {
  .c-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; }
  .c-topics { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .p-hero { padding: 44px 0 60px; }
  .c-ticket { transform: none; padding: 22px 20px 20px; }
  .c-ticket__stamp { right: 10px; }
  .c-layout { grid-template-columns: minmax(0, 1fr); }
  .c-paper { padding: 24px 20px; }
  .c-paper h3 { font-size: 1.45rem; }
  .c-paper:not(.is-picked) .c-paper__in { display: none; }
  .c-paper__btns { width: 100%; }
  .c-paper__btns .h-btn { flex: 1 1 100%; justify-content: center; }
  /* builder becomes a bar along the bottom once something is added */
  .c-builder { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); top: auto; z-index: 60; padding: 12px 12px 12px 18px; border-radius: 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 12px; box-shadow: 0 18px 40px -12px rgb(10 12 18 / .45); transform: translateY(calc(100% + 30px)); visibility: hidden; transition: transform .45s var(--h-ease), visibility 0s linear .45s; }
  .c-builder.has-items { transform: none; visibility: visible; transition: transform .45s var(--h-ease), visibility 0s; }
  .c-builder__head, .c-steps, .c-builder__list, .c-builder__empty, .c-builder__note, .c-builder__title { display: none; }
  .c-builder__sum { grid-column: 1; grid-row: 1; margin: 0; padding: 0; border: 0; gap: 8px; }
  .c-builder__lbl { display: none; }
  .c-builder__sum b { font-size: 1.6rem; }
  .c-save { grid-column: 1; grid-row: 2; margin: 2px 0 0; text-align: left; font-size: .75rem; }
  .c-builder__go { grid-column: 2; grid-row: 1 / span 2; width: auto; margin: 0; height: 50px; padding: 0 16px; }
  .c-builder__go svg { display: none; }
  body.c-has-pkg footer { padding-bottom: 110px; }
  .c-pkg { grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 20px; }
  .c-pkg__what { grid-column: 1 / -1; }
  .c-pkg .h-btn { padding: 0 18px; }
  .c-how li, .c-how li + li { padding: 26px 0 6px; border-left: 0; }
  .c-how li + li { border-top: 1px solid rgb(var(--c-line)); }
  .c-faq-wrap { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .c-faq summary { font-size: 1.08rem; }

  .r-stack { padding: 0 0 14px 14px; }
  .r-stack__sheet--3, .r-stack__sheet--2 { inset: 14px 14px 0 0; }
  .r-stack__sheet--1 { padding: 22px 20px; }
  .r-stack__steps li { font-size: 1rem; }
  .r-level__count { text-align: left; }
  .r-grid { grid-template-columns: minmax(0, 1fr); }
  .r-card { padding: 20px; }
  .r-card__name { min-height: 0; font-size: 1.2rem; }

  .m-spines { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .m-spine { justify-content: space-between; min-height: 52px; padding: 0 18px 0 24px; }
  .m-demo { transform: none; }
  .m-row, .m-row--flip { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 44px 0; }
  .m-row--flip .m-row__book { order: 0; }
  .m-row__book .bk { --bk-h: 300px; --bk-t: 26px; max-width: 230px; }
  .m-row__copy > p { font-size: 1.05rem; }
  .m-open { width: 100%; justify-content: center; }
}

/* ============================================================
   Resources: every decoder visible on opening (Oct 2026)
   ============================================================ */
.r-hero.p-hero { padding: 44px 0 52px; }
.r-hero__top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 48px; }
.r-hero__t { flex: 1 1 520px; min-width: 0; }
.r-hero.p-hero h1 { font-size: clamp(2.1rem, 3.6vw, 3.3rem); margin-top: 14px; }
.r-hero__lede.h-hero__lede { flex: 0 1 380px; margin: 0 0 6px; font-size: 1.02rem; }
.r-quick { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr); gap: 20px; margin-top: 30px; }
.r-quick__col { min-width: 0; }
.r-quick__h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 10px; }
.r-quick__h h2 { margin: 0; font: 700 .72rem/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: rgb(var(--c-ink)); }
.r-quick__h h2 span { color: rgb(var(--c-ink-3)); margin-left: 6px; }
.r-quick__h a { font: 600 .8rem var(--sans); color: rgb(var(--c-ink-2)); text-decoration: none; white-space: nowrap; }
.r-quick__h a:hover { color: rgb(var(--c-ink)); text-decoration: underline; text-underline-offset: 3px; }
.r-quick__h--also { margin-top: 18px; }
.r-quick__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.r-quick__grid--one { grid-template-columns: minmax(0, 1fr); }
.r-tile { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 34px; grid-template-rows: auto 1fr auto; gap: 8px 12px; min-height: 132px; box-sizing: border-box; padding: 16px 16px 14px 18px; background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line)); border-radius: 18px; text-decoration: none; color: rgb(var(--c-ink)); transition: transform .25s var(--h-ease), border-color .25s ease, box-shadow .25s ease; }
.r-tile:hover { color: rgb(var(--c-ink)); transform: translateY(-3px); border-color: rgb(var(--c-amber-line)); box-shadow: 0 22px 40px -30px rgb(16 20 30 / .5); }
.r-tile .h-code { grid-column: 1; justify-self: start; }
.r-tile__n { grid-column: 1 / -1; font: 600 1.02rem/1.3 var(--serif); }
.r-tile__q { grid-column: 1; font-size: .8rem; color: rgb(var(--c-ink-2)); }
.r-tile__q b { font-weight: 700; color: rgb(var(--c-amber)); font-variant-numeric: tabular-nums; }
.r-tile__q i { font-style: normal; color: rgb(var(--c-ink-3)); }
.r-tile__go { grid-column: 2; grid-row: 1; width: 32px; height: 32px; border-radius: 999px; border: 1.5px solid rgb(var(--c-line)); display: inline-flex; align-items: center; justify-content: center; transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .3s ease; }
.r-tile__go svg { width: 15px; height: 15px; }
.r-tile:hover .r-tile__go { background: rgb(var(--c-ink)); color: rgb(var(--c-bg)); border-color: rgb(var(--c-ink)); transform: rotate(-45deg); }
.r-quick__col--side .r-tile { min-height: 0; }
.r-tile--alt { background: transparent; border-style: dashed; }
.r-tile--alt:hover { border-style: solid; background: rgb(var(--c-amber-soft)); }
@media (max-width: 1000px) {
  .r-quick { grid-template-columns: minmax(0, 1fr); }
  .r-quick__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .r-quick__grid--one { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* phones: one compact row per subject, so all of them fit on the first screen */
@media (max-width: 640px) {
  .r-hero.p-hero { padding: 22px 0 32px; }
  .r-hero.p-hero h1 { font-size: 1.95rem; line-height: 1.08; margin-top: 10px; }
  .r-hero__lede.h-hero__lede { flex-basis: 100%; font-size: .92rem; line-height: 1.5; margin: 4px 0 0; }
  .r-quick { margin-top: 18px; gap: 14px; }
  .r-quick__h { margin-bottom: 8px; }
  .r-quick__h--also { margin-top: 14px; }
  .r-quick__grid, .r-quick__grid--one { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .r-tile { grid-template-columns: 74px minmax(0, 1fr) auto 28px; grid-template-rows: auto; align-items: center; gap: 10px; min-height: 52px; padding: 8px 10px 8px 12px; border-radius: 14px; }
  .r-tile .h-code { grid-column: 1; justify-self: start; font-size: .68rem; }
  .r-tile__n { grid-column: 2; font: 600 .9rem/1.25 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .r-tile__q { grid-column: 3; font-size: .72rem; white-space: nowrap; }
  .r-tile__q i { display: none; }
  .r-tile__go { grid-column: 4; grid-row: 1; width: 28px; height: 28px; border: 0; }
  .r-tile--alt .r-tile__q { display: none; }
  .r-tile--alt .r-tile__n { grid-column: 2 / 4; }
  .r-tile:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .r-tile, .r-tile__go { transition: none !important; } }
.r-quick__col--side .r-quick__h h2 span { display: none; }
@media (max-width: 640px) {
  .r-tile__n { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: .86rem; }
  .r-tile__ql { display: none; }
  .r-tile__q b { font-size: .9rem; }
  .r-tile { grid-template-columns: 70px minmax(0, 1fr) auto 24px; gap: 8px; }
  .r-tile--alt { grid-template-columns: 84px minmax(0, 1fr) auto 24px; }
}
