:root {
    --sand: #EFEDE9;
    --ink: #141411;
    --muted: #7D7D7D;
    --dark-blue: #00223B;
    /* Base font size scales with viewport */
    font-size: clamp(12px, 1vw, 16px);
}

/* HK Gothic fonts from local fonts folder */
@font-face {
    font-family: 'HK Gothic';
    src: url('fonts/hk-gothic/HK Gothic Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'HK Gothic';
    src: url('fonts/hk-gothic/HK Gothic SemiBold.otf') format('opentype');
    font-weight: 600;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'HK Gothic', sans-serif;
    font-weight: 600;
    background: var(--sand);
    color: var(--ink);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    font-size: clamp(14px, 1.2vw, 16px);
}

body::-webkit-scrollbar {
    display: none;
}

body {
    scrollbar-width: none;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: transparent;
    padding: clamp(15px, 1.56vw, 30px) clamp(20px, 3.65vw, 70px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
    pointer-events: none;
}

.header>* {
    pointer-events: auto;
}

.logo {
    display: block;
    z-index: 10001;
}

.logo-image {
    height: 80px;
    width: 232px;
    display: block;
    opacity: 1;
    visibility: visible;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
    z-index: 10001;
}

body.menu-open .menu-toggle {
    opacity: 0;
    pointer-events: none;
}

.menu-toggle span {
    width: 30px;
    height: 3px;
    background: #000;
    transition: all 0.3s ease;
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Portfolio Frames */
.portfolio-frame {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    width: 100%;
    transition: transform 0.3s ease-out;
    will-change: transform;
}

.portfolio-frame-1 {
    background: #FFFFFF;
    z-index: 100;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: clamp(170px, 17.71vw, 340px) clamp(20px, 3.13vw, 60px) 0;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    width: 100%;
}

.portfolio-frame-1::after {
    content: '';
    position: absolute;
    right: 0px;
    bottom: 0;
    width: clamp(400px, 72.92vw, 1400px);
    max-width: 100%;
    height: clamp(300px, 41.67vw, 800px);
    background: url('assets/port1.png') center/cover no-repeat;
    background-size: cover;
    z-index: 1;
}

.portfolio-hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(15px, 1.56vw, 30px);
    width: clamp(275px, 28.7vw, 551px);
    max-width: 100%;
    z-index: 10;
    position: relative;
    margin-top: clamp(-30px, -3.13vw, -60px);
}

.portfolio-hero-title {
    font-family: 'HK Gothic', sans-serif;
    font-weight: 600;
    font-size: clamp(36px, 6.25vw, 120px);
    line-height: 100%;
    letter-spacing: clamp(-2px, -0.21vw, -4px);
    color: #141411;
    margin-top: clamp(-35px, -3.65vw, -70px) !important;
    transform: translateY(clamp(-20px, -2.08vw, -40px));
}

.portfolio-hero-description {
    font-family: 'HK Gothic', sans-serif;
    font-weight: 300;
    font-size: clamp(14px, 1.04vw, 20px);
    line-height: clamp(24px, 1.77vw, 34px);
    color: #7D7D7D;
    width: 100%;
    max-width: clamp(275px, 28.7vw, 551px);
}

.portfolio-frame-2 {
    background: #FFFFFF;
    z-index: 200;
    height: auto;
    min-height: 100vh;
    padding: 100px 0 50px;
    overflow: hidden;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

.portfolio-works-container {
    width: 100%;
    margin: 0;
    padding: 0 clamp(20px, 3.65vw, 70px);
    display: flex;
    flex-direction: column;
    gap: clamp(70px, 7.29vw, 140px);
    will-change: transform;
    transition: transform 0.1s ease-out;
    box-sizing: border-box;
}

.portfolio-works-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.portfolio-works-intro {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(20px, 2.08vw, 40px);
    width: 100%;
    max-width: clamp(313px, 32.66vw, 627px);
}

.portfolio-works-tag {
    box-sizing: border-box;
    width: clamp(100px, 7.29vw, 140px);
    height: clamp(30px, 2.08vw, 40px);
    border: 1px solid #8A99A5;
    border-radius: clamp(10px, 1.04vw, 20px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'HK Gothic', sans-serif;
    font-weight: 700;
    font-size: clamp(12px, 0.73vw, 14px);
    line-height: clamp(14px, 0.94vw, 18px);
    text-transform: uppercase;
    color: #000000;
}

.portfolio-works-title {
    font-family: 'HK Gothic', sans-serif;
    font-weight: 600;
    font-size: clamp(36px, 5vw, 96px);
    line-height: clamp(44px, 4.58vw, 88px);
    letter-spacing: clamp(-2px, -0.21vw, -4px);
    color: #141414;
    width: auto;
}

.portfolio-works-subtitle {
    font-family: 'HK Gothic', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 0.83vw, 16px);
    line-height: clamp(24px, 1.67vw, 32px);
    color: #555555;
    width: 100%;
    max-width: clamp(200px, 16.46vw, 316px);
    margin-top: clamp(40px, 4.17vw, 80px);
}

.word-separator {
    display: inline-block;
    margin: 0 8px;
    color: #555555;
    opacity: 0.6;
    font-weight: 300;
}

.portfolio-projects-list {
    display: flex;
    flex-direction: column;
    gap: clamp(27px, 2.81vw, 54px);
    width: 100%;
}

.portfolio-project-card {
    width: 100%;
    background: #FFFFFF;
    position: relative;
    border-bottom: 1px solid #E6E9EB;
    padding-bottom: clamp(35px, 3.65vw, 70px);
}

.portfolio-project-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.project-content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: clamp(20px, 2.08vw, 40px);
    width: 100%;
    min-height: clamp(300px, 23.96vw, 460px);
    flex-wrap: wrap;
}

.project-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(15px, 1.56vw, 30px);
    flex: 1;
    max-width: clamp(350px, 36.6vw, 702px);
    width: 100%;
}

.project-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: clamp(10px, 0.73vw, 14px) clamp(15px, 1.04vw, 20px);
    gap: clamp(5px, 0.52vw, 10px);
    width: clamp(150px, 10.94vw, 210px);
    height: clamp(35px, 2.45vw, 47px);
    background: #00223B;
    border-radius: clamp(3px, 0.31vw, 6px);
    font-family: 'HK Gothic', sans-serif;
    font-weight: 600;
    font-size: clamp(14px, 0.83vw, 16px);
    line-height: clamp(20px, 1.46vw, 28px);
    text-transform: uppercase;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.project-title {
    font-family: 'HK Gothic', sans-serif;
    font-weight: 600;
    font-size: clamp(24px, 2.19vw, 42px);
    line-height: clamp(36px, 3.13vw, 60px);
    letter-spacing: -0.02em;
    text-transform: capitalize;
    color: #000000;
    width: auto;
    max-width: 100%;
}

.project-description {
    font-family: 'HK Gothic', sans-serif;
    font-weight: 300;
    font-size: clamp(14px, 0.94vw, 18px);
    line-height: clamp(24px, 1.77vw, 34px);
    color: #555555;
    width: 100%;
}

.project-image {
    width: 100%;
    max-width: clamp(320px, 34.38vw, 660px);
    min-width: clamp(240px, 25vw, 480px);
    height: clamp(250px, 20.83vw, 400px);
    background: #D9D9D9;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
}

.project-placeholder {
    width: 100%;
    height: 100%;
    background: #D9D9D9;
}

/* Frame 3: Contact Section */
.portfolio-frame-3 {
    background: linear-gradient(164.47deg, rgba(0, 0, 0, 0.5) 48.44%, rgba(0, 0, 0, 0) 138.37%), url('assets/port5.png');
    background-size: 105%;
    background-position: center 20%;
    background-repeat: no-repeat;
    z-index: 50;
    height: 100vh;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 100px 0 120px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
}

.portfolio-contact-overlay {
    width: min(960px, 90%);
    text-align: center;
    padding: 0 20px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.portfolio-contact-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 187px;
    height: 40px;
    border: 1px solid #FFFFFF;
    border-radius: 20px;
    font-family: 'HK Gothic', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 18px;
    text-transform: uppercase;
    color: #FFFFFF;
    margin-bottom: 20px;
}

.portfolio-contact-title {
    font-family: 'HK Gothic', sans-serif;
    font-weight: 600;
    font-size: clamp(32px, 5vw, 96px);
    line-height: clamp(40px, 6.51vw, 125px);
    letter-spacing: clamp(-6px, -0.63vw, -12px);
    color: #FFFFFF;
    margin: clamp(5px, 0.52vw, 10px) 0 clamp(5px, 0.52vw, 10px);
    width: 100%;
    max-width: clamp(600px, 63.75vw, 1222px);
    margin-left: clamp(-40px, -4.17vw, -80px);
    margin-right: auto;
    white-space: nowrap;
    text-align: left;
}

.portfolio-contact-description {
    font-family: 'HK Gothic', 'Geist', sans-serif;
    font-weight: 200;
    font-size: clamp(14px, 0.94vw, 18px);
    line-height: clamp(20px, 1.41vw, 27px);
    color: #e2dcdc;
    margin: 0 auto clamp(12px, 1.25vw, 24px);
    max-width: clamp(550px, 57.29vw, 1100px);
    width: 100%;
    text-align: center;
}

.portfolio-contact-form {
    background: #FFFFFF;
    backdrop-filter: blur(2.5px);
    border-radius: clamp(16px, 1.67vw, 32px);
    padding: clamp(20px, 2.08vw, 40px);
    display: flex;
    flex-direction: column;
    gap: clamp(14px, 1.46vw, 28px);
    border: 1px solid #E6E9EB;
    margin: 0 auto;
    width: 100%;
    max-width: clamp(400px, 41.67vw, 800px);
    min-height: clamp(250px, 20.16vw, 387px);
    height: auto;
}

.portfolio-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(16px, 1.67vw, 32px);
}

