/* ═══════════════════════════════════════════════════════════════════════════
   Home — sections below the AI hero
   ═══════════════════════════════════════════════════════════════════════════ */

.home-main {
    position: relative;
    width: 100%;
}

/* Desktop: the header appears once the hero (with its own floating nav) is left behind */
@media (min-width: 961px) {
    body.page-home #header-placeholder {
        display: block;
    }

    body.page-home:not(.home-past-hero) .site-header-wrap {
        transform: translateY(-140%);
    }
}

/* Hero portrait reacts to the pointer */
.hero-portrait-wrap {
    transform-style: preserve-3d;
}

.hero-stage {
    will-change: transform, opacity;
}

/* Scroll cue */
.home-scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 1.75rem;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: -22px;
    border-bottom: none !important;
}

.home-scroll-cue__mouse {
    position: relative;
    width: 22px;
    height: 34px;
    border-radius: 999px;
    border: 1.5px solid rgba(15, 23, 42, 0.35);
}

.home-scroll-cue__mouse::before {
    content: '';
    position: absolute;
    top: 7px;
    left: 50%;
    width: 4px;
    height: 8px;
    margin-left: -2px;
    border-radius: 999px;
    background: var(--brand);
    animation: cue-dot 1.6s var(--ease-out) infinite;
}

@keyframes cue-dot {
    0% { opacity: 1; transform: translateY(0); }
    70% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 0; transform: translateY(10px); }
}

body.dark-mode .home-scroll-cue__mouse {
    border-color: rgba(255, 255, 255, 0.35);
}

@media (max-width: 960px) {
    .home-scroll-cue { display: none; }
}

/* ── Shared eyebrow ─────────────────────────────────────────────────────── */
.home-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 2rem;
}

.home-eyebrow__num {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
}

.home-eyebrow__line {
    width: 48px;
    height: 1px;
    background: var(--line-strong);
}

.home-eyebrow__label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ── About ──────────────────────────────────────────────────────────────── */
.home-about {
    position: relative;
    z-index: 1;
    padding: 9rem 0 7rem;
}

.home-about__lead {
    max-width: 22ch;
    margin: 0 0 4rem;
    font-size: clamp(2rem, 4.6vw, 4.1rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.12;
    color: var(--text);
}

@media (min-width: 900px) {
    .home-about__lead { max-width: 26ch; }
}

.home-about__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 920px;
    margin-left: auto;
}

.home-about__p {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--muted);
}

.home-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin: 5rem 0 0;
}

.home-stat {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.75rem 1.5rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    overflow: hidden;
}

.home-stat__num {
    margin: 0;
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.home-stat__label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

@media (max-width: 760px) {
    .home-about { padding: 6rem 0 4rem; }
    .home-about__grid { grid-template-columns: 1fr; gap: 1.25rem; }
    .home-stats { grid-template-columns: 1fr 1fr; margin-top: 3rem; }
}

/* ── Selected work ──────────────────────────────────────────────────────── */
.hw {
    position: relative;
    z-index: 1;
    padding: 2rem 0 6rem;
}

.hw__head {
    width: 100%;
}

.hw__title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.hw__title {
    max-width: 16ch;
    margin: 0;
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.02;
    color: var(--text);
}

.hw__progress {
    display: none;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.hw__current {
    color: var(--text);
}

.hw__bar {
    position: relative;
    width: 140px;
    height: 2px;
    background: var(--line-strong);
    overflow: hidden;
    border-radius: 2px;
}

.hw__bar-fill {
    position: absolute;
    inset: 0;
    background: var(--grad-line);
    transform-origin: 0 50%;
    transform: scaleX(0);
}

.hw__viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.hw__viewport::-webkit-scrollbar { display: none; }

.hw__track {
    display: flex;
    gap: 1.5rem;
    width: max-content;
    padding: 0.5rem max(1.25rem, calc((100vw - 1200px) / 2 + 2rem)) 1.5rem;
    will-change: transform;
}

.hw-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(82vw, 520px);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    border-bottom: 1px solid var(--line) !important;
    color: var(--text) !important;
    overflow: hidden;
    scroll-snap-align: center;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.5s var(--ease-out), border-color 0.3s ease, transform 0.5s var(--ease-out);
}

.hw-card:hover {
    opacity: 1;
    border-color: rgba(30, 96, 241, 0.35) !important;
    box-shadow: var(--shadow-lg);
    transform: translateY(-6px);
}

.hw-card__media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #e9edf5;
}

.hw-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: translateX(calc(var(--hw-shift, 0) * -36px)) scale(1.12);
    transition: scale 0.8s var(--ease-out);
}

.hw-card:hover .hw-card__media img {
    scale: 1.06;
}

