/* ============================================
   BODI -- Production Studio Website
   Dark, cinematic, editorial. Not a product page.
   ============================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- Tokens --- */
:root {
    --black: #000000;
    --bg: #080808;
    --surface: #0f0f0f;
    --surface-2: #161616;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --white: #ffffff;
    --text: #c8c8c8;
    --text-dim: #777777;
    --text-muted: #444444;
    --accent: #d0d0d0;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', monospace;

    --ease: cubic-bezier(0.16, 1, 0.3, 1);

    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 3rem;
    --space-xl: 5rem;
    --space-2xl: 8rem;
    --space-3xl: 12rem;

    --nav-h: 64px;
    --radius: 4px;
}

/* --- Base --- */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}

::selection {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

/* --- Grain --- */
.grain {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: 0.025;
    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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 128px;
}

/* --- Loading --- */
.loading {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--black);
    transition: opacity 0.8s var(--ease);
}

.loading.done {
    opacity: 0;
    pointer-events: none;
}

.loading-logo {
    height: 28px;
    width: auto;
    animation: loadPulse 1.4s ease-in-out infinite;
}

@keyframes loadPulse {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 1; }
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-h);
    z-index: 100;
    mix-blend-mode: difference;
    transition: mix-blend-mode 0.3s;
}

.nav.solid {
    mix-blend-mode: normal;
    background: rgba(8, 8, 8, 0.9);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.nav-inner {
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
}

.nav-logo-img {
    height: 20px;
    width: auto;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav-links {
    display: flex;
    gap: var(--space-lg);
}

.nav-link {
    font-size: 0.8125rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--white);
    opacity: 0.6;
    transition: opacity 0.2s;
}

.nav-link:hover { opacity: 1; }

/* Language toggle */
.lang-toggle {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    padding: 0.3rem 0.6rem;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-toggle:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

/* Mobile toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 1px;
    background: var(--white);
    transition: all 0.3s;
}

.nav-toggle.active span:first-child { transform: translateY(3px) rotate(45deg); }
.nav-toggle.active span:last-child { transform: translateY(-3px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 99;
    background: var(--black);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease);
}

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

.mobile-menu-link {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    color: var(--white);
    opacity: 0.5;
    transition: opacity 0.2s;
}

.mobile-menu-link:hover { opacity: 1; }

/* ============================================
   HERO -- Full-viewport, cinematic
   ============================================ */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to bottom, transparent, var(--bg));
    z-index: 2;
    pointer-events: none;
}

.hero-bg-img {
    position: absolute;
    inset: -20%;
    z-index: 0;
    will-change: transform;
}

.hero-bg-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
    opacity: 0.35;
    filter: brightness(0.6) contrast(1.1);
}

.hero-grid-pattern {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 10%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 10%, transparent 70%);
}

.hero-glow {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    z-index: 1;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 60%);
    filter: blur(60px);
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 0 var(--space-md) var(--space-3xl);
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.hero-title-line {
    display: block;
    font-size: clamp(4rem, 12vw, 9rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: var(--white);
    opacity: 0;
    transform: translateY(60px);
    animation: heroUp 1s var(--ease) forwards;
}

.hero-title-line:nth-child(1) { animation-delay: 0.3s; }
.hero-title-line:nth-child(2) { animation-delay: 0.45s; }

.hero-title-accent {
    opacity: 0;
    color: var(--text-dim);
}

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

/* Scroll cue */
.scroll-cue {
    position: absolute;
    bottom: var(--space-md);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.scroll-cue-line {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent);
    animation: scrollPulse 2.5s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.2; transform: scaleY(0.5); transform-origin: top; }
    50% { opacity: 0.6; transform: scaleY(1); }
}

/* ============================================
   SHARED
   ============================================ */
