/* Design tokens from Figma (Kathleen Site) */
:root {
    --color-yellow: #FCDC47;
    --color-teal: #00B09A;
    --color-about-bg: #E0F2F1;
    --color-black: #000000;
    --font-display: 'Montserrat', sans-serif;
    --font-body: 'Kulim Park', sans-serif;
    --font-size-h2: 36px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--color-yellow);
    color: #000000;
    font-family: 'Kulim Park', sans-serif;
    font-size: 18px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 3rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 2rem;
    z-index: 1000;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav.nav--scrolled {
    background-color: #000000;
}

.nav.nav--scrolled .nav-links a:not(.nav-cta) {
    color: #ffffff;
}

.nav.nav--scrolled .nav-hamburger-line {
    background-color: #ffffff;
}

.nav-brand {
    position: absolute;
    left: 3rem;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.1em;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav.nav--scrolled .nav-brand {
    opacity: 1;
    visibility: visible;
    color: #00B09A;
    transition: opacity 0.3s ease, visibility 0.3s ease, color 0.3s ease;
}

.nav.nav--scrolled .nav-brand:hover {
    color: var(--color-yellow);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav a {
    color: var(--color-black);
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    transition: opacity 0.3s;
}

.nav a:hover {
    opacity: 0.7;
}

.nav-cta {
    background-color: var(--color-teal);
    color: #ffffff !important;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 700;
}

.nav-cta:hover {
    opacity: 0.85 !important;
}

/* Hamburger - hidden on desktop */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.nav-hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-black);
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-hamburger[aria-expanded="true"] .nav-hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-hamburger[aria-expanded="true"] .nav-hamburger-line:nth-child(2) {
    opacity: 0;
}

.nav-hamburger[aria-expanded="true"] .nav-hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding: 2rem 2rem 4rem;
    text-align: center;
    cursor: default;
    -webkit-user-select: none;
    user-select: none;
}

.hero-name {
    position: relative;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Hero letters - single container for FLIP animation */
.hero-letters {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0;
    width: fit-content;
}

.hero-letter {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 180px;
    line-height: 0.85;
    color: var(--color-teal);
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Subtitle - hidden in start state */
.hero-subtitle {
    display: none;
    font-family: 'Kulim Park', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #000000;
    max-width: 600px;
    margin: 0;
    padding: 0;
}

/* End state: grid layout, letters in KTLE / AHEN positions */
.hero-name.hero-expanded .hero-letters {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: auto auto auto;
    width: 100%;
    gap: 0;
}

.hero-name.hero-expanded .hero-letter {
    font-size: 270px;
}

.hero-name.hero-expanded .hero-letter:nth-child(1) { grid-row: 1; grid-column: 1; } /* K */
.hero-name.hero-expanded .hero-letter:nth-child(2) { grid-row: 3; grid-column: 1; } /* A */
.hero-name.hero-expanded .hero-letter:nth-child(3) { grid-row: 1; grid-column: 2; } /* T */
.hero-name.hero-expanded .hero-letter:nth-child(4) { grid-row: 3; grid-column: 2; } /* H */
.hero-name.hero-expanded .hero-letter:nth-child(5) { grid-row: 1; grid-column: 3; } /* L */
.hero-name.hero-expanded .hero-letter:nth-child(6) { grid-row: 3; grid-column: 3; } /* E */
.hero-name.hero-expanded .hero-letter:nth-child(7) { grid-row: 1; grid-column: 4; } /* E */
.hero-name.hero-expanded .hero-letter:nth-child(8) { grid-row: 3; grid-column: 4; } /* N */

.hero-name.hero-expanded .hero-subtitle {
    display: block;
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: center;
    margin: 0.5rem 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Sections */
.section {
    min-height: 100vh;
    padding: 6rem 2.5rem;
    display: flex;
    flex-direction: column;
}

/* Scroll prompt - fixed at bottom of hero, within yellow (above about overlap) */
.scroll-prompt {
    position: absolute;
    bottom: 12vh;
    left: 0;
    right: 0;
    z-index: 1;
    text-align: center;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--color-black);
    opacity: 0.8;
    transition: opacity 0.4s ease;
}

.scroll-prompt.is-hidden {
    opacity: 0;
    pointer-events: none;
}

/* About Section - light teal background, peaks above viewport */

#about {
    margin-top: -10vh;
    min-height: 60vh;
    padding: 2.5rem 2.5rem;
    justify-content: center;
    background-color: var(--color-about-bg);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

#experience .container {
    max-width: 680px;
}

.experience-resume-btn-wrapper {
    text-align: center;
    margin-top: 3rem;
}

.experience-resume-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--color-teal);
    color: #ffffff;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 18px;
    text-decoration: none;
    border-radius: 25px;
    transition: opacity 0.2s ease;
}

.experience-resume-btn:hover {
    opacity: 0.85;
}

.section-heading {
    font-family: 'Kulim Park', sans-serif;
    font-weight: 700;
    font-size: 160px;
    will-change: transform;
    color: var(--color-teal);
    margin: 0 -2rem 3rem;
    width: calc(100% + 4rem);
    line-height: 1;
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
    box-sizing: border-box;
}

