/* ============================================
   LUXURY WINDOWS — Custom Design System
   Stack: Tailwind CSS 4.0 (CDN) + Custom CSS
   ============================================ */

/* --- Google Fonts Import --- */
/* --- CSS Custom Properties --- */
:root {
  /* Typography */
  --font-serif: 'Mulish', 'Helvetica Neue', Arial, sans-serif;
  --font-sans: 'Mulish', 'Helvetica Neue', Arial, sans-serif;

  /* Colors */
  --color-white: #FFFFFF;
  --color-offwhite: #FAFAF8;
  --color-cream: #F5F4F0;
  --color-warm-grey: #8A8A8A;
  --color-anthracite: #2C2C2C;
  --color-matte-black: #1A1A1A;
  --color-border: #E8E6E1;

  /* Spacing */
  --section-padding-y: clamp(80px, 10vw, 160px);
  --section-padding-x: clamp(24px, 5vw, 80px);

  /* Transitions */
  --transition-smooth: 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-fast: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* --- Base Reset & Global Styles --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

section[id],
.section[id],
.cta[id],
.hero[id] {
  scroll-margin-top: 88px;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-anthracite);
  background-color: var(--color-white);
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  text-decoration: none;
  color: inherit;
  transition: opacity var(--transition-fast);
}

a:hover {
  opacity: 0.7;
}

/* --- Typography --- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.15;
  color: var(--color-matte-black);
}

h1 {
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
}

h4 {
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
}

p {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(0.95rem, 1.1vw, 1.1rem);
  line-height: 1.8;
  color: var(--color-warm-grey);
}

.label {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.75rem; /* >=12px lighthouse */
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-warm-grey);
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px var(--section-padding-x);
  transition: background-color var(--transition-fast),
    padding var(--transition-fast),
    box-shadow var(--transition-fast);
}

.nav.scrolled {
  background-color: rgba(255, 255, 255, 0.97);
  padding: 16px var(--section-padding-x);
  box-shadow: 0 1px 0 var(--color-border);
}

.theme-dark .nav.scrolled {
  background-color: rgba(26, 26, 26, 0.96);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--color-white);
  letter-spacing: 0.05em;
  transition: color var(--transition-fast);
}

.nav.scrolled .nav-logo {
  color: var(--color-matte-black);
}

.theme-dark .nav.scrolled .nav-logo {
  color: var(--color-white);
}

.nav-logo-img {
  width: 180px;
  max-width: 100%;
  height: auto;
  display: block;
  transition: filter var(--transition-fast);
  filter: brightness(0) invert(1);
  /* White for hero bg */
}

.nav.scrolled .nav-logo-img {
  filter: none;
}

.theme-dark .nav.scrolled .nav-logo-img {
  filter: brightness(0) invert(1);
}

.footer-logo-img {
  width: 300px;
  max-width: 100%;
  height: auto;
  filter: brightness(0) invert(1);
  /* Assuming dark footer */
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 40px;
  list-style: none;
}

.nav-lang {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 24px;
}

.nav-lang button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  padding: 6px 10px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
}

.nav-lang button.active,
.nav-lang button:hover {
  background-color: var(--color-white);
  color: var(--color-matte-black);
  border-color: var(--color-white);
  opacity: 1;
}

.nav.scrolled .nav-lang button {
  border-color: var(--color-warm-grey);
  color: var(--color-warm-grey);
}

.nav.scrolled .nav-lang button.active,
.nav.scrolled .nav-lang button:hover {
  background-color: var(--color-matte-black);
  color: var(--color-white);
  border-color: var(--color-matte-black);
}

.nav-links a {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  transition: color var(--transition-fast);
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 4px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: currentColor;
  transition: width var(--transition-fast);
}

