/* ==========================================================================
   home.css — Home page specific styles
   ========================================================================== */

/* --- Home layout -------------------------------------------------------- */

.home-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
}

.home-main,
.home-aside {
    min-width: 0;
}

.home-aside {
    display: grid;
    gap: 14px;
    align-content: start;
    position: static;
}

.page-diary .home-grid {
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 980px) {
    .home-grid {
        grid-template-columns: minmax(0, 1fr) 320px;
    }

    .page-diary .home-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-aside {
        position: sticky;
        top: var(--sidebar-safe, 16px);
        margin-top: var(--sidebar-safe, 16px);
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 760px) {
    .home-aside,
    .page-home #home-status-card {
        display: none;
    }
}

/* --- Hero (Home) -------------------------------------------------------- */

.page-home {
    --home-hero-image-size: clamp(120px, 18vw, 210px);
    --home-hero-image-space: clamp(110px, 20vw, 240px);
    --home-hero-image-bottom: 12px;
    --home-hero-image-right: 14px;
    --home-hero-image-opacity: 0.18;
    --home-cta-safe-space: 170px;
}

.page-home .hero-card--home {
    position: relative;
    overflow: hidden;
}

.page-home .hero-card--home .hero-head,
.page-home .hero-card--home .hero-body {
    position: relative;
    z-index: 1;
}

.page-home .hero-card--home .hero-body {
    padding-bottom: 28px;
    padding-right: var(--home-hero-image-space);
}

.page-home .hero-card--home .hero-p {
    position: absolute;
    right: var(--home-hero-image-right);
    bottom: var(--home-hero-image-bottom);
    width: var(--home-hero-image-size);
    height: auto;
    opacity: var(--home-hero-image-opacity);
    pointer-events: none;
    user-select: none;
    z-index: 0;
    filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.35));
}

.page-home .hero-cta.hero-cta--glass {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    width: fit-content;
    max-width: 100%;
    padding: 8px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.page-home .hero-cta.hero-cta--glass .hero-cta-btn {
    min-height: 38px;
    font-weight: 800;
    white-space: nowrap;
}

.page-home .hero-cta.hero-cta--glass .hero-cta-btn.btn-glass {
    background: linear-gradient(135deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
    transition: transform 120ms ease, filter 120ms ease, background 120ms ease;
}

.page-home .hero-cta.hero-cta--glass .hero-cta-btn.btn-glass:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.page-home .hero-cta.hero-cta--glass .hero-cta-btn.btn-glass:active {
    transform: translateY(0);
    filter: brightness(0.98);
}

@media (max-width: 760px) {
    .page-home {
        --home-hero-image-size: 150px;
        --home-hero-image-space: 0px;
        --home-hero-image-bottom: 10px;
        --home-hero-image-right: 12px;
        --home-hero-image-opacity: 0.14;
    }

    .page-home .hero-card--home .hero-body {
        padding-bottom: 36px;
    }

    .page-home .hero-cta.hero-cta--glass {
        max-width: calc(100% - var(--home-cta-safe-space));
    }
}

@media (max-width: 520px) {
    .page-home {
        --home-cta-safe-space: 160px;
    }

    .page-home .hero-cta.hero-cta--glass {
        flex-wrap: wrap;
    }

    .page-home .hero-cta.hero-cta--glass .hero-cta-btn {
        width: auto;
        justify-content: center;
    }
}

@media (max-width: 380px) {
    .page-home {
        --home-hero-image-size: 132px;
        --home-hero-image-opacity: 0.12;
    }
}

@media (max-width: 360px) {
    .page-home .hero-cta.hero-cta--glass {
        width: 100%;
        max-width: none;
    }

    .page-home .hero-cta.hero-cta--glass .hero-cta-btn {
        width: 100%;
        flex: 1 1 100%;
    }
}

/* --- Section emphasis --------------------------------------------------- */

.page-home #projects .card-head h2 {
    font-size: 1.36rem;
}

.page-home #news .card-head h2,
.page-home #diary-updates .card-head h2,
.page-home #home-status-card .card-head h2 {
    font-size: 1.18rem;
}

.page-home .home-feed {
    padding-bottom: 32px;
}

.page-home .home-mobile-links {
    display: none;
}

