/* Homepage — hero + course sections + category grid.
 *
 * Ported from redesign/v1 static/redesign/css/homepage.css, trimmed to the
 * pieces the engine homepage uses (no funnel, no reading desk). Reuses the
 * redesign's shelf/book vocabulary for course listings.
 */

/* ---------- Hero (anon) ---------- */
.hero {
    position: relative;
    padding: 96px 0 80px;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 64px;
    align-items: center;
}
.hero-text .display { max-width: 14ch; }
.hero-text .lead { max-width: 46ch; margin-top: 24px; margin-bottom: 40px; }
.hero-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.hero-actions .skip {
    color: var(--muted); border-bottom: none; font-size: 14px;
}
.hero-actions .skip:hover { color: var(--amber); }
.hero-lion {
    width: 100%;
    max-width: 440px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
    justify-self: center;
    display: block;
}

/* ---------- Welcome banner (authed, top of home) ---------- */
.greeting { padding: 72px 0 36px; }
.greeting h1 { margin: 0; }
.greeting .eyebrow {
    font-family: var(--font-mono);
    font-size: 12px; letter-spacing: .14em;
    text-transform: uppercase; color: var(--muted);
    margin-bottom: 10px;
}

/* ---------- Shelf section (used for recommended + featured) ---------- */
.shelf-section { padding: 48px 0 64px; }
.shelf-section:last-child { padding-bottom: 120px; }
.shelf-heading {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 28px;
}
.shelf-heading h2 { margin: 0; }
.shelf-heading .shelf-sub {
    color: var(--muted); font-size: 14px; margin: 4px 0 0;
}
.shelf-heading a.all-link { font-size: 14px; color: var(--muted); border-bottom: none; }
.shelf-heading a.all-link:hover { color: var(--amber); }

/* Shelf grid — book-spine style.
 * Base book is compact; catalog page (.shelf-block .shelf in shelf.css)
 * packs more per row. */
.shelf {
    display: grid; grid-template-columns: repeat(6, 1fr);
    gap: 12px; align-items: end;
    padding: 24px 0 0; position: relative;
    max-width: 720px;
}
.shelf::after {
    content: ""; position: absolute;
    left: -8px; right: -8px; bottom: -6px; height: 8px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--shelf-wood), color-mix(in srgb, var(--shelf-wood) 80%, #000));
    box-shadow: 0 6px 16px rgba(0,0,0,.22), inset 0 1px 0 var(--shelf-edge);
}
.book {
    aspect-ratio: 1 / 2.8;
    border-radius: 2px 6px 6px 2px;
    position: relative; overflow: hidden;
    cursor: pointer;
    box-shadow: -2px 0 0 rgba(0,0,0,.22), 0 2px 10px rgba(0,0,0,.25);
    transition: transform .15s;
    display: flex; align-items: flex-end; justify-content: center;
    padding: 8px 6px;
    text-decoration: none; color: inherit; border-bottom: none;
    background: linear-gradient(180deg, var(--spine), color-mix(in srgb, var(--spine) 55%, black));
}
.book:hover { transform: translateY(-6px) rotate(-1deg); }
.book-spine-title {
    font-family: var(--font-serif);
    font-variation-settings: "opsz" 48, "SOFT" 30;
    font-weight: 500; font-size: 11px; line-height: 1.15;
    color: rgba(255,255,255,.92);
    writing-mode: vertical-rl; transform: rotate(180deg);
    padding: 8px 0; letter-spacing: .015em; text-align: left;
}
.book-lang {
    position: absolute; bottom: 8px; left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 9px; color: rgba(255,255,255,.55);
    letter-spacing: .1em; text-transform: uppercase;
}
.book-difficulty {
    position: absolute; top: 8px; left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 8px; color: rgba(255,255,255,.6);
    letter-spacing: .08em; text-transform: uppercase;
}

/* ---------- Category grid ---------- */
.categories-section { padding: 64px 0 120px; background: var(--bg-2); }
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 36px;
}
.category-tile {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 32px 20px;
    background: var(--bg); border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    text-decoration: none; border-bottom: none;
    color: inherit;
    transition: border-color .15s, transform .15s;
}
.category-tile:hover { border-color: var(--amber); transform: translateY(-2px); }
.category-tile .cat-icon {
    width: 56px; height: 56px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--amber) 14%, transparent);
    margin-bottom: 16px;
    font-size: 22px; color: var(--amber);
}
.category-tile .cat-icon img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.category-tile h6 {
    font-family: var(--font-serif);
    font-variation-settings: "opsz" 48, "SOFT" 40;
    font-weight: 500; font-size: 18px;
    margin: 0 0 6px;
}
.category-tile .cat-desc { color: var(--muted); font-size: 13px; margin: 0; }

/* ---------- Empty states ---------- */
.empty-shelf {
    text-align: center; padding: 48px 0;
    color: var(--muted);
    font-family: var(--font-serif); font-style: italic;
    font-variation-settings: "opsz" 24, "SOFT" 60;
}

.quiet-link {
    display: block; margin-top: 48px; text-align: center;
    color: var(--muted); border-bottom: none;
    font-size: 14px;
    font-family: var(--font-serif); font-style: italic;
    font-variation-settings: "opsz" 14, "SOFT" 70;
}
.quiet-link:hover { color: var(--amber); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-lion { max-width: 320px; order: -1; margin-top: 0; margin-bottom: 24px; }
    .shelf { grid-template-columns: repeat(4, 1fr); }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .hero { padding: 24px 0 32px; }
    .hero-grid { gap: 16px; }
    .hero-lion { max-width: 200px; margin-bottom: 0; }
    .shelf { grid-template-columns: repeat(3, 1fr); }
    .category-grid { grid-template-columns: 1fr; }
}