.nav-links a:hover {
  opacity: 1;
  color: var(--color-white);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a.active-link {
  color: var(--color-white);
}

.nav-links a.active-link::after {
  width: 100%;
}

.nav.scrolled .nav-links a {
  color: var(--color-warm-grey);
}

.nav.scrolled .nav-links a:hover {
  color: var(--color-matte-black);
}

.theme-dark .nav.scrolled .nav-links a {
  color: rgba(255, 255, 255, 0.7);
}

.theme-dark .nav.scrolled .nav-links a:hover {
  color: var(--color-white);
}

/* Mobile menu button */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 28px;
  height: 1.5px;
  background-color: var(--color-white);
  transition: transform var(--transition-fast),
    opacity var(--transition-fast),
    background-color var(--transition-fast);
}

.nav.scrolled .nav-toggle span {
  background-color: var(--color-matte-black);
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
      rgba(0, 0, 0, 0.25) 0%,
      rgba(0, 0, 0, 0.1) 40%,
      rgba(0, 0, 0, 0.35) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--color-white);
  max-width: 900px;
  width: 100%;
  /* Clear fixed header so the label never sits under the nav */
  padding: clamp(110px, 18vh, 160px) var(--section-padding-x) 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

.hero-content h1 {
  color: var(--color-white);
  margin-bottom: 20px;
  font-weight: 300;
  font-size: clamp(1.75rem, 3.6vw, 2.85rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  max-width: 18ch;
}

.hero-content p {
  color: rgba(255, 255, 255, 0.8);
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  font-weight: 300;
  max-width: 560px;
  margin: 0 auto 32px;
}

.hero-scroll {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: clamp(28px, 5vh, 48px);
  flex-shrink: 0;
  animation: float 3s ease-in-out infinite;
}

.hero-scroll .line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.6), transparent);
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(8px);
  }
}

/* --- Section Shared Styles --- */
.section {
  padding: var(--section-padding-y) var(--section-padding-x);
}

.section-center {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: clamp(48px, 6vw, 80px);
}

.section-header .label {
  margin-bottom: 16px;
  display: block;
}

.section-header h2 {
  margin-bottom: 20px;
}

.section-header p {
  max-width: 600px;
}

.section-center .section-header p,
.section-header.section-center p {
  margin-left: auto;
  margin-right: auto;
}

/* Divider line */
.divider {
  width: 60px;
  height: 1px;
  background-color: var(--color-border);
  margin: 24px 0;
}

.section-center .divider {
  margin: 24px auto;
}

/* --- About Section --- */
.about {
  background-color: var(--color-white);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 100px);
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.about-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/5;
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.about-image:hover img {
  transform: scale(1.03);
}

.about-text {
  max-width: 520px;
}

.about-text blockquote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  color: var(--color-matte-black);
  line-height: 1.5;
  margin-top: 32px;
  padding-left: 24px;
  border-left: 2px solid var(--color-border);
}

/* --- Categories Grid --- */
.categories {
  background-color: var(--color-offwhite);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  max-width: 1600px;
  margin: 0 auto;
}

.category-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3/4;
  cursor: pointer;
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.category-card:hover img {
  transform: scale(1.05);
}

.category-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
      rgba(0, 0, 0, 0.6) 0%,
      rgba(0, 0, 0, 0.05) 50%,
      transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(24px, 3vw, 48px);
  transition: background var(--transition-fast);
}

.category-card:hover .category-overlay {
  background: linear-gradient(to top,
      rgba(0, 0, 0, 0.7) 0%,
      rgba(0, 0, 0, 0.1) 60%,
      transparent 100%);
}

.category-overlay .label {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}

.category-overlay h3 {
  color: var(--color-white);
  margin-bottom: 12px;
}

.categories-grid-solutions .category-overlay {
  padding: clamp(14px, 1.6vw, 22px);
  justify-content: flex-end;
}

.categories-grid-solutions .category-overlay h3 {
  font-size: clamp(0.8rem, 0.95vw, 0.95rem);
  line-height: 1.3;
  letter-spacing: 0.01em;
  margin-bottom: 0;
  max-width: 26ch;
  transition: margin-bottom var(--transition-fast);
}

