/* ==========================================================================
   Studio — Modern Portfolio
   ========================================================================== */

:root {
    --black: #0a0a0b;
    --dark: #141416;
    --gray-900: #1a1a1d;
    --gray-800: #27272a;
    --gray-600: #52525b;
    --gray-400: #a1a1aa;
    --gray-200: #e4e4e7;
    --white: #fafafa;
    --accent: #6366f1;
    --accent-soft: #818cf8;

    --font-display: 'Space Grotesk', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;

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

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-200);
    background: var(--black);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

::selection {
    background: var(--accent);
    color: var(--white);
}

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

/* Noise Overlay */
.noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Physics Ball */
.ball {
    display: none;
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--white);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4), 0 0 40px rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: opacity 0.5s ease;
}

.ball.active {
    display: block;
    opacity: 1;
}

.ball.fade-out {
    opacity: 0;
}

/* Hero cursor style */
.hero {
    cursor: pointer;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    mix-blend-mode: difference;
}

@media (max-width: 640px) {
    .header {
        padding: 1.25rem 1.5rem;
    }
}

.logo {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--white);
    letter-spacing: -0.02em;
}

.nav {
    display: flex;
    gap: 2.5rem;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--white);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

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

@media (max-width: 640px) {
    .nav {
        gap: 1.5rem;
    }
    .nav-link {
        font-size: 0.8125rem;
    }
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8rem 3rem 4rem;
    position: relative;
}

@media (max-width: 640px) {
    .hero {
        padding: 7rem 1.5rem 3rem;
    }
}

.hero-content {
    max-width: 1200px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--white);
    max-width: 1200px;
    width: min(90vw, 1200px);
}

.hero-title-image {
    display: block;
    width: 100%;
    height: auto;
}

.hero-title .line {
    display: block;
    overflow: hidden;
}

.hero-title .line span,
.hero-title .line {
    display: block;
    transform: translateY(100%);
    animation: slideUp 1s var(--ease) forwards;
}

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

.hero-title em {
    font-style: italic;
    color: var(--accent-soft);
}

@keyframes slideUp {
    to { transform: translateY(0); }
}

.hero-sub {
    margin-top: 2rem;
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--gray-400);
    max-width: 500px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.8s var(--ease) 0.4s forwards;
}

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

.hero-scroll {
    position: absolute;
    bottom: 3rem;
    left: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    animation: fadeIn 0.8s var(--ease) 0.8s forwards;
}

.hero-scroll span {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gray-600);
    writing-mode: vertical-rl;
}

.scroll-line {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, var(--gray-600), transparent);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

@media (max-width: 640px) {
    .hero-scroll {
        display: none;
    }
}

/* Marquee */
.marquee {
    padding: 1.5rem 0;
    border-top: 1px solid var(--gray-800);
    border-bottom: 1px solid var(--gray-800);
    overflow: hidden;
}

.marquee-track {
    display: flex;
    gap: 3rem;
    animation: marquee 30s linear infinite;
    width: max-content;
}

.marquee-word {
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray-600);
    white-space: nowrap;
}

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* Sections Common */
.label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.section-header {
    padding: 0 3rem;
    margin-bottom: 3rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--white);
    letter-spacing: -0.02em;
}

@media (max-width: 640px) {
    .section-header {
        padding: 0 1.5rem;
    }
}

/* Work Section */
.work {
    padding: 6rem 0;
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--gray-800);
}

.work-item {
    background: var(--black);
    padding: 2rem;
    cursor: pointer;
    transition: background 0.4s var(--ease);
}

.work-item:hover {
    background: var(--dark);
}

.work-item--wide {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .work-grid {
        grid-template-columns: 1fr;
    }
    .work-item--wide {
        grid-column: span 1;
    }
}

.work-image {
    aspect-ratio: 16/10;
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: var(--gray-900);
    border-radius: 4px;
}

.work-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}

.work-item:hover .work-image img {
    transform: scale(1.03);
}

.work-category {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.work-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--white);
    margin-top: 0.5rem;
    letter-spacing: -0.01em;
}

/* Services */
.services {
    padding: 6rem 3rem;
    border-top: 1px solid var(--gray-800);
}

.services .section-header {
    max-width: 600px;
    margin-bottom: 4rem;
}