.page-home .home-mobile-shortcuts--inline {
    display: none;
}

.page-home #news .tl-meta {
    color: rgba(148, 163, 184, 0.72);
}

.page-home .home-feed .card-head {
    align-items: flex-start;
    gap: 12px 16px;
}

.page-home .home-section-lead {
    margin: 6px 0 0;
    max-width: 62ch;
}

.page-home #news .news,
.page-home #diary-updates .news {
    padding-top: 2px;
}

.page-home .diary-feed a {
    display: grid;
    gap: 8px;
}

.page-home .diary-feed .news-meta {
    display: flex;
    align-items: center;
    gap: 8px 10px;
    flex-wrap: wrap;
    color: var(--muted-2);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.page-home .diary-feed .news-kind {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.page-home .diary-feed .news-title {
    display: block;
    font-size: 1.06rem;
    line-height: 1.5;
    font-weight: 700;
}

.page-home .home-aside h3 {
    margin-bottom: 12px;
    font-size: 1rem;
}

.page-home #news .card-hr {
    margin: 12px 10px 14px;
    opacity: 0.78;
}

/* --- Home cards --------------------------------------------------------- */

.welcome h1 {
    font-size: 1.15rem;
    margin: 0 0 10px;
}

.welcome p {
    margin: 0;
    opacity: 0.9;
    line-height: 1.7;
}

.welcome-updated {
    float: right;
    font-size: 0.85rem;
    opacity: 0.8;
}

/* --- Project cards ------------------------------------------------------ */

.project-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 1099px) {
    .project-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .project-cards {
        grid-template-columns: 1fr;
    }
}

.project-card {
    display: block;
    padding: 20px;
    border-radius: 18px;
    text-decoration: none;
    color: inherit;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
    transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.project-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
}

.pc-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px 10px;
    margin-bottom: 10px;
}

.pc-top .badge {
    flex: 0 0 auto;
}

.pc-top .small {
    min-width: 0;
    flex: 1 1 auto;
    text-align: right;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.pc-title {
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1.35;
    font-size: 1.12rem;
    margin-bottom: 8px;
}

.pc-desc {
    max-width: 30ch;
    line-height: 1.68;
    font-size: 1rem;
}

/* --- Aside -------------------------------------------------------------- */

.shortcut {
    display: grid;
    gap: 12px;
}

.shortcut .btn {
    width: 100%;
    min-height: 44px;
}

.page-diary .diary-entry-list {
    gap: 10px;
}

.page-diary .diary-entry-link {
    display: grid;
    gap: 7px;
    justify-items: start;
    align-items: start;
    width: 100%;
    min-height: unset;
    padding: 14px 16px;
    text-align: left;
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: none;
}

.page-diary .diary-entry-link:hover {
    text-decoration: none;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.16);
}

.page-diary .diary-entry-date {
    color: var(--muted-2);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.page-diary .diary-entry-title {
    display: block;
    font-size: 1.02rem;
    line-height: 1.5;
    font-weight: 700;
}

.page-diary .diary-entry-summary {
    box-shadow: none;
}

.page-home .social-link {
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px;
    min-height: 52px;
    text-align: left;
    font-weight: 800;
}

.page-home .social-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    color: var(--text);
}

.page-home .social-icon svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: currentColor;
}

.page-home .social-label {
    min-width: 0;
    overflow-wrap: anywhere;
}

.page-home .social-link--youtube .social-icon {
    border-color: rgba(255, 0, 51, 0.28);
    background: linear-gradient(180deg, rgba(255, 0, 51, 0.16), rgba(255, 0, 51, 0.08));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.page-home .social-link--youtube:hover .social-icon {
    border-color: rgba(255, 0, 51, 0.42);
    background: linear-gradient(180deg, rgba(255, 0, 51, 0.22), rgba(255, 0, 51, 0.12));
}

.page-home .social-link--donate .social-icon {
    border-color: rgba(245, 158, 11, 0.28);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
    color: #fde68a;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.page-home .social-link--donate:hover .social-icon {
    border-color: rgba(245, 158, 11, 0.42);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.28), rgba(245, 158, 11, 0.16));
}

