/* ======================================================
   RYAN NGUITUI — BEYOND CANVAS PORTFOLIO
   Space Grotesk + Playfair Display
   GSAP Magnetic Cursor
   ====================================================== */

/* ======================================================
   1. RESET
   ====================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

ul,
ol {
    list-style: none;
}

img,
video {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    font: inherit;
}

/* ======================================================
   2. DESIGN TOKENS
   ====================================================== */
:root {
    --bg: #000000;
    --text: #FFFFFF;
    --text2: rgba(255, 255, 255, 0.55);
    /* raised from .42 for readability */
    --text3: rgba(255, 255, 255, 0.28);
    --border: rgba(255, 255, 255, 0.09);
    --border2: rgba(255, 255, 255, 0.16);

    /* Fonts */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-sans: 'Space Grotesk', -apple-system, sans-serif;
    /* Keep --font-serif alias for project.css compatibility */
    --font-serif: 'Playfair Display', Georgia, serif;

    --nav-h: 64px;
    --pad-x: 48px;
    --max-w: 1380px;

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-io: cubic-bezier(0.33, 1, 0.68, 1);
}

/* ======================================================
   2b. LIGHT THEME
   ====================================================== */
html.light {
    --bg: #f5f0ea;
    --text: #0a0a0a;
    --text2: rgba(10, 10, 10, 0.55);
    --text3: rgba(10, 10, 10, 0.28);
    --border: rgba(10, 10, 10, 0.09);
    --border2: rgba(10, 10, 10, 0.16);
}

html.light body {
    background: var(--bg);
    color: var(--text);
}

/* ======================================================
   2c. NEWTON'S CRADLE PRELOADER
   ====================================================== */
.site-loader {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    background: var(--bg);
    color: var(--text);
    opacity: 1;
    visibility: visible;
    transition: opacity .45s var(--ease), visibility .45s var(--ease);
}

.site-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.newtons-cradle {
    --uib-size: 58px;
    --uib-speed: 1.2s;
    --uib-color: var(--text);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--uib-size);
    height: var(--uib-size);
}

.newtons-cradle__dot {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    width: 25%;
    transform-origin: center top;
}

.newtons-cradle__dot::after {
    content: '';
    display: block;
    width: 100%;
    height: 25%;
    border-radius: 50%;
    background-color: var(--uib-color);
}

.newtons-cradle__dot:first-child {
    animation: loaderSwing var(--uib-speed) linear infinite;
}

.newtons-cradle__dot:last-child {
    animation: loaderSwing2 var(--uib-speed) linear infinite;
}

.loader-text {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text2);
}

@keyframes loaderSwing {
    0% {
        transform: rotate(0deg);
        animation-timing-function: ease-out;
    }

    25% {
        transform: rotate(70deg);
        animation-timing-function: ease-in;
    }

    50% {
        transform: rotate(0deg);
        animation-timing-function: linear;
    }
}

@keyframes loaderSwing2 {
    0% {
        transform: rotate(0deg);
        animation-timing-function: linear;
    }

    50% {
        transform: rotate(0deg);
        animation-timing-function: ease-out;
    }

    75% {
        transform: rotate(-70deg);
        animation-timing-function: ease-in;
    }
}

