/* ═══════════════════════════════════════════════
   ISCA DESIGN — DESIGN TOKENS
   ═══════════════════════════════════════════════ */
:root {
    /* Colors — Ethereal Light Palette */
    --isca-white:         #FAFAF8;
    --isca-cream:         #F0EDE8;
    --isca-sand:          #E8E2DA;
    --isca-warmgray:      #D4CEC6;
    --isca-charcoal:      #1A1A18;
    --isca-graphite:      #3D3D3A;
    --isca-mist:          #9E9B94;
    --isca-orange:        #E85D24;
    --isca-orange-soft:   #F0804D;
    --isca-orange-glow:   #FF7A45;
    --isca-gold:          #C9A96E;
    --isca-glass:         rgba(255, 255, 255, 0.55);
    --isca-glass-heavy:   rgba(255, 255, 255, 0.75);
    --isca-glass-border:  rgba(0, 0, 0, 0.06);
    --isca-glass-shadow:  rgba(0, 0, 0, 0.04);

    /* Typography */
    --font-display:    'Instrument Serif', serif;
    --font-heading:    'Inter Tight', sans-serif;
    --font-body:       'Inter', sans-serif;
    --font-accent:     'Cormorant Garamond', serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;
    --space-2xl: 12rem;

    /* Motion */
    --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out:    cubic-bezier(0.77, 0, 0.175, 1);
    --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Cursor */
    --cursor-size: 10px;
}

/* ═══════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--isca-charcoal);
    background-color: var(--isca-white);
    overflow-x: hidden;
    overscroll-behavior: none;
    line-height: 1.6;
    letter-spacing: -0.01em;
}

::selection {
    background-color: var(--isca-orange);
    color: #fff;
}

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

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

/* ═══════════════════════════════════════════════
   NOISE OVERLAY — Cinematic grain
   ═══════════════════════════════════════════════ */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.028;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* ═══════════════════════════════════════════════
   CUSTOM CURSOR
   ═══════════════════════════════════════════════ */
.cursor-dot {
    width: var(--cursor-size);
    height: var(--cursor-size);
    background: var(--isca-orange);
    border-radius: 50%;
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
    transition: width 0.4s var(--ease-out-expo),
                height 0.4s var(--ease-out-expo),
                background 0.3s ease,
                border 0.3s ease;
    will-change: transform;
}

.cursor-ring {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(232, 93, 36, 0.3);
    border-radius: 50%;
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: width 0.5s var(--ease-out-expo),
                height 0.5s var(--ease-out-expo),
                border-color 0.3s ease,
                opacity 0.3s ease;
    will-change: transform;
    opacity: 0.6;
}

body.cursor-hover .cursor-dot {
    width: 60px;
    height: 60px;
    background: rgba(232, 93, 36, 0.08);
    border: 1px solid rgba(232, 93, 36, 0.4);
    mix-blend-mode: normal;
    backdrop-filter: blur(4px);
}

body.cursor-hover .cursor-ring {
    width: 80px;
    height: 80px;
    border-color: rgba(232, 93, 36, 0.1);
    opacity: 0.3;
}

/* ═══════════════════════════════════════════════
   PRELOADER
   ═══════════════════════════════════════════════ */
