/* Home page below the shelf: compact, evenly spaced sections on the dark brand ground. */

.hm-sec { padding: 104px 0; position: relative; }
.hm-sec-tight { padding: 8px 0 72px; }
.hm-sec-last { padding-bottom: 120px; }
.hm-center { display: flex; justify-content: center; margin-top: 48px; }

.hm-head { max-width: 680px; margin: 0 0 52px; }
.hm-head h2 { font-size: clamp(36px, 4.2vw, 58px); margin: 14px 0 14px; }
.hm-head p { margin: 0; font-size: 18px; max-width: 560px; }
.hm-head.is-center { margin-left: auto; margin-right: auto; text-align: center; }
.hm-head.is-center p { margin-left: auto; margin-right: auto; }

/* Numbers */
.hm-stats { background: var(--bg-raised); border-bottom: 1px solid var(--rule); }
.hm-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); }
.hm-stats-row > div { padding: 40px 24px; text-align: center; border-left: 1px solid var(--rule); display: flex; flex-direction: column; gap: 6px; }
.hm-stats-row > div:first-child { border-left: 0; }
.hm-stats-row strong { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 4.6vw, 64px); line-height: 1; color: var(--gold-soft); font-variation-settings: 'opsz' 144; font-variant-numeric: tabular-nums; }
.hm-stats-row span { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }

/* Top 10 */
.hm-top { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 44px 28px; }
.hm-book { position: relative; display: block; padding: 0; background: none; border: 0; text-align: left; cursor: pointer; color: inherit; min-width: 0; }
.hm-rank {
    position: absolute;
    left: -10px;
    top: -26px;
    z-index: 2;
    font-family: var(--serif);
    font-size: 78px;
    line-height: 1;
    font-weight: 500;
    color: var(--bg);
    -webkit-text-stroke: 1.5px var(--gold);
    text-shadow: 0 0 24px rgba(5, 17, 12, 0.9);
    pointer-events: none;
}
.hm-cover { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--bg-soft); box-shadow: 0 24px 40px -22px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--rule); transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.hm-cover img { width: 100%; height: 100%; object-fit: cover; }
.hm-book:hover .hm-cover, .hm-book:focus-visible .hm-cover { transform: translateY(-8px); box-shadow: 0 34px 50px -22px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--gold); }
.hm-book:focus-visible { outline: none; }
.hm-book-title { display: block; margin-top: 16px; font-family: var(--serif); font-size: 18px; line-height: 1.2; color: var(--ink); }
.hm-book-by { display: block; margin-top: 4px; font-size: 13.5px; color: var(--ink-3); }

/* Steps */
.hm-steps { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--rule); border-radius: 24px; overflow: hidden; background: var(--bg-raised); }
.hm-step { position: relative; padding: 36px 36px 40px; border-left: 1px solid var(--rule); }
.hm-step:first-child { border-left: 0; }
.hm-step-n { position: absolute; right: 28px; top: 16px; font-family: var(--serif); font-size: 74px; line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(224, 188, 106, 0.4); }
.hm-step-i { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: rgba(224, 188, 106, 0.12); color: var(--gold); margin-bottom: 22px; }
.hm-step h3 { font-size: 26px; margin: 0 0 8px; }
.hm-step p { margin: 0; font-size: 16px; max-width: 30ch; }

/* App screens: four cards, each with its phone rising out of the bottom edge */
.hm-app { background: linear-gradient(180deg, transparent, rgba(16, 36, 28, 0.55) 14%, rgba(16, 36, 28, 0.55) 86%, transparent); }
.hm-app-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.hm-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 28px; height: 560px; padding: 40px 0 0 40px; border: 1px solid var(--rule); border-radius: 28px; background: linear-gradient(155deg, var(--bg-soft), var(--bg-raised) 72%); overflow: hidden; transition: border-color 0.3s ease; }
.hm-card:hover { border-color: var(--rule-strong); }
.hm-card::before { content: ""; position: absolute; right: -60px; bottom: -80px; width: 380px; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(82, 223, 129, 0.2), transparent 68%); pointer-events: none; }
.hm-row-tag { display: inline-block; padding: 6px 14px; border: 1px solid var(--rule-strong); border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-bottom: 18px; }
.hm-card-text { position: relative; z-index: 1; min-width: 0; }
.hm-card-text h3 { font-size: clamp(26px, 2.5vw, 34px); margin: 0 0 12px; }
.hm-card-text > p { font-size: 16px; margin: 0 0 20px; }
.hm-card-text ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hm-card-text li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.5; }
.hm-card-text li svg { color: var(--mint); flex-shrink: 0; margin-top: 3px; }
.hm-card-text li strong { color: var(--ink); font-weight: 700; }
.hm-card-shot { position: relative; align-self: end; margin-right: 36px; transform: translateY(70px); }
.hm-card-shot .phone { width: 100%; transition: transform 0.5s var(--ease); }
.hm-card:hover .hm-card-shot .phone { transform: translateY(-14px); }

