/* Home: the bio and a way into the About page on the left; a hand-drawn arrow pointing at the
   menu's project list; hovering a project plays its preview in the open space (js/home.js).
   The menu itself is css/menu.css; on home it sits on the page without the floating card. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
body.home-page {
    --ink: #161615;
    --muted: #6b6b66;
    overflow: hidden;
    background-color: #f8f8f8;
    color: var(--ink);
    font-family: "Inter", sans-serif;
    -webkit-font-smoothing: antialiased;
}
.home-page a { color: inherit; }
.home-page button { font: inherit; }

/* Menu on home: fixed on the right, a white card on the grey page (css/filter.css) */
.home-page .right-side-menu {
    position: fixed;
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.85);
}

/* Main area: everything left of the menu */
.home {
    position: relative;
    height: 100vh;
    margin-right: max(30vw, 400px);
    padding: clamp(32px, 6vh, 88px) clamp(32px, 5.2vw, 76px);
}

.home-intro { position: relative; z-index: 2; max-width: 30em; }
.home-bio {
    font-size: clamp(18px, 1.15vw + 4px, 21px);
    line-height: 1.42;
    letter-spacing: -0.022em;
    color: var(--muted);
    text-wrap: pretty;
}
.home-bio-lead { color: var(--ink); }

/* Company links: the grey brand tags (css/filter.css), a touch larger to match the bio */
.home-bio .bio-tag { padding: 1px 6px; border-radius: 6px; }
.home-bio .bio-tag.is-tapped { animation: bio-tap 0.6s ease-out; }

/* The button itself, with its spectrum-ring hover, is .ring-button (css/filter.css) */
.home-about { margin-top: 28px; }

/* Stage: the open space under the intro */
.home-stage { position: absolute; inset: 0; pointer-events: none; }

.home-hint {
    position: absolute;
    right: clamp(16px, 4.5vw, 88px);
    bottom: clamp(32px, 13vh, 170px);
    width: min(560px, 40vw, calc((100vh - 380px) * 1.3));
    aspect-ratio: 560 / 430;
}
.home-arrow { display: block; width: 100%; height: 100%; overflow: visible; }
.home-arrow path { fill: none; stroke: #8a8a85; stroke-width: 7; /* 3.4:1 on the page, the minimum for graphics is 3:1 */ stroke-linecap: round; stroke-linejoin: round; }
.home-hint-text {
    position: absolute;
    left: 19.6%;
    top: 31.6%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    letter-spacing: -0.01em;
    color: #767672; /* light, and still 4.5:1 on white */
    white-space: nowrap;
}

/* Project preview: a small window that plays the hovered project (js/home.js) */
.home-preview { position: absolute; top: 0; left: 0; visibility: hidden; opacity: 0; will-change: transform, opacity; }
.home-preview-frame {
    position: relative;
    width: 460px;
    height: 290px;
    overflow: hidden;
    border-radius: 16px;
    background-color: #f2f2ef;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 40px 80px -40px rgba(0, 0, 0, 0.4);
}
.home-preview-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.home-preview figcaption { display: flex; justify-content: space-between; gap: 16px; margin-top: 12px; font-size: 13px; }
.home-preview figcaption span + span { color: var(--muted); }

/* Nothing flashes before the launch animation runs */
.intro:not(.intro-ready) .home :is(.home-bio, .home-about, .home-hint) { opacity: 0; }

.home-top, .home-swipe { display: none; }

/* Phones: the greeting, bio and a swipe hint stay put while the work sheet (the menu, frosted)
   scrolls up over them with native momentum; the hero recedes as it's covered. */
@media (max-width: 780px) {
    body.home-page { overflow: auto; height: auto; }
    .home-page .page-wrapper { display: block; }
    .home {
        position: fixed;
        inset: 0;
        height: 100svh;
        margin-right: 0;
        padding: 16px 20px;
        display: flex;
        flex-direction: column;
        animation: home-recede linear both;
        animation-timeline: scroll(root);
        animation-range: 0 60svh;
    }
    .home-stage { display: none; }
    .home-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
    .home-top-hello { display: flex; align-items: center; gap: 10px; }
    .home-top-hello img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
    .home-top-hello > span { display: grid; line-height: 1.3; }
    .home-top-hello b { font-weight: 400; }
    .home-top-hello b + span { color: var(--muted); }
    .home-top-clock { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
    .home-intro { display: flex; flex-direction: column; max-width: none; margin-top: 48px; padding: 0 12px; }
    .home-bio { font-size: 16px; }
    .home-about { align-self: flex-start; margin-top: 24px; }
    .home-swipe {
        display: grid;
        justify-items: center;
        gap: 18px;
        margin-top: 36px;
        color: #6b6b66;
        font-size: 14px;
    }
    .home-swipe svg { width: 26px; height: 52px; animation: swipe-bob 2.2s ease-in-out infinite; }
    .home-swipe path { fill: none; stroke: #e3e3df; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }

    .home-page .right-side-menu {
        position: relative;
        z-index: 2;
        display: block;
        width: auto;
        min-width: 0;
        height: auto;
        min-height: 100svh;
        margin-top: 66svh;
        overflow: visible;
        border: 0;
        border-radius: 28px 28px 0 0;
        background-color: rgba(255, 255, 255, 0.62);
        -webkit-backdrop-filter: blur(28px) saturate(1.4);
        backdrop-filter: blur(28px) saturate(1.4);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.06);
    }
    .home-page .right-side-menu::before {
        content: "";
        display: block;
        width: 40px;
        height: 4px;
        margin: 12px auto 0;
        border-radius: 4px;
        background-color: rgba(0, 0, 0, 0.12);
    }
    .home-page .menu-top { display: none; }
    .home-page .menu-inner { padding: 20px 18px 32px; min-height: calc(100svh - 16px); }
    .home-page .menu-section:first-of-type { margin-top: 0; }
}
@keyframes home-recede { to { opacity: 0.3; transform: scale(0.97) translateY(-16px); } }
@keyframes swipe-bob { 50% { transform: translateY(-8px); } }

@media (prefers-reduced-motion: reduce) {
    .home, .home-swipe svg { animation: none !important; }
}


/* Back home with the menu hidden: it stays closed until it ripples open (js/home.js) */
html.nav-reopen .home-page #right-side-menu { clip-path: circle(0% at 100% 0%); }

/* While the bio's lines rise, the tags' grey stays clear, then fades in (js/home.js) */
.home-bio .bio-tag { transition: background-color 0.5s ease; }
.home-bio.is-rising .bio-tag { background-color: transparent; }