@media (max-width: 768px) {
    .portfolio-form-row {
        grid-template-columns: 1fr;
    }
}

.portfolio-contact-form input,
.portfolio-contact-form textarea {
    width: 100%;
    padding: clamp(12px, 0.83vw, 16px) 0;
    border: none;
    border-bottom: 1px solid #E6E9EB;
    border-radius: 0;
    font-family: 'HK Gothic', sans-serif;
    font-size: clamp(14px, 0.83vw, 16px);
    font-weight: 500;
    color: #000000;
    background: transparent;
    outline: none;
}

.portfolio-contact-form input:focus,
.portfolio-contact-form textarea:focus {
    border-bottom-color: #00223B;
}

.portfolio-contact-form input::placeholder,
.portfolio-contact-form textarea::placeholder {
    color: #C7C7C7;
}

.portfolio-contact-form textarea {
    min-height: 60px;
    resize: vertical;
    grid-column: 1 / -1;
}

.portfolio-contact-form button {
    padding: clamp(14px, 1.46vw, 28px) clamp(20px, 2.08vw, 40px);
    background: #00223B;
    color: #FFFFFF;
    border: none;
    border-radius: clamp(6px, 0.63vw, 12px);
    font-family: 'HK Gothic', sans-serif;
    font-size: clamp(14px, 0.94vw, 18px);
    font-weight: 700;
    letter-spacing: -0.02em;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: clamp(300px, 38.33vw, 736px);
    height: clamp(40px, 3.33vw, 64px);
    margin-top: clamp(4px, 0.36vw, 7px);
}