/* Why */
.hm-why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.hm-why-card { padding: 30px 28px 32px; border: 1px solid var(--rule); border-radius: 22px; background: var(--bg-raised); transition: transform 0.35s var(--ease), border-color 0.3s ease; }
.hm-why-card:hover { transform: translateY(-5px); border-color: var(--rule-strong); }
.hm-why-i { display: inline-grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; background: rgba(82, 223, 129, 0.12); color: var(--mint); margin-bottom: 22px; }
.hm-why-card h3 { font-size: 22px; line-height: 1.15; margin: 0 0 10px; }
.hm-why-card p { margin: 0; font-size: 15.5px; }

/* Subjects */
.hm-subjects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.hm-subject { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 290px; padding: 28px; border: 1px solid var(--rule); border-radius: 24px; background: linear-gradient(160deg, var(--bg-soft), var(--bg-raised) 70%); overflow: hidden; transition: transform 0.35s var(--ease), border-color 0.3s ease; }
.hm-subject:hover { transform: translateY(-5px); border-color: var(--gold); }
.hm-fan { position: absolute; right: 26px; top: 26px; display: flex; }
.hm-fan img { width: 78px; height: 117px; object-fit: cover; border-radius: 6px; box-shadow: 0 14px 26px -10px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08); transition: transform 0.4s var(--ease); }
.hm-fan img:nth-child(1) { transform: rotate(-8deg) translateY(8px); }
.hm-fan img:nth-child(2) { margin-left: -34px; position: relative; z-index: 1; }
.hm-fan img:nth-child(3) { margin-left: -34px; transform: rotate(8deg) translateY(8px); }
.hm-subject:hover .hm-fan img:nth-child(1) { transform: rotate(-12deg) translateY(2px); }
.hm-subject:hover .hm-fan img:nth-child(3) { transform: rotate(12deg) translateY(2px); }
.hm-subject h3 { font-size: 32px; margin: 0 0 6px; }
.hm-subject p { margin: 0 0 18px; font-size: 15.5px; max-width: 30ch; }
.hm-subject-count { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }

/* Scholars */
.hm-scholars { padding-bottom: 96px; overflow: hidden; }
.hm-marquee { overflow: hidden; margin-top: 12px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent); mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent); }
.hm-marquee-track { display: flex; gap: 28px; width: max-content; padding: 10px 14px; animation: hm-scroll 90s linear infinite; }
.hm-marquee.is-reverse .hm-marquee-track { animation-direction: reverse; animation-duration: 110s; }
.hm-marquee:hover .hm-marquee-track { animation-play-state: paused; }
@keyframes hm-scroll { to { transform: translateX(-50%); } }
.hm-scholar { display: block; width: 132px; text-align: center; flex-shrink: 0; }
.hm-arch { display: block; width: 132px; height: 170px; border-radius: 999px 999px 14px 14px; overflow: hidden; border: 1px solid var(--rule-strong); background: var(--bg-soft); transition: border-color 0.3s ease, transform 0.35s var(--ease); }
.hm-arch img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9); }
.hm-scholar:hover .hm-arch { border-color: var(--gold); transform: translateY(-5px); }
.hm-scholar-name { display: block; margin-top: 12px; font-size: 13px; line-height: 1.3; color: var(--ink-2); }

