/* ---------- TOKENS & THEMES (MATCHING 5.HTML) ---------- */
:root[data-theme="light"] {
    --bg: #FFFFFF;
    --bg-2: #F3F7FF;
    --surface: rgba(30, 109, 250, 0.035);
    --border: rgba(10, 22, 40, 0.10);
    --border-hi: rgba(30, 109, 250, 0.35);
    --text: #0A1628;
    --text-soft: #2A3B54;
    --text-mute: #6B7280;
    --accent: #1E6DFA;
    --accent-2: #3D7FFF;
    --accent-hi: #3D7FFF;
    --glow: rgba(30, 109, 250, 0.14);
    --nav-bg: rgba(255, 255, 255, 0.75);
}

:root[data-theme="dark"] {
    --bg: #070F1E;
    --bg-2: #0A1628;
    --surface: rgba(255, 255, 255, 0.04);
    --border: rgba(120, 160, 230, .16);
    --border-hi: rgba(61, 127, 255, .5);
    --text: #EEF4FF;
    --text-soft: #C3D2EC;
    --text-mute: #7488A8;
    --accent: #1E6DFA;
    --accent-2: #3D7FFF;
    --accent-hi: #7FB0FF;
    --glow: rgba(30, 109, 250, .4);
    --nav-bg: rgba(7, 15, 30, 0.7);
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Poppins', system-ui, sans-serif;
    overflow-x: hidden;
    transition: background 0.45s ease, color 0.45s ease;
}

/* LOGO THEME ADAPTATION */
.l-blue {
    display: none;
}

.l-white {
    display: block;
}

:root[data-theme="light"] .l-blue {
    display: block;
}

:root[data-theme="light"] .l-white {
    display: none;
}



.mono {
    font-family: 'Space Mono', monospace;
}

.wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* NAVBAR */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 18px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo img {
    height: 32px;
}

.nav-links {
    display: flex;
    gap: 35px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
}

/* HERO SECTION */
.hero-typewriter {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(120% 100% at 80% 8%, var(--glow), var(--bg) 55%);
    margin-bottom: 0;
}

#cnstCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--accent);
    padding: 8px 15px;
    border: 1px solid var(--border-hi);
    border-radius: 100px;
    background: var(--surface);
    backdrop-filter: blur(8px);
    margin-bottom: 28px;
}

.eyebrow .live {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-hi);
    box-shadow: 0 0 10px var(--accent-hi);
    animation: bl 2.2s infinite;
}

@keyframes bl {
    50% {
        opacity: .35;
    }
}

.ed-big {
    font-size: clamp(2.6rem, 8vw, 6.6rem);
    font-weight: 700;
    line-height: 1.1;
    /* Slightly increased for better spacing between brands and people */
    letter-spacing: -.045em;
    margin-bottom: 20px;
}

.h-line-2 {
    white-space: nowrap;
    /* Strictly force 2-line layout */
    display: inline-block;
    vertical-align: top;
}

.tw-wrap {
    display: inline-block;
    min-width: 9.5ch;
    text-align: left;
    vertical-align: top;
    /* Match parent baseline for equal spacing */
}

.grad {
    background: linear-gradient(100deg, var(--accent-2), var(--accent-hi));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#twCursor {
    color: var(--accent);
    animation: blink 1s step-end infinite;
    font-weight: 400;
    margin-left: -2px;
    /* Pull it slightly closer to the gradient text */
}

@keyframes blink {

    from,
    to {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.sub {
    font-size: clamp(1rem, 2vw, 1.16rem);
    color: var(--text-soft);
    max-width: 500px;
    margin: 26px 0 34px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 100px;
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
    transition: 0.3s;
}

.btn-pri {
    background: var(--accent);
    color: #fff;
}

.btn-pri:hover {
    background: var(--accent-2);
    box-shadow: 0 12px 30px -8px var(--glow);
    transform: translateY(-2px);
}

.btn-sec {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-hi);
    backdrop-filter: blur(8px);
}

/* SERVICES */
#ch-services {
    background: var(--bg);
    padding: 0;
    margin: 0;
}

#ch-services .ed-big,
#ch-process .ed-big {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    margin-bottom: 40px;
    margin-top: 0;
}

#ch-services .wrap {
    margin: 0;
    max-width: none;
}

