:root {
    --color-bg-deep: #041a3b;
    --color-bg-sky: #0d2c59;
    --color-accent: #f9b44c;
    --color-accent-soft: #ffe3b0;
    --color-surface: #ffffff;
    --color-text-main: #0b1020;
    --color-text-muted: #5b6575;
    --color-border-subtle: #e1e4ec;
}

/* Global */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, system-ui, "Inter", "Roboto", sans-serif;
    background: #f5f6fb;
    color: var(--color-text-main);
}

.container {
    width: 90%;
    max-width: 1180px;
    margin: 0 auto;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(4, 26, 59, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Larger logo */
.logo {
    height: 112px;
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

.brand-name {
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* Nav */
.nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav a {
    color: #e5e9f5;
    text-decoration: none;
    font-size: 0.95rem;
}

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

.nav-contact {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(249, 180, 76, 0.7);
}

/* Language toggle: pill slider */
.lang-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 12px;
    padding: 2px;
    border-radius: 999px;
    border: 1px solid rgba(229, 233, 245, 0.4);
    background: rgba(10, 15, 31, 0.75);
    overflow: hidden;
    cursor: pointer;
}

.lang-toggle-slider {
    position: absolute;
    top: 2px;
    bottom: 2px;
    width: 50%;
    border-radius: 999px;
    background: rgba(249, 180, 76, 0.26);
    box-shadow: 0 0 0 1px rgba(249, 180, 76, 0.35);
    transform: translateX(0%);
    transition: transform 0.18s ease-out;
}

.lang-toggle[data-lang="es"] .lang-toggle-slider {
    transform: translateX(100%);
}

.lang-option {
    position: relative;
    flex: 1;
    border: none;
    background: transparent;
    color: #e5e9f5;
    font-size: 0.8rem;
    padding: 4px 12px;
    cursor: pointer;
    z-index: 1;
}

.lang-toggle[data-lang="en"] .lang-option[data-lang="en"],
.lang-toggle[data-lang="es"] .lang-option[data-lang="es"] {
    color: #ffffff;
    font-weight: 600;
}

/* Hero */
.hero {
    background: linear-gradient(160deg, var(--color-bg-deep), var(--color-bg-sky) 45%, #f49d3a 120%);
    color: #ffffff;
    padding: 90px 0 80px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 2.1fr 1.3fr;
    gap: 40px;
    align-items: center;
}

.hero-text h1 {
    font-size: 2.8rem;
    line-height: 1.1;
    margin-bottom: 18px;
}

.hero-text p {
    max-width: 560px;
    color: #e0e4f2;
    margin-bottom: 26px;
}

.hero-actions {
    display: flex;
    gap: 12px;
}

.hero-side .hero-card {
    background: rgba(11, 16, 32, 0.9);
    padding: 22px 20px;
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 227, 176, 0.25);
}

.hero-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.hero-card p {
    color: #d7def4;
    font-size: 0.9rem;
}

.hero-card ul {
    margin: 14px 0 0;
    padding-left: 18px;
    color: #f4f6ff;
    font-size: 0.88rem;
}

/* Sections */
.section {
    padding: 70px 0;
}

.section-intro {
    max-width: 640px;
    color: var(--color-text-muted);
    margin: 8px 0 32px;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.card {
    background: var(--color-surface);
    border-radius: 14px;
    padding: 22px 22px 20px;
    border: 1px solid var(--color-border-subtle);
    box-shadow: 0 10px 25px rgba(46, 60, 98, 0.06);
}

.card h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 14px;
}

.card ul {
    margin: 0;
    padding-left: 18px;
    color: #3a4355;
    font-size: 0.9rem;
}

/* About */
.about {
    background: #f2f4fb;
}

.about-grid {
    display: grid;
    grid-template-columns: 1.7fr 1.3fr;
    gap: 32px;
}

.about-highlight {
    background: #ffffff;
    border-radius: 14px;
    padding: 22px 22px 18px;
    border: 1px solid var(--color-border-subtle);
}

/* Contact */
.contact-inner {
    display: flex;
    gap: 36px;
    align-items: flex-start;
}

.contact-actions {
    max-width: 320px;
}

.contact-note {
    margin-top: 10px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Locations */
.locations {
    background: #0b1020;
    color: #f2f4ff;
    padding-top: 40px;
    padding-bottom: 40px;
}

.locations-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.locations-text {
    max-width: 560px;
}

.locations .section-intro {
    color: #c3c8dd;
    margin-bottom: 16px;
}

.locations-tags span {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(249, 180, 76, 0.8);
    margin-right: 8px;
    font-size: 0.9rem;
    background: rgba(4, 26, 59, 0.7);
}

.locations-logo {
    flex-shrink: 0;
}

.locations-logo-img {
    width: 220px;
    max-width: 100%;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 227, 176, 0.35);
}

/* Buttons */
.button-primary,
.button-secondary {
    display: inline-block;
    padding: 11px 22px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.94rem;
    cursor: pointer;
}

.button-primary {
    background: var(--color-accent);
    color: #141414;
    border: none;
}

.button-primary:hover {
    background: #ffbf5f;
}

.button-secondary {
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.button-secondary:hover {
    background: rgba(10, 15, 31, 0.18);
}

/* Footer */
.footer {
    background: #0b1020;
    color: #c2c6d6;
    padding: 18px 0;
    font-size: 0.85rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 404 */
body.not-found {
    background: linear-gradient(160deg, var(--color-bg-deep), #f49d3a);
    color: #ffffff;
}

.not-found .nf-container {
    text-align: center;
    padding: 120px 0;
}

.not-found h1 {
    font-size: 5rem;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 920px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .about-grid,
    .contact-inner {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .nav {
        gap: 10px;
    }

    .locations-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .locations-logo {
        margin-top: 16px;
    }
}

/* Dark mode base */
@media (prefers-color-scheme: dark) {
  body {
    background: #050816;
    color: #e8ecff;
  }

  .section {
    background: transparent;
  }

  .section-intro {
    color: #cfd5f5;
  }

  .card {
    background: #151a27;
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  }

  .card h3 {
    color: #f7f8ff;
  }

  .card p {
    color: #d1d6f2;
  }

  .card ul {
    color: #e3e7ff;
  }

  .about {
    background: transparent;
  }

  .about-highlight {
    background: #181c27;
    color: #e6e9f7;
    border-color: rgba(255, 255, 255, 0.08);
  }

  .about-highlight h3 {
    color: #f3f4ff;
  }

  .about-highlight li {
    color: #d5d9ee;
  }

  .contact {
    background: #050816;
  }

  .contact h2 {
    color: #f5f7ff;
  }

  .contact p {
    color: #d3d8f5;
  }

  .contact-note {
    color: #cfd5f0;
  }

  .button-primary {
    background: #f9b44c;
    color: #1a1308;
  }

  .button-primary:hover {
    background: #ffbf5f;
  }

  .header {
    background: rgba(3, 10, 24, 0.96);
    border-bottom-color: rgba(255, 255, 255, 0.05);
  }

  .lang-toggle {
    background: rgba(3, 10, 24, 0.95);
    border-color: rgba(229, 233, 245, 0.3);
  }

  .hero {
    background: radial-gradient(circle at top left, #1e2a4d, #050816 55%, #f49d3a 140%);
  }
}

/* Layout safety: prevent horizontal scrolling on narrow viewports */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Ensure top-level sections never push wider than the viewport */
.header,
.hero,
.section,
.footer {
    overflow-x: hidden;
}

/* Mobile header/nav layout: allow wrapping so EN/ES toggle never causes overflow */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        row-gap: 8px;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}