.preloader {
    position: fixed;
    inset: 0;
    background: var(--isca-white);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.preloader__logo {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 400;
    color: var(--isca-charcoal);
    letter-spacing: 0.02em;
    overflow: hidden;
    display: flex;
}

.preloader__logo .char {
    display: inline-block;
    transform: translateY(120%);
    opacity: 0;
}

.preloader__logo .char--dot {
    color: var(--isca-orange);
}

.preloader__line {
    width: 60px;
    height: 1px;
    background: var(--isca-sand);
    position: relative;
    overflow: hidden;
}

.preloader__progress {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: 0%;
    background: var(--isca-orange);
}

.preloader__tagline {
    font-family: var(--font-accent);
    font-style: italic;
    font-weight: 300;
    font-size: 1rem;
    color: var(--isca-mist);
    letter-spacing: 0.08em;
    opacity: 0;
    transform: translateY(10px);
}

.preloader__tagline--notice {
    font-family: var(--font-heading);
    font-style: normal;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(61, 61, 58, 0.82);
}

@media (max-width: 767px) {
    .preloader__tagline {
        max-width: 22rem;
        text-align: center;
        line-height: 1.35;
        letter-spacing: 0.02em;
    }

    .preloader__tagline--notice {
        font-size: 0.72rem;
        line-height: 1.55;
        max-width: 20rem;
        padding: 0 0.25rem;
    }
}

/* ═══════════════════════════════════════════════
   NAVIGATION — Glassmorphism
   ═══════════════════════════════════════════════ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9000;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.6s ease,
                backdrop-filter 0.6s ease,
                box-shadow 0.6s ease,
                padding 0.4s ease;
}

.nav.is-scrolled {
    background: var(--isca-glass-heavy);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    box-shadow: 0 1px 0 var(--isca-glass-border),
                0 8px 32px var(--isca-glass-shadow);
    padding: 1rem 2rem;
}

.nav__logo {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--isca-charcoal);
    letter-spacing: 0.02em;
    display: flex;
    align-items: baseline;
    gap: 0;
    cursor: pointer;
    position: relative;
    z-index: 10;
    transition: color 0.4s ease;
}

/* Dark Theme Overrides for Nav (Before SCROLL) */
body.theme-dark .nav:not(.is-scrolled) .nav__logo {
    color: var(--isca-white);
}
body.theme-dark .nav:not(.is-scrolled) .nav__link {
    color: rgba(255, 255, 255, 0.7);
}
body.theme-dark .nav:not(.is-scrolled) .nav__link:hover,
body.theme-dark .nav:not(.is-scrolled) .nav__link.active {
    color: var(--isca-white);
    text-shadow: 0 0 10px rgba(255,255,255,0.4);
}

.nav__logo-dot {
    color: var(--isca-orange);
    transition: transform 0.4s var(--ease-spring);
    display: inline-block;
}

.nav__logo:hover .nav__logo-dot {
    transform: scale(1.4) translateY(-2px);
}

.nav__links {
    display: none;
    gap: 2.5rem;
    align-items: center;
}

@media (min-width: 768px) {
    .nav__links { display: flex; }
}

.nav__link {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--isca-graphite);
    position: relative;
    padding: 0.25rem 0;
    transition: color 0.3s ease;
    cursor: pointer;
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 1px;
    background: var(--isca-orange);
    transition: width 0.4s var(--ease-out-expo);
}

.nav__link:hover {
    color: var(--isca-orange);
}

.nav__link:hover::after {
    width: 100%;
}

/* ═══════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════ */
.hero {
    position: relative;
    width: 100%;
    height: 100svh;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--isca-white);
}

/* Layer 1 — Video */
.hero__video-wrap {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    clip-path: inset(8% 8% 8% 8% round 12px);
    transition: clip-path 1.8s var(--ease-in-out);
    opacity: 0;
}

.hero__video-wrap.is-expanded {
    clip-path: inset(0% 0% 0% 0% round 0px);
}

.hero__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.6) contrast(1.05) brightness(1.1);
    transform: scale(1.1);
    transition: transform 8s ease-out, filter 2s ease;
}

.hero__video-wrap.is-expanded .hero__video {
    transform: scale(1.0);
}

.hero__video-overlay {
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(180deg, 
            rgba(250,250,248,0.85) 0%, 
            rgba(250,250,248,0.4) 30%,
            rgba(250,250,248,0.15) 60%,
            rgba(250,250,248,0.7) 100%
        );
    z-index: 2;
}

/* Layer 2 — WebGL Canvas (Three.js smoke) */
.hero__webgl {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.hero__webgl canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Layer 3 — Content */
.hero__content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 1.5rem;
    max-width: 1400px;
    width: 100%;
}

.hero__eyebrow {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    color: var(--isca-mist);
    margin-bottom: var(--space-md);
    overflow: hidden;
}

.hero__eyebrow span {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
}

.hero__headline {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(3.5rem, 12vw, 11rem);
    line-height: 0.88;
    color: var(--isca-charcoal);
    letter-spacing: -0.03em;
    margin-bottom: var(--space-md);
    overflow: hidden;
}

.hero__headline-line {
    display: block;
    overflow: hidden;
}

.hero__headline-line span {
    display: inline-block;
    transform: translateY(110%);
}

.hero__headline-line--accent {
    font-family: var(--font-accent);
    font-style: italic;
    font-weight: 300;
    color: var(--isca-orange);
    font-size: 0.85em;
}

.hero__subtitle {
    font-family: var(--font-accent);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    color: var(--isca-graphite);
    letter-spacing: 0.02em;
    max-width: 600px;
    margin-bottom: var(--space-lg);
    opacity: 0;
    transform: translateY(20px);
}

