/* Header: marca y navegación abiertas; acciones con geometría propia. */
:root { --nav-h: 84px; }

/* Marca compartida con el footer. */
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.4rem; letter-spacing: -0.03em; }
.logo svg { width: 24px; height: 24px; stroke: var(--accent); stroke-width: 2.5; fill: none; }

.navbar {
    --nav-bg: #080c11;
    --nav-ink: #f1f3f5;
    --nav-muted: #aab2bd;
    --nav-rule: #ffffff12;
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    height: var(--nav-h);
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-rule);
    transition: border-color 180ms ease;
}
.navbar.scrolled { border-bottom-color: #ffffff24; }
.navbar .navbar-content {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(24px, 2.5vw, 40px);
    width: min(86%, 1560px);
    max-width: none;
    padding-inline: 0;
}
.navbar .nav-brand {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: clamp(190px, 16vw, 236px);
    min-height: 44px;
    gap: 8px;
}
.navbar .nav-brand .logo-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1906 / 272;
    margin: 0;
    stroke: none;
}
.nav-brand-caption {
    padding-left: 25%;
    color: var(--nav-muted);
    font-size: 8px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    white-space: nowrap;
}
.navbar .nav-links {
    display: flex;
    align-items: center;
    justify-self: center;
    gap: clamp(22px, 2.2vw, 36px);
}
.navbar .nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--nav-muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    transition: color 180ms ease;
}
.navbar .nav-link:hover,
.navbar .nav-link.active { color: var(--nav-ink); }
.navbar .nav-link::after {
    content: '';
    position: absolute;
    inset: auto 0 5px;
    height: 1px;
    background: #ef476b;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 180ms ease;
}
.navbar .nav-link.active::after { transform: scaleX(1); }
.navbar .nav-actions { display: flex; align-items: center; gap: 12px; }
.navbar.menu-open .nav-actions { visibility: hidden; pointer-events: none; }
.navbar .nav-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 48px;
    padding: 11px 16px;
    border: 1px solid #536070;
    border-radius: 7px;
    background: #0d131b;
    box-shadow: inset 0 1px 0 #ffffff07;
    color: #e0e5ec;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}
