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

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

.home-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--home-grid-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) {
    body.page-home {
        --max: calc(980px + var(--home-grid-gap) + var(--home-aside-width));
    }

    .home-grid {
        grid-template-columns: minmax(0, 1fr) var(--home-aside-width, 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-aside-width: 320px;
    --home-grid-gap: 18px;
    --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: 0;
}

.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) {
    /* hero-body: image gone, so no clearance padding needed */
    .page-home .hero-card--home .hero-body {
        padding-bottom: 12px;
    }
}

@media (max-width: 520px) {
    /* CTA buttons wrap on very small screens */
    .page-home .hero-cta.hero-cta--glass {
        flex-wrap: wrap;
        width: 100%;
        max-width: 100%;
    }

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

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

/* --- Section lead text -------------------------------------------------- */

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

/* --- 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) {
    /* Section spacing */
    .page-home .grid {
        padding: 14px 0 24px;
    }

    /* CTA banner: tighter padding on mobile */
    .cta-banner {
        padding: 24px 16px;
        gap: 12px;
    }

    /* Pricing: tighten row padding on small screens */
    .pricing-row {
        padding: 11px 14px;
    }

    .pricing-label,
    .pricing-price {
        font-size: 0.9rem;
    }

    /* Service cards: slightly reduced padding */
    .service-card {
        padding: 18px;
    }
}

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

/* --- Problems list ------------------------------------------------------ */

.problems-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 28px;
}

.problems-list li {
    position: relative;
    padding-left: 18px;
    line-height: 1.65;
    font-size: 0.96rem;
}

.problems-list li::before {
    content: '\25CF';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 0.6em;
    top: 0.45em;
}

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

/* --- Service cards ------------------------------------------------------ */

.service-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

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

.service-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sc-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sc-num {
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    color: var(--primary);
    flex: 0 0 auto;
    opacity: 0.8;
}

.sc-title {
    margin: 0;
    font-size: 1.04rem;
    font-weight: 900;
    line-height: 1.4;
}

.sc-desc {
    font-size: 0.93rem;
    line-height: 1.72;
    color: var(--muted);
    margin: 0;
}

.sc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
    padding-top: 4px;
    border-top: 1px solid var(--border);
}

.sc-list li {
    font-size: 0.88rem;
    padding-left: 16px;
    position: relative;
    line-height: 1.55;
    color: var(--muted);
}

.sc-list li::before {
    content: '\25B8';
    position: absolute;
    left: 0;
    color: var(--primary);
    opacity: 0.7;
    font-size: 0.82em;
    top: 0.18em;
}

/* --- CTA banner --------------------------------------------------------- */

.cta-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 36px 24px;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.08), rgba(124, 58, 237, 0.06)) !important;
    border-color: rgba(96, 165, 250, 0.22) !important;
}

.cta-banner-heading {
    margin: 0;
    font-size: 1.28rem;
    font-weight: 900;
}

.cta-banner-text {
    margin: 0;
    line-height: 1.7;
}

.cta-banner .btn {
    min-width: 200px;
}

/* --- Reasons grid ------------------------------------------------------- */

.reasons-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 16px;
}

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

.reason-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.reason-num {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(96, 165, 250, 0.10);
    border: 1px solid rgba(96, 165, 250, 0.22);
    display: grid;
    place-items: center;
    font-size: 0.88rem;
    font-weight: 900;
    color: var(--primary);
}

.reason-body h3 {
    margin: 0 0 6px;
    font-size: 0.98rem;
    font-weight: 900;
    line-height: 1.4;
}

.reason-body p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.65;
}

/* --- Works grid -------------------------------------------------------- */

.works-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

@media (max-width: 600px) {
    .works-grid {
        grid-template-columns: 1fr;
    }
}

.work-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.work-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.4;
}

.work-tags {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.work-tags li {
    font-size: 0.8rem;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 10px;
}

.work-count {
    font-size: 0.88rem;
    font-weight: 900;
    color: var(--primary);
    margin-top: auto;
    padding-top: 4px;
}

/* --- Pricing ----------------------------------------------------------- */

.pricing-rows {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.pricing-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.pricing-row:last-child {
    border-bottom: none;
}

.pricing-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.025);
}

.pricing-label {
    font-size: 0.96rem;
    font-weight: 700;
}

.pricing-price {
    font-size: 0.96rem;
    font-weight: 900;
    color: var(--primary);
    text-align: right;
    white-space: nowrap;
}

/* --- Aside (business) -------------------------------------------------- */

.home-aside-contact p {
    margin: 8px 0 0;
}

.home-aside-links {
    margin-top: 14px !important;
}

.home-aside-profile-text {
    line-height: 1.8;
    margin: 8px 0 12px;
}

.home-aside-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.home-aside-nav a {
    font-size: 0.88rem;
    color: var(--muted);
    text-decoration: none;
    padding: 4px 0;
}

.home-aside-nav a:hover {
    color: var(--primary);
}

/* --- About summary card ------------------------------------------------- */

.about-summary-card {
    padding: 28px 32px;
}

.about-summary-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    justify-content: space-between;
}

.about-summary-text {
    flex: 1;
    min-width: 0;
}

.about-summary-text h2 {
    margin-bottom: 4px;
}

.about-summary-tagline {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0 0 10px;
    letter-spacing: 0.04em;
}

@media (max-width: 760px) {
    .about-summary-card {
        padding: 20px 18px;
    }
    .about-summary-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

/* --- Page-home section spacing ----------------------------------------- */

/* Desktop: reduce default 56px grid bottom padding for the business landing page.
   Mobile override (14px 0 24px) is kept in the @media (max-width: 760px) block above. */
@media (min-width: 761px) {
    .page-home .grid {
        padding: 12px 0 32px;
    }
}

/* --- Service cards: desktop breakpoint fix ------------------------------ */

/* When aside is visible (≥980px), main column is ~642–860px.
   3-col service cards are too narrow until the viewport reaches ~1200px. */
@media (min-width: 980px) and (max-width: 1199px) {
    .page-home .service-cards {
        grid-template-columns: 1fr;
    }
}
