/* ==========================================================================
   home.css — homepage layout only. Colors and fonts come from style.css;
   this file only uses the existing palette:
   teal #126889 · yellow #EDED14 · pink #FFD2FF · cream #F9F7F2
   grey #AAA7A2 · dark green #323F2F
   ========================================================================== */

.skip-link {
    position: absolute; left: -999px; top: 0; z-index: 2000;
    background: #EDED14; color: #126889; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid #126889; outline-offset: 3px; }

.landing-page-container { background-color: #F9F7F2; }

/* ---------- Hero ---------- */

.home-hero {
    min-height: 92vh;
    padding: calc(8vh + 4.5vw) 4vw 4vw; /* 8vh clears the fixed header; ~65px gap below it */
    align-content: start; /* content starts at the top instead of floating in the middle */
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 4vw;
    align-items: center;
}

.home-hero-text { display: flex; flex-direction: column; gap: 3vh; }

#dynamic-time { color: #323F2F; font-size: 1.1rem; }

.home-hero .introduction {
    font-size: 3rem;
    line-height: 4rem;
    color: #AAA7A2;
}

#nameBtn { display: inline-block; vertical-align: middle; }
#nameBtn:hover, #nameBtn:focus-visible { transform: scale(1.05); }
.nameGif { height: 3rem; width: auto; border-radius: 0; vertical-align: middle; }

.home-tagline {
    font-size: 1.4rem;
    line-height: 1.6;
    color: #323F2F;
    font-weight: 400;
    max-width: 38ch;
}

/* direct child only: the contact buttons are h2s too and should keep the .button weight */
.home-contact > h2 { color: #126889; font-size: 1.5rem; margin-bottom: 2vh; font-weight: 500; }
.home-contact #intro-contact { justify-content: flex-start; flex-wrap: wrap; }

/* The building: the original floor images, now always labeled and clickable */
.building {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-right: 6vw;
    /* line the top of floor 3 up with the intro line (date line + gaps above it) */
    align-self: start;
    margin-top: calc(6vh + 1.6rem);
}

.floor {
    position: relative;
    display: block;
    text-decoration: none;
    margin-top: -9vh;
    animation: fallIn 1s ease-out backwards, float 3s infinite ease-in-out;
}
.floor-3 { margin-top: 0; animation-delay: 0.4s, 1.4s; z-index: 3; }
.floor-2 { animation-delay: 1.2s, 2.2s; z-index: 2; }
.floor-1 { animation-delay: 2s, 3s; z-index: 1; }

.floor img { height: 23vh; width: auto; border-radius: 0; display: block; transition: opacity 0.3s ease, transform 0.5s ease; }
.floor .floor-mono { position: absolute; inset: 0; opacity: 0; }
.floor:hover .floor-color, .floor:focus-visible .floor-color { opacity: 0; }
.floor:hover .floor-mono, .floor:focus-visible .floor-mono { opacity: 1; transform: scale(1.1); }

.floor-label {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 1vw;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    font-size: 1.6rem;
    font-weight: 400;
    color: #126889;
    transition: color 0.2s ease;
}
.floor-label small { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: #323F2F; font-weight: 600; }
.floor:hover .floor-label, .floor:focus-visible .floor-label {
    color: #FFD2FF;
    text-shadow: 1px 1px 2px #126889, 0 0 1em #EDED14, 0 0 0.2em #126889;
}

@media (prefers-reduced-motion: reduce) {
    .floor { animation: none; }
}

/* ---------- Project index ---------- */

.home-work { padding: 4vh 4vw 12vh; scroll-margin-top: 10vh; }

.home-work-head {
    display: flex;
    flex-wrap: wrap;
    gap: 3vh 2vw;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 4vh;
}
.home-work-head h1 { font-size: 3rem; color: #323F2F; font-weight: 400; }
.home-work-head p { font-size: 1.1rem; color: #323F2F; margin-top: 1vh; font-weight: 400; }

/* segmented pill, same as the toolkit's Design / Code / AI tabs (colours flipped for the cream background) */
.work-filters {
    display: inline-flex; gap: 4px; padding: 5px; max-width: 100%;
    border-radius: 999px; border: 1px solid rgba(18, 104, 137, 0.35);
}
.work-filters button {
    font: inherit; font-size: 1.05rem; font-weight: 400; color: #126889; cursor: pointer;
    min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: transparent;
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.work-filters button small { font-size: 0.85rem; opacity: 0.7; }
.work-filters button:hover { color: #323F2F; background: rgba(237, 237, 20, 0.35); }
.work-filters button[aria-pressed="true"] { background: #EDED14; color: #126889; }
.work-filters button[aria-pressed="true"] small { opacity: 0.8; }

.work-layout { display: flex; flex-wrap: wrap; gap: 4vw; align-items: flex-start; }
.work-list { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.work-rows { list-style: none; }

.work-row {
    display: grid;
    grid-template-columns: 4rem minmax(0, 1fr) 11rem 4rem;
    gap: 1.5vw;
    align-items: baseline;
    padding: 2.4vh 0;
    border-bottom: 1px solid #AAA7A2;
    color: #323F2F;
    text-decoration: none;
}
.work-row-head {
    padding: 0 0 1.5vh;
    border-bottom: 1.5px solid #323F2F;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
}
.work-row-head span:last-child, .work-year { text-align: right; }

.work-no, .work-year { font-size: 1rem; color: #323F2F; }
.work-title { display: flex; flex-direction: column; gap: 0.5vh; }
.work-name { font-size: 1.8rem; font-weight: 500; transition: color 0.2s ease; }
.work-summary { font-size: 1rem; font-weight: 400; }
.work-type {
    justify-self: start;
    font-size: 0.9rem;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid #126889;
    color: #126889;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.work-row.is-active .work-name, .work-row:hover .work-name { color: #126889; }
.work-row.is-active .work-type { background: #126889; color: #F9F7F2; }
.work-row:hover .work-type { background: #EDED14; color: #126889; }

.work-thumb-mobile { display: none; }

.work-archive-link { margin-top: 3vh; color: #126889; font-size: 1.1rem; }

.work-preview {
    flex: 1 1 320px;
    min-width: 0;
    position: sticky;
    top: 12vh;
    display: flex;
    flex-direction: column;
    gap: 2vh;
}
/* thumbnails cross-fade: the new image fades in over the old one */
.work-preview-media { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 30px; overflow: hidden; background: #AAA7A2; }
.work-preview-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; opacity: 0; transition: opacity 0.6s ease; }
.work-preview-img.is-front { opacity: 1; }
.work-preview-copy { display: flex; flex-direction: column; gap: 2vh; transition: opacity 0.3s ease; }
.work-preview-copy.is-fading { opacity: 0; }
.work-preview-text { font-size: 1.1rem; line-height: 1.6; color: #323F2F; font-weight: 400; }
.work-preview-role { font-size: 0.95rem; color: #126889; font-weight: 500; }

/* ---------- About ---------- */

.home-about { padding: 10vh 4vw 4vh; color: #F9F7F2; scroll-margin-top: 8vh; }
.home-about-inner {
    margin: 0 0 8vh; /* full width inside the section padding, like Highlighted Works */
    display: flex;
    flex-wrap: wrap;
    gap: 4vw;
    align-items: flex-start;
}
.home-about-photo { flex: 0 1 320px; margin: 0; display: flex; flex-direction: column; gap: 1.5vh; }
.home-about-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 30px; }
.home-about-photo figcaption { font-size: 0.95rem; color: #F9F7F2; font-weight: 400; }

.home-about-text { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 2.5vh; }
.home-about-text h1 { font-size: 3rem; color: #EDED14; font-weight: 400; } /* matches "Highlighted Works" */
.home-about-text .home-about-lead { font-size: 1.8rem; line-height: 1.35; font-weight: 300; color: #FFD2FF; }
.home-about-text p { font-size: 1.15rem; line-height: 1.7; color: #F9F7F2; font-weight: 400; }
.home-about-text strong { color: #EDED14; font-weight: 600; }

/* ---------- Toolkit (About section) ----------
   Same flex columns as .home-about-inner: the card sits under the photo (320px),
   the heading, tabs and tool pills sit under the text column. */
.home-toolkit {
    margin: 0 0 8vh;
    display: flex; flex-wrap: wrap; gap: 4vw; align-items: flex-start;
    color: #F9F7F2;
}
.tk-card { flex: 0 1 320px; min-width: 0; margin-top: 84px; } /* drops level with the pills, below the heading row */
.tk-main { flex: 1 1 520px; min-width: 0; }

.tk-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 24px; margin-bottom: 24px; min-height: 60px; }
.tk-top h2 { font-size: 2.6rem; font-weight: 400; color: #EDED14; }

/* Design / Code / AI: a segmented pill */
.tk-tabs { display: inline-flex; gap: 4px; padding: 5px; border-radius: 999px; border: 1px solid rgba(249, 247, 242, 0.35); }
.tk-tab {
    font: inherit; font-size: 1.05rem; font-weight: 400; color: #F9F7F2; cursor: pointer;
    min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: transparent;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.tk-tab small { font-size: 0.85rem; opacity: 0.7; }
/* same pale-yellow hover as the Highlighted Works filters (solid, so it doesn't turn green over the teal) */
.tk-tab:hover { background: #F5F3A4; color: #126889; }
.tk-tab:hover small { opacity: 0.8; }
.tk-tab[aria-selected="true"] { background: #EDED14; color: #126889; }
.tk-tab[aria-selected="true"] small { opacity: 0.8; }

/* one pill per tool */
.tk-pills { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; }
.tk-pill {
    font: inherit; font-size: 1.05rem; font-weight: 400; color: #F9F7F2; cursor: pointer;
    min-height: 48px; padding: 0 20px; border-radius: 999px; background: transparent;
    border: 1px solid rgba(249, 247, 242, 0.45);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.tk-pill:hover, .tk-pill:focus-visible { border-color: #F5F3A4; background: #F5F3A4; color: #126889; }
.tk-pill[aria-pressed="true"] { background: #FFD2FF; border-color: #FFD2FF; color: #126889; }

/* the card that explains the selected tool */
.tk-card-inner {
    background: #F9F7F2; color: #323F2F; border-radius: 24px; padding: 28px;
}
/* only the card's contents fade, so the cream card itself stays put */
.tk-card-inner > * { animation: tk-in 0.45s ease both; }
@keyframes tk-in { from { opacity: 0; transform: translateY(4px); } }
.tk-card-kicker { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; color: #126889; }
.tk-card-inner h3 { font-size: 2.1rem; font-weight: 400; color: #126889; line-height: 1.15; margin: 14px 0 16px; }
.tk-card-use { font-size: 1.1rem; line-height: 1.6; font-weight: 300; }
.tk-card-used { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; }
.tk-card-used > span { font-size: 0.95rem; font-weight: 400; margin-right: 4px; }
.tk-project {
    font-size: 0.95rem; font-weight: 400; color: #126889; text-decoration: none;
    padding: 5px 14px; border-radius: 999px; background: #FFD2FF; transition: background-color 0.2s ease;
}
a.tk-project:hover, a.tk-project:focus-visible { background: #EDED14; }
.tk-project-plain { background: rgba(18, 104, 137, 0.1); }

@media (prefers-reduced-motion: reduce) {
    .tk-card-inner > * { animation: none; }
    .work-preview-img, .work-preview-copy { transition: none; }
}

/* once the About block stacks (photo above text), stack this too: tools first, card under them */
@media (max-width: 955px) {
    .tk-card { order: 2; flex-basis: 100%; margin-top: 0; }
    .tk-main { flex-basis: 100%; }
}

.home-about-link { color: #EDED14; font-size: 1.15rem; align-self: flex-start; }
.home-about-link:hover { color: #FFD2FF; }

.home-about .backToTop { display: flex; justify-content: center; }

/* ---------- Tablet & phone ---------- */

@media (max-width: 1024px) {
    .home-hero { grid-template-columns: 1fr; }
    .building { flex-direction: row; justify-content: center; padding-right: 0; gap: 2vw; margin-top: 0; }
    .floor, .floor-3 { margin-top: 0; }
    .floor img { height: 16vh; }
    .floor-label { position: static; transform: none; margin: 1vh 0 0; align-items: center; font-size: 1.2rem; }
}

@media (max-width: 768px) {
    .home-hero { padding: calc(8vh + 24px) 20px 32px; min-height: auto; gap: 32px; }
    .home-hero .introduction { font-size: 2rem; line-height: 2.7rem; }
    .nameGif { height: 2rem; }
    .home-tagline { font-size: 1.1rem; }
    .building { gap: 3vw; }
    .floor img { height: auto; width: 26vw; }
    .floor-label { font-size: 1rem; }
    .floor-label small { font-size: 0.65rem; }
    .home-contact .buttonContent { padding: 8px 18px !important; }
    .home-contact #intro-contact h2 { font-size: 1.2rem; }
    .home-work { padding: 16px 20px 64px; }
    .home-work-head h1 { font-size: 2.2rem; }
    .work-filters { overflow-x: auto; scrollbar-width: none; }
    .work-filters button { flex: none; padding: 0 14px; font-size: 0.95rem; }
    .work-row-head { display: none; }
    .work-row { grid-template-columns: 2.5rem minmax(0, 1fr); row-gap: 8px; padding: 20px 0; }
    .work-type { grid-column: 2; }
    .work-year { display: none; }
    .work-name { font-size: 1.4rem; }
    .work-thumb-mobile { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 15px; margin-top: 8px; }
    .work-preview { display: none; }
    .home-about { padding: 64px 20px 32px; }
    .home-about-photo { flex-basis: 100%; }
    .home-about-text h1 { font-size: 2.2rem; }
    .home-about-text .home-about-lead { font-size: 1.4rem; }
    .home-about-inner { row-gap: 32px; }
}


/* ---------- Phone hero: building stacked vertically, between the tagline and the contact buttons ---------- */
@media (max-width: 768px) {
    .home-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 3vh; }
    /* let the text's children sit in the hero column so the building can slot in between them */
    .home-hero-text { display: contents; }
    .home-contact { order: 2; }
    .building {
        order: 1;
        flex-direction: column; align-items: flex-start; gap: 0;
        margin: 8px 0 4px; padding-right: 0; padding-left: 4vw;
    }
    .floor { margin-top: -17vw; }          /* same overlap as desktop, scaled to the phone width */
    .floor-3 { margin-top: 0; }
    .floor img { width: 54vw; height: auto; }
    .floor-label { position: absolute; left: 100%; top: 50%; transform: translateY(-50%); margin: 0 0 0 3vw; align-items: flex-start; font-size: 1.15rem; }
    .floor-label small { font-size: 0.65rem; }
}

.home-contact .button { color: #126889; }

/* ---------- Smooth scrolling (Lenis, set up in home.js → smoothScroll) ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