.section-heading span {
    flex-shrink: 0;
}

.about-text {
    font-size: 20px;
    line-height: 1.7;
    margin-bottom: 0.75rem;
    color: #000000;
}

#about .about-text:last-child {
    margin-bottom: 0;
}

#brands {
    background-color: var(--color-about-bg);
    min-height: auto;
}

#brands .container {
    max-width: none;
    width: 100%;
    padding: 0 2.5rem;
}

.brands-logos {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: minmax(62px, auto);
    gap: 8rem 8rem;
    justify-items: stretch;
    align-items: stretch;
}

.brands-logo {
    width: 100%;
    height: 100%;
    min-height: 41px;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.brands-logos.is-visible .brands-logo {
    opacity: 1;
}

.brands-logos.is-visible .brands-logo:nth-child(1) { transition-delay: 0s; }
.brands-logos.is-visible .brands-logo:nth-child(2) { transition-delay: 0.05s; }
.brands-logos.is-visible .brands-logo:nth-child(3) { transition-delay: 0.1s; }
.brands-logos.is-visible .brands-logo:nth-child(4) { transition-delay: 0.15s; }
.brands-logos.is-visible .brands-logo:nth-child(5) { transition-delay: 0.2s; }
.brands-logos.is-visible .brands-logo:nth-child(6) { transition-delay: 0.25s; }
.brands-logos.is-visible .brands-logo:nth-child(7) { transition-delay: 0.3s; }
.brands-logos.is-visible .brands-logo:nth-child(8) { transition-delay: 0.35s; }
.brands-logos.is-visible .brands-logo:nth-child(9) { transition-delay: 0.4s; }
.brands-logos.is-visible .brands-logo:nth-child(10) { transition-delay: 0.45s; }
.brands-logos.is-visible .brands-logo:nth-child(11) { transition-delay: 0.5s; }
.brands-logos.is-visible .brands-logo:nth-child(12) { transition-delay: 0.55s; }
.brands-logos.is-visible .brands-logo:nth-child(13) { transition-delay: 0.6s; }
.brands-logos.is-visible .brands-logo:nth-child(14) { transition-delay: 0.65s; }
.brands-logos.is-visible .brands-logo:nth-child(15) { transition-delay: 0.7s; }

.brands-logo:hover {
    opacity: 0.85;
}

/* Job Entries */
.job {
    margin-bottom: 5rem;
}

h3 {
    font-family: 'Kulim Park', sans-serif;
    font-weight: 700;
    font-size: 36px;
    color: #000000;
    margin-bottom: .75rem;
    line-height: 2rem;
}

h4 {
    font-size: 36px;
    font-weight: 400;
    color: #000000;
    margin-bottom: 0.25rem;
    line-height: 2rem;
}

.job-date {
    font-size: 16px;
    color: #000000;
    margin-bottom: 1rem;
    opacity: 0.7;
    text-decoration: none;
}

/* Prevent iOS Safari from underlining detected dates */
.job-date,
.job-date a {
    text-decoration: none !important;
}

.job-description {
    line-height: 1.6;
    color: #000000;
    list-style: disc;
    padding-left: 1.5rem;
    margin: 0;
}

.job-description li {
    margin-bottom: 0.5rem;
}

.job-description li:last-child {
    margin-bottom: 0;
}

/* Work Section */
.work-section {
    min-height: auto;
    justify-content: flex-start;
}

#work .section-heading {
    margin-bottom: 1.5rem;
}

.work-item {
    margin-bottom: 6rem;
}

.work-item:last-child {
    margin-bottom: 4rem;
}

.work-item-image-wrap {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-bottom: 2rem;
}

.work-item-image {
    width: 100%;
    height: 50vh;
    min-height: 320px;
    object-fit: cover;
    display: block;
}

.work-item-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: rgba(0, 176, 154, 0.9);
    color: #ffffff;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 18px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

.work-item-play:hover {
    background-color: rgba(0, 176, 154, 0.7);
    opacity: 0.95;
}

.work-item-play:focus {
    outline: 2px solid var(--color-teal);
    outline-offset: 4px;
}

.work-item-play-icon {
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 14px solid #ffffff;
}

.work-item-play-text {
    position: static;
    transform: none;
}

.work-item:not([data-video-url]) .work-item-play {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.work-item-play-case {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--color-teal);
    color: #ffffff;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 18px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: opacity 0.2s ease;
}

.work-item-play-case:hover {
    opacity: 0.85;
}

.work-item-play-case:focus {
    outline: 2px solid var(--color-teal);
    outline-offset: 4px;
}