/* Glass CTA Button */
.hero__cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.1rem 2.5rem;
    background: var(--isca-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--isca-glass-border);
    border-radius: 100px;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--isca-charcoal);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.4s ease,
                box-shadow 0.4s ease,
                transform 0.4s var(--ease-spring);
    box-shadow: 0 4px 24px rgba(0,0,0,0.04),
                inset 0 1px 0 rgba(255,255,255,0.6);
    opacity: 0;
    transform: translateY(20px);
}

.hero__cta-fill {
    position: absolute;
    inset: 0;
    background: var(--isca-orange);
    border-radius: inherit;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s var(--ease-out-expo);
    z-index: 0;
}

.hero__cta:hover .hero__cta-fill {
    transform: scaleX(1);
}

.hero__cta:hover {
    border-color: var(--isca-orange);
    color: #fff;
    box-shadow: 0 8px 40px rgba(232, 93, 36, 0.2);
}

.hero__cta-label {
    position: relative;
    z-index: 1;
    transition: color 0.4s ease;
}

.hero__cta-arrow {
    position: relative;
    top: -1.5px;
    z-index: 1;
    width: 18px;
    height: 18px;
    transition: transform 0.4s var(--ease-spring), color 0.4s ease;
}

.hero__cta:hover .hero__cta-arrow {
    transform: translateX(4px);
}

/* Scroll Indicator */
.hero__scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
}

.hero__scroll-text {
    font-family: var(--font-heading);
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--isca-mist);
    writing-mode: vertical-lr;
}

.hero__scroll-line {
    width: 1px;
    height: 48px;
    background: var(--isca-sand);
    position: relative;
    overflow: hidden;
    border-radius: 1px;
}

.hero__scroll-dot {
    width: 100%;
    height: 12px;
    background: var(--isca-orange);
    border-radius: 1px;
    position: absolute;
    top: -12px;
    animation: scrollPulse 2s var(--ease-out-expo) infinite;
}

@keyframes scrollPulse {
    0%   { top: -12px; opacity: 0; }
    30%  { opacity: 1; }
    100% { top: 48px; opacity: 0; }
}

/* ═══════════════════════════════════════════════
   FLOATING SMOKE FALLBACK (Mobile CSS)
   ═══════════════════════════════════════════════ */
.hero__smoke-css {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

.smoke-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0;
    animation: smokeFloat 12s infinite ease-in-out;
}

.smoke-orb--1 {
    width: 40vw; height: 40vw;
    background: radial-gradient(circle, rgba(201,169,110,0.12) 0%, transparent 70%);
    top: 20%; left: 10%;
    animation-delay: 0s;
    animation-duration: 14s;
}
.smoke-orb--2 {
    width: 50vw; height: 50vw;
    background: radial-gradient(circle, rgba(232,93,36,0.06) 0%, transparent 70%);
    top: 40%; right: 5%;
    animation-delay: 3s;
    animation-duration: 18s;
}
.smoke-orb--3 {
    width: 35vw; height: 35vw;
    background: radial-gradient(circle, rgba(240,237,232,0.3) 0%, transparent 70%);
    bottom: 10%; left: 30%;
    animation-delay: 6s;
    animation-duration: 16s;
}

@keyframes smokeFloat {
    0%, 100% { 
        opacity: 0;
        transform: translate(0, 0) scale(1);
    }
    20% { opacity: 1; }
    80% { opacity: 1; }
    50% { 
        transform: translate(30px, -20px) scale(1.15);
    }
}

/* Mobile: use CSS fallback, hide WebGL */
@media (max-width: 767px) {
    .hero__webgl { display: none; }
    .hero__smoke-css { display: block; }
    .cursor-dot, .cursor-ring { display: none !important; }
    .nav { padding: 1rem 1.25rem; }
    .hero__cta { padding: 1rem 2rem; }
}

@media (min-width: 768px) {
    .nav { padding: 1.5rem 3rem; }
    .nav.is-scrolled { padding: 1rem 3rem; }
}

@media (min-width: 1200px) {
    .nav { padding: 2rem 4rem; }
    .nav.is-scrolled { padding: 1rem 4rem; }
}

/* ═══════════════════════════════════════════════
   MAGNETIC LINK UTILITY
   ═══════════════════════════════════════════════ */
.magnetic { display: inline-block; }

/* ═══════════════════════════════════════════════
   PAGE VISIBILITY (hidden until preloader done)
   ═══════════════════════════════════════════════ */
