/* ══════════════════════════════════════════════
   UNSERVISA – Index Stylesheet
   Inspired by BAUKUNST architectural template
   ══════════════════════════════════════════════ */

/* ── Reset & Variables ── */
:root {
    --coffee-bean: #1C130F;
    --brandy: #932618;
    --tiger-flame: #FD561F;
    --honey-bronze: #FAB447;
    --apricot-cream: #F5CA7E;
    --vanilla-cream: #F3ECCE;
    --white-smoke: #F3F4F4;

    --coffee-bean-rgb: 28, 19, 15;
    --tiger-flame-rgb: 253, 86, 31;
    --white-smoke-rgb: 243, 244, 244;

    --text-dark: #1C130F;
    --text-body: #4a4a4a;
    --text-muted: #777;
    --bg-light: #ffffff;
    --bg-off: #f9f9f9;
    --accent: #FD561F;
    --accent-hover: #e84a15;

    --font-primary: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Bebas Neue', sans-serif;

    --shadow-card: 0 4px 20px rgba(0,0,0,0.2);
    --radius: 12px;
    --transition: 0.3s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-primary);
    color: var(--text-body);
    background: var(--bg-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

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

ul { list-style: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ── Header ── */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: box-shadow var(--transition);
}

.header.scrolled {
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-icon {
    height: 32px;
    width: auto;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-dark);
    letter-spacing: 2px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-list {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    position: relative;
    padding: 0.25rem 0;
    transition: color var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--accent);
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: #fff;
    padding: 0.6rem 1.4rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background var(--transition), transform var(--transition);
}

.nav-cta:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.lang-toggle {
    width: 38px;
    height: 38px;
    padding-top: 5px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    border: none;
    cursor: pointer;
    order: 99;
    transition: background var(--transition), transform var(--transition);
}

.lang-toggle:hover {
    background: var(--accent-hover);
    transform: scale(1.08);
}

.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(0,0,0,0.12);
    color: var(--text-dark);
    cursor: pointer;
    order: 98;
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: rgba(0,0,0,0.06);
    transform: scale(1.08);
}

html.dark .theme-toggle {
    border-color: rgba(255,255,255,0.15);
    color: #e8e8e8;
}

html.dark .theme-toggle:hover {
    background: rgba(255,255,255,0.08);
}

.theme-toggle .icon-moon { display: none; }
html.dark .theme-toggle .icon-sun { display: none; }
html.dark .theme-toggle .icon-moon { display: block; }

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

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-dark);
    transition: var(--transition);
    transform-origin: center;
}

.header.nav-open .menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.header.nav-open .menu-toggle span:nth-child(2) {
    opacity: 0;
}

.header.nav-open .menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Nav toggles wrapper (theme + lang) */
.nav-toggles {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Hero ── */
.hero {
    position: relative;
    padding: 10rem 0 6rem;
    background: var(--bg-light);
    overflow: hidden;
}

.sparks-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content {
    position: relative;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 4rem;
    line-height: 1.05;
    color: var(--text-dark);
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.hero-accent-dots {
    display: inline-flex;
    gap: 0.3rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.hero-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    display: inline-block;
}

.hero-dot:nth-child(2) { opacity: 0.7; }
.hero-dot:nth-child(3) { opacity: 0.4; }

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 420px;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: #fff;
    padding: 0.85rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    transition: background var(--transition), transform var(--transition);
}

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

.hero-image-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    transform: rotate(3deg);
    transition: transform 0.5s ease;
}

