/* Estela design system layer. Loaded after style.css: remaps the legacy --nb-* variables to the
   brand tokens (tokens.css) and restyles the components to match the Figma file. */

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --nb-navy:        var(--ink-950);
    --nb-navy-dark:   var(--ink-950);
    --nb-navy-mid:    var(--ink-900);
    --nb-navy-light:  var(--ink-700);
    --nb-light:       var(--color-bg-page);
    --nb-white:       var(--neutral-0);
    --nb-dark:        var(--color-text-primary);
    --nb-black:       var(--ink-950);
    --nb-accent:      var(--color-text-brand);
    --nb-accent-2:    var(--orange-300);
    --nb-border-dark: var(--color-border-default);
    --nb-radius:      var(--radius-md);
    --nb-radius-lg:   var(--radius-lg);
    --nb-shadow:      var(--shadow-md);
    --nb-shadow-lg:   var(--shadow-lg);
    --est-night-gradient: linear-gradient(180deg, var(--ink-950) 0%, var(--ink-900) 60%, var(--ink-700) 100%);
}

/* Orange 700 passes AA on light surfaces only; on the night sky the accent switches to orange 400. */
.nb-section-navy, .nb-section-navy-dark, .nb-section-dark, .nb-page-hero, .nb-project-hero,
.nb-404, .nb-cta-banner, .nb-footer, .nb-form-section, .nb-mobile-menu, .est-night, .est-band {
    --nb-accent: var(--orange-400);
    --est-on-dark: 1;
}

body {
    background-color: var(--color-bg-page);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
}

h1, h2, h3, h4 { font-family: var(--font-sans); }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--color-border-focus);
    outline-offset: 2px;
}

/* ---------- Header ---------- */
.nb-header {
    background: var(--color-bg-surface);
    border-bottom: 1px solid var(--color-border-default);
    backdrop-filter: none;
}
.nb-header-inner { max-width: 1344px; padding: 0 var(--spacing-2xl); }
.nb-logo-lockup { display: block; height: 40px; width: auto; }
.nb-nav a { color: var(--color-text-secondary); font-size: var(--text-label-m-size); font-weight: 500; letter-spacing: 0; }
.nb-nav a:hover, .nb-nav a[aria-current="page"] { color: var(--color-text-primary); }
.nb-mobile-nav-toggle span { background: var(--color-text-primary); }
.nb-mobile-menu { background: var(--color-bg-night); }
.nb-mobile-menu { z-index: 1001; }
.nb-mobile-menu a { color: var(--color-text-on-night); }
.nb-mobile-menu a.nb-btn-primary { color: var(--color-text-on-brand); font-size: var(--text-body-l-size); }
.wp-block-navigation a { color: var(--color-text-secondary) !important; }
.wp-block-navigation a:hover { color: var(--color-text-primary) !important; }

/* ---------- Buttons ---------- */
.nb-btn {
    padding: 12px var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: var(--text-label-m-size);
    font-weight: 500;
    line-height: var(--text-label-m-line);
    gap: var(--spacing-sm);
}
.nb-btn-primary { background: var(--color-bg-brand); color: var(--color-text-on-brand); }
.nb-btn-primary:hover { background: var(--color-bg-brand-hover); color: var(--color-text-on-brand); transform: none; }
.nb-btn-outline, .nb-btn-secondary {
    background: var(--color-bg-surface);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-strong);
}
.nb-btn-outline:hover, .nb-btn-secondary:hover { background: var(--color-bg-subtle); border-color: var(--color-border-strong); }
.nb-btn-ghost { background: transparent; color: var(--color-text-brand); }
.nb-btn-ghost:hover { background: var(--color-bg-brand-subtle); }
.nb-btn-navy { background: var(--color-bg-night); color: var(--color-text-on-night); }
.nb-btn-navy:hover { background: var(--ink-700); transform: none; box-shadow: none; }

:is(.nb-section-navy, .nb-section-navy-dark, .nb-section-dark, .nb-page-hero, .nb-project-hero, .nb-404, .nb-cta-banner, .nb-footer, .nb-form-section, .nb-mobile-menu, .est-night, .est-band) .nb-btn-outline {
    background: transparent;
    color: var(--color-text-on-night);
    border: 1px solid rgba(247, 245, 242, 0.45);
}
:is(.nb-section-navy, .nb-section-navy-dark, .nb-section-dark, .nb-page-hero, .nb-project-hero, .nb-404, .nb-cta-banner, .nb-footer, .nb-form-section, .nb-mobile-menu, .est-night, .est-band) .nb-btn-outline:hover {
    background: rgba(247, 245, 242, 0.08);
    border-color: var(--color-text-on-night);
}

