/* ==========================================================================
   Layout: header & navigation, page heroes, section headings, footer
   ========================================================================== */

/* Header ------------------------------------------------------------------ */
.site-header {
    position: fixed; inset: 0 0 auto; z-index: 100;
    height: var(--header-h);
    color: #fff;
    transition: background .4s var(--ease), height .4s var(--ease), box-shadow .4s, transform .5s var(--ease);
}
.site-header.is-scrolled {
    --header-h: 70px;
    background: rgba(3, 3, 42, .9);
    backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .08);
}
.site-header.is-hidden { transform: translateY(-100%); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 28px; }

.logo { display: inline-flex; align-items: center; gap: 12px; flex: none; }
.logo-mark { width: 44px; height: 44px; transition: transform .8s var(--ease); filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .25)); }
.logo:hover .logo-mark { transform: rotate(90deg) scale(1.05); }
.logo-word { display: flex; flex-direction: column; line-height: 1; }
.logo-name { font: 800 1.32rem/1 var(--font-display); letter-spacing: .01em; color: currentColor; }
.logo-name b { color: var(--orange); font-weight: 800; }
.logo-sub { margin-top: 4px; font: 700 .62rem/1 var(--font-display); letter-spacing: .32em; color: var(--green-400); }

.main-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-link {
    position: relative; display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 14px; border-radius: 999px;
    font-size: .92rem; font-weight: 500; color: rgba(255, 255, 255, .78);
    transition: color .25s, background .25s;
}
.nav-link:hover, .nav-link.is-active { color: #fff; background: rgba(255, 255, 255, .07); }
.nav-link.is-active::after {
    content: ''; position: absolute; left: 50%; bottom: 3px; width: 5px; height: 5px;
    background: var(--orange); border-radius: 1px; transform: translateX(-50%) rotate(45deg);
}
.caret { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .3s; }
.header-cta { margin-left: 8px; }

/* Mega menu */
.nav-item { position: relative; }
.mega {
    position: absolute; top: calc(100% + 14px); left: 50%;
    width: min(960px, 94vw);
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; /* one column per division, plus the quote card */
    padding: 14px; border-radius: var(--radius-lg);
    background: rgba(7, 7, 64, .92); border: 1px solid rgba(255, 255, 255, .1);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .6);
    opacity: 0; visibility: hidden;
    transform: translateX(-50%) translateY(10px) rotateX(-8deg); transform-origin: top center;
    transition: opacity .35s var(--ease), transform .45s var(--ease), visibility .35s;
}
.mega::before { content: ''; position: absolute; inset: -16px 0 auto; height: 16px; }
.has-mega:hover .mega, .has-mega:focus-within .mega { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0) rotateX(0); }
.has-mega:hover .caret { transform: rotate(225deg) translateY(-2px); }
.mega-col { display: flex; flex-direction: column; padding: 8px; }
.mega-col a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; font-size: .9rem; color: rgba(255, 255, 255, .75); transition: background .25s, color .25s, transform .25s; }
.mega-col a .icon { color: var(--orange-300); }
.mega-col a:hover { background: rgba(255, 255, 255, .06); color: #fff; transform: translateX(4px); }
.mega-col .mega-head { font: 600 .78rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: #fff; padding-bottom: 14px; }
.mega-head span { color: var(--orange); }
.mega-head.build span { color: var(--green-400); }
.mega-card {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
    padding: 22px; border-radius: 18px; min-height: 240px;
    background: radial-gradient(circle at 80% 10%, rgba(254, 102, 0, .55), transparent 55%), radial-gradient(circle at 10% 90%, rgba(0, 153, 51, .45), transparent 55%), var(--night-3);
}
.mega-card strong { font: 600 1.2rem/1.25 var(--font-display); }
.mega-card-link { display: inline-flex; align-items: center; gap: 8px; color: var(--orange-300); font-weight: 600; font-size: .9rem; }

/* Mobile toggle */
.nav-toggle { display: none; width: 46px; height: 46px; margin-left: auto; border-radius: 14px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); position: relative; }
.nav-toggle span { position: absolute; left: 13px; right: 13px; height: 2px; background: #fff; border-radius: 2px; transition: transform .4s var(--ease), opacity .3s, top .4s var(--ease); }
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 22px; right: 19px; }
.nav-toggle span:nth-child(3) { top: 28px; }
.nav-open .nav-toggle span:nth-child(1) { top: 22px; transform: rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { top: 22px; transform: rotate(-45deg); }

/* Page hero (inner pages) ---------------------------------------------------- */
.page-hero {
    position: relative; overflow: hidden; isolation: isolate;
    padding: calc(var(--header-h) + clamp(60px, 9vw, 120px)) 0 clamp(70px, 9vw, 120px);
    background: radial-gradient(ellipse at 85% 20%, rgba(254, 102, 0, .28), transparent 50%), radial-gradient(ellipse at 10% 100%, rgba(0, 153, 51, .25), transparent 50%), var(--night);
    color: #fff;
}
.page-hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.page-hero-grid, .hero-grid {
    position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
}
.page-hero-inner { max-width: calc(880px + var(--gutter) * 2); margin-left: 0; margin-right: auto; }
@media (min-width: 1321px) { .page-hero-inner { margin-left: max(0px, calc((100vw - var(--container)) / 2 - var(--gutter))); } }
.page-hero .display { margin: 20px 0 22px; }
.page-hero .lead { color: rgba(255, 255, 255, .72); max-width: 640px; }
.breadcrumb { display: flex; gap: 10px; margin-bottom: 28px; font: 500 .78rem var(--font-mono); color: rgba(255, 255, 255, .5); }
.breadcrumb a:hover { color: #fff; }
.page-hero::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
    background: linear-gradient(90deg, var(--orange) 0 33.3%, #fff 33.3% 66.6%, var(--green) 66.6%);
    opacity: .9;
}

/* Section heading ---------------------------------------------------------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px 60px; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head > div { max-width: 720px; }
.section-head .h1 { margin-top: 16px; }
.section-head > .lead { max-width: 420px; padding-bottom: 6px; }
.section-head.center { flex-direction: column; align-items: center; text-align: center; }
.section-head.center > div { display: flex; flex-direction: column; align-items: center; }

/* Footer -------------------------------------------------------------------- */
.site-footer { position: relative; overflow: hidden; background: var(--night); color: rgba(255, 255, 255, .7); padding-top: 90px; }
.footer-glow { position: absolute; inset: auto -20% -60% -20%; height: 80%; background: radial-gradient(ellipse at 30% 50%, rgba(254, 102, 0, .18), transparent 60%), radial-gradient(ellipse at 75% 50%, rgba(0, 153, 51, .16), transparent 60%); pointer-events: none; }
.footer-top { position: relative; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 48px; padding-bottom: 60px; }
.logo-light { color: #fff; }
.footer-brand p { margin-top: 22px; max-width: 340px; font-size: .95rem; }
.socials { display: flex; gap: 10px; margin-top: 26px; }
.socials a { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); transition: background .3s, transform .3s; }
.socials a:hover { background: var(--orange); transform: translateY(-3px); }
.footer-col { display: flex; flex-direction: column; gap: 12px; font-size: .95rem; }
.footer-col a { transition: color .2s, transform .2s; width: fit-content; }
.footer-col a:hover { color: #fff; transform: translateX(3px); }
.footer-label { font: 500 .74rem var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: #fff; margin-bottom: 8px; }
.footer-contact a, .footer-contact span { display: inline-flex; align-items: center; gap: 10px; }
.footer-contact .icon { color: var(--orange-300); }
.footer-wordmark {
    position: relative; text-align: center; user-select: none;
    font: 800 clamp(5rem, 21vw, 19rem)/.8 var(--font-display); letter-spacing: -.04em;
    color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .1);
    background: linear-gradient(180deg, rgba(255, 255, 255, .08), transparent 85%); -webkit-background-clip: text; background-clip: text;
    margin-bottom: -.06em;
}
.footer-wordmark span { -webkit-text-stroke-color: rgba(254, 102, 0, .35); }
.footer-bottom { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 26px 0 30px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .85rem; }
.footer-bottom a:hover { color: #fff; }
.tricolor { display: inline-flex; gap: 6px; }
.tricolor i { width: 28px; height: 4px; border-radius: 4px; }
.tricolor i:nth-child(1) { background: var(--orange); }
.tricolor i:nth-child(2) { background: #fff; }
.tricolor i:nth-child(3) { background: var(--green); }

/* Floating WhatsApp --------------------------------------------------------- */
.whatsapp-float {
    position: fixed; right: 22px; bottom: 22px; z-index: 90;
    width: 58px; height: 58px; display: grid; place-items: center;
    border-radius: 50%; background: var(--green); color: #fff;
    box-shadow: 0 14px 34px -8px rgba(0, 153, 51, .7);
    transition: transform .4s var(--ease);
}
.whatsapp-float .icon { width: 28px; height: 28px; }
.whatsapp-float:hover { transform: scale(1.08) rotate(-6deg); }
.whatsapp-float::before { content: ''; position: absolute; inset: 0; border-radius: inherit; border: 2px solid var(--green); animation: ping 2.4s var(--ease) infinite; }

/* Responsive ---------------------------------------------------------------- */
@media (max-width: 1100px) {
    .header-cta { display: none; }
    .nav-toggle { display: block; }
    .main-nav { display: none; } /* phones and tablets use the full-screen mobile menu */
    .nav-open { overflow: hidden; }
    .footer-top { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
    :root { --header-h: 72px; }
    .logo-mark { width: 38px; height: 38px; }
    .logo-name { font-size: 1.15rem; }
    .section-head { flex-direction: column; align-items: flex-start; }
    .footer-top { grid-template-columns: 1fr; gap: 36px; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .whatsapp-float { width: 52px; height: 52px; right: 16px; bottom: 16px; }
}

/* Mobile menu ------------------------------------------------------------------
   A full-screen layer above everything (header, WhatsApp button, preloader). It opens with a
   "code" or "bricks" reveal, set by ui.js in data-fx; the effect pieces go in .mm-fx. */
.mobile-menu { position: fixed; inset: 0; z-index: 1000; color: #fff; background: var(--night); overflow: hidden; }
.mobile-menu[hidden] { display: none; }
.mobile-menu.is-closing { opacity: 0; transition: opacity .25s ease; }
.mm-fx { position: absolute; inset: 0; overflow: hidden; }
.mm-panel {
    position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column;
    padding: 0 var(--gutter) max(24px, env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain;
    background: radial-gradient(circle at 90% 8%, rgba(254, 102, 0, .26), transparent 45%), radial-gradient(circle at 0 100%, rgba(0, 153, 51, .26), transparent 50%), rgba(3, 3, 42, .86);
}
.mm-top { flex: none; height: var(--header-h); display: flex; align-items: center; justify-content: space-between; }
.mm-close { position: relative; width: 46px; height: 46px; border-radius: 14px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); cursor: pointer; }
.mm-close span { position: absolute; left: 13px; right: 13px; top: 22px; height: 2px; border-radius: 2px; background: #fff; transform: rotate(45deg); }
.mm-close span + span { transform: rotate(-45deg); }
.mm-links { margin-top: 10px; }
.mm-link {
    display: grid; grid-template-columns: 38px 1fr auto; align-items: center; padding: 15px 2px;
    border-bottom: 1px solid rgba(255, 255, 255, .09); font: 600 clamp(1.3rem, 5.4vw, 1.75rem)/1.2 var(--font-display); color: rgba(255, 255, 255, .92);
}
.mm-num { font: 500 .72rem var(--font-mono); letter-spacing: .08em; color: var(--orange-300); }
.mm-text { min-height: 1.2em; }
.mm-arrow { width: 9px; height: 9px; margin-right: 6px; border-top: 2px solid rgba(255, 255, 255, .35); border-right: 2px solid rgba(255, 255, 255, .35); transform: rotate(45deg); transition: transform .25s, border-color .25s; }
.mm-link.is-active .mm-text { color: var(--orange-300); }
.mm-link.is-active .mm-arrow, .mm-link:hover .mm-arrow { border-color: var(--orange); transform: translateX(3px) rotate(45deg); }
.mm-foot { margin-top: auto; padding-top: 26px; }
.mm-cta { justify-content: center; }
.mm-contact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.mm-contact a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); font-size: .82rem; font-weight: 600; color: rgba(255, 255, 255, .88); }
.mm-contact .icon { width: 20px; height: 20px; color: var(--green-400); }
.nav-open .whatsapp-float { opacity: 0; pointer-events: none; }

/* Effect 1: code. Lines of code stream across the screen, a scan line sweeps down and
   "renders" the menu, then each item types itself out. */
.mm-code-line {
    position: absolute; left: 0; white-space: pre; font: 500 12px/1 var(--font-mono); color: var(--c);
    opacity: 0; transform: translateX(var(--from)); animation: mm-code-in .9s var(--ease) forwards; animation-delay: var(--d);
}
@keyframes mm-code-in {
    35% { opacity: .95; }
    100% { opacity: .16; transform: translateX(var(--to)); }
}
.mm-scan { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--orange), var(--green-400), transparent); box-shadow: 0 0 18px 4px rgba(254, 102, 0, .45); opacity: 0; }
.mobile-menu[data-fx="code"] .mm-panel { clip-path: inset(0 0 100% 0); }
.mobile-menu[data-fx="code"].is-revealing .mm-panel { clip-path: inset(0 0 0 0); transition: clip-path .7s linear; }
.mobile-menu[data-fx="code"].is-revealing .mm-scan { animation: mm-scan .7s linear forwards; }
@keyframes mm-scan { 0% { top: 0; opacity: 1; } 92% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
.mm-text.is-typing::after { content: '▍'; margin-left: 2px; color: var(--orange); animation: mm-caret .7s steps(1) infinite; }
@keyframes mm-caret { 50% { opacity: 0; } }

/* Effect 2: bricks. A wall is laid course by course from the bottom, then cleared away
   while the menu items drop into place like bricks. */
.mobile-menu[data-fx="bricks"] .mm-fx { background: #1b120d; }
.mm-brick {
    position: absolute; border-radius: 2px; background: var(--c);
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .22), inset 0 2px 0 rgba(255, 255, 255, .14);
    opacity: 0; transform: translateY(-70px); animation: mm-brick-lay .36s cubic-bezier(.3, 1.35, .5, 1) forwards; animation-delay: var(--d);
}
@keyframes mm-brick-lay { to { opacity: 1; transform: none; } }
.mobile-menu[data-fx="bricks"].is-built .mm-brick { animation: mm-brick-clear .45s ease-in forwards; animation-delay: var(--d2); opacity: 1; transform: none; }
@keyframes mm-brick-clear { to { opacity: 0; transform: translateY(46px) rotate(var(--r)) scale(.6); } }
.mobile-menu[data-fx="bricks"] .mm-panel { opacity: 0; pointer-events: none; }
.mobile-menu[data-fx="bricks"].is-revealing .mm-panel { opacity: 1; pointer-events: auto; transition: opacity .3s ease; }
.mobile-menu[data-fx="bricks"].is-revealing .mm-link,
.mobile-menu[data-fx="bricks"].is-revealing .mm-foot { animation: mm-row-drop .5s cubic-bezier(.3, 1.45, .5, 1) both; animation-delay: calc(var(--i, 8) * 70ms + 120ms); }
@keyframes mm-row-drop { from { opacity: 0; transform: translateY(-42px); } }
.mobile-menu[data-fx="bricks"] .mm-link { border-bottom-color: rgba(254, 102, 0, .22); }

@media (prefers-reduced-motion: reduce) {
    .mm-code-line, .mm-brick, .mm-scan { display: none; }
}
/* Tablets and narrow laptop windows: keep the menu in a readable centred column instead of
   stretching rows and buttons across the whole screen. */
@media (min-width: 640px) {
    .mm-links, .mm-foot { width: 100%; max-width: 560px; margin-left: auto; margin-right: auto; }
    .mm-links { margin-top: clamp(24px, 9vh, 96px); }
    .mm-foot { margin-top: 32px; padding-top: 0; }
    .mm-link { padding: 18px 2px; }
}
@media (min-width: 1101px) {
    .mobile-menu { display: none !important; }
}
.mega-col .mega-head { display: flex; align-items: flex-start; gap: 8px; line-height: 1.35; }
.mega-head span { flex: none; }

/* "Projects" dropdown: the mega menu in a single column. */
.mega.mega-list { width: 340px; grid-template-columns: 1fr; }
.mega-list .mega-col a { align-items: flex-start; }
.mega-list .mega-col a .icon { margin-top: 2px; flex: none; }
.mega-list .mega-col a span { display: flex; flex-direction: column; gap: 2px; }
.mega-list .mega-col a strong { color: #fff; font-weight: 600; }
.mega-list .mega-col a small { font-size: .8rem; color: rgba(255, 255, 255, .55); }
.mega-list .mega-col a.is-current { background: rgba(255, 255, 255, .06); }
/* Mobile menu: the Projects sub-pages as a compact row of chips. */
.mm-sub { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 14px 38px; border-bottom: 1px solid rgba(255, 255, 255, .09); }
.mm-sub a { padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); font-size: .82rem; font-weight: 600; color: rgba(255, 255, 255, .85); }
.mm-sub a.is-active { border-color: var(--orange); color: var(--orange-300); }
.mobile-menu[data-fx="bricks"].is-revealing .mm-sub { animation: mm-row-drop .5s cubic-bezier(.3, 1.45, .5, 1) both; animation-delay: 420ms; }

/* Account link (customers & partners) */
.header-account { display: grid; place-items: center; width: 40px; height: 40px; margin-left: 10px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); color: #fff; transition: background .2s, border-color .2s; }
.header-account .icon { width: 18px; height: 18px; }
.header-account:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .5); }
@media (max-width: 1360px) { .header-account { display: none; } } /* the menu needs the room; the mobile menu and footer link to the account */