.hscroll {
    height: 350vh;
}

.hscroll .pin {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.hbar {
    height: 4px;
    background: var(--border);
    margin: 2.6rem 0 0;
    position: relative;
    top: -18px;
    border-radius: 4px;
    overflow: hidden;
    max-width: 1140px;
    z-index: 10;
}

.hbar i {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-hi));
    border-radius: 3px;
}

.htrack {
    display: flex;
    gap: 2rem;
    padding: 0 40px;
}

.hcard {
    width: 340px;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px 30px;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}

.hcard:hover,
.hcard.on {
    border-color: var(--accent);
    background: var(--bg-2);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -15px var(--glow);
}

.idx {
    font-family: 'Space Mono';
    font-size: 0.65rem;
    color: var(--text-mute);
    margin-top: auto;
    align-self: flex-end;
    padding-top: 16px;
}

.ico {
    width: 52px;
    height: 52px;
    background: var(--surface);
    border: 1px solid var(--border-hi);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    transition: 0.3s cubic-bezier(.2, .8, .2, 1);
    flex-shrink: 0;
}

.hcard:hover .ico,
.hcard.on .ico {
    background: var(--bg-2);
    border-color: var(--accent);
    transform: scale(1.05);
}

.hcard h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.hcard p {
    color: var(--text-soft);
    font-size: 0.95rem;
    line-height: 1.55;
}

/* PROCESS SECTION (3.HTML) */
#ch-process {
    display: block;
    padding: 0;
    min-height: auto;
}

.pscroll {
    height: 400vh;
    position: relative;
}

.pscroll .pin {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    background: var(--bg);
}

.pgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 6vw, 6rem);
    align-items: center;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 40px;
    width: 100%;
}

.pstage {
    position: relative;
    min-height: 300px;
}

.pstep {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateY(36px);
    transition: opacity .5s, transform .5s cubic-bezier(.2, .8, .2, 1);
    pointer-events: none;
}

.pstep.on {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.pstep .num {
    font-family: 'Space Mono', monospace;
    color: var(--accent-hi);
    font-size: .85rem;
    letter-spacing: .15em;
}

.pstep h3 {
    font-size: clamp(2.4rem, 4.5vw, 3.8rem);
    margin: 1rem 0 1rem;
    font-weight: 800;
    line-height: 1.1;
}

.pstep p {
    color: var(--text-soft);
    font-size: 1.05rem;
    max-width: 440px;
    line-height: 1.6;
}

.pviz {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.pviz .bar {
    height: 74px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 0 1.6rem;
    transition: .45s cubic-bezier(.2, .8, .2, 1);
}

.pviz .bar .b-num {
    font-family: 'Space Mono', monospace;
    font-size: .75rem;
    color: var(--text-mute);
}

.pviz .bar .b-lab {
    font-weight: 600;
    color: var(--text);
    font-size: 1.15rem;
}

.pviz .bar.on {
    border-color: var(--accent);
    background: var(--bg-2);
    transform: translateX(14px) scale(1.02);
    box-shadow: 0 15px 40px -10px var(--glow);
}

.pviz .bar.on .b-num {
    color: var(--accent-hi);
}

.pviz .bar .bar-body {
    display: none; /* Desktop: hide body, show only header */
}

.pviz .bar .bar-head {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

/* MARQUEE */
.marquee {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 1.8rem 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    z-index: 2;
    background: var(--bg);
}

.marquee-track {
    display: inline-flex;
    gap: 4rem;
    animation: scroll 30s linear infinite;
    will-change: transform;
}

.marquee-track span {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-mute);
    display: inline-flex;
    align-items: center;
    gap: 4rem;
}

.marquee-track span::after {
    content: "✦";
    color: var(--accent);
}

@keyframes scroll {
    to { transform: translateX(-50%); }
}

/* CARD PLAY (EXACT AS 4.HTML — dark palette) */
.cardplay {
    padding: clamp(4rem, 8vw, 7rem) 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
}

.cardplay .wrap.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 6vw, 5rem);
    align-items: center;
}

.cardplay-h2 {
    font-size: clamp(1.9rem, 4.2vw, 3.2rem);
    font-weight: 800;
    margin: 1rem 0 1rem;
    line-height: 1.05;
}