.services-intro {
    font-size: 1rem;
    color: var(--gray-400);
    line-height: 1.7;
    margin-top: 1rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--gray-800);
    margin-bottom: 4rem;
}

@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .services {
        padding: 4rem 1.5rem;
    }
    .services-grid {
        grid-template-columns: 1fr;
    }
}

.service-card {
    background: var(--black);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    transition: background 0.4s var(--ease);
}

.service-card:hover {
    background: var(--dark);
}

.service-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.service-card-num {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.service-card-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--white);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.service-card-desc {
    font-size: 0.9375rem;
    color: var(--gray-400);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.service-card-list {
    list-style: none;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.service-card-list li {
    font-size: 0.875rem;
    color: var(--gray-200);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-800);
    transition: color 0.2s ease;
}

.service-card:hover .service-card-list li {
    border-color: var(--gray-600);
}

.service-card-list li:last-child {
    border-bottom: none;
}

.service-card-outcome {
    font-size: 0.8125rem;
    color: var(--gray-600);
    line-height: 1.5;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-800);
}

.service-card-outcome strong {
    color: var(--accent-soft);
    font-weight: 500;
}

/* Services CTA */
.services-cta {
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--dark) 100%);
    border: 1px solid var(--gray-800);
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.services-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.5;
}

.services-cta-content {
    max-width: 500px;
    margin: 0 auto;
}

.services-cta-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--white);
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.services-cta-text {
    font-size: 1rem;
    color: var(--gray-400);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.services-cta-btn {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--white);
    padding: 1rem 2rem;
    background: var(--accent);
    border-radius: 100px;
    transition: all 0.3s var(--ease);
}

.services-cta-btn:hover {
    background: var(--accent-soft);
    transform: translateY(-2px);
}

@media (max-width: 640px) {
    .services-cta {
        padding: 2rem 1.5rem;
    }
}

/* Philosophy */
.philosophy {
    padding: 8rem 3rem;
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--gray-800);
}

.philosophy-content {
    max-width: 800px;
    text-align: center;
}

.philosophy-text {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 500;
    line-height: 1.4;
    color: var(--white);
    letter-spacing: -0.02em;
}

@media (max-width: 640px) {
    .philosophy {
        padding: 5rem 1.5rem;
    }
}

/* About */
.about {
    padding: 6rem 3rem;
    border-top: 1px solid var(--gray-800);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1200px;
}

@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 640px) {
    .about {
        padding: 4rem 1.5rem;
    }
}

.about-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    line-height: 1.2;
    color: var(--white);
    letter-spacing: -0.02em;
}

.about-text {
    font-size: 1rem;
    color: var(--gray-400);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.about-services {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.service {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-800);
}

.service-num {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
}

.service-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-200);
}

/* Contact */
.contact {
    padding: 8rem 3rem;
    border-top: 1px solid var(--gray-800);
    text-align: center;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

.contact-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
}

.contact-email {
    display: inline-block;
    font-family: var(--font-display);
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 500;
    color: var(--accent-soft);
    padding: 1rem 2rem;
    border: 1px solid var(--gray-800);
    border-radius: 100px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.3s var(--ease);
}

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

.email-copied-bubble {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 1rem);
    transform: translateX(-50%) translateY(10px) scale(0.9);
    background: var(--accent);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 100px;
    font-size: 0.875rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s var(--ease);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.email-copied-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--accent);
}

.contact-email.copied .email-copied-bubble {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}
@media (max-width: 640px) {
    .contact {
        padding: 5rem 1.5rem;
    }
}

/* Footer */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 3rem;
    border-top: 1px solid var(--gray-800);
}

.footer-left span {
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.footer-right {
    display: flex;
    gap: 2rem;
}

.footer-link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-400);
    transition: color 0.2s ease;
}

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

@media (max-width: 640px) {
    .footer {
        flex-direction: column;
        gap: 1.5rem;
        padding: 2rem 1.5rem;
        text-align: center;
    }
    .footer-right {
        gap: 1.5rem;
    }
}

/* Reveal Animations */
[data-reveal] {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

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

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    .hero-title .line,
    .hero-sub,
    .hero-scroll,
    [data-reveal] {
        opacity: 1;
        transform: none;
    }
}