.categories-grid-solutions .category-overlay p {
  font-size: 0.68rem;
  line-height: 1.4;
  max-width: 38ch;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin: 0;
  transform: none;
  transition:
    max-height var(--transition-fast),
    opacity var(--transition-fast),
    margin-top var(--transition-fast);
}

.categories-grid-solutions .category-card:hover .category-overlay h3 {
  margin-bottom: 8px;
}

.categories-grid-solutions .category-card:hover .category-overlay p {
  max-height: 7.5em;
  opacity: 1;
  transform: none;
}

.category-overlay p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.category-card:hover .category-overlay p {
  opacity: 1;
  transform: translateY(0);
}

.category-overlay-visible p {
  opacity: 1;
  transform: none;
}

/* --- Technical Section --- */
.technical {
  background-color: var(--color-white);
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(24px, 4vw, 60px);
  max-width: 1200px;
  margin: 0 auto;
}

.tech-item {
  text-align: center;
  padding: 40px 20px;
}

.tech-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 28px;
  color: var(--color-matte-black);
}

.tech-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1;
  fill: none;
}

.tech-item h4 {
  margin-bottom: 12px;
}

.tech-item p {
  font-size: 0.9rem;
}

.tech-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  max-width: 1200px;
  margin: 80px auto 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.tech-stat {
  text-align: center;
  padding: 48px 20px;
  border-right: 1px solid var(--color-border);
}

.tech-stat:last-child {
  border-right: none;
}

.tech-stat .number {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 400;
  color: var(--color-matte-black);
  line-height: 1;
  margin-bottom: 8px;
}

.tech-stat .label {
  font-size: 0.75rem;
}

/* --- Portfolio Gallery --- */
.portfolio {
  background-color: var(--color-offwhite);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  max-width: 1600px;
  margin: 0 auto;
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.portfolio-item:nth-child(1) {
  grid-column: 1 / 8;
  grid-row: 1 / 3;
  aspect-ratio: 16/11;
}

.portfolio-item:nth-child(2) {
  grid-column: 8 / 13;
  aspect-ratio: 5/4;
}

.portfolio-item:nth-child(3) {
  grid-column: 8 / 13;
  aspect-ratio: 5/4;
}

.portfolio-item:nth-child(4) {
  grid-column: 1 / 5;
  aspect-ratio: 4/5;
}

.portfolio-item:nth-child(5) {
  grid-column: 5 / 9;
  aspect-ratio: 4/5;
}

.portfolio-item:nth-child(6) {
  grid-column: 9 / 13;
  aspect-ratio: 4/5;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.portfolio-item:hover img {
  transform: scale(1.04);
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(20px, 3vw, 40px);
  transition: background var(--transition-fast);
}

.portfolio-item:hover .portfolio-overlay {
  background: rgba(26, 26, 26, 0.4);
}

.portfolio-overlay .label,
.portfolio-overlay h3 {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.portfolio-overlay h3 {
  transition-delay: 0.05s;
}

.portfolio-item:hover .portfolio-overlay .label,
.portfolio-item:hover .portfolio-overlay h3 {
  opacity: 1;
  transform: translateY(0);
}

.portfolio-overlay .label {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
}

.portfolio-overlay h3 {
  color: var(--color-white);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
}

/* --- CTA Section --- */
.cta {
  position: relative;
  padding: clamp(120px, 15vw, 240px) var(--section-padding-x);
  overflow: hidden;
}

.cta-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.cta-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.55);
}

.cta-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.cta-content h2 {
  color: var(--color-white);
  margin-bottom: 20px;
}

.cta-content p {
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 40px;
  font-size: clamp(1rem, 1.2vw, 1.15rem);
}

.contact-form {
  margin-top: 32px;
  background-color: rgba(0, 0, 0, 0.35);
  padding: 24px;
  border-radius: 12px;
  backdrop-filter: blur(6px);
}

.contact-form .form-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 16px;
}