.cardplay-p {
    color: var(--text-soft);
    max-width: 440px;
    line-height: 1.7;
}

.stage-3d {
    perspective: 1100px;
    display: grid;
    place-items: center;
    min-height: 320px;
}

.bcard {
    width: min(380px, 86vw);
    aspect-ratio: 1.75;
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
    cursor: grab;
}

.bface {
    position: absolute;
    inset: 0;
    border-radius: 18px;
    backface-visibility: hidden;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5);
    padding: 1.6rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Front face — dark navy like WebWibe, text white */
.bfront {
    background: linear-gradient(135deg, var(--bg-2), var(--bg));
    border: 1px solid var(--border-hi);
    color: #fff;
}

.bfront .b-logo-img {
    height: 28px;
    width: auto;
    object-fit: contain;
}

.bfront .b-tag {
    font-family: 'Space Mono', monospace;
    font-size: .62rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    opacity: .6;
    color: var(--text-soft);
}

/* Back face — lighter dark panel */
.bback {
    background: var(--surface);
    border: 1px solid var(--border);
    transform: rotateY(180deg);
    color: var(--text);
}

.bback .b-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
}

.bback .b-role {
    font-family: 'Space Mono', monospace;
    font-size: .62rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--accent-hi);
    margin-top: 4px;
}

.bback .b-list {
    font-size: .72rem;
    color: var(--text-soft);
    line-height: 1.9;
}

.drag-hint {
    font-size: .7rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text-mute);
    text-align: center;
    margin-top: 1.4rem;
}


/* PROJECTS (HORIZONTAL STICKY SCROLL) */
#ch-projects {
    background: var(--bg);
}

.projscroll {
    height: 350vh;
    position: relative;
}

.projpin {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.projtrack {
    display: flex;
    align-items: center;
    gap: 3rem;
    padding: 0 80px;
    will-change: transform;
    flex-shrink: 0;
}

.proj-intro {
    width: 420px;
    flex-shrink: 0;
}

/* ── Project card (new portfolio-style design) ── */
.proj-panel {
    width: 380px;
    flex-shrink: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 22px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    display: block;
    text-align: left;
    font-family: inherit;
    color: inherit;
    transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s, border-color .35s;
}

.proj-panel:hover,
.proj-panel.on {
    transform: translateY(-7px);
    box-shadow: 0 22px 50px -20px var(--glow);
    border-color: var(--border-hi);
}

.proj-panel:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Thumbnail area */
.p-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--surface);
}

.p-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .6s cubic-bezier(.2,.8,.2,1);
}

.proj-panel:hover .p-thumb img {
    transform: scale(1.05);
}

.p-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(10,22,40,.68) 100%);
}

/* Category badge */
.p-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(10,22,40,.5);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 12px;
}

/* Overlaid title + category on image */
.p-meta {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 16px;
    z-index: 2;
    color: #fff;
}

.p-meta .p-cat {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent-hi);
    margin-bottom: 4px;
}

.p-meta h3 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.15;
    margin: 0;
}

/* Footer bar below image */
.p-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 18px;
}

.p-foot p {
    font-size: 13.5px;
    color: var(--text-mute);
    max-width: 22ch;
    line-height: 1.4;
    margin: 0;
}

.p-view {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
    opacity: .55;
    transition: opacity .3s, gap .3s;
    flex-shrink: 0;
}

.proj-panel:hover .p-view {
    opacity: 1;
    gap: 9px;
}

.p-view svg {
    width: 14px;
    height: 14px;
}

/* ── Work Modal (popup) ── */
.wm-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(10,22,40,.7);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity .3s;
}

.wm-modal.open {
    display: flex;
    opacity: 1;
}

.wm-panel {
    background: var(--bg);
    border-radius: 24px;
    border: 1px solid var(--border);
    max-width: 1040px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    transform: translateY(14px) scale(.985);
    transition: transform .35s cubic-bezier(.2,.8,.2,1);
}

.wm-modal.open .wm-panel {
    transform: none;
}

.wm-gallery {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wm-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 380px;
    perspective: 1600px;
}

.wm-stage-cap {
    font-size: 12px;
    color: var(--text-mute);
    text-align: center;
    min-height: 16px;
}

.wm-strip {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    justify-content: center;
}