/* Tiles */
.hm-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.hm-tile { padding: 26px 24px 28px; border: 1px solid var(--rule); border-radius: 20px; background: var(--bg-raised); transition: border-color 0.3s ease, transform 0.35s var(--ease); }
.hm-tile:hover { border-color: var(--rule-strong); transform: translateY(-4px); }
.hm-tile-i { display: inline-grid; color: var(--gold); margin-bottom: 18px; }
.hm-tile h4 { font-size: 20px; margin: 0 0 8px; }
.hm-tile p { margin: 0; font-size: 15px; line-height: 1.55; }

/* Quotes */
.hm-quote-grid { columns: 3; column-gap: 20px; }
.hm-quote { margin: 0 0 20px; padding: 30px 28px; border: 1px solid var(--rule); border-radius: 22px; background: var(--bg-raised); break-inside: avoid; }
.hm-quote blockquote { margin: 0 0 24px; font-family: var(--serif); font-size: 19px; line-height: 1.5; color: var(--ink); font-style: italic; font-variation-settings: 'opsz' 36; }
.hm-quote figcaption { display: flex; align-items: center; gap: 14px; }
.hm-avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--gold); color: #05110C; font-family: var(--serif); font-size: 20px; font-weight: 600; flex-shrink: 0; }
.hm-quote strong { display: block; color: var(--ink); font-size: 15px; }
.hm-quote small { display: block; color: var(--ink-3); font-size: 13px; }

/* FAQ keeps the shared styles; just tighten the top */
.hm-sec .faq-grid { align-items: start; }

/* Tablet */
@media (max-width: 1100px) {
    .hm-sec { padding: 84px 0; }
    .hm-top { gap: 40px 20px; }
    .hm-rank { font-size: 60px; top: -20px; }
    .hm-why-grid, .hm-tiles { grid-template-columns: repeat(2, 1fr); }
    .hm-subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hm-quote-grid { columns: 2; }
    .hm-app-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
    .hm-sec { padding: 68px 0; }
    .hm-head { margin-bottom: 36px; }
    .hm-head h2 { font-size: clamp(32px, 8vw, 44px); }
    .hm-head p { font-size: 16.5px; }
    .hm-stats-row { grid-template-columns: repeat(2, 1fr); }
    .hm-stats-row > div { padding: 28px 16px; border-left: 0; border-top: 1px solid var(--rule); }
    .hm-stats-row > div:nth-child(-n+2) { border-top: 0; }
    .hm-stats-row > div:nth-child(even) { border-left: 1px solid var(--rule); }
    .hm-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 16px; }
    .hm-steps { grid-template-columns: 1fr; }
    .hm-step { border-left: 0; border-top: 1px solid var(--rule); padding: 28px 24px 30px; }
    .hm-step:first-child { border-top: 0; }
    .hm-card { grid-template-columns: 1fr; height: auto; padding: 28px 24px 0; gap: 20px; }
    .hm-card-shot { width: min(220px, 62%); margin: 0 auto; transform: translateY(40px); }
    .hm-why-grid, .hm-tiles, .hm-subjects { grid-template-columns: 1fr; }
    .hm-subject { min-height: 240px; }
    .hm-quote-grid { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .hm-marquee-track { animation: none; }
    .hm-marquee { overflow-x: auto; }
}

/* Inner pages: headers sized to their content, not to the window */
.page-hero { min-height: 0 !important; padding: 150px 0 64px; }
.page-hero h1 { font-size: clamp(42px, 5.6vw, 84px); margin-bottom: 20px; }
.section { padding-top: 96px; padding-bottom: 96px; }
@media (max-width: 820px) { .page-hero { padding: 120px 0 44px; } .section { padding-top: 64px; padding-bottom: 64px; } }

/* Pinned scroll scenes: same designs, shorter runways so there is far less empty scrolling */
html .count.is-live { height: 240vh !important; }
html .arcade.is-live { height: 190vh !important; }
html .chart.is-live { height: 330vh !important; }
html .press.is-live { height: 450vh !important; }
html .mint.day.is-live { height: 230vh !important; }
html .story.is-live { height: 340vh !important; }
html .subjects.is-live { height: 270vh !important; }
html .relay.is-live { height: 230vh !important; }