.page-home .social-link--discord .social-icon {
    border-color: rgba(88, 101, 242, 0.28);
    background: linear-gradient(180deg, rgba(88, 101, 242, 0.2), rgba(88, 101, 242, 0.1));
    color: #dbe4ff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.page-home .social-link--discord:hover .social-icon {
    border-color: rgba(88, 101, 242, 0.42);
    background: linear-gradient(180deg, rgba(88, 101, 242, 0.28), rgba(88, 101, 242, 0.16));
}

@media (max-width: 760px) {
    .page-home .grid {
        padding: 14px 0 24px;
    }

    .page-home .home-feed {
        padding-bottom: 10px;
    }

    .page-home .home-mobile-links {
        display: block;
        margin-bottom: 0;
    }

    .page-home .home-mobile-shortcuts--inline {
        display: block;
    }

    .page-home .home-mobile-shortcuts .card-head {
        margin-bottom: 8px;
    }

    .page-home .shortcut--mobile {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        max-width: 100%;
    }

    .page-home .shortcut--mobile .social-link--mobile {
        position: relative;
        display: grid;
        justify-items: start;
        align-content: start;
        gap: 0;
        width: 100%;
        max-width: none;
        grid-column: span 2;
        aspect-ratio: 1 / 1;
        min-height: 0;
        padding: 10px;
        text-align: left;
        overflow: hidden;
        border-radius: 16px;
        border-color: rgba(255, 255, 255, 0.12);
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }

    .page-home .shortcut--mobile .social-icon {
        position: absolute;
        right: 8px;
        bottom: 6px;
        width: 56px;
        height: 56px;
        border: 0;
        background: transparent;
        color: rgba(255, 255, 255, 0.92);
        opacity: 0.9;
    }

    .page-home .shortcut--mobile .social-label {
        position: absolute;
        top: 10px;
        left: 10px;
        transform: none;
        z-index: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: max-content;
        max-width: calc(100% - 20px);
        padding: 4px 10px;
        border-radius: 999px;
        background: rgba(11, 16, 32, 0.48);
        border: 1px solid rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(8px);
        font-size: 0.68rem;
        line-height: 1;
        text-align: center;
        font-weight: 900;
        letter-spacing: 0.01em;
        white-space: nowrap;
    }

    .page-home .shortcut--mobile .social-link--mobile:nth-child(4) {
        grid-column: 2 / span 2;
    }

    .page-home .shortcut--mobile .social-link--mobile:nth-child(5) {
        grid-column: 4 / span 2;
    }

    @media (max-width: 360px) {
        .page-home .shortcut--mobile {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        .page-home .shortcut--mobile .social-link--mobile {
            grid-column: span 1;
        }

        .page-home .shortcut--mobile .social-link--mobile:nth-child(4),
        .page-home .shortcut--mobile .social-link--mobile:nth-child(5) {
            grid-column: span 1;
        }
    }

    .page-home .shortcut--mobile .social-icon svg {
        width: 100%;
        height: 100%;
    }

    .page-home .shortcut--mobile .social-link--x {
        background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.78));
        border-color: rgba(148, 163, 184, 0.18);
    }

    .page-home .shortcut--mobile .social-link--youtube {
        background: linear-gradient(135deg, rgba(127, 0, 18, 0.92), rgba(255, 0, 51, 0.18));
        border-color: rgba(255, 0, 51, 0.26);
    }

    .page-home .shortcut--mobile .social-link--soundcloud {
        background: linear-gradient(135deg, rgba(180, 71, 0, 0.94), rgba(255, 133, 26, 0.22));
        border-color: rgba(255, 140, 64, 0.26);
    }

    .page-home .shortcut--mobile .social-link--donate {
        background: linear-gradient(135deg, rgba(120, 53, 15, 0.94), rgba(245, 158, 11, 0.26));
        border-color: rgba(245, 158, 11, 0.3);
    }

    .page-home .shortcut--mobile .social-link--discord {
        background: linear-gradient(135deg, rgba(45, 56, 164, 0.94), rgba(88, 101, 242, 0.24));
        border-color: rgba(88, 101, 242, 0.3);
    }
}

@media (min-width: 980px) {
    .page-home .hero-card--home .hero-body {
        max-width: 62ch;
    }
}