.wm-strip button {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    overflow: hidden;
    padding: 0;
    border: 2px solid transparent;
    cursor: pointer;
    background: var(--bg-2);
    transition: border-color .2s;
}

.wm-strip button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wm-strip button.active {
    border-color: var(--accent);
}

/* 3D book */
.wm-book {
    position: relative;
    transform-style: preserve-3d;
    transform: rotateY(-26deg);
    transition: transform .7s cubic-bezier(.2,.8,.2,1);
    width: var(--bw);
    height: var(--bh);
    animation: wmBookIn .7s cubic-bezier(.2,.8,.2,1);
}

.wm-stage:hover .wm-book {
    transform: rotateY(-14deg);
}

@keyframes wmBookIn {
    from { transform: rotateY(-46deg); opacity: 0; }
    to   { transform: rotateY(-26deg); opacity: 1; }
}

.wm-book__cover {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    border-radius: 3px 6px 6px 3px;
    box-shadow: inset 7px 0 16px -7px rgba(0,0,0,.5), 0 0 0 1px rgba(0,0,0,.05);
}

.wm-book__cover::before {
    content: "";
    position: absolute;
    top: 0;
    left: 100%;
    width: var(--thick);
    height: 100%;
    transform-origin: left center;
    transform: rotateY(90deg);
    background: repeating-linear-gradient(to bottom,#fcfcfc 0 1px,#d6d6d6 1px 3px);
    box-shadow: inset 0 0 8px rgba(0,0,0,.18);
}

.wm-book__cover::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(102deg,rgba(255,255,255,.32) 0%,rgba(255,255,255,0) 20%,rgba(255,255,255,0) 84%,rgba(0,0,0,.12) 100%);
}

.wm-book__shadow {
    position: absolute;
    left: 50%;
    bottom: -24px;
    width: 78%;
    height: 28px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center,rgba(10,22,40,.28) 0%,rgba(10,22,40,0) 70%);
    filter: blur(3px);
    z-index: -1;
}

.wm-flat {
    max-width: 100%;
    max-height: 380px;
    border-radius: 8px;
    box-shadow: 0 18px 40px -14px rgba(10,22,40,.4), 0 0 0 1px rgba(10,22,40,.06);
}

/* Info panel */
.wm-info {
    padding: 36px 36px 40px;
    position: relative;
    overflow-y: auto;
}

.wm-info .wm-cat {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}

.wm-info h2 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.1;
    color: var(--text);
}

.wm-client {
    font-size: 14px;
    color: var(--text-mute);
    margin-top: 6px;
    margin-bottom: 24px;
}

.wm-block {
    margin-bottom: 20px;
}

.wm-block .wm-lbl {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 6px;
}

.wm-block p {
    font-size: 14px;
    color: var(--text-soft);
    line-height: 1.6;
}

.wm-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 13px;
    margin: 0 6px 7px 0;
}

.wm-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    font-size: 18px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, transform .2s;
}

.wm-close:hover {
    background: var(--surface);
    transform: rotate(90deg);
}

/* Responsive modal */
@media (max-width: 820px) {
    .wm-panel {
        grid-template-columns: 1fr;
        max-height: 92vh;
    }
    .wm-gallery { padding: 22px; }
    .wm-stage { min-height: 300px; }
    .wm-info { padding: 26px 22px 30px; }
}


/* FOOTER */
.site-footer {
    background: var(--bg-2);
    padding: 120px 0 60px;
    border-top: 1px solid var(--border);
}

.footer-cta-box {
    background: var(--surface);
    /* Glassy background instead of solid blue */
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 80px;
    color: var(--text);
}

.footer-cta-box h2 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
}

.footer-top {
    display: grid;
    grid-template-columns: 1.2fr 2fr 1fr 1.2fr;
    gap: 60px;
    padding-bottom: 60px;
}

.f-brand p {
    color: var(--text-mute);
    line-height: 1.7;
    margin-top: 20px;
    max-width: 300px;
}

.f-col {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center the column container itself */
    text-align: center;
}

.f-col.contact {
    align-items: flex-start;
    text-align: left;
}

.f-col h4 {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text);
    margin-bottom: 25px;
    opacity: 1;
}

.f-col ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 30px;
    width: 100%;
    max-width: 400px;
    text-align: left; /* Keep text aligned within the columns */
}