.page-content {
    opacity: 0;
    visibility: hidden;
}
.page-content.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ═══════════════════════════════════════════════
   SECTION: PORTFOLIO (Second Fold)
   ═══════════════════════════════════════════════ */
.portfolio {
    position: relative;
    background: var(--isca-charcoal);
    padding: 10vh 0;
    overflow: hidden;
    z-index: 10;
}

body.portfolio-hover .cursor-dot,
body.portfolio-hover .cursor-ring {
    opacity: 0 !important;
}

.portfolio__container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 768px) {
    .portfolio__container { padding: 0 4rem; }
}

/* Fluid Columns Layout */
.portfolio__grid {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

/* Base flex offsets */
@media (min-width: 1024px) {
    .portfolio__grid {
        flex-direction: row;
        align-items: flex-start;
        gap: 6rem;
    }
    .portfolio__col { flex: 1; margin-top: 0; }
    .portfolio__col--offset { margin-top: 15vh; }
}

/* ─── Compact 3-Column Layout (Less visual weight/spaced out) ─── */
.portfolio__grid--compact {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 3rem;
    width: 100%;
}

@media (min-width: 768px) {
    .portfolio__grid--compact {
        grid-template-columns: repeat(2, 1fr);
        gap: 4rem;
    }
}

@media (min-width: 1200px) {
    .portfolio__grid--compact {
        grid-template-columns: repeat(3, 1fr);
        gap: 5rem; /* Spacious as requested */
        align-items: flex-start;
    }
    
    /* Native masonry simulation through nth-child offsets */
    .portfolio__grid--compact .project { margin-bottom: 0; }
    .portfolio__grid--compact .project:nth-child(3n+1) { margin-top: 5vh; }
    .portfolio__grid--compact .project:nth-child(3n+2) { margin-top: 0vh; }
    .portfolio__grid--compact .project:nth-child(3n+3) { margin-top: 12vh; }
}

/* Project Card */
.project {
    position: relative;
    margin-bottom: 6rem;
    cursor: pointer;
}

.project__media {
    position: relative;
    width: 100%;
    aspect-ratio: 4/5;
    overflow: hidden;
    border-radius: 4px; /* Minimalist */
    background: #111;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.project:hover .project__media {
    transform: scale(0.98);
}

.project__plus {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(0,0,0,0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(250,250,248,0.9);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1;
    opacity: 0;
    transform: translateY(6px) scale(0.98);
    transition: opacity 0.45s var(--ease-out-expo),
                transform 0.45s var(--ease-out-expo),
                border-color 0.45s var(--ease-out-expo);
    pointer-events: none;
}

.project:hover .project__plus {
    opacity: 1;
    transform: translateY(0) scale(1);
    border-color: rgba(232, 93, 36, 0.35);
}

.project__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) brightness(0.7) blur(2px);
    transition: filter 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    transform: scale(1.1);
}

.project:hover .project__img {
    filter: grayscale(0) brightness(1) blur(0);
    transform: scale(1);
}

/* Mouse-tracking info */
.project__info {
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    mix-blend-mode: difference;
}

.project:hover ~ .project__info, 
.project:hover .project__info {
    opacity: 1;
}

.project__category {
    font-family: var(--font-heading);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--isca-orange);
    margin-bottom: 0.5rem;
}

.project__name {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--isca-white);
    line-height: 1;
    white-space: nowrap;
}

/* Cursor label (Portfolio) */
.portfolio__cursor {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    margin-top: -45px;
    pointer-events: none;
    z-index: 11000;
    opacity: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    mix-blend-mode: difference;
}

.portfolio__cursor-category {
    font-family: var(--font-heading);
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.32em;
    color: var(--isca-orange);
}

.portfolio__cursor-title {
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    color: var(--isca-white);
}

@media (max-width: 767px) {
    .portfolio__cursor { display: none !important; }
}

/* Magnetic Trail Button */
.cta-portfolio {
    display: flex;
    justify-content: center;
    padding: 8vh 0;
    position: relative;
}

.magnetic-trail {
    position: relative;
    background: var(--isca-charcoal);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--isca-white);
    padding: 1.5rem 3.5rem;
    border-radius: 40px;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    cursor: pointer;
    z-index: 2;
    overflow: visible;
    transition: border-color 0.4s;
}

.magnetic-trail:hover {
    border-color: var(--isca-orange);
}

