@font-face {
  font-family: "Sora";
  src: url("../assets/sora-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../assets/manrope-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  /* Aluz brand tokens (site oficial) */
  --navy: #071426;
  --navy-alt: #0b1b31;
  --ink-deep: #040c18;
  --blue: #1479ff;
  --blue-hover: #086ee8;
  /* Button fills: white text needs >= 4.5:1. #1479ff gives 4.03, so buttons use the deeper brand blue (4.77 / 5.9 on hover). */
  --btn: #086ee8;
  --btn-hover: #0a5fd0;
  /* Shape rule: interactive elements 8px, image and panel surfaces 12px. */
  --cyan: #4bc4ff;
  --paper: #f5f8fc;
  --text-on-dark: #eef4fb;
  --text-soft: #b7c6d9;
  --text-faint: #8597ad;
  --mullion: #02070f;

  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;

  --scroll-height: 520vh;
  --ease-out: cubic-bezier(0.22, 0.8, 0.24, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--navy);
  color: var(--text-on-dark);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; border-radius: 4px; }

/* ---------- Loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 100;
  display: none; place-content: center; justify-items: center; gap: 1.25rem;
  background: var(--navy);
  transition: opacity 0.6s var(--ease-out), visibility 0.6s var(--ease-out);
}
.js #loader { display: grid; }
#loader.is-done { opacity: 0; visibility: hidden; }
.loader-brand { width: 160px; height: auto; }
.loader-track { width: 220px; height: 2px; background: rgba(75, 196, 255, 0.16); overflow: hidden; }
#loader-bar { width: 100%; height: 100%; background: var(--cyan); transform: scaleX(0); transform-origin: left center; transition: transform 0.2s var(--ease-out); }
#loader-percent { font-family: var(--font-display); font-size: 0.875rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 5vw;
  transition: background-color 0.3s var(--ease-out);
}
.site-header.is-scrolled { background: rgba(7, 20, 38, 0.82); backdrop-filter: blur(10px); }
.brand img { height: 26px; width: auto; }
.site-header nav { display: flex; align-items: center; gap: 2rem; font-size: 0.9375rem; }
.site-header nav a { text-decoration: none; color: var(--text-soft); transition: color 0.2s var(--ease-out); }
@media (hover: hover) { .site-header nav a:hover { color: var(--text-on-dark); } }
.site-header .nav-cta {
  color: #fff; background: var(--btn);
  padding: 0.6rem 1.1rem; border-radius: 8px; font-weight: 600;
  min-height: 44px; display: inline-flex; align-items: center;
}
@media (hover: hover) { .site-header .nav-cta:hover { background: var(--btn-hover); color: #fff; } }

/* ---------- Hero ---------- */
.hero-standalone {
  position: relative; z-index: 5;
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.7fr);
  align-items: end; gap: 4vw;
  padding: 6rem 5vw 9vh;
  background: var(--navy);
}
.hero-inner { grid-column: 1; grid-row: 1; position: relative; z-index: 1; }
/* The first frame of the film, framed like the window the video plays in */
.hero-window {
  grid-column: 2; grid-row: 1; justify-self: end; align-self: end;
  margin: 0; height: min(72vh, 46rem); aspect-ratio: 540 / 960;
  border: 8px solid var(--mullion); border-radius: 12px; overflow: hidden;
  outline: 1px solid rgba(75, 196, 255, 0.35); outline-offset: 6px;
  background: var(--navy-alt);
}
.hero-window img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-heading {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.2rem, 6.4vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  color: var(--text-on-dark);
}
.hero-heading .word { display: inline-block; margin-right: 0.18em; }
.hero-heading .word:last-child { color: var(--blue); }
.hero-cta-wrap { margin-top: 2.25rem; }
.hero-tagline {
  margin: 4vh 0 0; max-width: 34rem;
  font-size: clamp(1.125rem, 1.2vw + 0.6rem, 1.5rem); line-height: 1.45;
  color: var(--text-soft);
}

