/* ============================================
   PORTFOLIO CMS — Frontend Styles
   Cinematic / Editorial Aesthetic
   ============================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--sans); background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
button { border: none; background: none; font-family: inherit; color: inherit; }

/* === CUSTOM CURSOR === */
.cursor { position: fixed; top: -8px; left: -8px; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #f5f0eb; pointer-events: none; z-index: 9999; will-change: transform; transition: width 0.2s, height 0.2s, top 0.2s, left 0.2s, background 0.2s, opacity 0.2s; }
.cursor--hover { width: 50px; height: 50px; top: -25px; left: -25px; background: rgba(245,240,235,0.06); }
.cursor--click { width: 12px; height: 12px; top: -6px; left: -6px; }
.cursor--hidden { opacity: 0; }

/* === GRAIN OVERLAY — static, lightweight === */
.grain { position: fixed; inset: 0; pointer-events: none; z-index: 9998; opacity: var(--grain-opacity, 0.04); background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E"); background-repeat: repeat; background-size: 256px 256px; }

/* === PRELOADER === */
.preloader { position: fixed; inset: 0; z-index: 10000; background: var(--bg); display: flex; align-items: center; justify-content: center; transition: opacity 0.6s, visibility 0.6s; }
.preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader__text { font-family: var(--serif); font-size: clamp(1.5rem, 4vw, 3rem); letter-spacing: -0.03em; opacity: 0; animation: preloaderIn 0.8s 0.1s forwards; }
@keyframes preloaderIn { 0% { opacity: 0; transform: translateY(15px); } 50% { opacity: 1; transform: translateY(0); } 100% { opacity: 1; transform: translateY(0); } }

/* === PAGE TRANSITIONS === */
.page-transition { position: fixed; inset: 0; z-index: 9990; background: var(--bg); transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.76, 0, 0.24, 1); pointer-events: none; }
.page-transition.active { transform: translateY(0); }

/* === NAV === */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 2rem 3rem; color: #f5f0eb; }
.nav__logo { font-family: var(--serif); font-size: 1.4rem; display: flex; align-items: center; gap: 0.5rem; }
.nav__logo img { height: var(--logo-height, 24px); width: auto; max-width: 180px; filter: brightness(0) invert(1); }
.nav__links { display: flex; gap: 2.5rem; align-items: center; }
.nav__link { font-size: 0.82rem; opacity: 0.8; transition: opacity 0.3s; }
.nav__link:hover { opacity: 1; }
.nav__burger { display: none; flex-direction: column; gap: 6px; width: 28px; padding: 4px 0; }
.nav__burger span { display: block; height: 2px; background: currentColor; border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
.nav__burger.active span:first-child { transform: translateY(8px) rotate(45deg); }
.nav__burger.active span:last-child { transform: translateY(-8px) rotate(-45deg); }


.mobile-menu { position: fixed; inset: 0; z-index: 99; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem; opacity: 0; pointer-events: none; transition: opacity 0.4s; }
.mobile-menu.open { opacity: 1; pointer-events: all; }
.mobile-menu__link { font-family: var(--serif); font-size: 2rem; }

/* === HERO === */
.hero { position: relative; width: 100%; height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.hero__video-bg { position: absolute; inset: -10% 0; z-index: 0; overflow: hidden; }
.hero__video-bg video, .hero__fallback { width: 100%; height: 100%; object-fit: cover; }
.hero__fallback { background: linear-gradient(180deg, #c47a1a 0%, #d4891f 20%, #c87d18 40%, #b06a12 55%, #7a3a1a 70%, #3d1a10 85%, #1a0c08 100%); }
.hero__video-bg::before { content: ''; position: absolute; inset: 0; background: #000; opacity: var(--hero-overlay, 0.4); z-index: 1; }
.hero__video-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, var(--hero-fade, #0a0a0a) 100%); z-index: 2; }
.hero__content { position: relative; z-index: 3; flex: 1; display: flex; align-items: center; justify-content: center; }
.hero__center { text-align: center; opacity: 0; animation: heroFade 1.2s 0.3s cubic-bezier(0.16,1,0.3,1) forwards; }
.hero__name { font-family: var(--serif); font-size: clamp(4rem,12vw,10rem); letter-spacing: -0.03em; line-height: 0.95; }
.hero__subtitle { margin-top: 1rem; font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; opacity: 0.7; line-height: 1.8; }
.hero__disciplines { position: relative; z-index: 3; display: flex; justify-content: space-between; padding: 1.8rem 3rem; border-top: 1px solid var(--border); }
.hero__discipline { font-size: 0.68rem; letter-spacing: 0.25em; text-transform: uppercase; opacity: 0.6; }
@keyframes heroFade { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* === SECTIONS === */
.section { padding: 8rem 3rem; max-width: 1400px; margin: 0 auto; }
.section-label { font-size: 0.62rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 1.5rem; }
.section-title { font-family: var(--serif); font-size: clamp(2.5rem,5vw,4.5rem); letter-spacing: -0.03em; line-height: 1.05; }
.section-title em { font-style: italic; }
.divider { width: 100%; height: 1px; background: var(--border); }

/* === PROJECTS GRID === */
.work__header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 4rem; flex-wrap: wrap; gap: 2rem; }
.filters { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.filter { padding: 0.55rem 1.2rem; font-size: 0.72rem; border: 1px solid var(--border); border-radius: 100px; color: var(--text-muted); transition: all 0.35s; }
.filter:hover { border-color: var(--text-muted); color: var(--text); }
.filter.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.project-card { position: relative; overflow: hidden; border-radius: 6px; cursor: pointer; }
.project-card__media { position: relative; overflow: hidden; }
.project-card__media { aspect-ratio: 16/10; }
.project-card__img-wrap { width: 100%; height: 120%; position: absolute; top: -10%; }
.project-card__img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s cubic-bezier(0.16,1,0.3,1); }
.project-card:hover .project-card__img { transform: scale(1.03); }
.ph-1 { background: linear-gradient(135deg, #1a1520, #2a1f35, #0f0a0a); }
.ph-2 { background: linear-gradient(160deg, #0a1520, #152535, #0a1018); }
.ph-3 { background: linear-gradient(145deg, #1a1a0a, #252010, #151008); }
.ph-4 { background: linear-gradient(150deg, #0f1a18, #0a2520, #0a0f0f); }
.project-card__overlay { position: absolute; inset: 0; background: transparent; display: flex; flex-direction: column; justify-content: flex-end; padding: 2rem; z-index: 2; }
.project-card__overlay-title { font-family: var(--serif); font-size: 1.6rem; transform: translateY(10px); opacity: 0; transition: all 0.5s cubic-bezier(0.16,1,0.3,1); }
.project-card:hover .project-card__overlay-title { transform: translateY(0); opacity: 1; }
.project-card__overlay-meta { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(245,240,235,0.5); transform: translateY(10px); opacity: 0; transition: all 0.5s 0.05s cubic-bezier(0.16,1,0.3,1); }
.project-card:hover .project-card__overlay-meta { transform: translateY(0); opacity: 1; }
.project-card__info { padding: 1.1rem 0.2rem; display: flex; align-items: center; justify-content: space-between; }
.project-card__title { font-family: var(--serif); font-size: 1.05rem; }
.project-card__meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }
.project-card__tag { font-size: 0.62rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-muted); }
.project-card.hidden { display: none; }

/* Card size variants */
.project-card--wide { grid-column: span 2; }
.project-card--wide .project-card__media { aspect-ratio: 2.35/1; }
.project-card--wide .project-card__overlay { padding: 2.5rem 3rem; }
.project-card--wide .project-card__overlay-title { font-size: 2.2rem; }
.project-card--tall { grid-row: span 2; }
.project-card--tall .project-card__media { aspect-ratio: auto; height: 100%; }
.project-card--tall .project-card__img-wrap { height: 100%; position: relative; top: 0; }
.project-card--tall .project-card__img { height: 100%; }
.project-card--normal .project-card__media { aspect-ratio: 16/10; }

/* CTA Button below projects */
.work__cta { text-align: center; margin-top: 4rem; }
.cta-btn { display: inline-flex; align-items: center; gap: 0.75rem; padding: 1rem 2.5rem; border: 1px solid var(--border); border-radius: 100px; font-size: 0.8rem; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; transition: all 0.4s; }
.cta-btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.cta-btn svg { transition: transform 0.3s; }
.cta-btn:hover svg { transform: translateX(4px); }

/* === ABOUT === */
.about__intro-row { display: grid; grid-template-columns: 1.2fr 1fr; gap: 6rem; align-items: center; margin-top: 4rem; margin-bottom: 6rem; }
.about__intro { font-family: var(--serif); font-size: clamp(1.4rem,2.5vw,2rem); line-height: 1.5; color: var(--text-muted); margin-bottom: 2rem; }
.about__intro em { font-style: italic; color: var(--text); }
.about__body { font-size: 0.92rem; line-height: 1.9; color: var(--text-muted); margin-bottom: 2rem; }
.about__skills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.skill-tag { padding: 0.4rem 0.9rem; border: 1px solid var(--border); border-radius: 100px; font-size: 0.73rem; color: var(--text-muted); transition: all 0.3s; }
.skill-tag:hover { border-color: var(--text-muted); color: var(--text); }
.about__photo { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 8px; }
.about__card { width: 100%; aspect-ratio: 3/4; border-radius: 8px; background: linear-gradient(160deg, #1a1510, #0f0c08); border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.about__exp-number { font-family: var(--serif); font-size: 7rem; line-height: 1; background: linear-gradient(180deg, var(--text) 0%, rgba(245,240,235,0.15) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.about__exp-label { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-muted); margin-top: 0.75rem; }

.about__columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem; margin-bottom: 6rem; border-top: 1px solid var(--border); padding-top: 4rem; }
.about__col-title { font-size: 0.62rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 1.5rem; }
.about__entry { margin-bottom: 1.5rem; }
.about__entry-title { font-family: var(--serif); font-size: 1.05rem; margin-bottom: 0.15rem; }
.about__entry-sub { font-size: 0.82rem; color: var(--text-muted); }
.about__entry-year { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.1rem; }

.about__clients { border-top: 1px solid var(--border); padding-top: 4rem; }
.about__clients-title { font-size: 0.62rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.5rem; text-align: center; }
.about__clients-subtitle { font-size: 0.85rem; color: var(--text-muted); text-align: center; margin-bottom: 2.5rem; }
.about__logos-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2rem 3rem; align-items: start; }
.about__logo-item { display: flex; flex-direction: column; align-items: center; text-align: center; }
.about__logo { aspect-ratio: 2.5/1; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; color: rgba(245,240,235,0.2); transition: all 0.3s; overflow: hidden; width: 100%; }
.about__logo img { max-width: 80%; max-height: 70%; object-fit: contain; filter: grayscale(1) brightness(2); opacity: 0.35; transition: all 0.4s; }
.about__logo-item:hover .about__logo img { opacity: 0.7; filter: grayscale(0) brightness(1); }
.about__logo-sub { font-size: 0.68rem; color: var(--text-muted); margin-top: 0.4rem; letter-spacing: 0.02em; }

/* === CONTACT === */
.contact__layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 6rem; margin-top: 4rem; }
.contact__text { font-family: var(--serif); font-size: clamp(1.2rem,2vw,1.6rem); line-height: 1.6; color: var(--text-muted); margin-bottom: 3rem; }
.contact__text em { font-style: italic; color: var(--text); }
.contact__email { display: inline-block; font-family: var(--serif); font-size: clamp(1.5rem,3vw,2.5rem); position: relative; padding-bottom: 4px; }
.contact__email::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 1px; background: var(--text); transform: scaleX(0); transform-origin: right; transition: transform 0.5s cubic-bezier(0.16,1,0.3,1); }
.contact__email:hover::after { transform: scaleX(1); transform-origin: left; }
.contact__phone { display: block; font-size: 1rem; color: var(--text-muted); margin-top: 1rem; transition: color 0.3s; }
.contact__phone:hover { color: var(--text); }
.contact__social { display: flex; gap: 2.5rem; margin-top: 3rem; }
.contact__social a { font-size: 0.72rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-muted); transition: color 0.3s; }
.contact__social a:hover { color: var(--text); }
.contact__form { display: flex; flex-direction: column; gap: 0.6rem; }
.contact__form input, .contact__form textarea { width: 100%; padding: 1.1rem 0; background: transparent; border: none; border-bottom: 1px solid var(--border); color: var(--text); font-family: var(--sans); font-size: 0.9rem; outline: none; transition: border-color 0.3s; }
.contact__form input::placeholder, .contact__form textarea::placeholder { color: var(--text-muted); }
.contact__form input:focus, .contact__form textarea:focus { border-color: var(--text-muted); }
.contact__form textarea { min-height: 100px; resize: vertical; }
.contact__submit { align-self: flex-start; margin-top: 1.5rem; padding: 0.9rem 2.5rem; border: 1px solid var(--border); border-radius: 100px; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; transition: all 0.4s; }
.contact__submit:hover { background: var(--text); color: var(--bg); }
.contact__success { font-size: 1.1rem; text-align: center; padding: 2rem; color: var(--text); }

.footer { padding: 2rem 3rem; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); font-size: 0.7rem; color: var(--text-muted); }
.footer a { color: var(--text-muted); font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; transition: color 0.3s; }
.footer a:hover { color: var(--text); }

/* === PROJECT PAGE === */
.project-hero { position: relative; height: 75vh; overflow: hidden; display: flex; align-items: flex-end; z-index: 1; }
.project-hero__bg { position: absolute; inset: 0; z-index: 0; }
.project-hero__bg-inner { width: 100%; height: 120%; position: absolute; top: -10%; background-size: cover; background-position: center; }
.project-hero__bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg) 0%, rgba(10,10,10,0.15) 25%, transparent 50%); z-index: 1; }
.project-hero__content { position: relative; z-index: 2; padding: 3rem; padding-top: 6rem; width: 100%; max-width: 1400px; margin: 0 auto; }
.project-hero__back { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2rem; transition: color 0.3s; }
.project-hero__back:hover { color: var(--text); }
.project-hero__title { font-family: var(--serif); font-size: clamp(2.5rem,6vw,5rem); letter-spacing: -0.03em; line-height: 1; margin-bottom: 1rem; }
.project-hero__meta { display: flex; gap: 2.5rem; font-size: 0.75rem; color: var(--text-muted); }
.project-hero__meta span { display: flex; flex-direction: column; gap: 0.2rem; }
.project-hero__meta strong { color: var(--text); font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.65rem; }

.project-content { max-width: 1600px; margin: 0 auto; padding: 4rem 2rem 8rem; }
.project-desc { max-width: 700px; font-size: 1.05rem; line-height: 1.9; color: var(--text-muted); margin-bottom: 5rem; }

.block { margin-bottom: 1rem; }
.block-grid { display: grid; gap: 1rem; }
.block-grid[data-cols="1"] { grid-template-columns: 1fr; }
.block-grid[data-cols="2"] { grid-template-columns: 1fr 1fr; }
.block-grid[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
.block-grid[data-cols="4"] { grid-template-columns: repeat(4, 1fr); }
.block-item { position: relative; }
.block-item__img { width: 100%; display: block; border-radius: 6px; }
.block-item__video { width: 100%; display: block; border-radius: 6px; }
.video-placeholder { width: 100%; aspect-ratio: 16/9; background: #111; display: flex; align-items: center; justify-content: center; position: relative; border-radius: 6px; overflow: hidden; }
.video-placeholder__bg { position: absolute; inset: 0; opacity: 0.4; }
.block-item__play { width: 70px; height: 70px; border-radius: 50%; border: 1px solid rgba(245,240,235,0.5); display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.4); transition: background 0.3s; z-index: 2; position: relative; }
.block-item__play:hover { background: var(--text); }
.block-item__play:hover svg { fill: var(--bg); }

.next-project { display: block; border-top: 1px solid var(--border); padding: 5rem 3rem; max-width: 1400px; margin: 0 auto; text-align: center; }
.next-project__label { font-size: 0.65rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 1rem; }
.next-project__title { font-family: var(--serif); font-size: clamp(2rem,5vw,4rem); letter-spacing: -0.03em; transition: color 0.3s; }
.next-project:hover .next-project__title { color: var(--text-muted); }

/* === SCROLL REVEAL === */
.sr { opacity: 0; transform: translateY(35px); transition: opacity 1s cubic-bezier(0.16,1,0.3,1), transform 1s cubic-bezier(0.16,1,0.3,1); }
.sr.visible { opacity: 1; transform: translateY(0); }
.sr-d1 { transition-delay: 0.1s; } .sr-d2 { transition-delay: 0.2s; } .sr-d3 { transition-delay: 0.3s; } .sr-d4 { transition-delay: 0.4s; }

/* Card stagger — faster, snappier */
.project-card.sr { transition-duration: 0.7s; }

/* === VIDEO HOVER PREVIEW === */
.project-card__hover-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s; z-index: 1; }
.project-card:hover .project-card__hover-video { opacity: 1; }

/* === LAZY VIDEO === */
.block-item__video { opacity: 0; transition: opacity 0.5s; }
.block-item__video.loaded { opacity: 1; }

/* === BACK TO TOP === */
.back-to-top { position: fixed; bottom: 2rem; right: 2rem; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; background: var(--bg); color: var(--text-muted); z-index: 90; opacity: 0; transform: translateY(20px); pointer-events: none; transition: opacity 0.3s, transform 0.3s; }
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: all; }
.back-to-top:hover { border-color: var(--text); color: var(--text); }

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .nav { padding: 1.5rem; }
    .nav__links { display: none; }
    .nav__burger { display: flex; }
    .hero__disciplines { padding: 1.5rem; flex-wrap: wrap; gap: 1rem; justify-content: center; }
    .section { padding: 5rem 1.5rem; }
    .projects-grid { grid-template-columns: 1fr; }
    .project-card--wide { grid-column: span 1; }
    .project-card--wide .project-card__media { aspect-ratio: 16/10; }
    .project-card--tall { grid-row: span 1; }
    .about__intro-row { grid-template-columns: 1fr; gap: 3rem; }
    .about__columns { grid-template-columns: 1fr; gap: 2rem; }
    .about__logos-grid { grid-template-columns: repeat(3, 1fr); }
    .contact__layout { grid-template-columns: 1fr; gap: 3rem; }
    .block-grid[data-cols="3"], .block-grid[data-cols="4"] { grid-template-columns: 1fr 1fr; }
    .project-content { padding: 3rem 1rem 6rem; }
    .project-hero__content { padding: 2rem 1.5rem; }
    .footer { flex-direction: column; gap: 1rem; text-align: center; }
    /* Disable custom cursor on touch devices */
    * { cursor: auto !important; }
    a, button, [onclick], .project-card, .filter { cursor: pointer !important; }
    .cursor { display: none !important; }
}
@media (max-width: 550px) {
    .about__logos-grid { grid-template-columns: repeat(2, 1fr); }
    .block-grid[data-cols="2"], .block-grid[data-cols="3"] { grid-template-columns: 1fr; }
}