/* Nav in light mode */
html.light .nav.scrolled {
    background: rgba(245, 240, 234, .92);
    border-bottom-color: var(--border);
}
html.light .mobile-menu {
    background: var(--bg);
}
html.light .burger span {
    background: #0a0a0a;
}
html.light .m-link { color: #0a0a0a; }
html.light .m-social a { color: rgba(10, 10, 10, 0.55); }
html.light .m-social a:hover { color: #0a0a0a; }

/* Hero */
html.light .hero-title { color: var(--text); }
html.light .portrait-img { filter: grayscale(0%); }

/* Hero tagline */
html.light .hero-tagline { color: rgba(10, 10, 10, 0.55); }

/* Scroll hint */
html.light .scroll-hint-label { color: rgba(10, 10, 10, .38); }
html.light .scroll-hint-line { background: rgba(10, 10, 10, .3); }

/* Watermark */
html.light .ryan-watermark { color: rgba(10, 10, 10, .30); }

/* Card stack */
html.light .stack-card { border-color: rgba(10, 10, 10, .10); }
html.light .stack-card-content {
    background: rgba(245, 240, 234, 0.92);
    border-top-color: rgba(10, 10, 10, .08);
}
html.light .stack-card-title { color: #0a0a0a; }
html.light .stack-card-tag { color: rgba(10, 10, 10, .5); }
html.light .stack-card-cat { color: rgba(10, 10, 10, .6); }
html.light .stack-card-cta { color: #0a0a0a; border-color: rgba(10, 10, 10, .4); }
html.light .stack-dot { background: rgba(10, 10, 10, .2); }
html.light .stack-dot.is-active { background: #0a0a0a; }
html.light .client-fit-card {
    background: rgba(10, 10, 10, 0.04);
    border-color: rgba(10, 10, 10, 0.10);
}
html.light .case-block,
html.light .case-visual {
    background: rgba(10, 10, 10, 0.045);
    border-color: rgba(10, 10, 10, 0.10);
}
html.light .case-block p,
html.light .case-before p {
    color: rgba(10, 10, 10, 0.72);
}

/* Sticky gallery */
html.light .sticky-gallery { background: var(--bg); }

/* CTA glass */
html.light .cta-glass {
    color: #0a0a0a;
    background: rgba(10, 10, 10, 0.06);
    border-color: rgba(10, 10, 10, 0.16);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
html.light .cta-glass:hover {
    background: rgba(10, 10, 10, 0.10);
    border-color: rgba(10, 10, 10, 0.3);
}

/* Testimonials */
html.light .testi-public { color: var(--text); }
html.light .testi-mark { color: rgba(10, 10, 10, .14); }

/* Contact */
html.light .contact-email { color: var(--text2); border-bottom-color: var(--border2); }
html.light .contact-email:hover { color: var(--text); border-color: rgba(10, 10, 10, .4); }

/* Post-testi CTA */
html.light .post-testi-line { color: var(--text); }

/* Footer */
html.light .footer-social a { color: var(--text2); }
html.light .footer-social a:hover { color: var(--text); }

/* Project modal */
html.light .proj-modal { background: #ece6dd; border-color: var(--border2); }
html.light .proj-modal-backdrop { background: rgba(245, 240, 234, 0.82); }
html.light .proj-modal-title { color: #0a0a0a; }
html.light .proj-modal-desc { color: rgba(10, 10, 10, 0.72); }

/* Magnetic cursor */
html.light .magnetic-cursor {
    background: #0a0a0a;
}

/* About section — cream background in light mode */
html.light .about-section {
    background: #ebe4d6;
}
html.light .about-desc { color: #0a0a0a; }
html.light .skill-pill:hover { border-color: rgba(10, 10, 10, .35); }

/* Falling pattern — hide in light mode */
html.light .falling-pattern-ctn { opacity: 0 !important; }

/* ======================================================
   3. BASE
   ====================================================== */
body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Magnetic cursor active — JS adds .has-magnetic-cursor to <html> only when GSAP
   loaded successfully on a non-touch device. If GSAP CDN fails, the native cursor
   stays visible (no class added) so visitors aren't left with nothing. */
.has-magnetic-cursor,
.has-magnetic-cursor body,
.has-magnetic-cursor a,
.has-magnetic-cursor button,
.has-magnetic-cursor [data-magnetic] {
    cursor: none;
}

/* ======================================================
   4. MAGNETIC CURSOR
   Single white circle — mix-blend-mode: exclusion
   GSAP handles all position, scale, rotation
   ====================================================== */
.magnetic-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #FFFFFF;
    mix-blend-mode: exclusion;
    pointer-events: none;
    z-index: 99999;
    will-change: transform, width, height, border-radius;
    /* contrast boost so it's visible on dark backgrounds */
    backdrop-filter: contrast(1.5);
    -webkit-backdrop-filter: contrast(1.5);
    opacity: 0;
    /* starts invisible; JS fades in on first move */
}

/* ======================================================
   5. WATERMARK
   ====================================================== */
.ryan-watermark {
    position: fixed;
    bottom: 32px;
    right: var(--pad-x);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, .45);
    z-index: 900;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .6s var(--ease), transform .6s var(--ease);
}

.ryan-watermark sup {
    font-size: 9px;
    vertical-align: super;
    font-weight: 400;
}

.ryan-watermark.show {
    opacity: 1;
    transform: translateY(0);
}

/* ======================================================
   6. NAVIGATION
   ====================================================== */
.nav {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    z-index: 1000;
    height: var(--nav-h);
    border-bottom: 1px solid transparent;
    transition: border-color .3s, background .3s;
}

.nav.scrolled {
    border-bottom-color: var(--border);
    background: rgba(10, 10, 10, .88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.nav-inner {
    max-width: var(--max-w);
    margin-inline: auto;
    padding-inline: var(--pad-x);
    height: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-logo {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--text);
    transition: opacity .2s;
    flex-shrink: 0;
}

.nav-logo:hover {
    opacity: .5;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-inline-start: auto;
}

.nav-link {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text2);
    position: relative;
    transition: color .2s;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--text);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s var(--ease);
}

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

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

.nav-year {
    font-size: 11px;
    color: var(--text3);
    letter-spacing: .06em;
    flex-shrink: 0;
}

/* Theme toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text2);
    cursor: pointer;
    transition: background .25s, border-color .25s, color .25s;
    flex-shrink: 0;
    padding: 0;
}
.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--text);
}
html.light .theme-toggle {
    background: rgba(10, 10, 10, 0.06);
    border-color: rgba(10, 10, 10, 0.12);
    color: rgba(10, 10, 10, 0.55);
}
html.light .theme-toggle:hover {
    background: rgba(10, 10, 10, 0.12);
    border-color: rgba(10, 10, 10, 0.25);
    color: #0a0a0a;
}
.theme-icon { display: block; }
.theme-icon-sun { display: none; }
html.light .theme-icon-moon { display: none; }
html.light .theme-icon-sun { display: block; }

/* Burger */
.burger {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
}

.burger span {
    display: block;
    width: 20px;
    height: 1.5px;
    background: var(--text);
    transition: transform .3s var(--ease), opacity .2s;
}

.burger.open span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.burger.open span:nth-child(2) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* Mobile menu */
.mobile-menu {
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    background: var(--bg);
    padding: 48px var(--pad-x);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transform: translateX(100%);
    transition: transform .4s var(--ease);
    z-index: 999;
    border-top: 1px solid var(--border);
}

.mobile-menu.open {
    transform: translateX(0);
}

.m-link {
    font-family: var(--font-display);
    font-size: clamp(40px, 8vw, 64px);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.1;
    transition: opacity .2s;
}

.m-link:hover {
    opacity: .4;
}

.m-social {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding-top: 32px;
    margin-top: auto;
    border-top: 1px solid var(--border);
}

.m-social a {
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text2);
    transition: color .2s;
}

.m-social a:hover {
    color: var(--text);
}

/* ======================================================
   7. HERO — Portrait + huge name only
   ====================================================== */
.hero {
    position: relative;
    min-height: 64svh;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 54fr 46fr;
    min-height: 64svh;
    align-items: stretch;
}

/* LEFT */
.hero-left {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 22px;
    padding: calc(28px + var(--nav-h)) var(--pad-x) 40px clamp(48px, 10vw, 140px);
    border-right: none;
    position: relative;
    z-index: 2;
}

/* BIG name — Space Grotesk + Playfair italic for the second line */
.hero-title {
    font-family: var(--font-sans);
    font-size: clamp(72px, 10vw, 160px);
    font-weight: 700;
    line-height: 1.0;
    letter-spacing: -0.045em;
    color: var(--text);
}

/* The italic <em> uses Playfair Display */
.hero-title em {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
}

.hero-tagline {
    font-family: var(--font-sans);
    font-size: clamp(15px, 1.3vw, 18px);
    font-weight: 400;
    line-height: 1.75;
    color: var(--text2);
    letter-spacing: .01em;
    max-width: 420px;
}

.tagline-short {
    display: none;
}

.hero-ctas {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

/* Glass CTA — primary "Let's Build" with brand-coloured icon */
.cta-glass {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 26px 14px 18px;
    border-radius: 999px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .02em;
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: background .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}

.cta-glass:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.cta-glass .cta-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #fff;
    flex-shrink: 0;
}

.cta-glass .cta-icon svg {
    display: block;
}

.cta-glass .cta-arrow {
    font-size: 16px;
    transition: transform .25s var(--ease);
}

.cta-glass:hover .cta-arrow {
    transform: translateX(3px);
}

.cta-mobile { display: none; }

/* Scroll hint */
.scroll-hint {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 3;
    opacity: 0;
    animation: heroIn .8s var(--ease) .5s forwards;
}

.scroll-hint-label {
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .38);
}

.scroll-hint-line {
    display: block;
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, .3);
    transform-origin: top center;
    animation: scrollDrop 2s ease-in-out 1s infinite;
}

@keyframes scrollDrop {
    0% {
        transform: scaleY(0);
        opacity: 0;
        transform-origin: top center;
    }

    40% {
        transform: scaleY(1);
        opacity: 1;
        transform-origin: top center;
    }

    60% {
        transform: scaleY(1);
        opacity: 1;
        transform-origin: bottom center;
    }

    100% {
        transform: scaleY(0);
        opacity: 0;
        transform-origin: bottom center;
    }
}

/* RIGHT — Portrait */
.hero-right {
    position: relative;
    overflow: hidden;
}



.portrait-img {
    position: absolute;
    inset: 0;
    transition: transform .8s var(--ease);
    transform-origin: center bottom;
    transform: scale(1.4);
    filter: grayscale(100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 25%);
    mask-image: linear-gradient(to right, transparent 0%, black 25%);
}

.hero-right:hover .portrait-img {
    transform: scale(1.45);
}

/* Hero load animations */
.hero-title,
.hero-tagline {
    opacity: 0;
    transform: translateY(24px);
    animation: heroIn .8s var(--ease) forwards;
}

.hero-title {
    animation-delay: .1s;
}

.hero-tagline {
    animation-delay: .26s;
}

.portrait-img {
    opacity: 0;
    animation: fadeIn .9s var(--ease) .2s forwards;
}

@keyframes heroIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Image cursor trail — injected by JS */
.trail-img {
    position: absolute;
    width: 155px;
    height: 195px;
    object-fit: cover;
    border-radius: 14px;
    pointer-events: none;
    user-select: none;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform .3s var(--ease-io), opacity .25s;
    z-index: 20;
    will-change: transform, opacity;
}

.trail-img[data-status="active"] {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    transition: transform .5s var(--ease-io), opacity .35s;
}

/* ======================================================
   8. ABOUT SECTION
   ====================================================== */
.about-section {
    border-top: 1px solid var(--border);
    padding: 100px var(--pad-x) 88px;
}

.about-inner {
    max-width: var(--max-w);
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: 64px;
}

.about-top {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: none;
}

.about-eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--text3);
}

.about-desc {
    font-family: var(--font-sans);
    font-size: clamp(24px, 2.4vw, 36px);
    line-height: 1.4;
    letter-spacing: -0.005em;
    color: #f5ede0;
    font-weight: 500;
    max-width: none;
}

.magic-word {
    display: inline;
    transition: opacity .2s ease;
}

.about-desc-mobile { display: none; }
.skills-mobile-more { display: none; }

.about-skills {
    padding-top: 28px;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 20px;
    align-items: start;
}

.skills-col,
.arcade-col {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.035);
}

.skills-col {
    padding: 26px;
}

.arcade-col {
    padding: 26px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    grid-template-areas:
        "fit-label arcade-label"
        "fit-card tap-invite"
        "fit-card arcade-button"
        "arcade-foot arcade-foot";
    gap: 14px 24px;
    align-items: start;
}

.arcade-col > .col-label:first-child {
    grid-area: fit-label;
    margin-bottom: 0;
}

.bridge-title {
    max-width: 620px;
    margin: 0 0 20px;
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(28px, 2.8vw, 42px);
    line-height: 1.08;
    letter-spacing: -0.035em;
    color: var(--text);
}

.col-label {
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text3);
    margin-bottom: 18px;
}