.trail-blob {
    position: fixed;
    top: 0;
    left: 0;
    width: 80px; height: 80px;
    background: var(--isca-orange);
    border-radius: 50%;
    filter: blur(18px);
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    transition: opacity 0.6s;
    box-shadow:
        0 0 0 1px rgba(232, 93, 36, 0.08),
        0 0 60px rgba(232, 93, 36, 0.45),
        0 0 120px rgba(232, 93, 36, 0.25);
}

.magnetic-trail:hover + .trail-blob {
    opacity: 0.6;
}

/* ═══════════════════════════════════════════════
   SECTION: SERVICES (Third Fold)
   ═══════════════════════════════════════════════ */
.services {
    position: relative;
    background: var(--isca-cream);
    overflow: hidden;
    padding-bottom: 0;
}

/* Services background lines */
.services__bg-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 1;
}

/* Intro block */
.services__intro {
    position: relative;
    z-index: 10;
    padding: 10vh 2rem 6vh;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

@media (min-width: 768px) {
    .services__intro { padding: 12vh 3rem 8vh; }
}
@media (min-width: 1200px) {
    .services__intro { padding: 14vh 4rem 8vh; }
}

.services__label {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    color: var(--isca-orange);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.services__label-line {
    width: 0;
    height: 1px;
    background: var(--isca-orange);
    display: inline-block;
}

.services__title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.8rem, 7vw, 6.5rem);
    line-height: 0.92;
    color: var(--isca-charcoal);
    letter-spacing: -0.03em;
    max-width: 900px;
}

.services__title-accent {
    font-family: var(--font-accent);
    font-style: italic;
    font-weight: 300;
    color: var(--isca-mist);
}

.services__desc {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    color: var(--isca-graphite);
    max-width: 520px;
    margin-top: 2rem;
    line-height: 1.7;
    opacity: 0;
    transform: translateY(24px);
}

/* ─── Bento Grid Layout ─── */
.bento {
    position: relative;
    z-index: 10;
    padding: 4vh 1.25rem 8vh;
    max-width: 1400px;
    margin: 0 auto;
    perspective: 1200px;
}

@media (min-width: 768px) {
    .bento { padding: 6vh 3rem 10vh; }
}
@media (min-width: 1200px) {
    .bento { padding: 6vh 4rem 12vh; }
}

.bento__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .bento__grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: minmax(180px, auto);
        gap: 1.6rem;
    }
}

@media (min-width: 1200px) {
    .bento__grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.6rem;
    }
}

/* ─── Bento Cell (base) ─── */
.bento__cell {
    position: relative;
    border-radius: 16px;
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transform-style: preserve-3d;
    clip-path: inset(0 0 100% 0 round 16px);
    
    /* Clear out visual background variables to move them to pseudo element */
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    
    --bg-scale: 1; /* Animated purely via JS */
}

/* Background Layer Separated */
.bento__cell::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    background: var(--isca-glass-heavy);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid var(--isca-glass-border);
    transition: box-shadow 0.5s ease, border-color 0.4s ease;
    box-shadow: 0 2px 20px rgba(0,0,0,0.02),
                inset 0 1px 0 rgba(255,255,255,0.6);
    transform: scale(var(--bg-scale));
    will-change: transform;
}

/* Maintain hover interactions on the new pseudo-element */
.bento__cell:hover::before {
    border-color: rgba(232, 93, 36, 0.4);
}

.bento__cell,
.bento__inner {
    -webkit-font-smoothing: antialiased;
    transform: translateZ(0); 
}

.bento__cell.is-revealed {
    /* Once revealed, clear clipping so the scale expansion isn't cropped */
    clip-path: inset(-50px -50px -50px -50px round 16px) !important;
}

.bento__inner {
    position: relative;
    z-index: 2; /* Ensure content is above bg */
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    will-change: transform;
}

/* Magnifier lens for Services (desktop)
    Keep the same cursor element size/function: disable the "blur + enlarge" hover state in Services. */
body.services-lens.cursor-hover .cursor-dot {
    width: var(--cursor-size) !important;
    height: var(--cursor-size) !important;
    background: var(--isca-orange) !important;
    border: none !important;
    mix-blend-mode: difference;
    backdrop-filter: none !important;
}

body.services-lens.cursor-hover .cursor-ring {
    width: 40px !important;
    height: 40px !important;
    border-color: rgba(232, 93, 36, 0.3) !important;
    opacity: 0.6 !important;
}