.navbar .nav-contact svg { width: 17px; height: 17px; color: #b1bdcc; }
.navbar .nav-contact:hover,
.navbar .nav-contact.active { border-color: #a2adbb; background: #17202b; }
.navbar .nav-contact:active { transform: translateY(1px); }

.nav-quote {
    --quote-fill: #c82048;
    --quote-hover: #df2853;
    --quote-edge: #f56e8b;
    --quote-cut: 11px;
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    min-height: 48px;
    padding: 12px 20px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    transition: transform 180ms ease;
}
.nav-quote::before,
.nav-quote::after {
    content: '';
    position: absolute;
    pointer-events: none;
    clip-path: polygon(0 0, calc(100% - var(--quote-cut)) 0, 100% var(--quote-cut), 100% 100%, var(--quote-cut) 100%, 0 calc(100% - var(--quote-cut)));
}
.nav-quote::before { inset: 0; z-index: -2; background: var(--quote-edge); }
.nav-quote::after {
    inset: 1px;
    z-index: -1;
    background: var(--quote-fill);
    box-shadow: inset 0 1px 0 #ffffff26, inset 0 -2px 0 #820c2c45;
    transition: background-color 180ms ease;
}
.nav-quote:hover { transform: translateY(-1px); }
.nav-quote:hover::after { background: var(--quote-hover); }
.nav-quote:active { transform: translateY(1px); }
.nav-quote-icon { display: inline-flex; flex-shrink: 0; }
.nav-quote-icon svg { display: block; width: 17px; height: 17px; transition: transform 180ms ease; }
.nav-quote:hover .nav-quote-icon svg { transform: translateX(3px); }
.nav-quote:active .nav-quote-icon svg { transform: translateX(0); }
.nav-quote-short { display: none; }
.navbar a:focus-visible,
.navbar button:focus-visible,
.drawer a:focus-visible { outline: 2px solid #ff6a87; outline-offset: 4px; }

.menu-toggle {
    display: none;
    position: relative;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #f1f3f5;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.menu-toggle span {
    position: absolute;
    height: 1.5px;
    background: currentColor;
    transition: transform 180ms ease, width 180ms ease, left 180ms ease;
}
.menu-toggle span:first-child { top: 17px; left: 10px; width: 24px; }
.menu-toggle span:last-child { top: 25px; left: 18px; width: 16px; }
.menu-toggle[aria-expanded="true"] span { left: 11px; width: 22px; }
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

.drawer {
    position: fixed;
    inset: var(--nav-h) 0 auto;
    height: calc(100vh - var(--nav-h));
    height: calc(100dvh - var(--nav-h));
    z-index: 190;
    display: none;
    flex-direction: column;
    gap: 24px;
    padding: 12px max(var(--gutter), env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
    background: #080c11;
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, visibility 0s linear 180ms;
}
.drawer.open { visibility: visible; opacity: 1; pointer-events: auto; transition-delay: 0s; }
.drawer-links { display: flex; flex-direction: column; list-style: none; }
.drawer-links a {
    display: flex;
    align-items: center;
    min-height: 72px;
    padding-block: 18px;
    border-bottom: 1px solid #ffffff14;
    color: #f1f3f5;
    font-size: clamp(26px, 3.6vw, 38px);
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.025em;
    transition: color 180ms ease;
}
.drawer-links a:hover,
.drawer-links a.active { color: #ff6a87; }
.drawer-bottom { margin-top: auto; }
.drawer-links,
.drawer-bottom { width: 100%; max-width: 760px; align-self: center; flex-shrink: 0; }
.drawer .nav-quote { width: 100%; min-height: 52px; justify-content: space-between; }

@media (max-width: 1119px) {
    :root { --nav-h: calc(76px + env(safe-area-inset-top)); }
    /* overflow:hidden en body rompe el anclaje sticky al bloquear el menú.
       La barra móvil queda fija; este espacio conserva el flujo de la página. */
    body { padding-top: var(--nav-h); }
    .navbar { position: fixed; inset: 0 0 auto; padding-top: env(safe-area-inset-top); }
    .navbar .navbar-content { grid-template-columns: minmax(0, 1fr) auto auto; gap: 20px; }
    .navbar .nav-links,
    .navbar .nav-contact { display: none; }
    .navbar .nav-brand { width: 200px; }
    .menu-toggle { display: block; }
    .drawer { display: flex; }
}
@media (max-width: 600px) {
    .navbar .navbar-content { width: calc(100% - 40px); gap: 10px; }
    .navbar .nav-brand { width: clamp(140px, 42vw, 180px); }
    .navbar .nav-brand { gap: 6px; }
    .navbar .nav-brand-caption { font-size: 7px; letter-spacing: 0.07em; }
    .navbar .nav-quote { --quote-cut: 8px; min-height: 44px; gap: 8px; padding: 10px 12px; font-size: 11px; }
    .navbar .nav-quote-icon svg { width: 15px; height: 15px; }
    .navbar .nav-quote-long { display: none; }
    .navbar .nav-quote-short { display: inline; }
}
@media (max-width: 359px) {
    .navbar .navbar-content { width: calc(100% - 32px); gap: 8px; }
    .navbar .nav-brand { width: 136px; }
    .navbar .nav-quote { gap: 6px; padding-inline: 10px; }
}
@media (max-width: 1119px) and (max-height: 540px) {
    .drawer { gap: 16px; padding-top: 8px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
    .drawer-links a { min-height: 48px; padding-block: 10px; font-size: 22px; }
}
@media (min-width: 600px) and (max-width: 1119px) and (max-height: 540px) {
    .drawer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
}
@media (prefers-reduced-motion: reduce) {
    .navbar, .navbar *, .drawer, .drawer * { transition: none; }
    .nav-quote::after { transition: none; }
    .nav-quote:hover .nav-quote-icon svg { transform: none; }
    .nav-quote:hover, .nav-quote:active, .navbar .nav-contact:active { transform: none; }
}