.contact-form label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 6px;
}

.contact-form input:not([type="checkbox"]),
.contact-form textarea {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  padding: 10px 16px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.contact-form textarea {
  border-radius: 16px;
  resize: vertical;
  min-height: 120px;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.72);
}

.contact-form input:not([type="checkbox"]):focus,
.contact-form textarea:focus {
  border-color: var(--color-white);
  background-color: rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.contact-form .form-helper {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 16px;
}

.contact-form .btn {
  margin-top: 4px;
}

.form-status {
  margin-top: 12px;
  font-size: 0.8rem;
  min-height: 1em;
}

.form-status.ok {
  color: #c6f6d5;
}

.form-status.error {
  color: #fed7d7;
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.75rem; /* >=12px lighthouse */
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 18px 48px;
  border: 1px solid var(--color-white);
  color: var(--color-white);
  background: transparent;
  cursor: pointer;
  transition: background-color var(--transition-fast),
    color var(--transition-fast);
}

.btn:hover {
  background-color: var(--color-white);
  color: var(--color-matte-black);
  opacity: 1;
}

.btn-dark {
  border-color: var(--color-matte-black);
  color: var(--color-matte-black);
}

.btn-dark:hover {
  background-color: var(--color-matte-black);
  color: var(--color-white);
}

/* --- Footer --- */
.footer {
  background-color: var(--color-matte-black);
  padding: 80px var(--section-padding-x) 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  max-width: 1400px;
  margin: 0 auto;
  padding-bottom: 60px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand .nav-logo {
  color: var(--color-white);
  display: inline-block;
  margin-bottom: 20px;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  max-width: 320px;
}

.footer-col .footer-heading, .footer-col h4 {
  color: var(--color-white);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.75rem; /* >=12px lighthouse */
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.footer-col ul a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  font-weight: 300;
  transition: color var(--transition-fast);
}

.footer-col ul a:hover {
  color: var(--color-white);
  opacity: 1;
}

.footer-col ul .footer-meta {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.72rem;
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
}

.footer-social {
  display: flex;
  gap: 20px;
}

.footer-social a {
  color: rgba(255, 255, 255, 0.65);
  transition: color var(--transition-fast);
}

.footer-social a:hover {
  color: var(--color-white);
  opacity: 1;
}

.footer-social svg {
  width: 18px;
  height: 18px;
}

/* --- Scroll Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 {
  transition-delay: 0.1s;
}

.reveal-delay-2 {
  transition-delay: 0.2s;
}

.reveal-delay-3 {
  transition-delay: 0.3s;
}

.reveal-delay-4 {
  transition-delay: 0.4s;
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  position: relative;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
}

.lightbox-caption {
  position: absolute;
  bottom: -48px;
  left: 0;
  right: 0;
  text-align: center;
}

.lightbox-caption .label {
  color: rgba(255, 255, 255, 0.72);
}

.lightbox-caption h3 {
  color: var(--color-white);
  font-size: 1.3rem;
  margin-top: 4px;
}

.lightbox-close {
  position: absolute;
  top: 32px;
  right: 40px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.6);
  transition: color var(--transition-fast);
}

.lightbox-close:hover {
  color: var(--color-white);
}

.lightbox-close svg {
  width: 100%;
  height: 100%;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.72);
  transition: color var(--transition-fast);
}

.lightbox-nav:hover {
  color: var(--color-white);
}

.lightbox-nav svg {
  width: 24px;
  height: 24px;
}

.lightbox-prev {
  left: 32px;
}

.lightbox-next {
  right: 32px;
}

/* --- Mobile Menu Overlay --- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 999;
  background-color: var(--color-matte-black);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.mobile-menu.active {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu a {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--color-white);
  font-weight: 400;
  transition: opacity var(--transition-fast);
}

.mobile-menu a:hover {
  opacity: 0.5;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .categories-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .categories-grid-solutions {
    grid-template-columns: repeat(2, 1fr);
    max-width: 900px;
  }

  .categories-grid-solutions .category-card-placeholder {
    grid-column: 1 / -1;
    max-width: 420px;
    width: 100%;
    justify-self: center;
  }

  .category-card {
    aspect-ratio: 16/9;
  }

  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tech-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .tech-stat:nth-child(2) {
    border-right: none;
  }

  .tech-stat:nth-child(1),
  .tech-stat:nth-child(2) {
    border-bottom: 1px solid var(--color-border);
  }

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

  .portfolio-item:nth-child(1) {
    grid-column: 1 / 3;
    grid-row: auto;
    aspect-ratio: 16/9;
  }

  .portfolio-item:nth-child(2),
  .portfolio-item:nth-child(3),
  .portfolio-item:nth-child(4),
  .portfolio-item:nth-child(5),
  .portfolio-item:nth-child(6) {
    grid-column: auto;
    aspect-ratio: 1/1;
  }

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

@media (max-width: 1024px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-lang {
    margin-left: auto;
  }
}

@media (max-width: 768px) {
  .nav-lang {
    margin-left: auto;
  }

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

  .about-image {
    aspect-ratio: 16/10;
  }

  .tech-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .tech-stats {
    grid-template-columns: 1fr 1fr;
  }

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

  .portfolio-item:nth-child(1),
  .portfolio-item:nth-child(2),
  .portfolio-item:nth-child(3),
  .portfolio-item:nth-child(4),
  .portfolio-item:nth-child(5),
  .portfolio-item:nth-child(6) {
    grid-column: 1;
    aspect-ratio: 16/10;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .cta-bg {
    background-attachment: scroll;
  }
}

@media (max-width: 480px) {
  .tech-grid {
    grid-template-columns: 1fr;
  }

  .tech-stats {
    grid-template-columns: 1fr;
  }

  .tech-stat {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .tech-stat:last-child {
    border-bottom: none;
  }
}
/* ============================================
   EN dark theme + Architecture + Modal (v3)
   ============================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.theme-dark {
  /* Exact footer colour — docx: página inicial + contact */
  background-color: var(--color-matte-black); /* #1A1A1A */
  color: rgba(255, 255, 255, 0.85);
}

.theme-dark h1,
.theme-dark h2,
.theme-dark h3,
.theme-dark h4 {
  color: var(--color-white);
}

.theme-dark p,
.theme-dark .label {
  color: rgba(255, 255, 255, 0.78);
}

.theme-dark .divider {
  background-color: rgba(255, 255, 255, 0.2);
}

.hero-dark,
.hero-bg-solid,
.cta-bg-solid {
  background: var(--color-matte-black);
}

.hero-bg-solid {
  background-image: none !important;
}

.hero-dark .hero-content h1 {
  font-weight: 300;
}

.hero-dark .hero-content p,
.hero-label {
  color: rgba(255, 255, 255, 0.7) !important;
}

.btn-light {
  border-color: rgba(255, 255, 255, 0.85);
  color: var(--color-white);
  background: transparent;
}

.btn-light:hover {
  background: var(--color-white);
  color: var(--color-matte-black);
  opacity: 1;
}

.about-dark,
.categories-dark,
.portfolio-dark,
.architecture {
  background-color: var(--color-matte-black);
}

.about-dark .about-text p {
  color: rgba(255, 255, 255, 0.65);
}

.theme-dark .nav.scrolled .nav-toggle span {
  background: var(--color-white);
}

.categories-grid-single {
  grid-template-columns: 1fr;
  max-width: 900px;
  margin: 0 auto;
}

.categories-grid-solutions {
  grid-template-columns: repeat(3, 1fr);
  max-width: 1200px;
  margin: 0 auto;
  gap: clamp(16px, 2vw, 24px);
}

.category-card-placeholder {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: var(--color-matte-black);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  pointer-events: none;
}

.category-placeholder-inner {
  text-align: center;
  padding: 24px;
}

.category-placeholder-inner p {
  margin: 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.bsd-subtitle {
  margin-top: 8px !important;
  margin-bottom: 0 !important;
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 1.05rem !important;
  font-weight: 400;
}

.legal-page {
  padding-top: calc(var(--section-padding-y) + 64px);
  padding-left: var(--section-padding-x);
  padding-right: var(--section-padding-x);
  padding-bottom: var(--section-padding-y);
  background: var(--color-matte-black);
  color: rgba(255, 255, 255, 0.7);
}

.legal-content {
  max-width: 760px;
  margin: 0 auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.legal-content h1 {
  margin: 16px 0 28px;
  color: #fff;
}

.legal-content h2 {
  margin: 36px 0 14px;
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
}

.legal-content p {
  margin: 0 0 14px;
  line-height: 1.7;
}

.legal-content ul {
  margin: 0 0 16px;
  padding-left: 1.2rem;
}

.legal-content li {
  margin-bottom: 10px;
  line-height: 1.6;
}

.legal-content a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-updated {
  margin-top: 32px !important;
  color: rgba(255, 255, 255, 0.45);
}

.privacy-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.privacy-link:hover {
  color: #fff;
}

.category-card-compact {
  aspect-ratio: 16 / 10;
  max-height: 380px;
}

.category-overlay-visible {
  background: linear-gradient(to top,
      rgba(0, 0, 0, 0.72) 0%,
      rgba(0, 0, 0, 0.2) 55%,
      transparent 100%);
}

.category-overlay-visible .label,
.category-overlay-visible h3,
.category-overlay-visible p {
  opacity: 1;
  transform: none;
}

.category-card-link {
  display: block;
  color: inherit;
}

.category-card-link:hover {
  opacity: 1;
}

.architecture .arch-block-split > p {
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.7;
}

.architecture {
  padding: var(--section-padding-y) var(--section-padding-x);
}

.architecture-lead {
  max-width: 820px;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.65);
}

.arch-block {
  max-width: 1200px;
  margin: clamp(48px, 8vw, 96px) auto 0;
}

.arch-block-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}

.arch-block-split:nth-child(even) .arch-figure {
  order: 2;
}

.arch-figure {
  margin: 0;
  position: relative;
}

.arch-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.arch-figure figcaption {
  margin-top: 10px;
  font-size: 0.75rem; /* >=12px lighthouse */
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.7);
}