.f-col ul li {
    margin-bottom: 15px;
}

.f-col ul a {
    color: var(--text-soft);
    text-decoration: none;
    transition: 0.3s;
}

.f-col ul a:hover {
    color: var(--text);
}

.socials {
    display: flex;
    gap: 1.5rem;
}

.socials a {
    color: var(--text-soft);
    transition: 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.socials a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.footer-bot {
    padding-top: 40px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-soft);
    font-size: 0.85rem;
    margin-top: 60px;
}

/* THEME TOGGLE (MATCHING 5.HTML) */
.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    position: relative;
    overflow: hidden;
    transition: 0.3s;
}

.theme-toggle:hover {
    border-color: var(--border-hi);
    transform: translateY(-1px);
}

.theme-toggle svg {
    width: 19px;
    height: 19px;
    position: absolute;
    transition: transform 0.45s cubic-bezier(.5, 1.5, .5, 1), opacity 0.35s ease;
}

.icon-sun {
    color: #F3A93B;
}

.icon-moon {
    color: var(--accent);
}

:root[data-theme="light"] .icon-sun {
    opacity: 1;
    transform: rotate(0) scale(1);
}

:root[data-theme="light"] .icon-moon {
    opacity: 0;
    transform: rotate(-90deg) scale(.4);
}

:root[data-theme="dark"] .icon-sun {
    opacity: 0;
    transform: rotate(90deg) scale(.4);
}

:root[data-theme="dark"] .icon-moon {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* MOBILE MENU COMPONENT */
.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    position: relative;
    z-index: 110;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    position: absolute;
    left: 4px;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s;
}

.menu-toggle span:first-child {
    top: 12px;
}

.menu-toggle span:last-child {
    top: 18px;
}

/* Morphing animation states */
.menu-open .menu-toggle span:first-child {
    transform: translateY(3px) rotate(45deg);
}

.menu-open .menu-toggle span:last-child {
    transform: translateY(-3px) rotate(-45deg);
}

.mobile-menu {
    position: fixed;
    inset: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.menu-open .mobile-menu {
    opacity: 1;
    pointer-events: auto;
}

.menu-open body {
    overflow: hidden;
    /* Lock scroll when menu is open */
}

.m-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    transform: translateY(30px);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.menu-open .m-links {
    transform: translateY(0);
}

.m-link {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 0.3s, transform 0.3s;
}

.m-link:hover,
.m-link.active {
    opacity: 1;
    transform: scale(1.05);
}

.m-btn {
    background: var(--accent);
    padding: 12px 30px;
    border-radius: 100px;
    font-size: 1rem;
    opacity: 1;
}

@media (max-width: 900px) {
    .nav-links {
        display: none !important;
    }

    .menu-toggle {
        display: block;
    }

    .d-hide {
        display: none !important;
    }
}

/* ==========================================================================
   GLOBAL VIEWPORT STABILITY
   ========================================================================== */
:root {
    --pad: clamp(1.25rem, 5vw, 5rem);
}

html {
    scroll-behavior: smooth;
}

body {
    width: 100%;
    margin: 0;
    padding: 0;
    /* REMOVED overflow-x: hidden from here as it can break sticky on mobile */
}

/* THE WRAPPER THAT PREVENTS SHAKING WITHOUT BREAKING STICKY */
.main-wrap {
    width: 100%;
    overflow-x: clip;
    position: relative;
}

/* ==========================================================================
   STRICT STICKY LOCKING (MATCHING 3.HTML)
   ========================================================================== */
#ch-services,
#ch-process,
#ch-projects {
    display: block;
    position: relative;
    width: 100%;
}

