/* Base styles and layout */
:root {
    --bg: #d9d9d9;
    --fg: #2F2F2F;
    --muted: #6c6c6c;
    /* --link: #bebebe; */
    --link: #4f6a8f;
    --alternate-fg: #bebebe;
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: "Charter", "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, Noto Sans, Ubuntu, Helvetica Neue, Arial, sans-serif
}

body.show-grid::before {
    content: "";
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1440px;
    /* match your page width */
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background-image: repeating-linear-gradient(to right,
            rgba(255, 0, 0, 0.1) 0,
            rgba(255, 0, 0, 0.1) calc((100% - 11 * 24px) / 12),
            transparent calc((100% - 11 * 24px) / 12 + 24px));
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* overflow-x: hidden; */
    /* overflow-x: clip; */
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 16px 24px;
    background: transparent;
    backdrop-filter: blur(25px);

}

.logo a {
    font-family: "Helvetica", serif;
    font-weight: 700;
    letter-spacing: .5px;
    text-decoration: none;
    color: var(--fg);
}

/* .logo a {
    text-decoration: none;
    color: var(--fg);
} */

.logo a:hover {
    opacity: .7;
    color: var(--link);
}

.nav a {
    margin: 0 16px;
    color: var(--fg);
    text-decoration: none;
    font-weight: 600;
    border-radius: 999px;
    padding: 10px 10px 10px 10px;
    font-family: "Helvetica", "Charter", system-ui, -apple-system, sans-serif
}

.nav a:hover {
    opacity: .7;
    color: var(--link);
    background: rgba(255, 255, 255, 0.35);
}

.social {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
}

.social a {
    color: var(--fg);
    margin-left: 0px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    transition: transform .25s ease, background-color .25s ease, border-color .25s ease;
    text-decoration: none;
}

.social i {
    font-size: 18px;
    opacity: .9
}

.social a:hover i {
    opacity: 1;
    color: var(--link);
}

.social a:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 0, 0, 0.14);
    background: rgba(255, 255, 255, 0.55);
}

/* Main area */
.main {
    position: relative;
    min-height: 100vh;
    /* padding: 40px 24px 0px; */
}

/* Hero component */
.hero {
    position: relative;
    height: 100vh;
    display: grid;
    grid-template-columns: 1.5fr minmax(320px, 680px) 1fr;
    align-items: start;
    /* border-bottom: 2px solid var(--alternate-fg); */
}

.center {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 680px;
    margin-inline: auto;
    margin-top: 30%;
    /* padding-left: 1%; */
}

.title {
    margin: 40px 0 16px 0;
    line-height: .9;
    font-family: "Helvetica", "Ultra", serif;
    font-weight: 800;
    font-size: clamp(42px, 7vw, 96px);
    text-transform: uppercase
}

.title span {
    display: block
}

.copy {
    margin: 12px 0 20px 0;
    line-height: 1.75;
    max-width: 50ch;
    font-size: clamp(14px, 1.6vw, 18px)
}

/* Right vertical text */
.right-vertical {
    position: absolute;
    right: 20px;
    top: 45%;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-family: "Charter", serif;
    font-size: 18px;
    letter-spacing: .5px;
    /* color: #111 */
}

/* Bottom-right big tagline */
.bottom-right {
    position: absolute;
    right: 24px;
    bottom: 26px;
    font-family: "Ultra", serif;
    font-size: clamp(18px, 2vw, 252px);
    /* font-weight: 400; */
    color: #111
}

/* Left hero image beside title */
/* .hero-image {
    grid-column: 1;
    align-self: start;
    justify-self: end;
    max-width: min(38vw, 520px);
    width: auto;
    height: auto;
} */

.hero-image {
    position: absolute;
    bottom: 0;
    left: 0%;
    align-self: start;
    justify-self: end;
    max-width: min(38vw, 820px);
    width: auto;
    height: auto;
    z-index: 1;
}

/* Expertise component */
.expertise {
    position: relative;
    min-height: calc(100vh - 64px);
    display: grid;
    grid-template-columns: 2fr 1f 1fr;
    align-items: start;
    padding: 40px 24px 0px;
    /* background: #131313; */
    z-index: 2;
}

.expertise-title {
    font-family: "Plus Jakarta Sans", "Ultra", serif;
    font-size: clamp(28px, 6vw, 72px);
    /* color: var(--alternate-fg); */
    position: absolute;
    top: 10%;
    left: 12%;
}

.expertise-content {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 680px;
    margin-inline: auto
}

/* Portfolio section */
.projects {
    position: relative;
    margin-top: 0;
    min-height: 100vh;
    padding: clamp(48px, 8vw, 120px) clamp(24px, 8vw, 120px) clamp(64px, 10vw, 160px);
    display: grid;
    align-items: start;
    grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
    gap: clamp(32px, 6vw, 120px);
    /* border-bottom: 2px solid var(--alternate-fg); */
    /* background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), transparent); */
    background: #0b0b0b;
    color: var(--bg);
}