.hero-image {
    width: 90%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.hero-image-wrap:hover {
    transform: rotate(0deg);
}

.hero-image-accent {
    position: absolute;
    bottom: -50px;
    left: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.15;
    z-index: -1;
}

/* ── Section commons ── */
.section {
    padding: 6rem 0;
}

.section--gray {
    background: var(--bg-off);
}

.section--dark {
    background: var(--coffee-bean);
    color: #fff;
}

.section-label {
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.8rem;
    color: var(--text-dark);
    letter-spacing: 1px;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.section--dark .section-title {
    color: #fff;
}

.section-line {
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin-bottom: 2rem;
}

/* ── About ── */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-image-wrap {
    position: relative;
}

.about-image {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    border: 2px solid rgba(0,0,0,0.1);
}

html.dark .about-image {
    border-color: transparent;
}

/* ── Medal Badge ── */
.medal-badge {
    position: absolute;
    bottom: 1.5rem;
    left: -2rem;
    width: 140px;
    height: 170px;
    z-index: 3;
}

.medal-ribbon-left,
.medal-ribbon-right {
    position: absolute;
    bottom: 0;
    width: 36px;
    height: 55px;
    z-index: 1;
}

.medal-ribbon-left {
    left: 28px;
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 50%, #b33225 100%);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%);
    transform: rotate(20deg);
}

.medal-ribbon-right {
    right: 28px;
    background: linear-gradient(225deg, #c0392b 0%, #e74c3c 50%, #b33225 100%);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%);
    transform: rotate(-20deg);
}

.medal-disc {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(
        145deg,
        #e8e8e8 0%,
        #c0c0c0 20%,
        #f0f0f0 40%,
        #a8a8a8 60%,
        #d4d4d4 80%,
        #b8b8b8 100%
    );
    box-shadow:
        0 0 0 5px #b0b0b0,
        0 0 0 7px #d8d8d8,
        0 4px 15px rgba(0,0,0,0.25);
    z-index: 2;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.medal-inner {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(
        160deg,
        #d8d8d8 0%,
        #f2f2f2 30%,
        #c8c8c8 50%,
        #e0e0e0 70%,
        #b8b8b8 100%
    );
    border: 2px solid #c0c0c0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.medal-number {
    font-family: var(--font-display);
    font-size: 2rem;
    color: #3a3a3a;
    line-height: 1;
    text-shadow: 0 1px 1px rgba(255,255,255,0.6);
}

.medal-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #555;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.about-text p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.why-box {
    background: var(--bg-off);
    border-radius: var(--radius);
    padding: 2rem;
    margin-top: 1rem;
}

.why-box h3 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--text-dark);
    margin-bottom: 1.2rem;
    letter-spacing: 0.5px;
}

.why-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.why-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.why-item::before {
    content: '';
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* ── Projects Gallery ── */
.projects-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
}

.projects-header .section-title {
    margin-bottom: 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

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

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-card:hover img {
    transform: scale(1.05);
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 40%, rgba(var(--coffee-bean-rgb), 0.75));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
}

.project-tag {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    margin-bottom: 0.75rem;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: #fff;
    letter-spacing: 0.5px;
}

.project-card--featured {
    grid-row: 1 / 3;
    min-height: 500px;
}

.project-card--small {
    min-height: 240px;
}

/* ── Services / Capabilities ── */
.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    align-items: center;
}

.capabilities-text {
    padding-right: 2rem;
}

.capabilities-text p {
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.capabilities-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.95rem;
    transition: gap var(--transition);
}

.capabilities-link:hover {
    gap: 0.8rem;
}

.capabilities-link svg {
    width: 18px;
    height: 18px;
}

.team-photos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.team-card {
    text-align: center;
}

.team-card img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-card);
    transition: transform var(--transition);
}

.team-card:hover img {
    transform: translateY(-4px);
}