@media (max-width: 900px) {
    .ed-big {
        font-size: clamp(2.2rem, 8.5vw, 4rem);
        /* Balanced for mobile width */
        line-height: 1.15;
        /* More generous spacing for clarity */
        text-align: left;
    }

    .sub {
        text-align: left;
        margin: 20px 0 30px;
    }

    .ctas {
        display: flex;
        gap: 15px;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {

    .pin,
    .pscroll .pinner,
    .projpin {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0;
        height: 100svh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: center;
        /* Vertical center */
        align-items: flex-start;
        /* Horizontal START - Fixes hidden heading */
        width: 100%;
    }

    .pgrid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        padding: 40px 20px !important;
        display: block !important; /* Stack elements naturally */
    }

    .pstage {
        display: none !important; /* Hide floating text column on mobile */
    }

    .pviz {
        flex-direction: column !important; /* Stack vertically like cards */
        gap: 1.5rem !important;
        padding-bottom: 0 !important;
        overflow: visible !important;
    }

    .pviz .bar {
        width: 100% !important;
        height: auto !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 24px !important;
        gap: 0.5rem !important;
    }

    .pviz .bar .bar-body {
        display: block !important;
        margin-top: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, margin-top 0.4s ease, opacity 0.3s ease;
        opacity: 0;
    }

    .pviz .bar .bar-body p {
        color: var(--text-soft);
        font-size: 0.95rem;
        line-height: 1.6;
        margin: 0;
        padding-top: 10px;
    }

    .pviz .bar.on {
        transform: scale(1.02) !important;
        border-color: var(--accent) !important;
        box-shadow: 0 0 30px var(--glow) !important;
    }

    .pviz .bar.on .bar-body {
        max-height: 100px; /* Expand to show caption */
        margin-top: 5px;
        opacity: 1;
    }

    /* LENGTHEN THE PIN RANGE SO PAGE DOESN'T MOVE TOO EARLY */
    .hscroll,
    .projscroll {
        height: 400vh;
    }

    .pscroll {
        height: 500vh;
    }

    .htrack,
    .projtrack {
        display: flex !important;
        gap: 1.5rem;
        padding: 0 var(--pad);
        width: max-content;
        will-change: transform;
        transform: translate3d(0, 0, 0);
    }

    .proj-intro {
        width: clamp(280px, 85vw, 360px);
        flex-shrink: 0;
        text-align: left;
        opacity: 1 !important;
        /* Force visibility */
        visibility: visible !important;
        position: relative;
        z-index: 10;
        padding-top: 10px;
    }

    .proj-intro h2 {
        font-size: clamp(2rem, 8vw, 3.2rem) !important;
        line-height: 1.1;
        color: var(--text) !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .proj-intro .eyebrow {
        opacity: 1 !important;
        color: var(--accent) !important;
    }

    .hcard,
    .proj-panel {
        width: 280px;
        flex: none;
    }

    /* HANDS ON — MOBILE POLISH */
    .cardplay .grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 2.5rem !important;
        /* Proper gap between text and card */
        text-align: center;
    }

    .cardplay-h2 {
        font-size: clamp(2.2rem, 9vw, 3.2rem);
        margin-bottom: 20px;
    }

    .stage-3d {
        height: 320px;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: none;
    }


    .bcard {
        width: 320px;
        /* Restored to a larger, more impactful size */
        max-width: 88vw;
        /* Safety for very narrow phones */
        margin: 0 auto;
        transform: scale(1);
    }


    /* FOOTER Polish */
    .footer-cta-box {
        flex-direction: column;
        text-align: center;
        padding: 40px 25px;
        gap: 25px;
    }

    .footer-cta-box h2 {
        font-size: 2.2rem;
    }

    .footer-top {
        display: flex;
        flex-direction: column;
        gap: 50px;
        text-align: left; /* Align text to left for better multi-col reading */
        align-items: flex-start;
    }

    .f-brand {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        margin-bottom: 10px;
    }

    .f-brand p {
        margin: 15px 0 0;
        max-width: 100%;
    }

    .f-col {
        align-items: flex-start;
        text-align: left;
        width: 100%;
    }

    .f-col h4 {
        margin-bottom: 20px;
        font-size: 1rem;
    }

    /* Force Services and Quick Links into a two-column grid on mobile */
    .f-col ul {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 15px 20px !important;
        width: 100%;
    }

    .f-col.contact ul {
        display: flex !important; /* Contact doesn't need 2 cols */
        flex-direction: column !important;
    }

    .footer-bot {
        flex-direction: column-reverse;
        gap: 30px;
        text-align: center;
        padding: 30px 0;
    }

    .footer-legal {
        justify-content: center;
        gap: 20px;
    }

    .socials {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .wrap {
        padding: 0 20px;
        /* More space for the heading */
    }

    #ch-services .ed-big {
        font-size: 2.1rem !important;
        /* Proper fit for mobile */
    }
}