.skills-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-pill {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: .02em;
    color: var(--text2);
    padding: 7px 18px;
    border: 1px solid var(--border2);
    border-radius: 999px;
    transition: color .2s, border-color .2s;
}

.skill-pill:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, .3);
}

.client-fit-card {
    grid-area: fit-card;
    width: 100%;
    padding: 24px;
    border: 1px solid var(--border2);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.055);
}

.fit-stat {
    display: block;
    margin-bottom: 14px;
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(26px, 2.6vw, 36px);
    font-weight: 700;
    line-height: 1.05;
    color: var(--text);
}

.bridge-copy {
    max-width: 540px;
    margin: 0;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.75;
    color: var(--text2);
}

.client-fit-card p {
    margin: 0 0 20px;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.7;
    color: var(--text2);
}

.fit-link {
    display: inline-flex;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text);
    border-bottom: 1px solid var(--border2);
    padding-bottom: 4px;
}

.poster-note {
    grid-area: poster;
    width: 100%;
    margin-top: 8px;
    padding: 22px 24px 24px;
    border: 1px solid var(--border2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
}

.poster-note h3 {
    margin: 0 0 12px;
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(28px, 3vw, 42px);
    line-height: 1.02;
    letter-spacing: -0.03em;
    color: var(--text);
}

.poster-note p:last-child {
    margin: 0;
    max-width: 760px;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.7;
    color: var(--text2);
}

.arcade-heading {
    grid-area: arcade-label;
    margin: 0;
    justify-self: end;
    text-align: right;
}

.tap-invite {
    grid-area: tap-invite;
    justify-self: end;
    max-width: 280px;
    margin: 0;
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(22px, 2vw, 30px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    text-align: right;
    color: var(--text);
}

.tap-invite.is-calling {
    animation: tapInviteNudge 1.25s cubic-bezier(0.16, 1, 0.3, 1) 2;
}


/* ======================================================
   ARCADE TAP BUTTON — gamified press button beside skills
   Real depth via dark "side" shadow that compresses on press.
   ====================================================== */
.arcade-btn {
    --face-1:   #f5ede0;
    --face-2:   #d8cfbe;
    --rim:      #0a0a0a;
    --depth:    7px;
    position: relative;
    grid-area: arcade-button;
    justify-self: end;
    display: block;
    width: 280px;
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--rim);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    isolation: isolate;
    transform: translateY(0);
    transition: transform .12s ease;
    will-change: transform;
}

.arcade-btn.is-inviting .arcade-face {
    animation: arcadeInvitePulse 1.25s cubic-bezier(0.16, 1, 0.3, 1) 2;
}

.arcade-face {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 18px 14px;
    background: linear-gradient(180deg, var(--face-1) 0%, var(--face-2) 100%);
    border: 1.5px solid var(--rim);
    border-radius: 18px;
    box-shadow:
        0 var(--depth) 0 0 var(--rim),                     /* the "side" of the button */
        0 calc(var(--depth) + 6px) 18px rgba(0, 0, 0, 0.45), /* drop shadow */
        inset 0 2px 0 rgba(255, 255, 255, 0.55),            /* top highlight */
        inset 0 -2px 0 rgba(0, 0, 0, 0.08);                 /* bottom shading */
    transition: box-shadow .12s ease;
}

/* Hover — lifts a touch, shadow grows */
.arcade-btn:hover {
    transform: translateY(-2px);
}
.arcade-btn:hover .arcade-face {
    box-shadow:
        0 calc(var(--depth) + 2px) 0 0 var(--rim),
        0 calc(var(--depth) + 12px) 26px rgba(0, 0, 0, 0.55),
        inset 0 2px 0 rgba(255, 255, 255, 0.65),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

/* Press — button compresses into its own shadow */
.arcade-btn:active,
.arcade-btn.is-pressed {
    transform: translateY(var(--depth));
    transition-duration: .06s;
}
.arcade-btn:active .arcade-face,
.arcade-btn.is-pressed .arcade-face {
    box-shadow:
        0 1px 0 0 var(--rim),
        0 3px 8px rgba(0, 0, 0, 0.35),
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.12);
    transition-duration: .06s;
}

.arcade-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .18em;
    color: var(--rim);
}

