/* ===========================================================
   SHOWROOM — CSS Base + Switcher + Transiciones
   =========================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.6s ease, color 0.6s ease;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; }

/* ===========================================================
   BACK LINK
   =========================================================== */
.back-link {
    position: fixed; top: 1.25rem; left: 1.25rem;
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1rem; border-radius: 999px;
    font-size: 0.8rem; z-index: 200;
    background: rgba(255,255,255,0.85); color: #555;
    border: 1px solid rgba(0,0,0,0.1);
    backdrop-filter: blur(12px);
    transition: all 0.3s;
}
.back-link:hover { color: #000; border-color: rgba(0,0,0,0.3); }
.back-link i { width: 14px; height: 14px; }

/* ===========================================================
   THEME SWITCHER BAR
   =========================================================== */
.theme-switcher {
    position: fixed; bottom: 1.5rem; left: 50%;
    transform: translateX(-50%);
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 999px;
    backdrop-filter: blur(20px);
    z-index: 1000;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transition: background 0.5s, border-color 0.5s;
}
.theme-folk .theme-switcher { background: rgba(250,247,242,0.95); border-color: rgba(196,101,58,0.2); }
.theme-hvac .theme-switcher { background: rgba(15,23,42,0.92); border-color: rgba(59,130,246,0.2); }

.switcher-label {
    font-size: 0.7rem; color: #888; margin-right: 0.25rem;
    font-family: 'Inter', sans-serif; white-space: nowrap;
}
.theme-hvac .switcher-label { color: #64748b; }

.theme-btn {
    display: flex; align-items: center; gap: 0.35rem;
    padding: 0.35rem 0.7rem; border: 2px solid transparent;
    border-radius: 999px; background: transparent;
    cursor: pointer; font-family: 'Inter', sans-serif;
    font-size: 0.75rem; color: #888;
    transition: all 0.3s; white-space: nowrap;
}
.theme-btn:hover { border-color: #ccc; }
.theme-hvac .theme-btn { color: #94a3b8; }
.theme-hvac .theme-btn:hover { border-color: #334155; }

.theme-btn.active {
    background: #111; color: #fff; border-color: #111;
}
.theme-hvac .theme-btn.active {
    background: #3b82f6; color: #fff; border-color: #3b82f6;
}
.theme-folk .theme-btn.active {
    background: #c4653a; color: #faf7f2; border-color: #c4653a;
}

.swatch {
    width: 12px; height: 12px; border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.08); flex-shrink: 0;
}
.sw-minimal { background: linear-gradient(135deg, #fff 50%, #111 50%); }
.sw-hvac { background: linear-gradient(135deg, #0f172a 50%, #3b82f6 50%); }
.sw-folk { background: linear-gradient(135deg, #faf7f2 50%, #c4653a 50%); }

/* ===========================================================
   TRANSICIONES DE ENTRADA / SALIDA
   =========================================================== */
#app {
    transition: opacity 0.4s ease, transform 0.4s ease;
}
#app.exiting {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
}
#app.entering .reveal-item {
    animation: stagger-in 0.6s ease forwards;
    animation-delay: calc(var(--i, 0) * 0.1s);
}

/* Reveal on scroll - 3D Fold & Slide (Apple Style) */
.reveal-item {
    opacity: 0;
    transform: translateY(60px) scale(0.96) rotateX(10deg);
    transform-origin: bottom center;
    perspective: 1200px;
    transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(var(--i, 0) * 0.08s);
}
.reveal-item.visible {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0);
}

@keyframes stagger-in {
    from { opacity: 0; transform: translateY(50px) scale(0.95) rotateX(10deg); }
    to { opacity: 1; transform: translateY(0) scale(1) rotateX(0); }
}

/* ===========================================================
   TEMA 1: ESTUDIO (Minimal)
   =========================================================== */
.theme-minimal { background: #fff; color: #111; font-family: Georgia, 'Times New Roman', serif; }

.mn-page { max-width: 860px; margin: 0 auto; padding: 0 2rem 6rem; }

/* Hero */
.mn-hero {
    min-height: 85vh; display: flex; flex-direction: column;
    justify-content: center; align-items: center; text-align: center;
    padding: 4rem 0;
}
.mn-eyebrow {
    font-family: 'Inter', sans-serif; font-size: 0.7rem;
    text-transform: uppercase; letter-spacing: 0.2em; color: #aaa;
    margin-bottom: 2rem;
}
.mn-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(3rem, 10vw, 7rem); font-weight: 700;
    line-height: 0.95; letter-spacing: -0.03em; color: #111;
    transform: translateY(calc(var(--scroll, 0) * 0.15px));
    will-change: transform;
}
.mn-role {
    margin-top: 1.5rem; font-size: 1rem; color: #999;
    letter-spacing: 0.15em; font-family: 'Inter', sans-serif;
    font-weight: 300;
}

/* About */
.mn-about { padding: 6rem 0; border-top: 1px solid #e8e8e8; }
.mn-about-inner { max-width: 640px; }
.mn-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 600;
    line-height: 1.3; margin-bottom: 1.5rem; color: #111;
}
.mn-text { font-size: 1rem; line-height: 1.9; color: #555; margin-bottom: 2rem; }
.mn-stats { display: flex; gap: 3rem; }
.mn-stat { text-align: left; }
.mn-num {
    display: block; font-family: 'Playfair Display', serif;
    font-size: 2.5rem; font-weight: 700; color: #111; line-height: 1;
}
.mn-label { font-family: 'Inter', sans-serif; font-size: 0.75rem; color: #999; text-transform: uppercase; letter-spacing: 0.1em; }

/* Work */
.mn-work { padding: 4rem 0; border-top: 1px solid #e8e8e8; }
.mn-section-label {
    font-family: 'Inter', sans-serif; font-size: 0.7rem;
    text-transform: uppercase; letter-spacing: 0.2em; color: #aaa;
    margin-bottom: 2.5rem;
}
.mn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.mn-grid .mn-project:first-child { grid-column: 1 / -1; }

.mn-img-wrap {
    position: relative; overflow: hidden; aspect-ratio: 16/10;
    background: #f5f5f5; cursor: pointer;
}
.mn-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.mn-img-wrap:hover img { transform: scale(1.05); }

.mn-overlay {
    position: absolute; inset: 0; padding: 2rem;
    display: flex; flex-direction: column; justify-content: flex-end;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
    opacity: 0; transition: opacity 0.4s ease; color: #fff;
}
.mn-img-wrap:hover .mn-overlay, .mn-overlay.always-visible { opacity: 1; }
.mn-overlay .mn-proj-tag {
    font-family: 'Inter', sans-serif; font-size: 0.65rem;
    text-transform: uppercase; letter-spacing: 0.15em;
    color: rgba(255,255,255,0.7); margin-bottom: 0.4rem;
}
.mn-overlay h3 { font-family: 'Playfair Display', serif; font-size: 1.25rem; margin-bottom: 0.3rem; }
.mn-overlay p { font-size: 0.8rem; color: rgba(255,255,255,0.8); line-height: 1.5; font-family: 'Inter', sans-serif; }

.mn-img-wrap.placeholder { background: #f0f0f0; }

/* Contact */
.mn-contact {
    padding: 6rem 0; border-top: 1px solid #e8e8e8; text-align: center;
}
.mn-contact .mn-text { color: #888; margin-bottom: 1.5rem; }
.mn-cta {
    display: inline-block; padding: 0.9rem 2.5rem;
    border: 1px solid #111; color: #111;
    font-family: 'Inter', sans-serif; font-size: 0.85rem;
    transition: all 0.3s;
}
.mn-cta:hover { background: #111; color: #fff; }

.mn-footer {
    text-align: center; padding: 2rem 0; border-top: 1px solid #e8e8e8;
}
.mn-footer p { font-family: 'Inter', sans-serif; font-size: 0.75rem; color: #bbb; }
.mn-footer strong { color: #888; }

/* ===========================================================
   TEMA 2: INDUSTRIAL (HVAC)
   =========================================================== */
.theme-hvac {
    background: #0f172a; color: #e2e8f0;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

.hv-page { max-width: 1000px; margin: 0 auto; padding: 0 2rem 6rem; }

/* Hero */
.hv-hero {
    min-height: 80vh; display: flex; flex-direction: column;
    justify-content: center; padding: 5rem 0 3rem;
}
.hv-hero-content { max-width: 600px; transform: translateY(calc(var(--scroll, 0) * 0.15px)); will-change: transform; }
.hv-badge {
    display: inline-block; padding: 0.3rem 0.9rem; border-radius: 999px;
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.1em; background: rgba(59,130,246,0.15);
    color: #60a5fa; border: 1px solid rgba(59,130,246,0.2);
    margin-bottom: 1.5rem;
}
.hv-title {
    font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 700;
    line-height: 1.05; color: #f1f5f9; margin-bottom: 1rem;
}
.hv-accent { color: #3b82f6; }
.hv-subtitle { font-size: 1.05rem; color: #94a3b8; line-height: 1.6; margin-bottom: 2rem; max-width: 500px; }

.hv-hero-btns { display: flex; gap: 1rem; flex-wrap: wrap; }
.hv-btn-primary {
    padding: 0.8rem 2rem; background: #3b82f6; color: #fff;
    border: none; border-radius: 8px; font-family: inherit;
    font-size: 0.9rem; font-weight: 600; cursor: pointer;
    transition: all 0.3s;
}
.hv-btn-primary:hover { background: #2563eb; transform: translateY(-2px); box-shadow: 0 8px 25px rgba(59,130,246,0.3); }
.hv-btn-secondary {
    padding: 0.8rem 2rem; background: transparent; color: #94a3b8;
    border: 1px solid #334155; border-radius: 8px; font-family: inherit;
    font-size: 0.9rem; cursor: pointer; transition: all 0.3s;
}
.hv-btn-secondary:hover { border-color: #3b82f6; color: #60a5fa; }

.hv-hero-stats {
    display: flex; gap: 2.5rem; margin-top: 3rem;
    padding-top: 2rem; border-top: 1px solid #1e293b;
}
.hv-hero-stat { text-align: left; }
.hv-big-num {
    display: block; font-size: 2.5rem; font-weight: 700;
    color: #f1f5f9; line-height: 1; font-variant-numeric: tabular-nums;
}
.hv-stat-label { font-size: 0.75rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.08em; }

/* Services */
.hv-services { padding: 5rem 0; }
.hv-section-title {
    font-size: 1.75rem; font-weight: 700; color: #f1f5f9;
    margin-bottom: 2.5rem;
}
.hv-services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }

.hv-service-card {
    padding: 2rem 1.5rem; border-radius: 12px;
    background: rgba(255,255,255,0.03); border: 1px solid #1e293b;
    transition: all 0.4s;
}
.hv-service-card:hover {
    border-color: rgba(59,130,246,0.3);
    background: rgba(59,130,246,0.05);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.hv-service-card i { color: #3b82f6; margin-bottom: 1rem; width: 28px; height: 28px; }
.hv-service-card h3 { font-size: 1rem; font-weight: 600; color: #e2e8f0; margin-bottom: 0.5rem; }
.hv-service-card p { font-size: 0.8rem; color: #64748b; line-height: 1.6; }

/* Banner */
.hv-banner {
    padding: 4rem 0; margin: 2rem 0;
    border-top: 1px solid #1e293b; border-bottom: 1px solid #1e293b;
    text-align: center;
}
.hv-banner h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); color: #f1f5f9; line-height: 1.4; margin-bottom: 1rem; }
.hv-banner p { font-size: 0.9rem; color: #64748b; max-width: 550px; margin: 0 auto; }

/* Projects */
.hv-projects { padding: 4rem 0; }
.hv-proj-scroll { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }

.hv-proj-card {
    border-radius: 12px; overflow: hidden;
    background: rgba(255,255,255,0.03); border: 1px solid #1e293b;
    transition: all 0.4s;
}
.hv-proj-card:hover { border-color: rgba(59,130,246,0.3); transform: translateY(-4px); }
.hv-proj-card img { width: 100%; height: 160px; object-fit: cover; }
.hv-proj-placeholder {
    height: 160px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}
.hv-proj-placeholder i { width: 40px; height: 40px; color: #334155; }
.hv-proj-info { padding: 1.25rem; }
.hv-proj-tag {
    font-size: 0.65rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.1em; color: #3b82f6; margin-bottom: 0.4rem; display: block;
}
.hv-proj-info h3 { font-size: 1rem; color: #e2e8f0; margin-bottom: 0.4rem; }
.hv-proj-info p { font-size: 0.8rem; color: #64748b; line-height: 1.5; }

/* Contact */
.hv-contact { padding: 5rem 0; border-top: 1px solid #1e293b; }
.hv-contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.hv-contact-info h2 { font-size: 1.5rem; color: #f1f5f9; margin-bottom: 0.75rem; }
.hv-contact-info > p { font-size: 0.9rem; color: #64748b; margin-bottom: 1.5rem; }
.hv-contact-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.hv-contact-list li {
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 0.85rem; color: #94a3b8;
}
.hv-contact-list i { width: 18px; height: 18px; color: #3b82f6; }

.hv-form { display: flex; flex-direction: column; gap: 0.75rem; }
.hv-form input, .hv-form textarea {
    padding: 0.75rem 1rem; background: rgba(255,255,255,0.04);
    border: 1px solid #1e293b; border-radius: 8px;
    color: #e2e8f0; font-family: inherit; font-size: 0.85rem;
    transition: border-color 0.3s;
}
.hv-form input:focus, .hv-form textarea:focus {
    outline: none; border-color: #3b82f6;
}
.hv-form .hv-btn-primary { width: 100%; text-align: center; }

.hv-footer { text-align: center; padding: 2rem 0; border-top: 1px solid #1e293b; }
.hv-footer p { font-size: 0.75rem; color: #475569; }
.hv-footer strong { color: #64748b; }

/* ===========================================================
   TEMA 3: TIERRA (Café Artesanal)
   =========================================================== */
.theme-folk {
    background: #faf7f2; color: #3d2b1f;
    font-family: 'Work Sans', sans-serif;
}

.cf-page { max-width: 900px; margin: 0 auto; padding: 0 2rem 6rem; }

/* Hero */
.cf-hero { position: relative; margin: 0 -2rem; overflow: hidden; }
.cf-hero-bg { height: 70vh; min-height: 400px; overflow: hidden; }
.cf-hero-bg img { 
    width: 100%; height: 100%; object-fit: cover; filter: brightness(0.6); 
    transform: scale(calc(1 + var(--scroll, 0) * 0.0003)) translateY(calc(var(--scroll, 0) * 0.1px));
    will-change: transform;
}
.cf-hero-content {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    justify-content: center; align-items: center; text-align: center;
    padding: 2rem;
    transform: translateY(calc(var(--scroll, 0) * 0.2px));
    opacity: calc(1 - var(--scroll, 0) * 0.002);
    will-change: transform, opacity;
}
.cf-name {
    font-family: 'Lora', Georgia, serif; font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700; color: #faf7f2; line-height: 1;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.cf-tagline {
    font-size: 1.1rem; color: rgba(250,247,242,0.85);
    margin-top: 0.75rem; font-style: italic;
    font-family: 'Lora', serif;
}
.cf-btn {
    margin-top: 2rem; padding: 0.8rem 2.5rem;
    background: #c4653a; color: #faf7f2;
    border-radius: 999px; font-family: 'Work Sans', sans-serif;
    font-size: 0.9rem; font-weight: 600;
    transition: all 0.3s; border: 2px solid #c4653a;
}
.cf-btn:hover { background: #a8522d; border-color: #a8522d; transform: translateY(-2px); }

/* Story */
.cf-story { padding: 5rem 0; text-align: center; }
.cf-diamond { color: #c4653a; font-size: 1.25rem; display: block; margin-bottom: 1rem; }
.cf-story h2 {
    font-family: 'Lora', serif; font-size: 1.75rem; font-weight: 700;
    color: #3d2b1f; margin-bottom: 1.5rem;
}
.cf-story p { font-size: 1rem; line-height: 1.9; color: #6b5a4e; max-width: 600px; margin: 0 auto 2rem; }
.cf-quote {
    font-family: 'Lora', serif; font-style: italic;
    font-size: 1.15rem; color: #c4653a; max-width: 500px;
    margin: 0 auto; padding: 1.5rem 0;
    border-top: 1px solid #e6ddd4; border-bottom: 1px solid #e6ddd4;
}

/* Menu */
.cf-menu { padding: 3rem 0; }
.cf-section-title {
    font-family: 'Lora', serif; font-size: 1.5rem; font-weight: 700;
    color: #3d2b1f; margin-bottom: 2rem; text-align: center;
}
.cf-section-title .cf-diamond { display: inline; margin-right: 0.5rem; font-size: 0.9rem; }

.cf-menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cf-menu-item {
    padding: 1.5rem; background: #fff8f0;
    border-radius: 16px; border: 1px solid #e6ddd4;
    transition: all 0.4s;
}
.cf-menu-item:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 25px rgba(61,43,31,0.08);
    border-color: #c4653a;
}
.cf-menu-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.4rem; }
.cf-menu-item h3 { font-family: 'Lora', serif; font-size: 1rem; font-weight: 600; color: #3d2b1f; }
.cf-price { font-weight: 700; color: #c4653a; font-size: 0.95rem; }
.cf-menu-item p { font-size: 0.8rem; color: #8a7b6b; line-height: 1.5; }

/* Gallery */
.cf-gallery { padding: 4rem 0; border-top: 1px solid #e6ddd4; }
.cf-gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.cf-gallery-item {
    background: #fff8f0; border-radius: 16px; border: 1px solid #e6ddd4;
    overflow: hidden; padding: 0.75rem; text-align: center;
    transition: all 0.4s ease;
}
.cf-gallery-item:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 30px rgba(61,43,31,0.1);
    border-color: #c4653a;
}
.cf-gallery-item img {
    width: 100%; height: 200px; object-fit: cover; border-radius: 10px;
    margin-bottom: 0.75rem;
}
.cf-gallery-caption {
    font-family: 'Lora', serif; font-size: 0.85rem; font-style: italic;
    color: #3d2b1f; font-weight: 600; display: block;
}

/* Visit */
.cf-visit { padding: 3rem 0; border-top: 1px solid #e6ddd4; }
.cf-visit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.cf-visit-card {
    padding: 1.75rem; background: #fff8f0; border-radius: 16px;
    border: 1px solid #e6ddd4;
}
.cf-visit-card h3 {
    font-family: 'Lora', serif; font-size: 1rem; font-weight: 700;
    color: #c4653a; margin-bottom: 0.75rem;
}
.cf-visit-card p { font-size: 0.85rem; color: #6b5a4e; margin-bottom: 0.3rem; }
.cf-link {
    display: inline-block; margin-top: 0.5rem; font-size: 0.8rem;
    color: #c4653a; font-weight: 600; transition: opacity 0.3s;
}
.cf-link:hover { opacity: 0.7; }

.cf-footer { text-align: center; padding: 3rem 0; border-top: 1px solid #e6ddd4; }
.cf-footer-tagline {
    font-family: 'Lora', serif; font-style: italic;
    font-size: 0.9rem; color: #c4653a; margin-bottom: 0.5rem;
}
.cf-footer p { font-size: 0.75rem; color: #a89888; }
.cf-footer strong { color: #6b5a4e; }

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 768px) {
    .mn-grid { grid-template-columns: 1fr; }
    .mn-grid .mn-project:first-child { grid-column: auto; }
    .mn-stats { gap: 1.5rem; }

    .hv-hero-stats { flex-direction: column; gap: 1rem; }
    .hv-services-grid { grid-template-columns: 1fr; }
    .hv-proj-scroll { grid-template-columns: 1fr; }
    .hv-contact-grid { grid-template-columns: 1fr; }

    .cf-menu-grid { grid-template-columns: 1fr; }
    .cf-gallery-grid { grid-template-columns: 1fr; }
    .cf-visit-grid { grid-template-columns: 1fr; }

    .theme-switcher { padding: 0.35rem 0.6rem; gap: 0.2rem; }
    .switcher-label { display: none; }
    .theme-btn { padding: 0.3rem 0.55rem; font-size: 0.7rem; }
}