/* ---------- Night surfaces with the trail ---------- */
.nb-page-hero, .nb-project-hero, .nb-404 {
    background:
        radial-gradient(55% 45% at 78% 112%, rgba(242, 107, 29, 0.45), transparent 70%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 560 480' preserveAspectRatio='xMaxYMid slice'%3E%3Cpath d='M-151 480h56l392-480h-56z' fill='%23F26B1D' fill-opacity='.12'/%3E%3Cpath d='M-62 480h56l392-480h-56z' fill='%23F26B1D' fill-opacity='.25'/%3E%3Cpath d='M45 480h56l392-480h-56z' fill='%23F26B1D' fill-opacity='.6'/%3E%3C/svg%3E") right center / auto 100% no-repeat,
        var(--est-night-gradient);
}
.nb-hero::before, .nb-cta-banner::before { display: none; }
.nb-section-navy, .nb-section-navy-dark, .nb-section-dark { background: var(--color-bg-night); }
.nb-cta-banner {
    background: radial-gradient(70% 90% at 85% 120%, rgba(242, 107, 29, 0.35), transparent 70%), var(--color-bg-night);
    border-radius: var(--radius-xl);
}

/* ---------- Cards and lists ---------- */
.nb-testimonial-card, .nb-blog-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.nb-features-list li::before {
    background-color: var(--color-bg-brand);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230B1220' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 12.5 5 5 10-11'/%3E%3C/svg%3E");
}
.nb-project-content p, .nb-features-list li { color: var(--color-text-secondary); }
.nb-testimonial-role, .nb-blog-card-meta { color: var(--color-text-muted); }
.nb-blog-card p { color: var(--color-text-secondary); }
.nb-section-label { letter-spacing: 0.12em; }

/* ---------- Footer ---------- */
.nb-footer { background: var(--color-bg-night); color: rgba(247, 245, 242, 0.72); }
.nb-footer .nb-logo-lockup { height: 48px; }
.nb-footer-desc, .nb-footer-col a, .nb-footer-bottom, .nb-footer-social a { color: rgba(247, 245, 242, 0.72); }
.nb-footer-col a:hover { color: var(--color-text-on-night); }
.nb-footer-col h4 { color: var(--color-text-on-night); letter-spacing: 0.08em; }
.nb-footer-social a:hover { border-color: var(--orange-400); color: var(--orange-400); background: rgba(255, 138, 61, 0.1); }
.nb-footer-contact a { color: var(--orange-400); text-decoration: none; }

/* ---------- Home (Estela) ---------- */
.nb-section .nb-container { max-width: 1248px; }
.est-container { max-width: 1344px; margin: 0 auto; padding: 0 var(--spacing-2xl); }
.est-section { padding: var(--spacing-3xl) 0; }
.est-hero { background: var(--color-bg-page); padding: var(--spacing-3xl) 0; }
.est-hero-inner { display: grid; grid-template-columns: 1fr 560px; gap: var(--spacing-2xl); align-items: center; }
.est-eyebrow {
    display: inline-flex; align-items: center; gap: var(--spacing-xs);
    padding: 4px var(--spacing-sm); border-radius: var(--radius-full);
    background: var(--color-bg-subtle); border: 1px solid var(--color-border-default);
    font-size: var(--text-label-s-size); line-height: var(--text-label-s-line); font-weight: 500; color: var(--color-text-primary);
}
.est-eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--color-bg-brand); }
.est-hero h1 {
    font-size: clamp(2.5rem, 4.4vw, var(--text-display-xl-size)); line-height: var(--text-display-xl-line);
    font-weight: 700; letter-spacing: var(--text-display-xl-tracking); color: var(--color-text-primary);
    margin: var(--spacing-lg) 0;
}
.est-lead { font-size: var(--text-body-l-size); line-height: var(--text-body-l-line); color: var(--color-text-secondary); margin: 0 0 var(--spacing-lg); max-width: 60ch; }
.est-actions { display: flex; gap: var(--spacing-md); flex-wrap: wrap; }
.est-assurances { list-style: none; margin: var(--spacing-lg) 0 0; padding: 0; display: grid; gap: var(--spacing-xs); }
.est-assurances li { display: flex; align-items: center; gap: var(--spacing-sm); font-size: var(--text-body-s-size); color: var(--color-text-secondary); }
.est-assurances svg { width: 20px; height: 20px; color: var(--color-text-brand); flex-shrink: 0; }
.est-art {
    position: relative; aspect-ratio: 7 / 6; border-radius: var(--radius-xl); overflow: hidden;
    background: var(--est-night-gradient); box-shadow: var(--shadow-lg);
}
.est-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.est-heading { max-width: 720px; margin-bottom: var(--spacing-xl); }
.est-heading h2, .est-h2 {
    font-size: clamp(2rem, 3vw, var(--text-h1-size)); line-height: var(--text-h1-line); font-weight: 600;
    letter-spacing: var(--text-h1-tracking); color: var(--color-text-primary); margin: 0 0 var(--spacing-sm);
}
.est-heading p { font-size: var(--text-body-l-size); line-height: var(--text-body-l-line); color: var(--color-text-secondary); margin: 0; }
.est-night .est-heading h2, .est-night .est-heading p { color: var(--color-text-on-night); }
.est-night .est-heading p { opacity: 0.78; }