.arcade-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.arcade-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c43d2e;
    box-shadow: 0 0 0 0 rgba(196, 61, 46, 0.65);
    animation: arcadeLivePulse 1.4s ease-out infinite;
}
@keyframes arcadeLivePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(196, 61, 46, 0.65); }
    50%      { box-shadow: 0 0 0 6px rgba(196, 61, 46, 0); }
}

.arcade-label {
    color: rgba(10, 10, 10, 0.55);
}

.arcade-number-wrap {
    position: relative;
    display: block;
    overflow: visible;
}

.col-label-meta {
    font-style: italic;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    color: var(--text3);
    margin-left: 4px;
}

.arcade-units {
    display: block;
    margin-top: -4px;
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: rgba(10, 10, 10, 0.42);
}

.arcade-cue-text {
    display: inline-block;
    transition: opacity .18s ease;
}
.arcade-cue-text.is-flashing {
    animation: arcadeQuipFlash .42s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes arcadeQuipFlash {
    0%   { opacity: 0; transform: translateY(3px); }
    100% { opacity: 1; transform: translateY(0);   }
}

/* Cute "cert. ryan™" stamp angled on the bottom-right of the button */
.arcade-stamp {
    position: absolute;
    right: -8px;
    bottom: -10px;
    z-index: 6;
    transform: rotate(-6deg);
    padding: 4px 8px;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 10px;
    font-weight: 700;
    color: #f5ede0;
    background: #c43d2e;
    border: 1.5px solid #0a0a0a;
    border-radius: 4px;
    box-shadow: 0 2px 0 0 #0a0a0a;
    pointer-events: none;
    letter-spacing: 0.02em;
    transition: transform .25s var(--ease);
}
.arcade-btn:hover .arcade-stamp {
    transform: rotate(-3deg) translateY(-2px);
}

/* Tiny disclaimer line under the button */
.arcade-foot {
    grid-area: arcade-foot;
    justify-self: end;
    margin-top: 4px;
    max-width: 420px;
    font-family: var(--font-sans);
    font-size: 10px;
    font-style: italic;
    text-align: right;
    line-height: 1.5;
    color: var(--text3);
    letter-spacing: 0.02em;
}

.arcade-number {
    display: block;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 56px;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--rim);
    font-variant-numeric: tabular-nums;
    padding: 2px 0;
    transition: transform .12s ease;
}
.arcade-number.is-bumping {
    animation: arcadeBump .28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes arcadeBump {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.arcade-cue {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.arcade-cue svg { display: block; }

.arcade-key {
    background: var(--rim);
    color: var(--face-1);
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .14em;
    box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.12);
}

/* ---------- Click effects (particles + +1 floater) ---------- */
.tap-plus {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 18px;
    color: var(--rim, #0a0a0a);
    background: #f5ede0;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1.5px solid #0a0a0a;
    box-shadow: 0 3px 0 0 #0a0a0a;
    transform: translate(-50%, -50%);
    animation: tapPlusFloat 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes tapPlusFloat {
    0%   { transform: translate(-50%, -50%)  scale(0.6); opacity: 0; }
    18%  { transform: translate(-50%, -65%)  scale(1.05); opacity: 1; }
    100% { transform: translate(-50%, -200%) scale(0.85); opacity: 0; }
}
.tap-particle {
    position: absolute;
    z-index: 4;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: tapParticleBurst .85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes tapParticleBurst {
    0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.2); opacity: 0; }
}

@keyframes arcadeInvitePulse {
    0%, 100% {
        transform: translateY(0) rotate(0);
        box-shadow:
            0 var(--depth) 0 0 var(--rim),
            0 calc(var(--depth) + 6px) 18px rgba(0, 0, 0, 0.45),
            inset 0 2px 0 rgba(255, 255, 255, 0.55),
            inset 0 -2px 0 rgba(0, 0, 0, 0.08);
    }
    35% {
        transform: translateY(-8px) rotate(-1deg);
        box-shadow:
            0 calc(var(--depth) + 4px) 0 0 var(--rim),
            0 calc(var(--depth) + 18px) 34px rgba(245, 237, 224, 0.2),
            inset 0 2px 0 rgba(255, 255, 255, 0.65),
            inset 0 -2px 0 rgba(0, 0, 0, 0.08);
    }
    65% { transform: translateY(3px) rotate(1deg); }
}

@keyframes tapInviteNudge {
    0%, 100% { transform: translateX(0); color: var(--text); }
    35% { transform: translateX(-8px); color: #f5ede0; }
    65% { transform: translateX(3px); }
}

/* ---------- Mobile: stack columns, full-width button ---------- */
@media (max-width: 768px) {
    .about-skills {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .skills-col,
    .arcade-col {
        padding: 20px;
        border-radius: 14px;
    }

    .arcade-col {
        grid-template-columns: 1fr;
        grid-template-areas:
            "fit-label"
            "fit-card"
            "arcade-label"
            "tap-invite"
            "arcade-button"
            "arcade-foot";
        gap: 14px;
    }

    .bridge-title {
        font-size: clamp(28px, 8vw, 40px);
        margin-bottom: 18px;
    }

    .poster-note {
        margin-top: 4px;
        padding-top: 18px;
    }

    .arcade-btn { width: 100%; max-width: 360px; }
    .arcade-number { font-size: 48px; }

    .arcade-heading,
    .tap-invite,
    .arcade-btn,
    .arcade-foot {
        justify-self: start;
        text-align: left;
    }

    .tap-invite {
        max-width: 360px;
        font-size: clamp(24px, 7vw, 34px);
    }

    .arcade-foot {
        margin-top: 4px;
        max-width: 360px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .arcade-live-dot,
    .arcade-number.is-bumping,
    .arcade-btn.is-inviting .arcade-face,
    .tap-invite.is-calling { animation: none; }
}


/* ======================================================
   STICKY SCROLL GALLERY
   ====================================================== */
.gallery-intro {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 58px var(--pad-x) 32px;
}

.gallery-intro-inner {
    max-width: var(--max-w);
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
    gap: 32px;
    align-items: end;
}

.gallery-title {
    margin: 0;
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(46px, 6.6vw, 94px);
    font-weight: 700;
    line-height: 0.94;
    letter-spacing: -0.045em;
    color: var(--text);
}

.gallery-copy {
    max-width: 560px;
    margin: 0 0 6px;
    font-family: var(--font-sans);
    font-size: clamp(14px, 1.05vw, 17px);
    line-height: 1.65;
    color: var(--text2);
}

.sticky-gallery {
    background: var(--bg);
}
.sticky-gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 8px;
    max-width: var(--max-w);
    margin-inline: auto;
}

/* Scrolling side columns */
.sg-col-scroll {
    display: grid;
    gap: 8px;
}

/* Sticky center column */
.sg-col-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    gap: 8px;
}

/* Image figures */
.sg-fig {
    margin: 0;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
}
.sg-fig img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s var(--ease);
    border-radius: 8px;
}
.sg-fig:hover img {
    transform: scale(1.03);
}

/* Side column images — natural aspect ratio */
.sg-col-scroll .sg-fig img {
    height: auto;
    object-fit: contain;
}

/* Center column fills — stretch to fill row */
.sg-fig-fill {
    height: 100%;
}

/* Mobile: 3 columns maintained, tighter gaps */
@media (max-width: 768px) {
    .gallery-intro {
        padding: 42px var(--pad-x) 22px;
    }

    .gallery-intro-inner {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .gallery-title {
        max-width: 92vw;
        font-size: clamp(42px, 13vw, 66px);
        line-height: 0.96;
        letter-spacing: -0.045em;
    }

    .gallery-copy {
        max-width: 100%;
        font-size: 13.5px;
        line-height: 1.55;
    }

    .sticky-gallery-grid {
        gap: 4px;
        padding: 4px;
    }
    .sg-col-sticky {
        gap: 4px;
    }
}

/* ======================================================
   9. WORK / PROJECTS — 3 × 3 GRID
   ====================================================== */
.work-section {
    padding: 28px var(--pad-x) 120px;
    max-width: var(--max-w);
    margin-inline: auto;
    border-top: 1px solid var(--border);
}

.work-head {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 32px;
    margin-bottom: 48px;
}

.work-title {
    font-family: var(--font-display);
    font-size: clamp(52px, 8vw, 110px);
    font-weight: 700;
    font-style: italic;
    line-height: .92;
    letter-spacing: -0.04em;
}

.work-sub {
    max-width: 430px;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.7;
    color: var(--text2);
    padding-bottom: 8px;
}

/* ======================================================
   Card Stack — fan layout
   ====================================================== */
.card-stack-root {
    width: 100%;
    padding-bottom: 40px;
}

.card-stack-stage {
    position: relative;
    width: 100%;
    height: 580px;
    perspective: 1100px;
    perspective-origin: 50% 100%;
    outline: none;
    overflow: visible;
}

.stack-card {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 480px;
    height: 600px;
    margin-left: -240px;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, .10);
    box-shadow: 0 28px 72px rgba(0, 0, 0, .6);
    will-change: transform, opacity;
    transition: transform .55s cubic-bezier(0.16, 1, 0.3, 1), opacity .35s ease;
    transform-style: preserve-3d;
    user-select: none;
    cursor: pointer;
}

.stack-card.is-active {
    cursor: grab;
}

.stack-card.is-active:active {
    cursor: grabbing;
}

.stack-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

/* No full-card overlay — frosted glass nameplate handles contrast */
.stack-card-overlay { display: none; }

.stack-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 20px;
    background: rgba(8, 8, 8, 0.85);
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    border-top: 1px solid rgba(255, 255, 255, .1);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.stack-card-text {
    flex: 1;
    min-width: 0;
}

.stack-card-tag {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .5);
    margin-bottom: 2px;
}

.stack-card-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stack-card-cat {
    font-size: 10px;
    color: rgba(255, 255, 255, .6);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* "View case study" pill — shows on active card on the right */
.stack-card-cta {
    display: inline-block;
    flex-shrink: 0;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 999px;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #fff;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity .3s var(--ease), transform .3s var(--ease);
}

.stack-card.is-active .stack-card-cta {
    opacity: 1;
    transform: translateX(0);
}

/* Dots */
.card-stack-dots {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.stack-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .25);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background .25s, transform .25s;
}

.stack-dot.is-active {
    background: #fff;
    transform: scale(1.5);
}

.proof-eyebrow {
    margin-bottom: 16px;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text3);
}

/* ======================================================
   11. TESTIMONIALS
   ====================================================== */
.testi-section {
    border-top: 1px solid var(--border);
    padding: 96px var(--pad-x) 120px;
    max-width: var(--max-w);
    margin-inline: auto;
}

.testi-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 72px;
    padding: 96px 0;
    border-bottom: 1px solid var(--border);
    cursor: default;
    user-select: none;
}