.portfolio-contact-form button:hover {
    background: #003a5f;
    transform: translateY(-2px);
}

.form-message {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 18px;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@media (max-width: 1024px) {
    .project-content {
        flex-direction: column;
        gap: clamp(15px, 1.56vw, 30px);
    }

    .project-image {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
    }

    .portfolio-contact-title {
        margin-left: 0;
        white-space: normal;
        text-align: center;
    }
}

@media (max-width: 768px) {

    /* RESET SCROLL LOGIC FOR MOBILE - Allowing Frame-over-Frame */

    /* HEADER */
    .header {
        padding: 20px;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 10000 !important;
        background: transparent;
        transition: transform 0.3s ease, background 0.3s ease;
    }

    .logo-image {
        height: 50px !important;
        width: auto !important;
    }

    /* Keep Frame Scroll Logic on Mobile */
    body {
        /* height will be set by JS */
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    .portfolio-frame {
        position: fixed !important;
        /* Keep fixed for sliding effect */
        width: 100% !important;
        height: 100vh !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
    }

    /* FRAME 1: HERO */
    .portfolio-frame-1 {
        z-index: 100;
        display: flex !important;
        flex-direction: column;
        justify-content: flex-start;
        padding: 120px 0 50px 0 !important;
    }

    /* FRAME 2: CONTENT */
    .portfolio-frame-2 {
        z-index: 200;
        background: #FFFFFF !important;
        padding: 100px 0 50px !important;
        overflow: hidden !important;
        /* Allow scroll within frame logic */
    }





    .portfolio-hero-content {
        width: 100%;
        max-width: 100%;
        margin-top: 20px;
        padding: 0 24px;
        display: flex;
        flex-direction: column;
        gap: 16px;
        margin-bottom: 20px;
    }

    .portfolio-hero-title {
        font-size: 52px !important;
        line-height: 1.1;
        margin-top: 0 !important;
        transform: none !important;
        width: 100%;
    }

    .portfolio-hero-description {
        font-size: 16px;
        line-height: 1.6;
        width: 100%;
        max-width: 100%;
    }

    .portfolio-frame-1::after {
        position: absolute;
        width: 100%;
        height: 45vh;
        /* Adjust height for mobile */
        bottom: 0;
        left: 0;
        background-position: center bottom;
        background-size: cover;
        z-index: 1;
    }

    /* Additional Frame 2 content styles */

    .portfolio-works-container {
        padding: 0 24px;
        gap: 48px;
        /* Removed transform: none to allow JS scrolling */
    }

    .portfolio-works-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .portfolio-works-tag {
        width: auto;
        padding: 0 16px;
    }

    .portfolio-works-title {
        font-size: 42px;
        line-height: 1.1;
        margin: 0;
    }

    .portfolio-works-subtitle {
        margin-top: 0;
        width: 100%;
        font-size: 15px;
        line-height: 1.6;
    }

    .portfolio-projects-list {
        gap: 50px;
    }

    .portfolio-project-card {
        padding-bottom: 0;
        border-bottom: none;
    }

    .portfolio-project-card:not(:last-child) {
        border-bottom: 1px solid #E6E9EB;
        padding-bottom: 40px;
    }

    .project-content {
        flex-direction: column;
        gap: 24px;
        min-height: auto;
    }

    .project-info {
        max-width: 100%;
        gap: 16px;
    }

    .project-badge {
        width: auto;
        display: inline-flex;
    }

    .project-title {
        font-size: 32px;
        line-height: 1.2;
    }

    .project-description {
        font-size: 15px;
        line-height: 1.6;
    }

    .project-image {
        width: 100%;
        height: 240px;
        max-width: 100%;
    }

    /* FRAME 3: CONTACT */
    .portfolio-frame-3 {
        z-index: 300;
        background: linear-gradient(164.47deg, rgba(0, 0, 0, 0.5) 48.44%, rgba(0, 0, 0, 0) 138.37%), url('assets/port5.png') !important;
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        padding: 60px 20px 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: auto !important;
        min-height: 100vh !important;
        overflow-y: auto !important;
    }

    .portfolio-contact-overlay {
        width: 100%;
        padding: 0;
        justify-content: center;
        margin: 0;
        text-align: center;
    }

    .portfolio-contact-pill {
        height: 28px;
        font-size: 11px;
        width: 140px;
        margin-bottom: 12px;
    }

    .portfolio-contact-title {
        font-size: 24px !important;
        line-height: 1.2 !important;
        margin-left: 0;
        margin-bottom: 10px;
        white-space: normal;
        text-align: center;
        letter-spacing: -1px;
    }

    .portfolio-contact-description {
        font-size: 13px !important;
        line-height: 1.5;
        margin-bottom: 20px;
        padding: 0 5px;
        max-width: 100%;
        text-align: center;
    }

    .portfolio-contact-description br {
        display: none;
    }

    .portfolio-contact-form {
        padding: 20px 16px !important;
        gap: 12px !important;
        border-radius: 16px;
        max-width: 100%;
    }

    .portfolio-form-row {
        gap: 12px !important;
        display: flex;
        flex-direction: column;
    }

    .portfolio-contact-form input,
    .portfolio-contact-form textarea {
        padding: 8px 0 !important;
        font-size: 13px !important;
    }

    .portfolio-contact-form button {
        margin-top: 8px;
        padding: 10px;
        font-size: 14px;
        height: auto;
    }
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
}

.toast {
    background: #FFFFFF;
    color: #333;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 5px solid #00223B;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-left-color: #27ae60;
}

.toast.error {
    border-left-color: #e74c3c;
}

.toast-icon {
    font-size: 20px;
    font-weight: bold;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
}

/* Mobile Toast Adjustments */
@media (max-width: 768px) {
    .toast-container {
        bottom: 20px;
        right: 20px;
        left: 20px;
        pointer-events: none;
        /* Allow clicks pass through */
    }

    .toast {
        min-width: 0;
        width: 100%;
        padding: 12px 16px;
        pointer-events: auto;
        /* Enable clicks on toast */
    }
}