.team-name {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.section--dark .team-name {
    color: #fff;
}

.team-role {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.section--dark .team-role {
    color: rgba(255,255,255,0.7);
}

/* ── Ember Particle Overlay ── */
.ember-particles {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.ember-particles canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.cta-banner > .container,
.page-hero > .container,
.page-cta > .container {
    position: relative;
    z-index: 1;
}

/* ── CTA Banner ── */
.cta-banner {
    position: relative;
    padding: 6rem 0;
    background-image: linear-gradient(rgba(var(--coffee-bean-rgb), 0.7), rgba(var(--coffee-bean-rgb), 0.7)), url('assets/MetalFundido.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    text-align: center;
    color: #fff;
}

.cta-banner .section-title {
    color: #fff;
    margin-bottom: 1rem;
}

.cta-banner p {
    max-width: 600px;
    margin: 0 auto 2rem;
    opacity: 0.9;
    line-height: 1.7;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: #fff;
    padding: 0.9rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    border: 2px solid var(--accent);
    transition: all var(--transition);
}

.cta-btn:hover {
    background: transparent;
    color: #fff;
    border-color: #fff;
}

/* ── Industries Cards ── */
.industries-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 2.5rem;
}

.industries-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.industry-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform var(--transition), box-shadow var(--transition);
}

.industry-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.industry-card img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.industry-card-body {
    padding: 1.2rem 1.4rem;
}

.industry-card-title {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

.industry-card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ── Footer ── */
.footer {
    background: var(--coffee-bean);
    color: rgba(255,255,255,0.75);
    padding: 4rem 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 3rem;
    padding-bottom: 3rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.footer-logo-icon {
    height: 28px;
    filter: brightness(0) invert(1);
}

.footer-logo-text {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: #fff;
    letter-spacing: 2px;
}

.footer-about {
    font-size: 0.9rem;
    line-height: 1.7;
    opacity: 0.7;
}

.footer h4 {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
}

.footer-links li {
    margin-bottom: 0.6rem;
    white-space: nowrap;
}

.footer-links a {
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity var(--transition), color var(--transition);
}

.footer-links a:hover {
    opacity: 1;
    color: var(--accent);
}

.footer-newsletter p {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.footer-newsletter-form {
    display: flex;
    gap: 0;
}

.footer-newsletter-input {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-right: none;
    border-radius: 6px 0 0 6px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition);
}

.footer-newsletter-input::placeholder {
    color: rgba(255,255,255,0.4);
}

.footer-newsletter-input:focus {
    border-color: var(--accent);
}

.footer-newsletter-btn {
    padding: 0.7rem 1.2rem;
    background: var(--accent);
    border: none;
    border-radius: 0 6px 6px 0;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background var(--transition);
}

.footer-newsletter-btn:hover {
    background: var(--accent-hover);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.5;
}

/* ── Language Toggle ── */
[data-lang="en"] { display: none; }
html[lang="en"] [data-lang="en"] { display: inline; }
html[lang="en"] [data-lang="es"] { display: none; }

/* ── Medal Shine Effect ── */
.medal-disc::before {
    content: '';
    position: absolute;
    top: 0;
    left: -60px;
    width: 50px;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.0) 0%,
        rgba(255, 255, 255, 0.15) 30%,
        rgba(255, 255, 255, 0.5) 77%,
        rgba(255, 255, 255, 0.0) 100%
    );
    transform: skewX(-30deg);
    animation: medal-shine 7s ease-in-out 0.3s infinite alternate;
    z-index: 3;
    pointer-events: none;
}

@keyframes medal-shine {
    0%   { left: -60px; }
    50%  { left: 70%; }
    100% { left: 130%; }
}

/* ── Dark Theme ── */
html.dark {
    --text-dark: #e8e8e8;
    --text-body: #b8b8b8;
    --text-muted: #999;
    --bg-light: #141414;
    --bg-off: #1c1c1c;
    --shadow-card: 0 4px 20px rgba(0,0,0,0.3);
}

html.dark .header {
    background: rgba(20,20,20,0.97);
    border-bottom-color: rgba(255,255,255,0.06);
}

html.dark .header.scrolled {
    box-shadow: 0 2px 20px rgba(255,255,255,0.1);
}

@media (max-width: 768px) {
    html.dark .nav {
        background: transparent;
        box-shadow: none;
    }
}

html.dark .logo-icon {
    filter: brightness(0) invert(1);
}

html.dark .menu-toggle span {
    background: #e8e8e8;
}

html.dark .medal-disc {
    box-shadow:
        0 0 0 5px #888,
        0 0 0 7px #aaa,
        0 4px 20px rgba(0,0,0,0.5);
}

html.dark .why-box {
    background: #1a1a1a;
}

html.dark .industry-card {
    background: #1e1e1e;
}

html.dark .industry-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

html.dark .hero-image {
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

html.dark .section--dark {
    background: #0d0d0d;
}

html.dark .team-card img {
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

html.dark .team-name {
    color: #e0e0e0;
}

html.dark .cta-banner {
    background-image: linear-gradient(rgba(0,0,0,0.75), rgba(0,0,0,0.75)), url('assets/MetalFundido.jpg');
}

html.dark .footer {
    background: #0a0a0a;
}

html.dark .footer-newsletter-input {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.12);
}

/* Auto-detect system theme for toggle icon */
@media (prefers-color-scheme: dark) {
    html:not(.light) .theme-toggle .icon-sun { display: none; }
    html:not(.light) .theme-toggle .icon-moon { display: block; }
    html:not(.light) .theme-toggle {
        border-color: rgba(255,255,255,0.15);
        color: #e8e8e8;
    }
    html:not(.light) .theme-toggle:hover {
        background: rgba(255,255,255,0.08);
    }
}

/* Auto-detect system theme */
@media (prefers-color-scheme: dark) {
    html:not(.light) {
        --text-dark: #e8e8e8;
        --text-body: #b8b8b8;
        --text-muted: #999;
        --bg-light: #141414;
        --bg-off: #1c1c1c;
        --shadow-card: 0 4px 20px rgba(0,0,0,0.3);
    }

    html:not(.light) .header {
        border: 2px;
        background: var(--coffee-bean);
        border-bottom-color: rgba(255,255,255,0.06);
        box-shadow: 0 2px 20px rgba(255,255,255,0.1);
    }

    html:not(.light) .header.scrolled {
        box-shadow: 0 2px 20px rgba(255,255,255,0.1);
    }

    html:not(.light) .logo-icon {
        filter: brightness(0) invert(1);
    }

    html:not(.light) .menu-toggle span {
        background: #e8e8e8;
    }

    html:not(.light) .medal-disc {
        box-shadow:
            0 0 0 5px #888,
            0 0 0 7px #aaa,
            0 4px 20px rgba(0,0,0,0.5);
    }

    html:not(.light) .why-box {
        background: #1a1a1a;
    }

    html:not(.light) .industry-card {
        background: #1e1e1e;
    }

    html:not(.light) .industry-card:hover {
        box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    }

    html:not(.light) .hero-image {
        box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    }

    html:not(.light) .section--dark {
        background: #0d0d0d;
    }

    html:not(.light) .team-card img {
        box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    }

    html:not(.light) .team-name {
        color: #e0e0e0;
    }

    html:not(.light) .cta-banner {
        background-image: linear-gradient(rgba(0,0,0,0.75), rgba(0,0,0,0.75)), url('assets/MetalFundido.jpg');
    }

    html:not(.light) .footer {
        background: #0a0a0a;
    }

    html:not(.light) .footer-newsletter-input {
        background: rgba(255,255,255,0.05);
        border-color: rgba(255,255,255,0.12);
    }
}

/* ══════════════════════════════════════════════
   SUBPAGE STYLES
   ══════════════════════════════════════════════ */

/* ── Page Hero Banner ── */
.page-hero {
    position: relative;
    overflow: hidden;
    padding: 10rem 0 4rem;
    background: var(--coffee-bean);
    color: #fff;
    text-align: center;
}

.page-title {
    font-family: var(--font-display);
    font-size: 3.5rem;
    letter-spacing: 1px;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.page-subtitle {
    font-size: 1.1rem;
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
}

/* ── Content Blocks ── */
.content-section {
    padding: 5rem 0;
}

.content-section--gray {
    background: var(--bg-off);
}

.content-section--dark {
    background: var(--coffee-bean);
    color: #fff;
}

.content-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.content-icon {
    font-size: 2.2rem;
}

.content-header h2 {
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: var(--text-dark);
    letter-spacing: 0.5px;
}

.content-section--dark .content-header h2 {
    color: #fff;
}

.content-desc {
    color: var(--text-muted);
    max-width: 800px;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.content-section--dark .content-desc {
    color: rgba(255,255,255,0.7);
}

/* ── Expertise / Detail Cards ── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.card-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.card-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

.card {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-card);
    transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.card-icon {
    height: 200px;
    margin: 0 auto 1rem;
    border-radius: var(--radius);
    overflow: hidden;
}

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    letter-spacing: 0.3px;
}

.card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.card h4 {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card ul li {
    font-size: 0.9rem;
    color: var(--text-body);
    padding-left: 1.2rem;
    position: relative;
}

.card ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* ── Capability Stats ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    text-align: center;
}

.stat {
    padding: 2rem;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-unit {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.stat-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ── Standards Badges ── */
.standards {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-off);
    border-radius: var(--radius);
}

.standards h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.standards p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.badges {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    letter-spacing: 1px;
}

/* ── Location Cards ── */
.location-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.location-card {
    background: var(--bg-off);
    padding: 2rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--accent);
}

.location-card h4 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.location-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ── Contact Form ── */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: start;
}

.contact-info h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.contact-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--bg-off);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-details h4 {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.contact-details p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.contact-details a {
    color: var(--accent);
    transition: color var(--transition);
}

.contact-details a:hover {
    color: var(--accent-hover);
}

.contact-form-wrap h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: var(--text-body);
    background: var(--bg-light);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--tiger-flame-rgb), 0.1);
}