.project-title {
    position: relative;
    top: 0;
    align-self: flex-start;
    grid-column: 1;
    font-family: "Helvetica", "Plus Jakarta Sans", serif;
    font-size: clamp(24px, 4vw, 56px);
    line-height: .9;
    text-transform: uppercase;
}

.project-title::after {
    content: "Selected work";
    display: block;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: clamp(12px, 1.2vw, 16px);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.6);
}

.portfolio-grid,
.project-grid {
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(24px, 4vw, 40px);
    width: 100%;
    max-width: 1080px;
    align-content: start;
    min-width: 0;
}

.project-body {
    color: var(--fg)
}

.project-item {
    position: relative;
    top: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    padding-bottom: 8px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
    transition: transform .4s ease, box-shadow .4s ease;
    min-width: 0;
}

.project-item:hover {
    transform: translateY(-12px);
    box-shadow: 0 35px 65px rgba(0, 0, 0, 0.12);
}

.project-media {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    margin: 16px 16px 0 16px;
    background: #111;
    aspect-ratio: 21 / 9;
}

.project-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .6s ease;
}

.project-item:hover .project-media img {
    transform: scale(1.04);
}

.project-duration {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #111;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.project-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px 28px 32px;
    gap: 16px;
    min-width: 0;
}

.project-body h3 {
    margin: 0;
    font-size: 24px;
    font-family: "Plus Jakarta Sans", sans-serif;
}

.project-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
    font-size: 15px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-tag {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.05);
    font-size: 13px;
    font-weight: 600;
}

.project-placeholder {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}

.project-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    width: 100%;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 600;
    color: var(--fg);
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 100%;
}

.project-link span {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.project-link i {
    font-size: 13px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    transition: transform .3s ease;
}

.project-link:hover i {
    transform: translate(2px, -2px);
    color: var(--link);
}

.project-link:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.14);
}


/* Contact section redesign */
.contact {
    background: var(--bg);
    padding: clamp(64px, 10vw, 140px) clamp(24px, 8vw, 120px);
    display: flex;
    justify-content: center;
}

.contact-wrapper {
    max-width: 900px;
    width: 100%;
}

.contact-title {
    font-family: "Helvetica", "Plus Jakarta Sans", sans-serif;
    font-size: clamp(32px, 5vw, 64px);
    margin-bottom: 12px;
}

.contact-subtitle {
    color: var(--muted);
    font-size: 16px;
    margin-bottom: 40px;
    max-width: 50ch;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.contact-item {
    padding: 20px 24px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform .25s ease, box-shadow .25s ease;
}

.contact-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.contact-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--muted);
}

.contact-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--fg);
    word-break: break-word;
}

/* Footer */
.footer {
    position: relative;
    /* min-height: 100vh; */
    padding: 40px 24px 0px;
    /* background: #111; */
    background: var(--bg);
    color: var(--muted);
}


/* Responsive */
@media (max-width: 600px) {
    .portfolio-title {
        font-size: 42px;
    }

    .project-info h3 {
        font-size: 18px;
    }
}

/* Responsive */
@media (max-width:900px) {
    .hero {
        grid-template-columns: 24px 1fr 2px;
        min-height: auto;
    }


    .right-vertical {
        display: none;
        font-size: 14px;
    }

    .bottom-right {
        font-size: clamp(24px, 8vw, 48px)
    }

    .projects {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 32px 24px 72px;
    }

    .project-title {
        position: static;
    }

    .portfolio-grid,
    .project-grid {
        grid-column: 1;
        max-width: 100%;
    }
}

@media (max-width: 720px) {
    .header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        gap: 12px;
    }

    .logo a {
        font-size: 16px;
        letter-spacing: 0.4px;
    }

    .nav {
        display: flex;
        gap: 10px;
    }

    .nav a {
        margin: 0;
        font-size: 13px;
        padding: 6px 10px;
        background: rgba(255, 255, 255, 0.25);
    }

    .hero {
        display: block;
        /* min-height: auto; */
        max-height: fit-content;
        padding: 24px 20px 16px;
    }

    .center {
        grid-column: auto;
        order: 1;
        margin-top: 0;
        max-width: 100%;
    }

    .title {
        margin: 8px 0 12px 0;
        font-size: clamp(36px, 12vw, 64px);
    }

    .copy {
        margin: 8px 0 16px 0;
        font-size: 15px;
    }

    .social {
        gap: 10px;
    }

    .social a {
        width: 34px;
        height: 34px;
    }

    .hero-image {
        position: static;
        display: block;
        width: min(72vw, 320px);
        height: min(44vh, 360px);
        max-width: none;
        margin: 16px 0 8px;
        object-fit: cover;
        object-position: center top;
    }

    .bottom-right {
        /* position: static;
        order: 3;
        margin-top: 6px;
        font-size: clamp(20px, 9vw, 40px); */
        display: none;
    }

    .projects {
        padding: 24px 20px 64px;
        gap: 24px;
    }

    .project-title {
        font-size: clamp(28px, 10vw, 48px);
    }

    .project-item {
        top: 0;
    }

}