/* Hero dashboard: identity above, portfolio preview below. */
#home {
    min-height: 0;
    padding-bottom: 0;
}

#home .hero-layout {
    min-height: 330px;
    padding-bottom: 30px;
}

/* A clipped viewport lets the map retain its parallax without crossing the divider. */
#home::after {
    display: none;
}

.hero-map-viewport {
    position: absolute;
    z-index: -2;
    inset: 0 0 auto;
    height: 362px;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
    pointer-events: none;
}

.hero-map-viewport::before {
    content: "";
    position: absolute;
    inset: -36px;
    opacity: var(--hero-map-opacity);
    background-color: rgba(31, 45, 61, 0.28);
    background-image:
        linear-gradient(90deg, rgba(4, 7, 11, 0.78) 0%, rgba(4, 7, 11, 0.62) 44%, rgba(4, 7, 11, 0.2) 72%, rgba(4, 7, 11, 0.06) 100%),
        linear-gradient(135deg, rgba(226, 239, 255, 0.2) 0%, rgba(145, 174, 205, 0.04) 48%, rgba(91, 122, 155, 0.13) 100%),
        url('../../images/hero-bay-area-map.png');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-blend-mode: normal, soft-light, luminosity;
    transform: translateX(var(--hero-depth-map-x)) translateY(var(--hero-depth-map-y));
    transform-origin: center;
    transition: opacity 5s 1s cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

#home.is-depth-active .hero-map-viewport::before {
    will-change: transform;
    transition: opacity 5s cubic-bezier(0.23, 1, 0.32, 1);
}

.hero-dashboard {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: 1.08fr 1fr 1fr;
    width: calc(100% + 64px);
    margin-inline: -32px;
    overflow: hidden;
    border-top: 1px solid rgba(222, 234, 247, 0.3);
}

/* Reuse the parent panel's pointer-driven sheen across the lower dashboard. */
.hero-dashboard::after {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(
            135deg,
            transparent 38%,
            rgba(255, 255, 255, 0.025) 44%,
            rgba(255, 255, 255, 0.18) 50%,
            rgba(255, 255, 255, 0.035) 56%,
            transparent 62%
        )
        var(--panel-sheen-x) var(--panel-sheen-y) / 250% 250% no-repeat;
    mix-blend-mode: screen;
    opacity: 0;
    transition: opacity 200ms ease;
}

#home:hover .hero-dashboard::after {
    opacity: 0.72;
}

.hero-dashboard-column {
    position: relative;
    z-index: 1;
    min-width: 0;
    padding: 26px 28px 28px;
}

.hero-dashboard-column + .hero-dashboard-column {
    border-left: 1px solid rgba(222, 234, 247, 0.24);
}

#home .hero-dashboard-column h2 {
    margin: 0 0 22px;
    color: var(--text-primary);
    font-family: 'SF Pro Display';
    font-size: var(--type-title);
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.hero-education-item {
    display: grid;
    gap: 5px;
    padding-bottom: 17px;
}

.hero-education-item + .hero-education-item {
    padding-top: 17px;
    border-top: 1px solid rgba(222, 234, 247, 0.14);
}

.hero-education-item strong,
.hero-project-card strong {
    color: var(--text-primary);
    font-family: 'SF Pro Text';
    font-size: var(--type-body);
    font-weight: 600;
    line-height: 1.294;
}

.hero-education-item span {
    color: var(--text-secondary);
    font-family: 'SF Pro Text';
    font-size: var(--type-subhead);
    line-height: var(--sf-subhead-leading);
}

.hero-education-item span:last-child {
    color: var(--text-tertiary);
    font-size: var(--type-caption);
    line-height: var(--sf-caption-leading);
}

.hero-project-card > span {
    color: var(--text-secondary);
    font-family: 'SF Pro Text';
    font-size: var(--type-body);
    line-height: 1.294;
}

.hero-dashboard-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 3px;
    color: var(--text-secondary);
    font-family: 'SF Pro Text';
    font-size: var(--type-subhead);
    line-height: var(--sf-subhead-leading);
    text-decoration: none;
}

.hero-dashboard-link:hover {
    color: var(--text-primary);
}

.hero-project-card {
    display: grid;
    gap: 8px;
    width: min(100%, 240px);
    color: inherit;
    text-decoration: none;
}

.hero-project-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 1px solid rgba(222, 234, 247, 0.34);
    border-radius: 15px;
    background: #080b10;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    transition: transform 180ms ease, border-color 180ms ease;
}

.hero-project-card:hover img {
    transform: translateY(-2px);
    border-color: rgba(222, 234, 247, 0.55);
}

.hero-about-preview p {
    max-width: 29ch;
    margin: 0 0 31px;
    color: var(--text-secondary);
    font-family: 'SF Pro Text';
    font-size: var(--type-body);
    line-height: 1.294;
}

.hero-dashboard :is(a):focus-visible {
    outline: 2px solid var(--text-primary);
    outline-offset: 5px;
    border-radius: 8px;
}

html[data-theme="light"] .hero-dashboard {
    border-top-color: rgba(112, 144, 176, 0.24);
}

html[data-theme="light"] .hero-dashboard::after {
    display: none;
}

html[data-theme="light"] .hero-map-viewport {
    display: block;
}

html[data-theme="light"] .hero-map-viewport::before {
    opacity: 0.82;
    background-color: #f5f7fa;
    background-image:
        linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.82) 44%, rgba(255, 255, 255, 0.3) 72%, rgba(255, 255, 255, 0.08) 100%),
        url('../../images/hero-bay-area-lightmode.png');
    background-blend-mode: normal;
    transform: none !important;
    transition: none;
    will-change: auto;
}

html[data-theme="light"] .hero-dashboard-column + .hero-dashboard-column,
html[data-theme="light"] .hero-education-item + .hero-education-item {
    border-color: rgba(112, 144, 176, 0.18);
}

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

    .hero-about-preview {
        grid-column: 1 / -1;
        border-top: 1px solid rgba(222, 234, 247, 0.24);
        border-left: 0 !important;
    }

    .hero-about-preview p {
        max-width: 54ch;
    }
}

@media (max-width: 768px) {
    #home {
        padding: 18px 18px 0;
    }

    #home .hero-layout {
        min-height: 274px;
        padding-top: 38px;
        padding-bottom: 22px;
    }

    .hero-map-viewport {
        height: 292px;
        border-radius: 20px 20px 0 0;
    }

    .hero-map-viewport::before {
        background-position: 58% center;
    }

    .hero-dashboard {
        display: none;
    }

    .hero-dashboard-column {
        padding: 22px 20px 24px;
    }

    .hero-dashboard-column + .hero-dashboard-column,
    .hero-about-preview {
        grid-column: auto;
        border-top: 1px solid rgba(222, 234, 247, 0.24);
        border-left: 0;
    }

    .hero-project-card img {
        aspect-ratio: 16 / 9;
    }

    .hero-about-preview p {
        max-width: 34ch;
        margin-bottom: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-project-card img {
        transition: none;
    }
}
