/* ============================================================
   HOME VIEW — 3D sloped carousel of mystery cards
   ============================================================ */
.home-hero {
    text-align: center;
    padding: 56px 16px 16px;
    max-width: 880px;
    margin: 0 auto;
}
.home-title {
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0 0 12px;
    background: linear-gradient(120deg, #5b8a72, #c9a960 60%, #8a5e3b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.home-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted, #666);
    margin: 0 auto;
    max-width: 640px;
    line-height: 1.5;
}

.home-stage {
    position: relative;
    width: 100%;
    height: 500px;
    margin: 24px 0 28px;
    perspective: 1200px;
    perspective-origin: 50% 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.home-ring {
    position: relative;
    width: 140px;
    height: 190px;
    transform-style: preserve-3d;
    transform: rotateX(18deg) rotateY(0deg);
    transition: transform 1.8s cubic-bezier(0.45, 0, 0.2, 1);
    /* Promote to its own compositor layer so the spinning ring doesn't
       trigger paints on the rest of the page during scroll. */
    will-change: transform;
}

.home-card {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

.home-card-glyph {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-style: italic;
    font-weight: 700;
    font-size: 3rem;
    color: rgba(60, 50, 40, 0.55);
    line-height: 1;
    padding-bottom: 6px;
    box-sizing: border-box;
}
.home-card-foot {
    position: absolute;
    bottom: 14px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.62rem;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: rgba(60, 50, 40, 0.55);
    font-weight: 600;
}

/* Popup over the carousel — shown each time the ring stops */
.home-popup {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%) translateY(8px);
    width: min(440px, 92%);
    background: var(--bg-surface, #fff);
    color: var(--text-primary, #2c2c2c);
    border-radius: 14px;
    padding: 18px 22px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
    z-index: 5;
}
.home-popup.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.home-popup-name {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 4px;
    cursor: pointer;
}
.home-popup-name:hover { text-decoration: underline; }
.home-popup-dates {
    font-size: 0.9rem;
    color: var(--text-muted, #666);
    margin-bottom: 10px;
}
.home-popup-row {
    font-size: 0.88rem;
    margin: 4px 0;
}
.home-popup-row strong {
    display: inline-block;
    min-width: 78px;
    color: var(--text-muted, #666);
    font-weight: 600;
}
.home-popup-empty {
    color: var(--text-muted, #888);
    font-style: italic;
    font-size: 0.82rem;
}

:root[data-theme="dark"] .home-title {
    background: linear-gradient(120deg, #8ec19f, #e6c87a 60%, #c89568);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
:root[data-theme="dark"] .home-card-glyph { color: rgba(20, 20, 20, 0.55); }
:root[data-theme="dark"] .home-card-foot   { color: rgba(20, 20, 20, 0.55); }

.home-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    max-width: 1100px;
    margin: 0 auto 60px;
    padding: 0 16px;
}
.home-tool {
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 12px;
    padding: 16px 16px 14px;
    text-align: left;
    font: inherit;
    color: var(--text-primary, #2c2c2c);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.home-tool:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
    border-color: var(--border-color-strong, #c9b78b);
}
.home-tool-icon {
    font-size: 1.6rem;
    line-height: 1;
    margin-bottom: 4px;
}
.home-tool-name {
    font-weight: 700;
    font-size: 1rem;
}
.home-tool-desc {
    font-size: 0.82rem;
    color: var(--text-muted, #666);
    line-height: 1.4;
}

@media (max-width: 720px) {
    .home-title { font-size: 2rem; }
    .home-stage { height: 400px; }
    .home-ring  { width: 110px; height: 150px; }
    .home-card-glyph { width: 56px; height: 56px; font-size: 2.2rem; }
    .home-tools { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    /* Tighter still: pull the Tools tiles closer to the fold on phones. */
    .home-hero    { padding: 28px 14px 10px; }
    .home-title   { font-size: 1.7rem; }
    .home-subtitle{ font-size: 0.92rem; }
    .home-stage   { height: 280px; margin: 12px 0 16px; }
    .home-ring    { width: 88px; height: 120px; }
    .home-card-glyph { width: 44px; height: 44px; font-size: 1.7rem; }
    .home-tools   { gap: 10px; margin-bottom: 32px; }
}