.services__lens {
    position: fixed;
    top: 0;
    left: 0;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    pointer-events: none;
    z-index: 12000;
    opacity: 0;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(232, 93, 36, 0.32);
    box-shadow:
        0 10px 40px rgba(0,0,0,0.08),
        0 0 0 1px rgba(255,255,255,0.25) inset,
        0 0 60px rgba(232, 93, 36, 0.18);
    backdrop-filter: blur(2px) saturate(160%);
    -webkit-backdrop-filter: blur(2px) saturate(160%);
}

.services__lens-inner {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    will-change: transform;
}

@media (max-width: 767px) {
    .services__lens { display: none !important; }
}

.bento__cell:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.07),
                inset 0 1px 0 rgba(255,255,255,0.8);
    border-color: rgba(232,93,36,0.45);
    border-width: 1.5px;
}

/* ─── Estado Ativo: Clicado/Selecionado ─── */
.bento__cell--active {
    border-color: var(--isca-orange) !important;
    border-width: 4.5px !important; /* 3x a borda padrão de 1.5px */
    box-shadow: 0 12px 40px rgba(232, 93, 36, 0.12),
                inset 0 1px 0 rgba(255,255,255,0.8) !important;
}

/* Elementos laranja fixos quando o card está ativo */
.bento__cell--active .bento__number { color: var(--isca-orange) !important; }
.bento__cell--active .bento__name   { color: var(--isca-orange) !important; }
.bento__cell--active .bento__icon   { background: var(--isca-orange) !important; border-color: var(--isca-orange) !important; }
.bento__cell--active .bento__icon svg { stroke: #fff !important; }
.bento__cell--active .bento__arrow  { background: var(--isca-orange) !important; border-color: var(--isca-orange) !important; transform: translateX(3px); }
.bento__cell--active .bento__arrow svg { stroke: #fff !important; }

/* Grid spans (desktop) */
@media (min-width: 1200px) {
    .bento__cell--wide   { grid-column: span 2; }
    .bento__cell--tall   { grid-row: span 2; }
}
@media (min-width: 768px) and (max-width: 1199px) {
    .bento__cell--wide   { grid-column: span 2; }
    .bento__cell--tall   { grid-row: span 2; }
}

/* ─── Transparent Cell (New) ─── */
.bento__cell--transparent {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    padding: 0;
}

.bento__cell--transparent:before,
.bento__cell--transparent:after {
    display: none; /* remove glow overlays */
}

/* Remove hover interactions for transparent cells */
.bento__cell--transparent.hover-trigger,
.bento__cell--transparent:hover {
    box-shadow: none;
    border-color: transparent;
    border-width: 0;
    transform: none !important;
}

.bento__cell--transparent::before {
    display: none; /* Completely disable separated bg layer */
}

/* ─── Dynamic Repository Text ─── */
.bento__cell--dynamic {
    display: flex;
    align-items: center;    /* Centralização vertical */
    justify-content: center; /* Centralização horizontal */
    padding: 0; /* Remove padding para permitir centralização limpa via flex */
}

.bento__dynamic-text {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(2rem, 3.5vw, 2.5rem);
    line-height: 1.25;
    color: var(--isca-sand);
    text-align: center; /* Centraliza linhas quebradas */
    opacity: 0; 
    margin: auto; /* Junto com flex, garante centralização vertical e horizontal */
    font-weight: 400;
    padding: 1.5rem 2rem; /* Margem interna simétrica: igual nas laterais, igual no topo/base */
    user-select: none; /* Remove a seleção de texto */
    -webkit-user-select: none;
    pointer-events: none; /* Não interfere com cliques */
}

.h-char {
    display: inline;
    padding: 0.08em 0; /* Ensures the highlight sits beautifully behind the tall display font */
}

/* ─── Service Cell Content ─── */
.bento__number {
    font-family: var(--font-heading);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--isca-warmgray);
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.bento__cell:hover .bento__number {
    color: var(--isca-orange);
}

.bento__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--isca-cream);
    border: 1px solid var(--isca-sand);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.bento__cell:hover .bento__icon {
    background: var(--isca-orange);
    border-color: var(--isca-orange);
}

.bento__icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--isca-graphite);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.3s ease;
}

.bento__cell:hover .bento__icon svg {
    stroke: #fff;
}

.bento__name {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.2vw, 1.9rem);
    font-weight: 400;
    color: var(--isca-charcoal);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 0.6rem;
}

.bento__body {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.82rem;
    line-height: 1.65;
    color: var(--isca-graphite);
    flex-grow: 1;
}

.bento__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--isca-sand);
}

