/* ═══════════════════════════════════════════════════
   COMMON.CSS — Day 2 Films Shared Base Styles
   Single source of truth for reset, variables,
   navigation, reveal animations, footer, transitions
   ═══════════════════════════════════════════════════ */

/* ─── RESET ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ─── CSS VARIABLES ─── */
:root {
    /* Canonical (Tier 1) names */
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #161616;
    --bg-elevated: #1a1a1a;
    --text-primary: #f0ebe3;
    --text-secondary: #8a8478;
    --text-muted: #5a564e;
    --text-mid: #8a8478;
    --accent: #c8a456;
    --accent-bright: #e4c577;
    --accent-dim: #8a7239;
    --red-accent: #c45c4a;
    --border: #2a2620;
    --border-light: #3a362e;
    --font-display: 'Bebas Neue', sans-serif;
    --font-serif: 'Cormorant Garamond', serif;
    --font-body: 'DM Sans', sans-serif;
    --grain-opacity: 0.03;

    /* Aliases for location page compatibility */
    --bg-dark: var(--bg-primary);
    --bg-mid: var(--bg-secondary);
    --bg-light: var(--bg-card);
    --text: var(--text-primary);
    --text-dim: var(--text-muted);
    --accent-light: var(--accent-bright);
    --accent-dark: var(--accent-dim);

    /* Phase 2: Cinematic complementary tones */
    --teal: #1a4a4a;
    --teal-glow: rgba(26, 74, 74, 0.12);
    --warm-glow: rgba(180, 90, 30, 0.06);
}

/* ─── HTML / BODY ─── */
html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-dim) var(--bg-primary);
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    animation: pageIn 0.6s ease forwards;
}

/* Film grain overlay */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    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='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    opacity: var(--grain-opacity);
    pointer-events: none;
    z-index: 9999;
}

::selection {
    background: var(--accent);
    color: var(--bg-primary);
}

a { color: inherit; text-decoration: none; }

/* ─── REVEAL ANIMATIONS ─── */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Film credit-style clip-path wipe for section titles */
.section-title.reveal,
.reveal .section-title {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.section-title.reveal.visible,
.reveal.visible .section-title {
    clip-path: inset(0 0% 0 0);
}

/* Staggered reveals for grid children */
.services-grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.services-grid .reveal:nth-child(3) { transition-delay: 0.2s; }
.services-grid .reveal:nth-child(4) { transition-delay: 0.15s; }
.services-grid .reveal:nth-child(5) { transition-delay: 0.25s; }
.services-grid .reveal:nth-child(6) { transition-delay: 0.3s; }

.portfolio-grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.portfolio-grid .reveal:nth-child(3) { transition-delay: 0.2s; }
.portfolio-grid .reveal:nth-child(4) { transition-delay: 0.1s; }
.portfolio-grid .reveal:nth-child(5) { transition-delay: 0.2s; }
.portfolio-grid .reveal:nth-child(6) { transition-delay: 0.3s; }
.portfolio-grid .reveal:nth-child(7) { transition-delay: 0.1s; }
.portfolio-grid .reveal:nth-child(8) { transition-delay: 0.2s; }
.portfolio-grid .reveal:nth-child(9) { transition-delay: 0.3s; }

/* ─── NAVIGATION (Tier 1 — main pages with #navbar) ─── */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 1.25rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.5s ease;
    background: linear-gradient(180deg, rgba(10,10,10,0.85) 0%, rgba(10,10,10,0.4) 70%, transparent 100%);
}

nav.scrolled {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0.8rem 3rem;
    border-bottom: 1px solid var(--border);
}

/* Tier 4 location nav override — solid background, no scroll effect */
nav.nav {
    background: rgba(10,10,10,0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 18px 40px;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.8rem;
    letter-spacing: 3px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

/* Location-page logo style (text-only, no SVG) */
nav.nav .nav-logo {
    font-size: 1.6rem;
    color: var(--accent);
    text-shadow: none;
}

.nav-logo .day { color: var(--accent); }

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    list-style: none;
}

.nav-links a {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-primary);
    transition: color 0.3s;
    position: relative;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* Gold underline grows from center on hover */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s ease, left 0.3s ease;
}

.nav-links a:hover { color: var(--text-primary); }
.nav-links a:hover::after { width: 100%; left: 0; }

/* Location nav link overrides */
nav.nav .nav-links {
    gap: 28px;
}
nav.nav .nav-links a {
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-shadow: none;
}
nav.nav .nav-links a::after { display: none; }
nav.nav .nav-links a:hover { color: var(--accent); }

.nav-phone {
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 1.5px;
    color: var(--accent) !important;
}
.nav-phone::after { display: none !important; }

nav.nav .nav-phone {
    font-family: var(--font-body);
    font-size: inherit;
    letter-spacing: inherit;
    font-weight: 600;
}

/* ─── MOBILE TOGGLE ─── */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
}
.mobile-toggle span {
    width: 28px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
}

.mobile-menu {
    display: none;
}

/* Hamburger pattern (service/case-study pages) */
.hamburger,
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
}
.hamburger span,
.nav-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
}

.mobile-service-link { display: none; }