.section {
    padding: var(--space-2xl) 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.container--narrow {
    max-width: 720px;
}

.container--narrow-lg {
    max-width: 860px;
}

/* ============================================
   CONCEPT -- Tagline + sub
   ============================================ */
.concept {
    position: relative;
    padding: var(--space-xl) 0 var(--space-3xl);
    z-index: 2;
    border-bottom: 1px solid var(--border);
}

.concept-inner {
    text-align: center;
}

.concept-tagline {
    font-size: clamp(1.5rem, 3.5vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--white);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
    white-space: nowrap;
}

.concept-sub {
    font-size: clamp(0.9375rem, 1.5vw, 1.125rem);
    font-weight: 300;
    line-height: 1.7;
    color: var(--text-dim);
    letter-spacing: 0.01em;
}

/* Section headings */
.section-heading {
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
}

/* ============================================
   TECHNOLOGY -- 4 capabilities
   ============================================ */
.technology {
    border-bottom: 1px solid var(--border);
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.tech-card {
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

.tech-card-media {
    overflow: hidden;
}

.tech-card-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    filter: grayscale(0.2);
    transition: filter 0.4s, transform 0.6s var(--ease);
}

.tech-card:hover .tech-card-img {
    filter: grayscale(0);
    transform: scale(1.03);
}

.tech-card-body {
    padding: var(--space-md);
}

.tech-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: var(--space-xs);
    letter-spacing: -0.01em;
}

.tech-card-text {
    font-size: 0.8125rem;
    font-weight: 300;
    line-height: 1.7;
    color: var(--text-dim);
}

/* ============================================
   WORK -- Case study
   ============================================ */
.work {
    padding-top: var(--space-xl);
}

/* --- Project card --- */
.project {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: start;
}

.project:nth-child(even) {
    direction: rtl;
}

.project:nth-child(even) > * {
    direction: ltr;
}

.project--featured {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.project--featured .project-img {
    aspect-ratio: 21/9;
}

.project-media {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
}

.project-img {
    width: 100%;
    aspect-ratio: 21/9;
    object-fit: cover;
    display: block;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: border-color 0.3s;
}

.project:hover .project-img {
    border-color: var(--border-hover);
}

.project-copyright {
    display: block;
    text-align: right;
    margin-top: 6px;
    font-size: 0.5rem;
    font-family: var(--font-mono);
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.02em;
    line-height: 1;
}

.project-info {
    padding-top: var(--space-sm);
}

.project-tag {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.6875rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.project-title {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    color: var(--white);
    line-height: 1.15;
    margin-bottom: var(--space-xs);
    letter-spacing: -0.01em;
}

.project-meta {
    font-size: 0.8125rem;
    color: var(--text-dim);
    margin-bottom: var(--space-md);
}

.project-description {
    font-size: 0.9375rem;
    font-weight: 300;
    line-height: 1.8;
    color: var(--text-dim);
    max-width: 520px;
}

/* ============================================
   ABOUT -- Manifesto
   ============================================ */
.about {
    border-top: 1px solid var(--border);
}

.manifesto-text {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    font-weight: 300;
    line-height: 2;
    color: var(--text-dim);
}

.manifesto-text strong {
    color: var(--white);
    font-weight: 600;
}

.manifesto-text a {
    color: var(--white);
    text-decoration: underline;
    text-underline-offset: 0.2em;
    text-decoration-color: rgba(255, 255, 255, 0.3);
    transition: text-decoration-color 0.2s;
}

.manifesto-text a:hover {
    text-decoration-color: var(--white);
}

/* ============================================
   CONTACT -- Simple, confident
   ============================================ */
.contact {
    padding: var(--space-3xl) 0;
}

.contact-inner {
    text-align: center;
}

.contact-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 300;
    color: var(--white);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-lg);
}

.contact-email {
    display: inline-block;
    font-family: var(--mono);
    font-size: clamp(0.875rem, 1.5vw, 1.125rem);
    font-weight: 400;
    color: var(--white);
    letter-spacing: 0.05em;
    padding: 1rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 100px;
    transition: all 0.3s var(--ease);
}

.contact-email:hover {
    border-color: var(--white);
    background: var(--white);
    color: var(--black);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    padding: var(--space-lg) 0 var(--space-md);
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.footer-brand {
    display: flex;
    align-items: center;
}

.footer-logo-img {
    height: 18px;
    width: auto;
    opacity: 0.6;
}

.footer-links {
    display: flex;
    gap: var(--space-md);
}

.footer-link {
    font-size: 0.75rem;
    color: var(--text-dim);
    transition: color 0.2s;
}

.footer-link:hover { color: var(--white); }

.footer-social {
    display: flex;
    gap: var(--space-sm);
}

.social-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color 0.2s;
}

.social-icon:hover { color: var(--white); }

.footer-bottom {
    text-align: center;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border);
}

.footer-bottom p {
    font-size: 0.6875rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* ============================================
   ANIMATIONS
   ============================================ */
[data-animate] {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

[data-animate].visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media (max-width: 768px) {
    :root { --nav-h: 56px; }

    .nav-links { display: none; }
    .lang-toggle { font-size: 0.625rem; }
    .nav-toggle { display: flex; }

    .hero { align-items: center; justify-content: center; }

    .hero-content {
        padding: 0 var(--space-md);
        text-align: center;
    }

    .hero-title-line {
        font-size: clamp(3rem, 14vw, 5rem);
    }

    .concept { padding: var(--space-2xl) 0; }
    .concept-tagline { white-space: normal; }

    .tech-grid { grid-template-columns: 1fr; }
    .tech-card-body { padding: var(--space-md); }

    .project {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .project:nth-child(even) { direction: ltr; }

    .project--featured .project-img { aspect-ratio: 16/9; }


    .footer-inner {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .footer-brand {
        align-items: center;
    }

    .section { padding: var(--space-xl) 0; }
}
