html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 0 5vw; }

header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 24px 5vw;
    display: flex; align-items: center; justify-content: space-between;
    background: transparent;
    transition: padding 0.5s var(--ease-out-expo), background-color 0.4s var(--ease-in-out), border-color 0.4s var(--ease-in-out);
}
header.scrolled {
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 16px 5vw;
}
.brand span { font-family: var(--font-display); font-size: 1.15rem; font-weight: 500; letter-spacing: 0.02em; }
#theme-toggle { width: 44px; height: 44px; }
#theme-toggle svg { width: 18px; height: 18px; transition: transform 0.6s var(--ease-spring); }
#theme-toggle:hover svg { transform: rotate(45deg); }

.portfolio-btn {
    display: flex; align-items: center; justify-content: center;
    height: 44px; padding: 0 20px; border-radius: 22px;
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
    text-decoration: none; font-size: 0.85rem; font-weight: 500;
    transition: background-color 0.4s var(--ease-in-out), border-color 0.3s var(--ease-out-expo),
    color 0.3s var(--ease-out-expo), transform 0.35s var(--ease-spring);
}
.portfolio-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.portfolio-btn:active { transform: scale(0.96); transition-duration: 0.12s; }

.hero { min-height: 100vh; display: flex; align-items: center; justify-content: space-between; gap: 64px; padding-top: 80px; }
.hero-content { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; max-width: 800px; z-index: 2; }
.studio-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(4rem, 10vw, 8.5rem); line-height: 0.9; letter-spacing: -0.03em; }
.tagline { font-family: var(--font-display); font-weight: 300; font-size: clamp(1.5rem, 3vw, 2.8rem); letter-spacing: -0.01em; line-height: 1.1; color: var(--muted); max-width: 26ch; }
.lede { font-size: clamp(1rem, 1.5vw, 1.25rem); font-weight: 300; color: var(--muted); max-width: 58ch; line-height: 1.7; }

.hero-visual { position: relative; flex-shrink: 0; width: clamp(200px, 25vw, 400px); height: clamp(200px, 25vw, 400px); perspective: 1000px; }
.hero-glow {
    position: absolute; top: 50%; left: 50%; width: 225%; height: 225%; /* 150% de la caja + 1.5× de margen para la cola del desenfoque */
    background-color: var(--glow);
    -webkit-mask: url(glow-mask.webp) center / 100% 100% no-repeat;
    mask: url(glow-mask.webp) center / 100% 100% no-repeat;
    transform: translate(-50%, -50%); z-index: 0; pointer-events: none; will-change: transform, opacity;
    transition: background-color 0.4s var(--ease-in-out);
    animation: glow-breathe 6s ease-in-out infinite;
}
@keyframes glow-breathe {
    0%, 100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}
.hero-moon { width: 100%; height: 100%; display: block; filter: invert(1); z-index: 1; position: relative; transition: filter 0.4s var(--ease-in-out); will-change: transform; backface-visibility: hidden; }
:root[data-theme="light"] .hero-moon { filter: none; }

.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8vw; padding: 100px 0; }
section h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 3vw, 2.5rem); margin-bottom: 16px; letter-spacing: -0.02em; }
.section-intro { color: var(--muted); font-size: 1.1rem; font-weight: 300; margin-bottom: 48px; max-width: 50ch; }