/* ─── DROPDOWN MENU ─── */
.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(10,10,10,0.97);
    border: 1px solid var(--border);
    min-width: 220px;
    padding: 0.5rem 0;
    z-index: 1001;
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 0.6rem 1.5rem;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.dropdown-menu a:hover {
    color: var(--accent);
    background: rgba(200,164,86,0.05);
}

.dropdown-menu a::after {
    display: none;
}

/* ─── COMMON BUTTONS ─── */
.btn {
    display: inline-block;
    padding: 14px 36px;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-body);
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

.btn-primary {
    display: inline-block;
    padding: 0.9rem 2.5rem;
    background: var(--accent);
    color: var(--bg-primary);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}
.btn-primary:hover {
    background: var(--accent-bright);
    transform: translateY(-2px);
}

/* ─── SECTION LABELS ─── */
.section-label {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-label::after {
    content: '';
    flex: 0 0 40px;
    height: 1px;
    background: var(--accent-dim);
}

/* ─── SECTION DIVIDERS ─── */
.section-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
    border: none;
}

/* ─── FOOTER ─── */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 3rem;
    text-align: center;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    letter-spacing: 3px;
}
.footer-logo .day { color: var(--accent); }

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.3s;
}
.footer-links a:hover { color: var(--accent); }

/* Location page simple footer */
nav.nav ~ footer {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* ─── PAGE TRANSITIONS ─── */
.page-transition {
    position: fixed;
    inset: 0;
    background: #0a0a0a;
    z-index: 99998;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.page-transition.active {
    opacity: 1;
}

@keyframes pageIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ─── ANIMATED SVG LOGO ─── */
.nav-logo-svg {
    overflow: visible;
}
.nav-logo-svg text {
    opacity: 0;
    animation: logoReveal 0.8s ease forwards;
}
.nav-logo-svg .logo-text-gold {
    animation-delay: 0.2s;
}
.nav-logo-svg .logo-text-white {
    animation-delay: 0.5s;
}
@keyframes logoReveal {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── PHASE 2: MICRO-INTERACTIONS ─── */

/* Service cards: gold glow on hover */
.service-card {
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.service-card:hover {
    box-shadow: 0 0 40px rgba(200,164,86,0.08);
}

/* Portfolio thumbnails: subtle scale on hover */
.portfolio-item,
.video-card,
.work-item {
    transition: transform 0.6s ease, border-color 0.3s;
}
.portfolio-item:hover,
.video-card:hover,
.work-item:hover {
    transform: scale(1.05);
}

/* CTA buttons: gold glow pulse on hover */
.hero-cta:hover,
.btn-primary:hover,
.form-submit:hover {
    box-shadow: 0 10px 30px rgba(200, 164, 86, 0.2);
}

/* Trusted-by marquee animation */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.trusted-names-track {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    animation: marquee 30s linear infinite;
    width: max-content;
}

.trusted-names-track span {
    white-space: nowrap;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.trusted-names-track span::after {
    content: '';
    width: 1px;
    height: 14px;
    background: var(--border-light);
    flex-shrink: 0;
}

/* ─── STICKY CTA ─── */
.sticky-cta {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9990;
    background: var(--accent);
    color: var(--bg-primary);
    font-family: var(--font-display);
    font-size: 0.95rem;
    letter-spacing: 3px;
    padding: 0.9rem 2rem;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(200, 164, 86, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease, background 0.3s ease, box-shadow 0.3s ease;
    pointer-events: none;
}
.sticky-cta.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.sticky-cta:hover {
    background: var(--accent-bright);
    box-shadow: 0 6px 30px rgba(200, 164, 86, 0.4);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    nav { padding: 1rem 1.5rem; }
    nav.scrolled { padding: 0.8rem 1.5rem; }
    .nav-links { display: none; }
    .mobile-toggle { display: flex; }
    .hamburger, .nav-hamburger { display: flex; }

    .mobile-menu {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(10,10,10,0.98);
        z-index: 999;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
    }

    .mobile-menu.active { display: flex; }

    .mobile-menu a {
        font-family: var(--font-display);
        font-size: 2rem;
        letter-spacing: 3px;
        color: var(--text-primary);
        transition: color 0.3s;
    }

    .mobile-menu a:hover { color: var(--accent); }

    /* Service/case-study mobile nav (uses .nav-links.open) */
    .nav-links.open {
        display: flex;
        position: fixed;
        inset: 0;
        background: rgba(10,10,10,0.98);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        z-index: 999;
        list-style: none;
    }
    .nav-links.open a {
        font-size: 1.3rem;
        color: var(--text-primary);
    }
    .nav-links.open .mobile-service-link { display: list-item; }

    .footer-inner { flex-direction: column; gap: 1.5rem; text-align: center; }

    /* Sticky CTA — full width bar on mobile */
    .sticky-cta {
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;
        border-radius: 0;
    }

    /* Location page mobile nav */
    nav.nav { padding: 12px 20px; }
    nav.nav .nav-links { display: none; }
}

@media (max-width: 1024px) {
    .footer-inner { flex-direction: column; gap: 1.5rem; text-align: center; }
}