.arch-list {
  margin: 16px 0 0;
  padding-left: 1.2rem;
  color: rgba(255, 255, 255, 0.65);
}

.arch-list li {
  margin-bottom: 14px;
  line-height: 1.6;
}

.arch-list strong {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.arch-cta {
  max-width: 720px;
  margin: clamp(64px, 10vw, 120px) auto 0;
  text-align: center;
}

.arch-cta p {
  margin: 16px 0 28px;
}

.portfolio-note {
  font-size: 0.8rem !important;
  margin-top: 12px !important;
  color: rgba(255, 255, 255, 0.65) !important;
}

.portfolio-grid-fluid {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: auto;
}

.portfolio-grid-fluid .portfolio-item {
  grid-column: auto !important;
  grid-row: auto !important;
  aspect-ratio: 4/3;
}

@media (max-width: 1024px) {
  .portfolio-grid-fluid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.portfolio-grid-fluid .portfolio-overlay h3 {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  font-weight: 400;
}

.cta-dark {
  min-height: 60vh;
  display: flex;
  align-items: center;
}

.cta-bg-solid {
  background-image: none !important;
}

.optional {
  font-weight: 400;
  opacity: 0.6;
  text-transform: none;
  letter-spacing: 0;
}

.privacy-check {
  display: inline-flex;
  gap: 10px;
  align-items: flex-start;
  width: fit-content;
  max-width: 100%;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 8px 0 20px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0.02em;
}

.privacy-check input[type="checkbox"] {
  width: auto;
  flex-shrink: 0;
  margin-top: 3px;
  accent-color: #fff;
}

.privacy-check span {
  line-height: 1.4;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay:not(.active) {
  display: none;
}

.modal-overlay[style*="display: none"] {
  display: none !important;
}

.modal-panel {
  background: var(--color-matte-black);
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 36px 32px;
  position: relative;
}

.modal-panel h3 {
  margin-bottom: 24px;
  color: var(--color-white);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.modal-form label {
  color: rgba(255, 255, 255, 0.75);
}

.modal-form input,
.modal-form textarea {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--color-white);
  width: 100%;
  padding: 12px 14px;
  font: inherit;
}

.modal-form input:focus,
.modal-form textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.75);
}

.form-status.ok {
  color: #9dcc9d;
  margin-top: 12px;
}

.form-status.error {
  color: #e8a0a0;
  margin-top: 12px;
}

@media (max-width: 900px) {
  .arch-block-split {
    grid-template-columns: 1fr;
  }

  .arch-block-split:nth-child(even) .arch-figure {
    order: 0;
  }

  .form-row-2 {
    grid-template-columns: 1fr;
  }
}


.about-heading {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 8px 0 20px;
  color: var(--color-white);
}

.theme-dark .about-heading {
  color: var(--color-white);
}

.lightbox-title {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: var(--color-white);
  font-weight: 400;
}


/* --- MOBILE HARDENING v5 --- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img, video {
  max-width: 100%;
  height: auto;
}

.nav {
  padding-left: max(var(--section-padding-x), env(safe-area-inset-left));
  padding-right: max(var(--section-padding-x), env(safe-area-inset-right));
  padding-top: max(16px, env(safe-area-inset-top));
}

.nav-toggle {
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1002;
}

.theme-dark .nav.scrolled .nav-toggle span,
.theme-dark .nav-toggle span {
  background-color: var(--color-white);
}

.mobile-menu {
  z-index: 1001;
  padding: max(80px, env(safe-area-inset-top)) 24px max(40px, env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu a {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.4rem, 6vw, 2rem);
  text-align: center;
}

/* Touch: overlays always readable without hover */
@media (hover: none), (pointer: coarse) {
  .portfolio-overlay {
    background: rgba(26, 26, 26, 0.45);
  }

  .portfolio-overlay .label,
  .portfolio-overlay h3,
  .portfolio-grid-fluid .portfolio-overlay h3 {
    opacity: 1;
    transform: none;
  }

  .category-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.2) 55%, transparent 100%);
  }

  .category-overlay .label,
  .category-overlay h3,
  .category-overlay p {
    opacity: 1;
    transform: none;
  }

  .categories-grid-solutions .category-overlay h3 {
    margin-bottom: 8px;
  }

  .categories-grid-solutions .category-overlay p {
    max-height: 7.5em;
    opacity: 1;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding-y: clamp(56px, 12vw, 96px);
    --section-padding-x: clamp(16px, 5vw, 28px);
  }

  .hero {
    min-height: 0;
    height: 100svh;
    height: 100dvh;
  }

  .hero-content {
    padding-top: clamp(96px, 16vh, 140px);
    padding-bottom: 16px;
  }

  .hero-content h1 {
    font-size: clamp(1.45rem, 6.5vw, 2.1rem);
    line-height: 1.2;
    font-weight: 300;
    max-width: 16ch;
  }

  .hero-content p {
    font-size: 0.95rem;
    margin-bottom: 24px;
    max-width: 34ch;
  }

  .hero-scroll {
    margin-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .nav-logo-img {
    width: min(140px, 42vw);
  }

  .footer-logo-img {
    width: min(220px, 70vw);
  }

  .portfolio-grid-fluid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .portfolio-grid-fluid .portfolio-item {
    aspect-ratio: 4 / 3;
  }

  .portfolio-overlay h3,
  .portfolio-grid-fluid .portfolio-overlay h3 {
    font-size: 0.9rem;
    line-height: 1.35;
  }

  .categories-grid-single .category-card,
  .categories-grid-solutions .category-card {
    aspect-ratio: 16 / 10;
    min-height: 220px;
    max-height: 320px;
  }

  .categories-grid-solutions {
    grid-template-columns: 1fr;
    max-width: 640px;
  }

  .categories-grid-solutions .category-card-placeholder {
    grid-column: auto;
    max-width: none;
    justify-self: stretch;
  }

  .categories-grid-solutions .category-overlay h3 {
    font-size: clamp(0.85rem, 3.5vw, 1.05rem);
    max-width: none;
  }

  .categories-grid-solutions .category-overlay p {
    font-size: 0.75rem;
    max-width: none;
  }

  .category-overlay h3 {
    font-size: clamp(1.2rem, 5vw, 1.6rem);
  }

  .category-overlay p {
    font-size: 0.9rem;
    max-width: none;
  }

  .arch-list {
    padding-left: 1.1rem;
  }

  .arch-cta {
    text-align: left;
  }

  .arch-cta .btn,
  .cta-content .btn {
    width: 100%;
    max-width: 100%;
  }

  .cta {
    padding-top: clamp(80px, 18vw, 120px);
    padding-bottom: clamp(80px, 18vw, 120px);
  }

  .cta-content h2 {
    font-size: clamp(1.8rem, 7vw, 2.6rem);
  }

  .modal-overlay {
    padding: 12px;
    align-items: center;
    justify-content: center;
  }

  .modal-panel {
    width: 100%;
    max-width: 420px;
    max-height: min(88dvh, 88vh);
    padding: 18px 16px calc(14px + env(safe-area-inset-bottom));
    border-radius: 12px;
    margin: auto;
  }

  .modal-panel h3 {
    margin-bottom: 12px;
    font-size: 1.15rem;
  }

  .modal-close {
    top: 8px;
    right: 12px;
    font-size: 1.35rem;
  }

  .modal-form .form-row,
  .modal-form .form-row-2 {
    gap: 10px;
  }

  .modal-form .form-row-2 {
    grid-template-columns: 1fr 1fr;
  }

  .modal-form .form-row {
    margin-bottom: 8px;
  }

  .modal-form label {
    font-size: 0.75rem;
    margin-bottom: 4px;
  }

  .modal-form input,
  .modal-form textarea {
    padding: 9px 11px;
    font-size: 16px !important;
  }

  .modal-form textarea {
    min-height: 64px;
    max-height: 80px;
  }

  .modal-form .privacy-check {
    margin: 4px 0 12px;
    font-size: 0.75rem;
    gap: 8px;
  }

  .modal-form .btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 0.8rem;
  }

  .modal-form .form-status {
    margin-top: 8px;
    font-size: 0.8rem;
  }

  .lightbox-nav {
    width: 44px;
    height: 44px;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }

  .lightbox-close {
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
  }

  .lightbox-content img {
    max-height: 70vh;
    max-height: 70dvh;
    width: auto;
    max-width: 100%;
  }

  .section-header h2,
  .architecture-lead {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .btn {
    padding-left: 28px;
    padding-right: 28px;
  }

  input,
  textarea,
  select {
    font-size: 16px !important;
  }

  .footer-col ul a,
  .footer-col ul .footer-meta {
    font-size: 0.85rem;
  }
}

@media (max-width: 380px) {
  .hero-content h1 {
    font-size: 1.7rem;
  }

  .mobile-menu a {
    font-size: 1.35rem;
  }
}