.timeline { position: relative; display: flex; flex-direction: column; gap: 32px; }
.timeline::before { content: ''; position: absolute; top: 8px; bottom: 8px; left: 5px; width: 1px; background: var(--border); }
.tl-item { position: relative; padding-left: 32px; display: flex; flex-direction: column; gap: 4px; }
.tl-item::before {
    content: ''; position: absolute; left: 0; top: 8px;
    width: 11px; height: 11px; border-radius: 50%;
    background: var(--bg); border: 1px solid var(--muted);
    transition: background-color 0.35s var(--ease-out-expo), border-color 0.35s var(--ease-out-expo),
    transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease-out-expo);
}
.tl-item:hover::before {
    border-color: var(--accent); background: var(--accent); transform: scale(1.4);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent);
}
.tl-item:hover .tl-name { color: var(--accent); }
.tl-date { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.tl-name { font-weight: 400; font-size: 1.3rem; font-family: var(--font-display); transition: color 0.3s var(--ease-out-expo); }

.practice { display: flex; flex-direction: column; gap: 24px; }
.practice-item {
    padding: 40px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border);
    position: relative;
    transition: background-color 0.4s var(--ease-in-out), border-color 0.35s var(--ease-out-expo),
    transform 0.5s var(--ease-spring);
}
/* La sombra vive en una capa fija y solo se anima su opacidad (va por la GPU, sin repintar) */
.practice-item::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    box-shadow: 0 24px 48px rgba(0,0,0,0.14), 0 0 0 1px color-mix(in srgb, var(--accent) 15%, transparent);
    opacity: 0; transition: opacity 0.5s var(--ease-out-expo);
}
.practice-item:hover { transform: translateY(-6px); border-color: var(--accent); }
.practice-item:hover::after { opacity: 1; }
.practice-item h3 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 400; margin-bottom: 12px; }
.practice-item p { color: var(--muted); font-size: 1.05rem; font-weight: 300; line-height: 1.6; }

.closing-section { padding: 120px 0 80px; border-top: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; text-align: center; transition: border-color 0.4s var(--ease-in-out); }
.closing-title { font-size: clamp(1.2rem, 2vw, 1.5rem); color: var(--muted); font-weight: 400; margin-bottom: 24px; text-transform: uppercase; letter-spacing: 0.1em; }
.massive-email {
    font-family: var(--font-display); font-weight: 400; font-size: clamp(1.1rem, 4.8vw, 5.5rem);
    color: var(--text); text-decoration: none; position: relative; margin-bottom: 80px;
    transition: color 0.35s var(--ease-out-expo); max-width: 100%; display: inline-block; white-space: nowrap;
}
.massive-email::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: var(--accent);
    transform: scaleX(0); transform-origin: right; transition: transform 0.5s var(--ease-out-expo);
}
.massive-email:hover { color: var(--accent); }
.massive-email:hover::after { transform: scaleX(1); transform-origin: left; }

.social-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 32px 48px; max-width: 900px; }
.social-link {
    display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 1.15rem; font-weight: 500;
    text-decoration: none; position: relative;
    transition: color 0.3s var(--ease-out-expo), transform 0.4s var(--ease-spring);
}
.social-link svg { width: 16px; height: 16px; opacity: 0; transform: translate(-10px, 10px); transition: opacity 0.4s var(--ease-out-expo), transform 0.4s var(--ease-spring); }
.social-link:hover { color: var(--accent); transform: translateY(-2px); }
.social-link:hover svg { opacity: 1; transform: translate(0, 0); }
.social-link:active { transform: scale(0.95); }

footer { padding: 32px 0; color: var(--muted); font-size: 0.9rem; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); transition: border-color 0.4s var(--ease-in-out); }
.legal-link { color: inherit; text-decoration: underline; text-underline-offset: 4px; }

/* Entrada con blur sutil además de fade+translate — se siente más "cinematográfico" */
.reveal {
    opacity: 0; transform: translateY(32px); filter: blur(4px); will-change: opacity, transform, filter;
    transition: opacity 0.9s var(--ease-out-expo), transform 0.9s var(--ease-out-expo), filter 0.7s var(--ease-out-expo);
}
.reveal.active { opacity: 1; transform: none; filter: none; }
.delay-1 { transition-delay: 0.08s; }
.delay-2 { transition-delay: 0.16s; }
.delay-3 { transition-delay: 0.24s; }

@media (max-width: 1024px) {
    .hero { gap: 32px; }
    .content-grid { grid-template-columns: 1fr; gap: 80px; padding: 60px 0; }
}
@media (max-width: 768px) {
    .hero { flex-direction: column-reverse; align-items: center; justify-content: center; text-align: center; padding-top: 120px; }
    .hero-content { align-items: center; }
    .hero-visual { width: 200px; height: 200px; }
    .tagline, .lede { margin-left: auto; margin-right: auto; }
    header { padding: 16px 5vw; }
    .closing-section { padding: 60px 0 40px; }
    .massive-email { margin-bottom: 48px; }
    .social-links { gap: 16px 24px; }
}
@media (max-width: 380px) {
    .massive-email { font-size: 1.1rem; }
    .social-link { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; filter: none; }
    .hero-glow { animation: none; }
}