.hw-card__body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.6rem 1.75rem 1.9rem;
    flex: 1;
}

.hw-card__num {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
}

.hw-card__title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.1;
    color: var(--text);
}

.hw-card__desc {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hw-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.6rem;
}

.hw-tag {
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--muted);
}

/* "See all" closing card */
.hw-card--all {
    align-items: flex-start;
    justify-content: space-between;
    padding: 2rem;
    background: var(--ink);
    color: #fff !important;
    border-color: var(--ink) !important;
    background-image:
        radial-gradient(70% 60% at 100% 100%, rgba(255, 0, 110, 0.35), transparent 70%),
        radial-gradient(80% 70% at 0% 0%, rgba(30, 96, 241, 0.6), transparent 70%);
    width: min(70vw, 380px);
    min-height: 360px;
}

.hw-card--all__count {
    font-size: clamp(5rem, 10vw, 8rem);
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 0.9;
}

.hw-card--all__label {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hw-card--all__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fff;
    color: var(--ink);
    transition: transform 0.5s var(--ease-out), background-color 0.3s ease, color 0.3s ease;
}

.hw-card--all:hover .hw-card--all__arrow {
    transform: rotate(-45deg);
    background: var(--brand);
    color: #fff;
}

/* Pinned mode (desktop + motion): vertical scroll drives the track */
.hw--pinned {
    padding: 0;
}

.hw--pinned .hw__sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.hw--pinned .hw__viewport {
    overflow: visible;
    scroll-snap-type: none;
}

.hw--pinned .hw__progress {
    display: inline-flex;
}

.hw--pinned .hw-card {
    width: clamp(380px, 36vw, 560px);
}

.hw--pinned .hw-card--all {
    width: clamp(300px, 24vw, 380px);
}

@media (max-height: 760px) {
    .hw--pinned .hw-card__desc { -webkit-line-clamp: 2; }
    .hw--pinned .hw__title-row { margin-bottom: 1.5rem; }
}

body.dark-mode .hw-card__media { background: #222; }

/* ── Marquee ────────────────────────────────────────────────────────────── */
.marquee {
    position: relative;
    z-index: 1;
    padding: 2.25rem 0;
    overflow: hidden;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee__track {
    display: flex;
    width: max-content;
    will-change: transform;
}

.marquee__item {
    display: inline-flex;
    align-items: center;
    gap: 2.5rem;
    padding-right: 2.5rem;
    font-size: clamp(1.8rem, 4vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    white-space: nowrap;
    color: var(--text);
}

.marquee__item:nth-child(even) {
    color: transparent;
    -webkit-text-stroke: 1.2px var(--text);
}

.marquee__item::after {
    content: '';
    width: 0.4em;
    height: 0.4em;
    border-radius: 50%;
    background: var(--grad-brand);
}

/* Without motion: a static, wrapping band */
html:not(.m-on) .marquee__track {
    width: auto;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.5rem;
}

html:not(.m-on) .marquee {
    -webkit-mask-image: none;
    mask-image: none;
}

/* ── Writing ────────────────────────────────────────────────────────────── */
.home-writing {
    position: relative;
    z-index: 1;
    padding: 8rem 0 8rem;
}

.home-writing__head {
    margin-bottom: 3rem;
}

.home-writing__title {
    max-width: 18ch;
    margin: 0;
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.02;
    color: var(--text);
}

.home-writing__list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--line-strong);
}

.hw-row {
    display: grid;
    grid-template-columns: 3rem 1fr auto 2.5rem;
    align-items: center;
    gap: 1.5rem;
    padding: 1.9rem 0.5rem;
    border-bottom: 1px solid var(--line-strong) !important;
    color: var(--text) !important;
    transition: padding 0.5s var(--ease-out), background-color 0.3s ease;
}

.hw-row:hover {
    opacity: 1;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    background: var(--surface);
}

.hw-row__num {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
}

.hw-row__title {
    font-size: clamp(1.15rem, 2.2vw, 1.6rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.25;
}

.hw-row__meta {
    font-size: 0.85rem;
    color: var(--muted);
    white-space: nowrap;
}

.hw-row__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    font-size: 1rem;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.5s var(--ease-out);
}

.hw-row:hover .hw-row__arrow {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    transform: rotate(45deg);
}

.home-writing__all {
    margin-top: 2.5rem;
}

@media (max-width: 700px) {
    .home-writing { padding: 5rem 0; }
    .hw-row {
        grid-template-columns: 2rem 1fr 2.5rem;
        row-gap: 0.35rem;
    }
    .hw-row__meta {
        grid-column: 2;
        grid-row: 2;
    }
    .hw-row__arrow { grid-column: 3; grid-row: 1 / span 2; }
}