.est-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--spacing-lg); }
.est-card {
    display: flex; flex-direction: column; gap: var(--spacing-md);
    background: var(--color-bg-surface); border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg); padding: var(--spacing-lg); box-shadow: var(--shadow-md);
}
.est-card-icon {
    width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--color-bg-brand-subtle);
    display: flex; align-items: center; justify-content: center; color: var(--color-text-brand);
}
.est-card-icon svg { width: 24px; height: 24px; }
.est-card h3 { font-size: var(--text-h4-size); line-height: var(--text-h4-line); font-weight: 600; color: var(--color-text-primary); margin: 0; }
.est-card p { font-size: var(--text-body-m-size); line-height: var(--text-body-m-line); color: var(--color-text-secondary); margin: 0; flex-grow: 1; }
.est-link { display: inline-flex; align-items: center; gap: var(--spacing-xs); font-size: var(--text-label-m-size); font-weight: 500; color: var(--color-text-brand); text-decoration: none; }
.est-link svg { width: 18px; height: 18px; transition: transform 0.2s ease; }
.est-link:hover svg { transform: translateX(3px); }

.est-split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-2xl); }
.est-split h2 { font-size: var(--text-h2-size); line-height: var(--text-h2-line); font-weight: 600; letter-spacing: var(--text-h2-tracking); color: var(--color-text-primary); margin: 0 0 var(--spacing-md); }
.est-split p { font-size: var(--text-body-m-size); line-height: 1.75; color: var(--color-text-secondary); margin: 0 0 var(--spacing-md); }
.est-split a { color: var(--color-text-brand); }

.est-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--spacing-xl); counter-reset: step; }
.est-step { display: flex; flex-direction: column; gap: var(--spacing-md); }
.est-step::before {
    counter-increment: step; content: counter(step);
    width: 40px; height: 40px; border-radius: 50%; background: var(--color-bg-brand); color: var(--color-text-on-brand);
    display: flex; align-items: center; justify-content: center; font-size: var(--text-label-m-size); font-weight: 600;
}
.est-step h3 { font-size: var(--text-h4-size); line-height: var(--text-h4-line); font-weight: 600; color: var(--color-text-primary); margin: 0; }
.est-step p { font-size: var(--text-body-m-size); line-height: var(--text-body-m-line); color: var(--color-text-secondary); margin: 0; }

.est-night { background: var(--color-bg-night); color: var(--color-text-on-night); }
.est-band {
    background: radial-gradient(70% 90% at 85% 120%, rgba(242, 107, 29, 0.4), transparent 70%), var(--color-bg-night);
    border-radius: var(--radius-xl); padding: var(--spacing-2xl) var(--spacing-3xl);
    display: flex; flex-direction: column; gap: var(--spacing-lg); align-items: flex-start;
}
.est-band h2 {
    font-size: clamp(2rem, 4vw, var(--text-display-xl-size)); line-height: var(--text-display-xl-line);
    font-weight: 700; letter-spacing: var(--text-display-xl-tracking); color: var(--color-text-on-night); margin: 0; max-width: 18ch;
}
.est-band p { font-size: var(--text-body-l-size); line-height: var(--text-body-l-line); color: var(--color-text-on-night); opacity: 0.78; margin: 0; max-width: 60ch; }
.est-band small { font-size: var(--text-body-s-size); color: var(--color-text-on-night); opacity: 0.72; }
.est-band small a { color: var(--orange-400); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .est-hero-inner { grid-template-columns: 1fr; }
    .est-art { aspect-ratio: 16 / 9; max-height: 420px; }
    .est-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .nb-header-inner, .est-container { padding: 0 var(--spacing-md); }
    .est-section, .est-hero { padding: var(--spacing-xl) 0; }
    .est-cards, .est-steps, .est-split { grid-template-columns: 1fr; }
    .est-art { aspect-ratio: 342 / 240; }
    .est-band { padding: var(--spacing-xl) var(--spacing-lg); }
    .nb-header .nb-btn-primary { display: none; }
    /* style.css declares the hidden toggle after its own media query, so the menu button never showed on phones. */
    .nb-mobile-nav-toggle { display: flex; }
    /* Legacy templates hard-code multi-column grids inline; collapse them on phones. */
    main [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
    .nb-page-hero, .nb-project-hero, .nb-404 { background-size: auto, auto 60%, auto; background-position: center, right bottom, center; }
}