.testi-item:first-of-type {
    border-top: 1px solid var(--border);
}

.testi-content {
    min-width: 0;
}

.testi-mark {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(72px, 8vw, 120px);
    line-height: 1;
    color: rgba(255, 255, 255, .14);
    margin-bottom: 12px;
    max-width: 920px;
}

.testi-text-wrap {
    position: relative;
    cursor: none;
    max-width: 920px;
    outline: none;
    border-radius: 4px;
}

.testi-text-wrap:focus-visible {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.testi-card-inner {
    position: relative;
}

.testi-public {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(28px, 3.2vw, 48px);
    font-weight: 400;
    line-height: 1.34;
    letter-spacing: -0.02em;
    color: var(--text);
}

/* Reveal overlay — circle follows cursor on desktop, flips as a card back-face on mobile */
.testi-reveal {
    position: absolute;
    inset: 0;
    background: #f5ede0;
    clip-path: circle(0px at 50% 50%);
    pointer-events: none;
    will-change: clip-path;
    border-radius: 4px;
}

.testi-real {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(28px, 3.2vw, 48px);
    font-weight: 400;
    line-height: 1.34;
    letter-spacing: -0.02em;
    color: #1a1209;
}

/* Flip cue (mobile only) — pulsing pill that screams "tap me" */
.testi-flip-cue {
    display: none;
    position: absolute;
    right: 0;
    bottom: -22px;
    z-index: 6;
    align-items: center;
    gap: 6px;
    padding: 8px 14px 8px 10px;
    background: #f5ede0;
    color: #1a1209;
    border-radius: 999px;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    pointer-events: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    animation: flipCuePulse 2.4s ease-in-out infinite;
    transition: background .25s, color .25s, opacity .35s;
}

.testi-flip-cue svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

@keyframes flipCuePulse {
    0%, 100% { transform: scale(1) translateY(0); }
    50%      { transform: scale(1.06) translateY(-2px); }
}

/* Mobile: the whole card becomes a 3D flip card */
@media (hover: none), (pointer: coarse), (max-width: 768px) {
    .testi-text-wrap {
        cursor: pointer;
        perspective: 1400px;
        padding: 4px;
    }

    .testi-card-inner {
        transform-style: preserve-3d;
        transition: transform .8s cubic-bezier(.5, .05, .2, 1);
        min-height: 1px;
    }

    .testi-text-wrap.is-flipped .testi-card-inner {
        transform: rotateY(180deg);
    }

    .testi-public,
    .testi-reveal {
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }

    .testi-public {
        position: relative;
        z-index: 1;
    }

    .testi-reveal {
        clip-path: none !important;
        transform: rotateY(180deg);
        display: flex;
        align-items: center;
        padding: 24px 28px;
        border-radius: 12px;
        box-shadow: 0 14px 38px rgba(0, 0, 0, 0.35);
        pointer-events: none;
    }

    .testi-flip-cue {
        display: inline-flex;
    }

    .testi-text-wrap.is-flipped .testi-flip-cue {
        background: rgba(255, 255, 255, 0.14);
        color: #fff;
    }
}

.testi-who {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 14px;
    flex-shrink: 0;
}

.testi-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    border: 1px solid var(--border2);
    background: rgba(255, 255, 255, .07);
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.testi-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.testi-initials {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    color: var(--text3);
    text-transform: uppercase;
}

.testi-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.testi-name {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: .01em;
}

.testi-role {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 400;
    color: var(--text3);
    letter-spacing: .03em;
}

/* ======================================================
   13. CONTACT
   ====================================================== */
.contact-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--border);
    padding: 120px var(--pad-x);
}