.form-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--accent);
    color: #fff;
    padding: 0.85rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: background var(--transition), transform var(--transition);
}

.form-submit:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.form-success {
    text-align: center;
    padding: 3rem;
    display: none;
}

.form-success .success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.form-success h3 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.form-success p {
    color: var(--text-muted);
}

/* ── Product Cards ── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.product-card {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 1.8rem;
    box-shadow: var(--shadow-card);
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.product-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.product-card h4 {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.95rem;
}

/* ── Product Gallery ── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.25) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: #fff;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.gallery-overlay p {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.4;
}

/* ── Materials Tables ── */
.table-wrap {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 700px;
}

.table thead {
    background: var(--coffee-bean);
    color: #fff;
}

.table th,
.table td {
    padding: 0.7rem 1rem;
    text-align: left;
    border: 1px solid rgba(0,0,0,0.08);
}

.table th {
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    background: var(--bg-light);
    transition: background var(--transition);
}

.table tbody tr:nth-child(even) {
    background: var(--bg-off);
}

.table tbody tr:hover {
    background: rgba(var(--tiger-flame-rgb), 0.05);
}

html.dark .table thead {
    background: #222;
}

html.dark .table tbody tr {
    background: var(--bg-light);
}

html.dark .table tbody tr:nth-child(even) {
    background: var(--bg-off);
}