.bento__tag {
    font-family: var(--font-accent);
    font-style: italic;
    font-weight: 400;
    font-size: 1.15rem;
    color: var(--isca-graphite);
}

.bento__dynamic-text {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2.5vw, 2.4rem);
    font-style: italic;
    line-height: 1.25;
    color: var(--isca-charcoal);
    /* Inicia menos "apagado" */
    opacity: 0.85; 
    transition: color 0.4s ease, opacity 0.4s ease;
}

.bento__arrow {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--isca-cream);
    border: 1px solid var(--isca-sand);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease,
                border-color 0.3s ease,
                transform 0.4s var(--ease-spring);
    flex-shrink: 0;
}

.bento__cell:hover .bento__arrow {
    background: var(--isca-orange);
    border-color: var(--isca-orange);
    transform: translateX(3px);
}

.bento__arrow svg {
    width: 12px;
    height: 12px;
    stroke: var(--isca-graphite);
    fill: none;
    stroke-width: 1.5;
    transition: stroke 0.3s ease;
}

.bento__cell:hover .bento__arrow svg {
    stroke: #fff;
}

/* ─── Separator ─── */
.section-line {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 1px;
    background: var(--isca-sand);
    transform: scaleX(0);
    transform-origin: left;
}

/* ═══════════════════════════════════════════════
   STUDIO SECTION (Fourth Fold)
   ═══════════════════════════════════════════════ */
.studio {
    background-color: var(--isca-graphite, #111111);
    color: var(--isca-sand, #F4F1ED);
    position: relative;
    z-index: 10; /* Stack neatly after services */
}

.studio__container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 15vh 2rem 25vh;
    display: flex;
    gap: 4rem;
}

/* Coluna Fixa da Esquerda (Sticky) */
.studio__left {
    position: sticky;
    top: 20vh;
    width: 40%;
    height: fit-content;
}

.studio__label {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--isca-orange);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.studio__label::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background: var(--isca-orange);
}

.studio__manifesto {
    font-family: var(--font-display);
    font-size: clamp(3rem, 5vw, 6rem);
    line-height: 0.9;
    margin-bottom: 2rem;
    font-weight: 400;
}

.studio__manifesto i {
    display: block;
    font-family: var(--font-accent);
    font-weight: 300;
    color: #888;
}

.studio__desc {
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.6;
    color: #AAA;
    font-weight: 300;
    max-width: 450px;
}

/* Coluna Rolável da Direita */
.studio__right {
    width: 60%;
    display: flex;
    flex-direction: column;
    gap: 4rem;
    padding-top: 15vh;
}

.studio-trait {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: border-color 0.4s ease, transform 0.4s ease;
    will-change: transform;
}

.studio-trait:hover {
    border-color: rgba(232, 93, 36, 0.3);
    transform: translateY(-5px); 
}

.studio-trait__num {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--isca-orange);
    font-style: italic;
}

.studio-trait__title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 500;
    color: #FFF;
}

.studio-trait__txt {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.6;
    color: #888;
}

@media (max-width: 1024px) {
    .studio__container {
        flex-direction: column;
        padding-top: 10vh;
        gap: 2rem;
    }
    .studio__left {
        position: relative;
        top: 0;
        width: 100%;
    }
    .studio__right {
        width: 100%;
        padding-top: 0;
    }
}

/* ═══════════════════════════════════════════════
   PROJECT DETAIL PAGE (VANGUARDA SINGLE)
   ═══════════════════════════════════════════════ */
.project-single {
    padding: 18vh 4% 10vh;
    max-width: 1800px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

@media (min-width: 1024px) {
    .project-single__layout {
        display: grid;
        grid-template-columns: 60% 35%;
        gap: 5%;
        align-items: start;
    }
}

/* Header Utilities */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--isca-mist);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    text-decoration: none;
    margin-bottom: 4rem;
    transition: color 0.4s ease, transform 0.4s var(--ease-spring);
}
.btn-back:hover { 
    color: var(--isca-orange); 
    transform: translateX(-5px);
}

/* Left Column: Slider (Brutalist Edges) */
.project-slider__main {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--isca-graphite);
}

.project-slider__track {
    display: flex;
    height: 100%;
    width: 100%;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.project-slider__item {
    flex: 0 0 100%;
    height: 100%;
}

.project-slider__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: contrast(1.05) saturate(1.1); /* Cinematic contrast */
}