.contact-inner {
    max-width: var(--max-w);
    width: 100%;
    margin-inline: auto;
}

.contact-label {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text3);
    margin-bottom: 32px;
}

.contact-title {
    position: relative;
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(80px, 14vw, 200px);
    font-weight: 700;
    line-height: .88;
    letter-spacing: -0.05em;
    margin-bottom: 64px;
}

/* Typewriter contact title: "Let's" stacked above a cycling word */
.typewriter-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.tw-prefix {
    display: block;
}

.tw-cycle {
    display: inline-flex;
    align-items: baseline;
    /* leave room for the longest word so layout doesn't shift mid-typing */
    min-width: 4ch;
}

.tw-text {
    /* inherits italic from .contact-title */
    white-space: pre;
}

.tw-caret {
    display: inline-block;
    width: 0.06em;
    height: 0.7em;
    background: currentColor;
    margin-left: 0.06em;
    transform: translateY(0.04em);
    animation: twCaretBlink 0.85s steps(2, end) infinite;
}

@keyframes twCaretBlink {
    50% { opacity: 0; }
}

.contact-body {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 48px;
    padding-top: 48px;
    border-top: 1px solid var(--border);
}

.contact-sub {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.8;
    color: var(--text2);
    max-width: 400px;
}

.contact-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 20px;
    flex-shrink: 0;
}