/* ---------- Canvas: the office window ---------- */
.canvas-wrap {
  position: fixed; inset: 0; z-index: 1;
  clip-path: circle(0% at 50% 50%);
  background: var(--navy);
}
#canvas { width: 100%; height: 100%; display: block; }

/* ---------- Scroll container + sections ---------- */
#scroll-container { position: relative; z-index: 4; height: var(--scroll-height); overflow-x: clip; }

/* Each section is centred in the viewport at the middle of its scroll range:
   range = container height minus one viewport (ScrollTrigger "top top" → "bottom bottom"). */
.scroll-section {
  position: absolute; left: 0; right: 0;
  top: calc(var(--mid, 0.5) * (100% - 100vh) + 50vh);
  transform: translateY(-50%);
}
/* Text zones end where the video window starts.
   Window width = 84vh × (540 / 960) = 47.25vh, so its half is 23.625vh; plus a 3vw gap. */
:root { --window-half: 23.625vh; --zone-gap: 3vw; }
.align-left { padding-left: 5vw; padding-right: calc(50vw + var(--window-half) + var(--zone-gap)); }
.align-right { padding-left: calc(50vw + var(--window-half) + var(--zone-gap)); padding-right: 5vw; }
.align-left .section-inner,
.align-right .section-inner { max-width: 34rem; }

.section-heading {
  margin: 0;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.2rem, 2.6vw + 1rem, 4rem);
  line-height: 1.02; letter-spacing: -0.035em;
  color: var(--text-on-dark);
  text-wrap: balance;
}
.section-body {
  margin: 1.5rem 0 0; max-width: 30rem;
  font-size: clamp(1.0625rem, 0.35vw + 0.95rem, 1.25rem); line-height: 1.6;
  color: var(--text-soft);
}
.section-note {
  margin: 1.75rem 0 0; padding-top: 0.9rem; max-width: 30rem;
  border-top: 1px solid rgba(75, 196, 255, 0.22);
  font-size: 0.875rem; color: var(--text-faint);
}

/* ---------- CTA ---------- */
.cta-wrap { margin-top: 2rem; }
.cta-button {
  display: inline-block;
  padding: 1.05rem 1.6rem; border-radius: 8px;
  background: var(--btn); color: #fff; text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem;
  transition: background 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
@media (hover: hover) { .cta-button:hover { background: var(--btn-hover); transform: translateY(-2px); } }
.cta-button:active, .site-header .nav-cta:active { transform: scale(0.98); }

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  :root { --scroll-height: 440vh; }
  .site-header nav a:not(.nav-cta) { display: none; }
  .site-header .nav-cta { font-size: 0.8125rem; padding: 0.5rem 0.8rem; }
  .brand img { height: 24px; }

  .hero-standalone { display: flex; flex-direction: column; justify-content: flex-end; padding: 0 16px 12vh; }
  /* Phones: the frame becomes the backdrop, dimmed toward the text */
  .hero-window { position: absolute; inset: 0; align-self: stretch; justify-self: stretch; height: auto; aspect-ratio: auto; border: 0; border-radius: 0; outline: 0; }
  .hero-window img { position: absolute; inset: 0; opacity: 0.42; }
  .hero-window::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 20, 38, 0.35) 0%, rgba(7, 20, 38, 0.75) 45%, var(--navy) 80%); }
  .hero-heading { font-size: clamp(2.8rem, 13vw, 6rem); letter-spacing: -0.04em; }
  .hero-heading .word { margin-right: 0.14em; }

  .align-left, .align-right { padding-left: 16px; padding-right: 16px; }
  .align-left .section-inner, .align-right .section-inner {
    max-width: none;
    background: rgba(7, 20, 38, 0.84);
    padding: 1.5rem 1.25rem; border-radius: 12px;
  }
  .section-heading { font-size: clamp(2rem, 8.5vw, 2.6rem); }
  .section-content .section-heading { font-size: clamp(2rem, 8.5vw, 2.6rem); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  #loader, #loader-bar, .site-header, .cta-button, .route-cta, .faq-list summary::after { transition: none; }
  .cta-button:hover { transform: none; }
}


/* =====================================================================
   Standard part: after the last frame freezes, the page flows normally.
   Solid backgrounds cover the frozen frame; no scroll-linked motion.
   ===================================================================== */