html.dark .table th,
html.dark .table td {
    border-color: rgba(255,255,255,0.06);
}

.spec-note {
    background: var(--accent);
    color: #fff;
    padding: 1.2rem 1.8rem;
    border-radius: var(--radius);
    margin: 2.5rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
}

.spec-note-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* ── CTA Section (subpages) ── */
.page-cta {
    position: relative;
    overflow: hidden;
    padding: 5rem 0;
    background: var(--coffee-bean);
    text-align: center;
    color: #fff;
}

.page-cta h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.page-cta p {
    opacity: 0.8;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.page-cta .cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: #fff;
    padding: 0.85rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    border: 2px solid var(--accent);
    transition: all var(--transition);
}

.page-cta .cta-btn:hover {
    background: transparent;
    border-color: #fff;
}

/* ── Dark overrides for subpages ── */
html.dark .page-hero {
    background: #0d0d0d;
}

html.dark .card {
    background: #1e1e1e;
}

html.dark .card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

html.dark .card h3,
html.dark .card h4 {
    color: #e0e0e0;
}

html.dark .contact-icon {
    background: #1e1e1e;
}

html.dark .form-group input,
html.dark .form-group select,
html.dark .form-group textarea {
    background: #1a1a1a;
    border-color: rgba(255,255,255,0.1);
    color: #ccc;
}

html.dark .product-card {
    background: #1e1e1e;
}

html.dark .product-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

html.dark .location-card {
    background: #1a1a1a;
}

html.dark .standards {
    background: #1a1a1a;
}

html.dark .page-cta {
    background: #0d0d0d;
}