.contact-email {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--text2);
    border-bottom: 1px solid var(--border2);
    padding-bottom: 3px;
    transition: color .2s, border-color .2s;
}

.contact-email:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, .4);
}

/* Legacy white button — superseded by .cta-glass */
.btn-white {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 14px 28px;
    background: var(--text);
    color: var(--bg);
    border-radius: 999px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
    transition: opacity .2s, transform .25s var(--ease);
}

.btn-white:hover {
    opacity: .88;
    transform: translateY(-2px);
}

/* ======================================================
   14. FOOTER
   ====================================================== */
.footer {
    padding-block: 28px;
    border-top: 1px solid var(--border);
}

.footer-inner {
    max-width: var(--max-w);
    margin-inline: auto;
    padding-inline: var(--pad-x);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-logo {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .01em;
    transition: opacity .2s;
}

.footer-logo:hover {
    opacity: .5;
}

.footer-logo sup {
    font-size: 9px;
    vertical-align: super;
    font-weight: 400;
}

.footer-social {
    display: flex;
    gap: 24px;
    margin-inline-start: auto;
}

.footer-social a {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text2);
    transition: color .2s;
}

.footer-social a:hover {
    color: var(--text);
}

.footer-copy {
    width: 100%;
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--text3);
    letter-spacing: .04em;
}

/* ======================================================
   15. SCROLL ANIMATIONS
   ====================================================== */
.fade-up {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity .75s var(--ease), transform .75s var(--ease);
}

.fade-up.in-view {
    opacity: 1;
    transform: translateY(0);
}


/* ======================================================
   16. RESPONSIVE — Tablet ≤ 1100px
   ====================================================== */
@media (max-width: 1100px) {
    :root {
        --pad-x: 32px;
    }

    .contact-body {
        flex-direction: column;
        align-items: flex-start;
    }

    .contact-links {
        align-items: flex-start;
    }
}

/* ======================================================
   17. RESPONSIVE — Mobile ≤ 768px
   ====================================================== */
@media (max-width: 768px) {
    :root {
        --pad-x: 20px;
        --nav-h: 56px;
    }

    .nav-links,
    .nav-year {
        display: none;
    }

    .theme-toggle {
        margin-inline-start: auto;
    }

    .burger {
        display: flex;
        margin-inline-start: 12px;
    }

    .cta-desktop { display: none; }
    .cta-mobile { display: inline-flex; }

    .hero {
        min-height: 68svh;
    }

    /* Mobile keeps the laptop hero idea: copy left, portrait right. */
    .hero-grid {
        grid-template-columns: minmax(0, 58fr) minmax(118px, 42fr);
        grid-template-rows: 1fr;
        min-height: 68svh;
    }

    .hero-left {
        position: relative;
        justify-content: flex-start;
        padding: calc(20px + var(--nav-h)) 0 52px var(--pad-x);
        gap: 12px;
        border-right: none;
        z-index: 3;
    }

    .hero-title {
        max-width: 64vw;
        font-size: clamp(62px, 17vw, 88px);
        line-height: 0.9;
        letter-spacing: -0.06em;
    }

    .hero-tagline {
        font-size: clamp(13px, 3.6vw, 15px);
        max-width: 49vw;
        line-height: 1.45;
        color: rgba(255, 255, 255, .75);
    }

    .tagline-long {
        display: none;
    }

    .tagline-short {
        display: inline;
    }

    .scroll-hint {
        display: none;
    }

    .hero-ctas {
        position: relative;
        z-index: 1;
        margin-top: 12px;
    }

    .cta-mobile {
        padding: 12px 16px 12px 12px;
        gap: 10px;
        font-size: 13px;
        color: #06130a;
        background: rgba(37, 211, 102, 0.92);
        border-color: rgba(37, 211, 102, 0.65);
        box-shadow: 0 10px 28px rgba(37, 211, 102, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    }

    .cta-mobile .cta-icon {
        width: 24px;
        height: 24px;
    }

    .cta-mobile:hover {
        background: #25D366;
        border-color: #25D366;
    }

    /* Portrait column: full-height fit, biased right, no face crop. */
    .hero-right {
        min-height: 68svh;
        overflow: visible;
        z-index: 5;
        pointer-events: none;
    }



    .portrait-img {
        inset: 0 -12vw 0 -22vw;
        transform: scale(1.08) !important;
        transform-origin: right bottom !important;
        background-position: right bottom !important;
        background-size: auto 101% !important;
        -webkit-mask-image: none !important;
        mask-image: none !important;
    }

    .hero-right:hover .portrait-img {
        transform: scale(1.08) !important;
    }

    .trail-img {
        width: 104px;
        height: 132px;
    }

    .testi-item {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 56px 0 72px;
    }

    .testi-who {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 14px;
        align-self: flex-start;
    }

    .testi-meta {
        align-items: flex-start;
    }

    .testi-avatar {
        width: 56px;
        height: 56px;
    }

    .testi-mark {
        font-size: clamp(64px, 16vw, 96px);
    }

    .testi-public,
    .testi-real {
        font-size: clamp(22px, 5.5vw, 30px);
        line-height: 1.36;
    }

    .testi-section {
        padding: 64px var(--pad-x) 80px;
    }

    .card-stack-stage { height: 360px; }
    .stack-card { width: 210px; height: 280px; margin-left: -105px; }
    .stack-card-title { font-size: 15px; }
    .stack-card-content { padding: 10px 14px 14px; }

    .work-section {
        padding: 18px var(--pad-x) 80px;
    }

    .work-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .work-sub {
        padding-bottom: 0;
    }

    .contact-section {
        padding: 80px var(--pad-x);
    }

    .contact-title {
        font-size: clamp(64px, 16vw, 100px);
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-social {
        margin-inline-start: 0;
    }

    .ryan-watermark {
        display: none;
    }

    .about-top { gap: 24px; padding-bottom: 24px; }

    .about-desc {
        font-size: 19px;
        line-height: 1.45;
        font-weight: 700;
    }

    .about-desc-desktop { display: none; }
    .about-desc-mobile { display: inline; }

    .skills-pills {
        gap: 6px;
    }

    .skill-pill {
        border: none !important;
        padding: 0 !important;
        font-size: 11px !important;
        font-weight: 500 !important;
        background: transparent !important;
    }

    .skill-pill::after {
        content: '·';
        margin-left: 6px;
        color: var(--text3);
    }

    .skill-pill:last-child::after {
        content: '';
    }

    .col-label { margin-bottom: 12px; }
}

/* ======================================================
   18. REDUCED MOTION
   ====================================================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }

    .fade-up {
        opacity: 1;
        transform: none;
    }

    .magnetic-cursor {
        display: none;
    }

    body,
    a,
    button,
    [data-magnetic] {
        cursor: auto;
    }
}

/* ======================================================
   19. HERO FALLING PATTERN KEYFRAMES
   ====================================================== */
@keyframes fallingBg {
    0%   { background-position: 0px 220px, 3px 220px, 151.5px 337.5px, 25px 24px, 28px 24px, 176.5px 150px, 50px 16px, 53px 16px, 201.5px 91px, 75px 224px, 78px 224px, 226.5px 230.5px, 100px 19px, 103px 19px, 251.5px 121px, 125px 120px, 128px 120px, 276.5px 187px, 150px 31px, 153px 31px, 301.5px 120.5px, 175px 235px, 178px 235px, 326.5px 384.5px, 200px 121px, 203px 121px, 351.5px 228.5px, 225px 224px, 228px 224px, 376.5px 364.5px, 250px 26px, 253px 26px, 401.5px 105px, 275px 75px, 278px 75px, 426.5px 180px; }
    100% { background-position: 0px 6800px, 3px 6800px, 151.5px 6917.5px, 25px 13632px, 28px 13632px, 176.5px 13758px, 50px 5416px, 53px 5416px, 201.5px 5491px, 75px 17175px, 78px 17175px, 226.5px 17301.5px, 100px 5119px, 103px 5119px, 251.5px 5221px, 125px 8428px, 128px 8428px, 276.5px 8495px, 150px 9876px, 153px 9876px, 301.5px 9965.5px, 175px 13391px, 178px 13391px, 326.5px 13540.5px, 200px 14741px, 203px 14741px, 351.5px 14848.5px, 225px 18770px, 228px 18770px, 376.5px 18910.5px, 250px 5082px, 253px 5082px, 401.5px 5161px, 275px 6375px, 278px 6375px, 426.5px 6480px; }
}

/* ======================================================
   20. POST-TESTIMONIAL CTA
   ====================================================== */
.post-testi-cta {
    padding: 80px var(--pad-x) 40px;
    border-top: 1px solid var(--border);
}
.post-testi-inner {
    max-width: var(--max-w);
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    text-align: center;
}
.post-testi-line {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text);
}
.post-testi-ctas {
    display: flex;
    align-items: center;
    gap: 12px;
}
@media (max-width: 768px) {
    .post-testi-cta { padding: 56px var(--pad-x) 24px; }
}

/* ======================================================
   21. PROJECT MODAL
   ====================================================== */
.proj-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s var(--ease);
}
.proj-modal-backdrop.is-open {
    opacity: 1;
    pointer-events: all;
}
.proj-modal {
    background: #0e0e0e;
    border: 1px solid var(--border2);
    border-radius: 20px;
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(24px) scale(0.97);
    transition: transform 0.38s var(--ease);
    scrollbar-width: none;
}
.proj-modal::-webkit-scrollbar { display: none; }
.proj-modal-backdrop.is-open .proj-modal {
    transform: translateY(0) scale(1);
}
.proj-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(220, 38, 38, 0.95);
    border: none;
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, background 0.2s;
}
.proj-modal-close:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.08);
}