.std-flow { position: relative; z-index: 6; }
.std { background: var(--navy); padding: clamp(5rem, 9vw, 8.5rem) 5vw; }
.std + .std { border-top: 1px solid rgba(75, 196, 255, 0.10); }
.std-inner { max-width: 1180px; margin: 0 auto; }

.std-label {
  margin: 0 0 1rem;
  font-family: var(--font-display); font-size: 0.9375rem; font-weight: 600; color: var(--cyan);
}
.std-heading {
  margin: 0; max-width: 22ch;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.2rem, 2.6vw + 1rem, 4rem);
  line-height: 1.04; letter-spacing: -0.03em; text-wrap: balance;
  color: var(--text-on-dark);
}
.std-lead {
  margin: 1.5rem 0 0; max-width: 60ch;
  font-size: clamp(1.0625rem, 0.4vw + 0.95rem, 1.25rem); line-height: 1.6; color: var(--text-soft);
}
.std-note {
  margin: 3rem 0 0; max-width: 70ch; padding-top: 1rem;
  border-top: 1px solid rgba(75, 196, 255, 0.18);
  font-size: 0.9375rem; color: var(--text-faint);
}

/* Promises: four figures, left-aligned, no cards */
.promise-grid {
  margin-top: 3.5rem;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.5rem 3rem;
}
.promise-figure { margin: 0; display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.promise-figure .count {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(3.4rem, 5vw, 5.5rem); line-height: 0.9; letter-spacing: -0.05em;
  color: var(--text-on-dark); font-variant-numeric: tabular-nums;
}
.promise-unit { font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; color: var(--cyan); }
.promise-text { margin: 1rem 0 0; max-width: 17rem; color: var(--text-soft); }

/* Solar: three routes read top to bottom (question, what it is, price) */
.std-solar { background: var(--navy-alt); }
.route-list { list-style: none; margin: 3.5rem 0 0; padding: 0; }
.route {
  display: grid; grid-template-columns: 1.1fr 1.6fr 1fr; gap: 2rem 3rem;
  padding: 2.25rem 0; border-top: 1px solid rgba(75, 196, 255, 0.16);
}
.route:last-child { border-bottom: 1px solid rgba(75, 196, 255, 0.16); }
.route-question { margin: 0; font-size: 0.9375rem; color: var(--text-faint); }
.route-name {
  margin: 0.4rem 0 0;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 1vw + 1.1rem, 2rem);
  line-height: 1.15; letter-spacing: -0.02em; color: var(--text-on-dark);
}
.route-body p { margin: 0; color: var(--text-soft); max-width: 52ch; }
.route-body .route-guarantee { margin-top: 0.9rem; color: var(--text-on-dark); font-weight: 600; }
.route-offer { display: flex; flex-direction: column; align-items: flex-start; gap: 1.1rem; }
.route-price { margin: 0; color: var(--text-soft); line-height: 1.5; }
.route-price strong { color: var(--text-on-dark); font-weight: 700; }
.route-cta {
  display: inline-block; padding: 0.8rem 1.2rem; border-radius: 8px;
  border: 1px solid var(--blue); color: var(--text-on-dark); text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 0.9375rem; white-space: nowrap;
  transition: background 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
@media (hover: hover) { .route-cta:hover { background: var(--btn); } }
.route-cta:active { transform: scale(0.98); }

/* About: real photo + text */
.about-grid { display: grid; grid-template-columns: 0.9fr 1.3fr; gap: clamp(2.5rem, 5vw, 5rem); align-items: center; }
.about-photo { margin: 0; border-radius: 12px; overflow: hidden; background: linear-gradient(180deg, #0f2440, var(--navy-alt)); }
.about-photo img { width: 100%; height: auto; display: block; }
.about-sub { margin: 2rem 0 0.75rem; font-weight: 600; color: var(--text-on-dark); }
.article-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.article-list a { color: var(--text-soft); text-decoration: underline; text-decoration-color: rgba(75, 196, 255, 0.4); text-underline-offset: 4px; }
@media (hover: hover) { .article-list a:hover { color: var(--text-on-dark); text-decoration-color: var(--cyan); } }

/* FAQ: native disclosure, keyboard-ready */
.std-faq { background: var(--navy-alt); }
.faq-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 2.5rem 4rem; align-items: start; }
.faq-list details { border-top: 1px solid rgba(75, 196, 255, 0.16); }
.faq-list details:last-child { border-bottom: 1px solid rgba(75, 196, 255, 0.16); }
.faq-list summary {
  cursor: pointer; list-style: none; padding: 1.25rem 2.5rem 1.25rem 0; position: relative;
  font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; color: var(--text-on-dark);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+"; position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; font-weight: 400; color: var(--cyan); transition: transform 0.2s var(--ease-out);
}
.faq-list details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-list details p { margin: 0 0 1.4rem; max-width: 62ch; color: var(--text-soft); }

/* Final CTA + footer */
.std-cta { padding-block: clamp(6rem, 11vw, 10rem); }
.cta-heading { font-size: clamp(2.4rem, 3.4vw + 1rem, 4.6rem); max-width: 16ch; }
.site-footer { background: var(--ink-deep); padding: 3rem 5vw; color: var(--text-faint); font-size: 0.9375rem; }
.footer-grid { display: grid; grid-template-columns: auto 1fr auto; gap: 2rem 4rem; align-items: start; }
.footer-logo { height: 26px; width: auto; }
.site-footer p { margin: 0; line-height: 1.7; }
.site-footer a { color: var(--text-soft); text-decoration: none; display: inline-block; min-height: 24px; line-height: 24px; }
@media (hover: hover) { .site-footer a:hover { color: var(--text-on-dark); } }


@media (max-width: 900px) {
  .promise-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .route { grid-template-columns: 1fr; gap: 1rem; }
  .about-grid, .faq-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 360px; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .std { padding: 4.5rem 16px; }
  .promise-grid { gap: 2rem 1.25rem; }
  .promise-text { font-size: 0.9375rem; }
  .site-footer { padding: 2.5rem 16px; }
}

/* Solar: the route list already closes with a rule; the note sits under it without a second one */
.std-solar .std-note { border-top: 0; padding-top: 0; margin-top: 2rem; }

@media (max-width: 767px) {
  /* Scenes sit in the lower part of the screen so the people in the film stay visible */
  .scroll-section { top: calc(var(--mid, 0.5) * (100% - 100vh) + 100vh - 20px); transform: translateY(-100%); }
  .align-left .section-inner, .align-right .section-inner { padding: 1.25rem 1.1rem; }
  .section-content .section-body { font-size: 1rem; margin-top: 0.9rem; }
  .section-content .section-note { margin-top: 1rem; }
  /* Promises: the unit always sits under the figure, so the four columns line up */
  .promise-figure { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
}

/* UX audit: navigation, resilient layouts and keyboard access. */
html { scroll-padding-top: 6rem; }
[id], :focus { scroll-margin-top: 6rem; }
#loader, .js #loader { display: none; }
.site-header { background: rgba(7, 20, 38, 0.96); gap: 1rem; }
.brand { min-height: 44px; display: flex; align-items: center; flex-shrink: 0; }
.site-header nav a { min-height: 44px; display: inline-flex; align-items: center; }
.skip-link { position: fixed; top: 1rem; left: 1rem; z-index: 110; padding: .75rem 1rem; background: var(--paper); color: var(--navy); transform: translateY(-200%); border-radius: 8px; }
.skip-link:focus { transform: none; }
.mobile-menu { display: none; }
.cta-button, .route-cta, .cta-ghost { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: center; }
.momento-link { min-height: 44px; }
.momento-question:focus-visible, .result-name:focus-visible { outline: 2px solid var(--cyan); outline-offset: 6px; }
.site-footer a { min-height: 44px; line-height: 1.5; padding-block: .6rem; overflow-wrap: anywhere; }
.article-list a { display: inline-block; padding-block: .4rem; }
.hero-heading .word { max-width: 100%; overflow-wrap: anywhere; }
@media (max-width: 1100px) {
  .site-header { padding: .75rem max(16px, env(safe-area-inset-left)); }
  .site-header nav { gap: .75rem; }
  .site-header > nav a:not(.nav-cta) { display: none; }
  .site-header .nav-cta { font-size: .8125rem; padding: .6rem .75rem; }
  .mobile-menu { display: block; margin-left: auto; }
  .mobile-menu summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; padding: .5rem .75rem; border: 1px solid var(--text-faint); border-radius: 8px; font-weight: 600; font-size: .9375rem; }
  .mobile-menu summary::after { content: "▾"; margin-left: .5rem; }
  .mobile-menu[open] summary::after { content: "▴"; }
  .mobile-menu nav { position: absolute; top: 100%; left: 16px; right: 16px; display: grid; padding: 1rem; border: 1px solid var(--text-faint); border-radius: 12px; background: var(--navy); box-shadow: 0 12px 32px #02070f66; }
  .mobile-menu nav a { display: flex !important; padding: .5rem .75rem; }
  .hero-standalone { padding-top: 7rem; }
}
/* Static reading mode is also the fallback if animation dependencies fail. */
html:not(.js) .canvas-wrap, .static-method .canvas-wrap { display: none; }
html:not(.js) #scroll-container, .static-method #scroll-container { height: auto; padding: clamp(2rem, 5vw, 4rem) 5vw; background: var(--navy); display: grid; gap: 2rem; }
html:not(.js) .scroll-section, .static-method .scroll-section { position: relative; top: auto; transform: none; padding: 0; }
html:not(.js) .section-inner, .static-method .section-inner { max-width: 52rem; padding: 2rem 0; background: none; border-radius: 0; border-bottom: 1px solid #4bc4ff38; }
@media (max-width: 767px) {
  .hero-standalone { padding-bottom: 3rem; }
  .static-method #scroll-container, html:not(.js) #scroll-container { padding-inline: 16px; gap: 1rem; }
  .promise-text { font-size: 1rem; }
  .first-message { padding: 1.25rem; }
}
@media (max-width: 360px) {
  .brand img { height: 20px; }
  .site-header { gap: .5rem; }
  .mobile-menu summary { padding-inline: .5rem; }
  .site-header .nav-cta { max-width: 9rem; text-align: center; }
  .promise-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

/* Reduced motion uses the readable static alternative at every viewport size. */
@media (prefers-reduced-motion: reduce) {
  .canvas-wrap { display: none !important; }
  #scroll-container { height: auto; padding: 2rem 5vw; display: grid; gap: 1rem; background: var(--navy); }
  .scroll-section { position: relative; top: auto; transform: none; padding: 0; }
  .scroll-section .section-inner { max-width: 52rem; padding: 2rem 0; background: none; border-bottom: 1px solid #4bc4ff38; }
  .scroll-section .section-inner, .scroll-section .section-inner > * { opacity: 1 !important; visibility: visible !important; transform: none !important; }
  .hero-inner, .hero-window, .hero-heading .word, .hero-tagline, .hero-cta-wrap { opacity: 1 !important; transform: none !important; }
}

/* Service names and deliverables: readable at narrow widths. */
.route-name, .result-name { text-wrap: balance; overflow-wrap: break-word; }
.route > *, .momento-result > * { min-width: 0; }
.route-body .route-scope { margin-top: 1.1rem; font-size: .9375rem; line-height: 1.65; }
.route-scope strong { color: var(--text-on-dark); }
.service-shortcut { margin: 1.25rem 0 0; }

/* Restore the cinematic method on tablets as well as phones and desktop. */
@media (min-width: 768px) and (max-width: 1100px) {
  .align-left, .align-right { padding-inline: 5vw; }
  .scroll-section { top: calc(var(--mid, .5) * (100% - 100vh) + 100vh - 24px); transform: translateY(-100%); }
  .scroll-section .section-inner { max-width: 38rem; padding: 1.5rem; background: rgba(7, 20, 38, .9); border-radius: 12px; }
  .section-heading { font-size: clamp(2rem, 3.6vw, 2.6rem); }
}