/* Video overlay */
.video-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.video-overlay-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(252, 220, 71, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.video-overlay-content {
    position: relative;
    width: 100%;
    max-width: 960px;
    aspect-ratio: 16 / 9;
    z-index: 1;
}

.video-overlay-close {
    position: absolute;
    top: -4rem;
    right: 0;
    padding: 0.75rem 1.5rem;
    background-color: var(--color-teal);
    color: #ffffff;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 18px;
    line-height: 1;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.video-overlay-close:hover {
    opacity: 0.85;
}

.video-overlay-close:focus {
    outline: 2px solid var(--color-teal);
    outline-offset: 2px;
}

.video-overlay-player {
    width: 100%;
    height: 100%;
    background-color: #000000;
    border-radius: 4px;
    overflow: hidden;
}

.video-overlay-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Local videos: container adapts to video's aspect ratio */
.video-overlay--local .video-overlay-content {
    aspect-ratio: auto;
    max-height: 80vh;
}

.video-overlay--local .video-overlay-player {
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-overlay--local .video-overlay-player video {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.work-item-title {
}

.work-item-description {
    font-size: 18px;
    line-height: 1.7;
    color: var(--color-black);
    margin-top: 0.75rem;
    margin-bottom: 1rem;
}

.work-item-awards {
    font-size: 16px;
    color: var(--color-yellow);
    background-color: var(--color-black);
    font-weight: 700;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    padding: 0.25em 0.5em;
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
}

.work-item-awards-emoji {
    font-size: 1.5em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    padding-right: 0.5em;
}

.work-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 14px;
    color: var(--color-black);
    opacity: 0.8;
}

.work-item-meta strong {
    font-weight: 700;
    opacity: 1;
}

#work .container {
    max-width: 680px;
}

/* Footer */
.footer {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-black);
    line-height: 1;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.footer-message {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 100;
    color: #ffffff;
    text-align: center;
    margin: 0;
}

.footer-cta {
    background-color: var(--color-teal);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 700;
    font-family: var(--font-body);
    font-size: 18px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.footer-cta:hover {
    opacity: 0.85;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .hero-letter {
        font-size: 150px;
    }
    
    .hero-name.hero-expanded .hero-letter {
        font-size: 225px;
    }
    
    .section-heading {
        font-size: 140px;
    }
}

/* Mobile nav - hamburger */
@media (max-width: 768px) {
    .nav {
        padding: 0.5rem 1.5rem;
    }
    
    .nav-brand {
        left: 1.5rem;
        font-size: 12px !important;
    }
    
    .nav-hamburger {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        justify-content: center;
        gap: 2rem;
        background-color: var(--color-black);
        padding: 5rem 2rem 2rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        z-index: 1000;
    }
    
    .nav-links.is-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-links.is-open a:not(.nav-cta) {
        color: #ffffff;
    }
    
    .nav:has(.nav-links.is-open) .nav-hamburger-line {
        background-color: #ffffff;
    }
    
    .nav a {
        font-size: 2rem;
    }
    
    .nav-links .nav-cta {
        padding: 0.75rem 1.5rem;
        font-size: 18px;
    }
}

@media (max-width: 900px) {
    .nav {
        padding: 0.75rem 2rem;
        gap: 1.5rem;
    }
    
    @media (min-width: 769px) {
        .nav a {
            font-size: 14px;
        }
    }
    
    .nav-cta {
        padding: 0.6rem 1.2rem;
    }
    
    .hero-letter {
        font-size: 120px;
    }
    
    .hero-name.hero-expanded .hero-letter {
        font-size: 180px;
    }
    
    .section-heading {
        font-size: 120px;
    }
    
    .about-text {
        font-size: 22px;
    }
    
    .job-title {
        font-size: 32px;
    }
    
    .job-role {
        font-size: 40px;
    }
    
    .work-item-title {
        font-size: 32px;
    }
    
    .work-item-role {
        font-size: 40px;
    }
}

@media (max-width: 600px) {
    .video-overlay {
        padding: 1rem;
    }

    .video-overlay-close {
        top: -4.5rem;
    }
    
    .hero {
        padding: 1rem 1rem 3rem;
    }
    
    .hero-letter {
        font-size: 68px;
    }
    
    .hero-name.hero-expanded .hero-letter {
        font-size: 120px;
    }
    
    .hero-subtitle {
        font-size: clamp(11px, 3.5vw, 14px);
        white-space: nowrap;
    }
    
    .section {
        padding: 4rem 2rem;
        min-height: auto;
    }
    
    .section-heading {
        font-size: 130px;
        line-height: 0.85;
        flex-wrap: wrap;
        row-gap: 0.05em;
        justify-content: flex-start;
        margin: 0 -1rem 2rem;
        width: calc(100% + 2rem);
        padding: 0 3rem 0 1rem;
    }
    
    .about-text {
        font-size: 20px;
    }
    
    .job-title {
        font-size: 28px;
    }
    
    .job-role {
        font-size: 36px;
    }
    
    .job-date {
        font-size: 14px;
    }
    
    .job-description {
        font-size: 19px;
    }
    
    .work-item-image {
        min-height: 240px;
    }
    
    .work-item-title {
        font-size: 28px;
    }
    
    .work-item-role {
        font-size: 36px;
    }
    
    .work-item-description {
        font-size: 16px;
    }
    
    .work-item-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer {
        padding-left: 3rem;
        padding-right: 3rem;
    }
    
    .brands-logos {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .brands-logo {
        min-height: 30px;
    }
}

@media (max-width: 400px) {
    .hero-letter {
        font-size: 52px;
    }
    
    .hero-name.hero-expanded .hero-letter {
        font-size: 90px;
    }
}