/* prefers-color-scheme dark auto-detect for subpage elements */
@media (prefers-color-scheme: dark) {
    html:not(.light) .page-hero { background: #0d0d0d; }
    html:not(.light) .card { background: #1e1e1e; }
    html:not(.light) .card:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
    html:not(.light) .card h3,
    html:not(.light) .card h4 { color: #e0e0e0; }
    html:not(.light) .contact-icon { background: #1e1e1e; }
    html:not(.light) .form-group input,
    html:not(.light) .form-group select,
    html:not(.light) .form-group textarea { background: #1a1a1a; border-color: rgba(255,255,255,0.1); color: #ccc; }
    html:not(.light) .product-card { background: #1e1e1e; }
    html:not(.light) .product-card:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
    html:not(.light) .location-card { background: #1a1a1a; }
    html:not(.light) .standards { background: #1a1a1a; }
    html:not(.light) .page-cta { background: #0d0d0d; }
    html:not(.light) .table thead { background: #222; }
    html:not(.light) .table tbody tr { background: var(--bg-light); }
    html:not(.light) .table tbody tr:nth-child(even) { background: var(--bg-off); }
    html:not(.light) .table th,
    html:not(.light) .table td { border-color: rgba(255,255,255,0.06); }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .hero-title { font-size: 3rem; }
    .projects-grid { grid-template-columns: 1fr; }
    .project-card--featured { min-height: 350px; grid-row: auto; }
    .industries-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .card-grid--4 { grid-template-columns: repeat(2, 1fr); }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    /* ══ Dynamic Island ══ */
    .header {
        top: 0.75rem;
        left: 0.75rem;
        right: 0.75rem;
        border-radius: 50px;
        border-bottom: none;
        transition: border-radius 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                    background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                    box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .header.scrolled {
        box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    }

    .header.nav-open,
    html.dark .header.nav-open {
        border-radius: 24px;
        background: var(--coffee-bean);
        box-shadow: 0 2px 20px rgba(255, 255, 255, 0.1);
    }

    .header-inner {
        position: relative;
        flex-wrap: wrap;
        padding: 0.65rem 1.25rem;
    }

    .logo-text { color: var(--text-dark); }

    .menu-toggle {
        display: flex;
        border-radius: 50px;
        padding: 6px;
        transition: background 0.3s ease;
    }

    .header.nav-open .menu-toggle {
        background: rgba(255,255,255,0.12);
        padding: 8px 14px;
    }

    .header.nav-open .logo-icon {
        filter: brightness(0) invert(1);
    }

    .header.nav-open .logo-text {
        color: var(--vanilla-cream);
    }

    .header.nav-open .menu-toggle span {
        background: var(--vanilla-cream);
    }

    /* ── Nav panel inside island ── */
    .nav {
        position: static;
        flex-basis: 100%;
        flex-direction: column;
        align-items: flex-start;
        background: transparent;
        box-shadow: none;
        padding: 1.5rem 0.5rem 1rem;
        gap: 0;
        display: none;
        z-index: auto;
    }

    .header.nav-open .nav {
        display: flex;
        animation: islandNavIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    @keyframes islandNavIn {
        from { opacity: 0; transform: translateY(-8px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .nav-list {
        display: flex;
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-list li { border-bottom: none; }

    .nav-link {
        display: block;
        padding: 0.55rem 0;
        font-size: 1.5rem;
        font-family: var(--font-display);
        text-transform: uppercase;
        letter-spacing: 2px;
        color: var(--vanilla-cream);
        text-align: left;
    }

    .nav-link:hover  { color: var(--accent); }
    .nav-link.active  { color: var(--accent); }
    .nav-link::after { display: none; }

    .nav-cta {
        margin-top: 1.25rem;
        align-self: flex-start;
    }

    .nav-toggles {
        margin-top: 1rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255,255,255,0.1);
        width: 100%;
    }

    /* Toggle colors inside the dark island */
    .header.nav-open .theme-toggle {
        border-color: rgba(255,255,255,0.2);
        color: var(--vanilla-cream);
    }

    .header.nav-open .theme-toggle:hover {
        background: rgba(255,255,255,0.1);
    }

    /* ══ Other mobile layout ══ */
    .hero { padding: 8rem 0 4rem; }
    .hero-inner { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
    .hero-subtitle { margin: 0 auto 2rem; }
    .hero-title { font-size: 2.5rem; }
    .hero-image { transform: rotate(0); width: 100%; }
    .about-grid { grid-template-columns: 1fr; }
    .medal-badge { left: 1rem; bottom: 1rem; }
    .capabilities-grid { grid-template-columns: 1fr; }
    .section { padding: 4rem 0; }
    .section-title { font-size: 2.2rem; }
    .industries-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .page-hero { padding: 8rem 0 3rem; }
    .page-title { font-size: 2.5rem; }
    .content-section { padding: 3rem 0; }
    .card-grid { grid-template-columns: 1fr; }
    .card-grid--2 { grid-template-columns: 1fr; }
    .card-grid--4 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; gap: 1rem; }
    .product-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: 1fr; }
    .location-grid { grid-template-columns: 1fr; }
    .form { grid-template-columns: 1fr; }
}