/* Prev/next arrows — let visitors browse projects without closing the modal */
.proj-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9100;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background .2s, transform .2s, border-color .2s;
}
.proj-modal-prev { left: 24px; }
.proj-modal-next { right: 24px; }
.proj-modal-nav:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.5);
}
.proj-modal-prev:hover { transform: translateY(-50%) translateX(-3px); }
.proj-modal-next:hover { transform: translateY(-50%) translateX(3px); }
@media (max-width: 600px) {
    .proj-modal-nav { width: 40px; height: 40px; font-size: 18px; }
    .proj-modal-prev { left: 8px; }
    .proj-modal-next { right: 8px; }
}
.proj-modal-img-wrap {
    width: 100%;
    height: 280px;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
}
.proj-modal-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s var(--ease);
}
.proj-modal:hover .proj-modal-img { transform: scale(1.04); }
.proj-modal-body {
    padding: 32px 36px 40px;
}
.proj-modal-tag {
    font-family: var(--font-sans);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text3);
    margin-bottom: 10px;
}
.proj-modal-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--text);
    margin: 0 0 6px;
    line-height: 1.2;
}
.proj-modal-cat {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text2);
    margin: 0 0 20px;
}

.proj-modal-case {
    display: grid;
    gap: 22px;
}

.case-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.case-block,
.case-visual {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.045);
}

.case-block {
    padding: 16px;
}

.case-result {
    grid-column: 1 / -1;
}

.case-block span,
.case-visual span {
    display: block;
    margin-bottom: 8px;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text3);
}

.case-block p,
.case-visual p {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.65;
    color: rgba(255,255,255,0.72);
}

.case-visuals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.case-visual {
    min-height: 170px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}

.case-before {
    background:
        linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.02)),
        repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 1px, transparent 1px 12px);
}

.case-after {
    background-size: cover;
    background-position: center;
}

.case-after span,
.case-after p {
    color: #fff;
    text-shadow: 0 1px 12px rgba(0,0,0,.75);
}

@media (max-width: 600px) {
    .proj-modal-body { padding: 24px 22px 32px; }
    .proj-modal-img-wrap { height: 200px; }
    .case-grid,
    .case-visuals { grid-template-columns: 1fr; }
}