/* Slider Controls (Minimalist & Lighter) */
.slider-btn {
    position: absolute;
    bottom: 25px; /* Desencostado da base */
    width: 42px; height: 42px;
    background: rgba(26, 26, 24, 0.4); /* Translúcido */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--isca-white);
    border: 1px solid rgba(255,255,255,0.15);
    cursor: pointer;
    transition: all 0.4s var(--ease-out-expo);
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
}
.slider-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.5; /* Linha mais fina */
}
.slider-btn:hover { 
    background: var(--isca-orange); 
    color: var(--isca-charcoal);
    border-color: var(--isca-orange);
    transform: translateY(-3px); 
}
.slider-btn--prev { left: 25px; } /* Desencostado da lateral */
.slider-btn--next { right: 25px; }

/* Thumbnails (Muted to Active) */
.project-slider__thumbs {
    display: flex;
    gap: 0;
    margin-top: 1px; /* Hairline gap */
}
.thumb-item {
    width: 120px;
    aspect-ratio: 16/9;
    overflow: hidden;
    cursor: pointer;
    filter: grayscale(1) opacity(0.3);
    transition: filter 0.6s ease;
    border-bottom: 2px solid transparent;
}
.thumb-item.is-active,
.thumb-item:hover {
    filter: grayscale(0) opacity(1);
    border-color: var(--isca-orange);
}
.thumb-img {
    width: 100%; height: 100%; object-fit: cover;
}

/* Right Column: Info Card */
.project-info-card {
    padding: 0;
    position: sticky;
    top: 15vh;
    /* Alinhamento dinâmico: a altura deve bater com a galeria 16:10 */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: calc(60vw * 0.625); /* 60vw é a largura da coluna galeria, 0.625 é 10/16 */
}
@media (max-width: 1023px) {
    .project-info-card { min-height: auto; margin-top: 3rem; }
}
.project-info__title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 4.5vw, 4.5rem); /* Levemente menor */
    font-weight: 400;
    font-style: italic;
    color: var(--isca-cream);
    line-height: 1.05;
    margin-bottom: 2.5rem; /* Ajustado */
    letter-spacing: -0.02em;
}

/* Ficha Técnica — Minimalista design-system */
.project-meta {
    margin-bottom: auto; /* Empurra o CTA para baixo no flex container */
    padding-bottom: 3rem;
}
.meta-label {
    font-family: var(--font-heading);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    color: var(--isca-orange);
    font-weight: 600;
    margin-bottom: 0.45rem;
    display: block;
}
.meta-value {
    font-family: var(--font-accent);
    font-size: 1.25rem;
    font-style: italic;
    color: var(--isca-sand);
    font-weight: 400;
    line-height: 1.3;
    display: block;
}
.meta-value--desc {
    font-family: var(--font-body);
    font-style: normal;
    font-size: 0.85rem;
    color: var(--isca-mist);
    line-height: 1.7;
    font-weight: 300;
}

/* Unified Premium Button (Black Magnetic) */
.project-cta {
    position: relative;
    align-self: flex-start; /* Não estica no flex */
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem 2.2rem; /* Mais compacto */
    background: var(--isca-charcoal);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    font-family: var(--font-heading);
    font-size: 0.7rem; /* Reduzido */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--isca-white);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s var(--ease-out-expo);
    z-index: 1;
}

.project-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--isca-orange);
    border-radius: inherit;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.6s var(--ease-out-expo);
    z-index: -1;
}

.project-cta:hover {
    border-color: var(--isca-orange);
    color: #fff;
    transform: translateY(-2px);
}

.project-cta:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

/* Testimonial Bar (Immersive Block) */
.project-testimonial {
    margin-top: 15vh;
    padding: 6rem 4rem;
    background: var(--isca-graphite); /* Dark brutal box */
    display: flex;
    gap: 4rem;
    position: relative;
}
.testimonial-quote {
    font-family: var(--font-display);
    font-style: normal;
    font-size: 8rem;
    color: var(--isca-orange);
    line-height: 0.5;
    transform: translateY(20px);
}
.testimonial-body {
    flex: 1;
    max-width: 900px;
}
.testimonial-text {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-style: italic;
    color: var(--isca-cream);
    line-height: 1.25;
    margin-bottom: 3rem;
}
.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.author-avatar {
    width: 60px; height: 60px;
    background: var(--isca-charcoal);
    display: flex; align-items: center; justify-content: center;
    color: var(--isca-orange);
}
.author-meta strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--isca-white);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.author-meta span {
    font-size: 0.85rem;
    color: var(--isca-mist);
    letter-spacing: 0.02em;
}
