/* ============================================
   NorthFlow — Design System & Styles
   Pure monochrome dark-tech aesthetic
   ============================================ */

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

/* --- Custom Properties --- */
:root {
  /* Palette — Pure Monochrome */
  --bg: #0a0a0f;
  --bg-surface: #0e0e14;
  --bg-elevated: #16161f;
  --bg-glass: rgba(14, 14, 20, 0.72);
  --bg-glass-heavy: rgba(10, 10, 15, 0.92);

  --white: #eeeef3;
  --gray-100: #c8cad4;
  --gray-200: #9096a8;
  --gray-300: #5c6178;
  --gray-400: #3a3e4e;
  --gray-500: #22242f;

  --text-primary: #eeeef3;
  --text-secondary: #9096a8;
  --text-muted: #5c6178;

  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.12);
  --border-active: rgba(255, 255, 255, 0.2);

  /* Accent — glacial teal, drawn from the flow wave of the logo */
  --accent: #67e8f9;
  --accent-dim: #22d3ee;
  --accent-soft: rgba(103, 232, 249, 0.12);
  --accent-border: rgba(103, 232, 249, 0.25);

  /* Typography */
  --font: 'Space Grotesk', system-ui, -apple-system, sans-serif;

  /* Spacing */
  --section-py: clamp(5rem, 10vw, 8rem);
  --section-px: clamp(1.25rem, 5vw, 4rem);
  --max-w: 1280px;

  /* Easing (Emil Kowalski curves) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  /* Radius — consistent shape system */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
}

/* --- Base --- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

@supports (scrollbar-width: thin) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
  }
}

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

/* --- Cookie Consent Banner --- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  transform: translateY(100%);
  transition: transform 500ms var(--ease-drawer);
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-banner .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.cookie-banner p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 65ch;
  margin: 0;
}

.cookie-banner a {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-banner a:hover {
  color: #fff;
}

.cookie-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.btn-cookie {
  padding: 0.55rem 1.2rem;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: transform 160ms var(--ease-out), background-color 300ms var(--ease-out), border-color 300ms var(--ease-out);
}

.btn-cookie:active {
  transform: scale(0.97);
}

.btn-cookie.accept {
  background: var(--white);
  color: var(--bg);
  border: none;
}

.btn-cookie.accept:hover {
  background: #fff;
}

.btn-cookie.configure {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-cookie.configure:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

/* --- Privacy Modal --- */
.privacy-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 400ms var(--ease-out), visibility 400ms var(--ease-out);
}

.privacy-modal.open {
  opacity: 1;
  visibility: visible;
}

.privacy-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.privacy-panel {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 90%;
  max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform 400ms var(--ease-out);
}

.privacy-modal.open .privacy-panel {
  transform: scale(1) translateY(0);
}

.privacy-panel h3 {
  margin-bottom: 1.5rem;
}

.privacy-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.privacy-option:last-child {
  border-bottom: none;
}

.privacy-option-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.privacy-option-label span:first-child {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.privacy-option-label span:last-child {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 1;
}

.toggle-switch-track {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: background-color 300ms var(--ease-out), border-color 300ms var(--ease-out);
}

.toggle-switch input:checked + .toggle-switch-track {
  background: var(--white);
  border-color: var(--white);
}

.toggle-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--text-primary);
  border-radius: 50%;
  transition: transform 300ms var(--ease-drawer);
}

.toggle-switch input:checked + .toggle-switch-track .toggle-switch-thumb {
  transform: translateX(20px);
}

.privacy-panel-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* --- Grain Noise Overlay --- */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
}
.grain-overlay::before {
  content: '';
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  animation: grainShift 0.8s steps(3) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-10%, -10%); }
  66% { transform: translate(5%, 10%); }
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* --- Focus Visible --- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

a:focus-visible {
  border-radius: var(--radius-sm);
}

/* --- Selection --- */
::selection {
  background: var(--accent);
  color: var(--bg);
}

/* --- Language Toggle --- */
html[lang="en"] .lang-es { display: none !important; }
html[lang="es"] .lang-en { display: none !important; }

/* --- Utility --- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--section-px);
  padding-right: var(--section-px);
}

.section {
  padding-top: var(--section-py);
  padding-bottom: var(--section-py);
  position: relative;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 5.2vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 500;
}

p {
  color: var(--text-secondary);
  max-width: 65ch;
  text-wrap: pretty;
}

.text-accent {
  color: var(--white);
}

/* --- Eyebrow tag (echoes the tracked logo wordmark) --- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  width: max-content;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* --- Wave divider (logo flow motif as section separator) --- */
.wave-divider {
  display: block;
  width: 100%;
  height: 56px;
  overflow: visible;
}

.wave-divider path {
  fill: none;
  stroke-linecap: round;
}

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.8rem;
  background: var(--white);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-pill);
  transition: transform 160ms var(--ease-out), background-color 300ms var(--ease-out);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  opacity: 0;
  transition: opacity 300ms var(--ease-out);
  border-radius: inherit;
}

.btn-primary:hover {
  background: #fff;
}

.btn-primary:hover::after {
  opacity: 1;
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary .btn-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.12);
  font-size: 0.85rem;
  transition: transform 300ms var(--ease-out), background-color 300ms var(--ease-out);
}

.btn-primary:hover .btn-arrow {
  transform: translateX(3px) translateY(-1px) scale(1.05);
  background: rgba(0, 0, 0, 0.18);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.8rem;
  background: transparent;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  transition: transform 160ms var(--ease-out), border-color 300ms var(--ease-out), background-color 300ms var(--ease-out);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-secondary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.04);
  opacity: 0;
  transition: opacity 300ms var(--ease-out);
  border-radius: inherit;
}

.btn-secondary:hover {
  border-color: var(--border-active);
}

.btn-secondary:hover::after {
  opacity: 1;
}

.btn-secondary:active {
  transform: scale(0.97);
}

/* Hover guard for touch devices */
@media (hover: hover) and (pointer: fine) {
  .btn-primary::after,
  .btn-secondary::after {
    display: block;
  }
}

/* ============================================
   NAVIGATION — Floating glass pill
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.25rem var(--section-px);
  transition: padding 400ms var(--ease-out);
}

.nav.scrolled {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.65rem 0.65rem 0.65rem 1.25rem;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  max-height: 64px;
  transition: background-color 400ms var(--ease-out), border-color 400ms var(--ease-out);
}

.nav.scrolled .nav-inner {
  background: var(--bg-glass-heavy);
  border-color: var(--border-light);
}

.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* --- Brand lockup (inline SVG mark + tracked wordmark) --- */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--white);
}

.brand-mark {
  display: block;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.brand-mark .mark-n {
  stroke: currentColor;
}

.brand-mark .mark-wave {
  stroke: var(--accent);
}

.brand-word {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  margin-right: -0.32em;
  color: var(--white);
  white-space: nowrap;
}

.footer-brand .brand-mark {
  width: 26px;
  height: 26px;
}

.footer-brand .brand-word {
  font-size: 0.85rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-secondary);
  transition: color 200ms var(--ease-out);
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-toggle {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: color 200ms var(--ease-out), border-color 200ms var(--ease-out);
}

.lang-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
}

.nav-cta {
  padding: 0.55rem 1.2rem;
  font-size: 0.85rem;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  position: relative;
}

.hamburger-line {
  width: 20px;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 2px;
  position: absolute;
  transition: transform 400ms var(--ease-drawer), opacity 300ms var(--ease-out);
}

.hamburger-line:nth-child(1) { transform: translateY(-4px); }
.hamburger-line:nth-child(2) { transform: translateY(4px); }

.hamburger.open .hamburger-line:nth-child(1) {
  transform: rotate(45deg);
}
.hamburger.open .hamburger-line:nth-child(2) {
  transform: rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 400ms var(--ease-drawer), visibility 400ms var(--ease-drawer);
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu a {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out), color 200ms var(--ease-out);
}

.mobile-menu.open a {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu.open a:nth-child(1) { transition-delay: 80ms; }
.mobile-menu.open a:nth-child(2) { transition-delay: 140ms; }
.mobile-menu.open a:nth-child(3) { transition-delay: 200ms; }
.mobile-menu.open a:nth-child(4) { transition-delay: 260ms; }
.mobile-menu.open a:nth-child(5) { transition-delay: 320ms; }
.mobile-menu.open a:nth-child(6) { transition-delay: 380ms; }
.mobile-menu.open a:nth-child(7) { transition-delay: 440ms; }

.mobile-menu a:hover {
  color: var(--white);
}

/* ============================================
   HERO — Split screen
   ============================================ */
.hero {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-top: 6rem;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-content h1 {
  position: relative;
}

.hero-content p {
  font-size: 1.1rem;
  line-height: 1.65;
  max-width: 48ch;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Animated flow wave — the logo's wave motif, drawn live */
.hero-wave {
  width: 100%;
  max-width: 560px;
  height: auto;
  overflow: visible;
}

.hero-wave path {
  fill: none;
  stroke-linecap: round;
}

.hero-wave .wave-line {
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation:
    waveDraw 2.8s var(--ease-out) forwards,
    waveDrift 7s ease-in-out infinite alternate;
  animation-delay: calc(var(--i, 0) * 220ms), calc(var(--i, 0) * -1.4s);
}

@keyframes waveDraw {
  to { stroke-dashoffset: 0; }
}

@keyframes waveDrift {
  from { transform: translateY(-7px); }
  to { transform: translateY(7px); }
}

/* Subtle ambient glow behind hero */
.hero-visual::before {
  content: '';
  position: absolute;
  width: 70%;
  height: 70%;
  background: radial-gradient(ellipse, var(--accent-soft) 0%, transparent 70%);
  filter: blur(60px);
  z-index: -1;
  pointer-events: none;
}

/* ============================================
   ABOUT — Full-width manifesto
   ============================================ */
.about {
  border-top: 1px solid var(--border);
}

.about-content {
  max-width: 850px;
}

.about-content h2 {
  margin-bottom: 2.5rem;
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-text p {
  font-size: 1.1rem;
  line-height: 1.8;
}

.manifesto-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 2rem 0;
}

.manifesto-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: border-color 300ms var(--ease-out), background-color 300ms var(--ease-out), transform 300ms var(--ease-out);
}

.manifesto-item:hover {
  border-color: var(--border-active);
  background: rgba(255, 255, 255, 0.02);
  transform: translateX(4px);
}

.manifesto-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
}

/* ============================================
   SERVICES — Bento grid
   Double-bezel card architecture
   ============================================ */
.services {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.services h2 {
  margin-bottom: 3rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

/* Double-bezel outer shell */
.service-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px;
  transition: border-color 400ms var(--ease-out), transform 400ms var(--ease-out), box-shadow 400ms var(--ease-out);
}

.service-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.03);
}

/* Featured card spans full width of desktop grid */
.service-card.featured {
  grid-column: span 2;
}

/* Double-bezel inner core */
.service-card-inner {
  background: var(--bg-elevated);
  border-radius: calc(var(--radius-lg) - 6px);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1rem;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
}

/* Visual variation for featured card: subtle gradient */
.service-card.featured .service-card-inner {
  background: linear-gradient(165deg, var(--bg-elevated) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.service-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  color: var(--white);
  flex-shrink: 0;
  transition: background-color 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
}

.service-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--white);
  stroke-width: 1.5;
  fill: none;
  transition: stroke 300ms var(--ease-out);
}

.service-card:hover .service-icon {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-border);
}

.service-card:hover .service-icon svg {
  stroke: var(--accent);
}

.service-card-inner h3 {
  font-size: 1.25rem;
}

.service-card-inner p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* ============================================
   PHILOSOPHY — Vertical cascade
   ============================================ */
.philosophy {
  border-bottom: 1px solid var(--border);
}

.philosophy-intro {
  margin-bottom: 3.5rem;
}

.philosophy-intro p {
  font-size: 1.05rem;
  max-width: 55ch;
}

.philosophy-lines {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.philosophy-line {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.philosophy-line:last-child {
  border-bottom: 1px solid var(--border);
}

.philosophy-line p {
  font-size: clamp(1.5rem, 3.2vw, 2.4rem);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  max-width: none;
}

.philosophy-line .accent-word {
  color: var(--accent);
  font-weight: 700;
}

/* ============================================
   MISSION / VISION — Two-column
   ============================================ */
.mission-vision {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.mv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.mv-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 1.5rem;
}

.mv-card p {
  font-size: 1.05rem;
  line-height: 1.75;
}

.mv-divider {
  width: 1px;
  background: var(--border);
  display: none;
}

/* ============================================
   CTA — Full-width accent banner
   ============================================ */
.cta-section {
  position: relative;
  overflow: hidden;
}

/* Subtle gradient backdrop */
.cta-section::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, var(--accent-soft) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  animation: glowPulse 4s var(--ease-in-out) infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.cta-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  position: relative;
  z-index: 1;
}

.slogans-cascade {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: left;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

.slogan-item {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  line-height: 1.6;
  font-weight: 400;
  color: var(--text-primary);
  border-left: 2px solid var(--accent);
  padding-left: 1.5rem;
}

.cta-tagline {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-weight: 500;
  color: var(--text-primary);
  max-width: 48ch;
  line-height: 1.5;
  text-align: center;
}

/* Closing wordmark — styled like the logo lockup */
.cta-brand {
  font-size: clamp(2rem, 8vw, 5rem);
  font-weight: 700;
  line-height: 1;
  color: rgba(255, 255, 255, 0.08);
  letter-spacing: 0.32em;
  margin-right: -0.32em;
  margin-top: 1rem;
  user-select: none;
}

/* ============================================
   CLIENTS / LOGO WALL
   ============================================ */
.clients {
  border-bottom: 1px solid var(--border);
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.clients-intro {
  text-align: center;
  margin-bottom: 3rem;
}

.clients-intro p {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin: 0 auto;
}

.clients-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 3rem 4rem;
}

.client-logo {
  width: 120px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 400ms var(--ease-out);
  flex-shrink: 0;
}

.client-logo:hover {
  opacity: 0.8;
}

.client-logo svg {
  width: 100%;
  height: 100%;
}

.client-logo svg text {
  font-family: var(--font);
  font-weight: 600;
}

/* ============================================
   TESTIMONIALS
   ============================================ */
.testimonials {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.testimonials h2 {
  margin-bottom: 3rem;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.testimonial-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  transition: border-color 300ms var(--ease-out);
}

.testimonial-card:hover {
  border-color: var(--border-active);
}

.testimonial-stars {
  display: flex;
  gap: 0.25rem;
}

.testimonial-stars svg {
  width: 16px;
  height: 16px;
  fill: var(--accent);
  stroke: none;
}

.testimonial-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  font-style: italic;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
}

.testimonial-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--white);
  flex-shrink: 0;
}

.testimonial-info {
  display: flex;
  flex-direction: column;
}

.testimonial-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.testimonial-role {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================
   CASE STUDIES / PORTFOLIO
   ============================================ */
.case-studies {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.case-studies h2 {
  margin-bottom: 3rem;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.case-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  transition: border-color 300ms var(--ease-out), transform 300ms var(--ease-out);
}

.case-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
}

.case-card-visual {
  height: 160px;
  background: linear-gradient(135deg, var(--bg-elevated) 0%, rgba(255, 255, 255, 0.03) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}

.case-card-visual svg {
  width: 48px;
  height: 48px;
  stroke: var(--white);
  stroke-width: 1.2;
  fill: none;
  opacity: 0.4;
}

.case-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.case-card-tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.case-card-body h3 {
  font-size: 1.05rem;
}

.case-card-body p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Featured case study (spans 2 cols) */
.case-card.featured {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.case-card.featured .case-card-visual {
  height: 100%;
  min-height: 200px;
  border-bottom: none;
  border-right: 1px solid var(--border);
}

/* ============================================
   MAP SECTION
   ============================================ */
.map-section {
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.map-container {
  width: 100%;
  height: 320px;
  position: relative;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(1) invert(0.9);
  opacity: 0.6;
  transition: opacity 400ms var(--ease-out);
}

.map-container iframe:hover {
  opacity: 0.85;
}

.map-overlay {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  z-index: 1;
}

.map-overlay p {
  font-size: 0.85rem;
  color: var(--text-primary);
  max-width: none;
}

.map-overlay span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================
   CONTACT FORM SECTION
   ============================================ */
.contact-section {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-info h2 {
  margin-bottom: 0.5rem;
}

.contact-info > p {
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 45ch;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.contact-detail-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.contact-detail-item svg {
  width: 18px;
  height: 18px;
  stroke: var(--white);
  stroke-width: 1.5;
  fill: none;
  flex-shrink: 0;
}

.contact-detail-item a {
  color: var(--text-secondary);
  transition: color 200ms var(--ease-out);
}

.contact-detail-item a:hover {
  color: var(--white);
}

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea,
.form-group select {
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 0.85rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color 300ms var(--ease-out), background-color 300ms var(--ease-out);
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent-border);
  background: rgba(255, 255, 255, 0.02);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

/* Custom Select Dropdown */
.custom-select {
  position: relative;
  font-family: var(--font);
}

.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.95rem;
  padding: 0.85rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 300ms var(--ease-out), background-color 300ms var(--ease-out);
  outline: none;
  user-select: none;
}

.select-trigger:focus {
  border-color: var(--accent-border);
  background: rgba(255, 255, 255, 0.02);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.select-arrow {
  color: var(--text-muted);
  transition: transform 300ms var(--ease-out);
  flex-shrink: 0;
}

.custom-select.open .select-arrow {
  transform: rotate(180deg);
}

.select-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.35rem 0;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 200ms;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  max-height: 240px;
  overflow-y: auto;
}

.custom-select.open .select-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.select-option {
  padding: 0.65rem 1.1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

.select-option:hover,
.select-option.highlighted {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.select-option.selected {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-status {
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  display: none;
}

.form-status.success {
  display: block;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--white);
}

.form-status.error {
  display: block;
  background: rgba(255, 80, 80, 0.1);
  border: 1px solid rgba(255, 80, 80, 0.2);
  color: #ff6b6b;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  border-top: 1px solid var(--border);
  padding-top: 4rem;
  padding-bottom: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-brand p {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 30ch;
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.footer-col-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-col-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color 200ms var(--ease-out);
}

.footer-col-links a:hover {
  color: var(--text-primary);
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.footer-contact-item svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  stroke-width: 1.5;
  fill: none;
  flex-shrink: 0;
  margin-top: 3px;
}

.footer-contact-item a {
  color: var(--text-secondary);
  transition: color 200ms var(--ease-out);
}

.footer-contact-item a:hover {
  color: var(--white);
}

.footer-bottom {
  padding-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(4px);
  transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out), filter 800ms var(--ease-out);
}

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

/* Stagger children */
.reveal-stagger .reveal {
  transition-delay: calc(var(--stagger, 0) * 100ms);
}

/* Stronger reveal variant */
.reveal-strong {
  opacity: 0;
  transform: translateY(48px) scale(0.98);
  filter: blur(6px);
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out), filter 900ms var(--ease-out);
}

.reveal-strong.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

/* Reveal from left */
.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  filter: blur(4px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out), filter 700ms var(--ease-out);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
  filter: blur(0);
}

/* Reveal from right */
.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  filter: blur(4px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out), filter 700ms var(--ease-out);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
  filter: blur(0);
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .grain-overlay {
    display: none;
  }

  .reveal,
  .reveal-strong,
  .reveal-left,
  .reveal-right {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }

  .mobile-menu a {
    opacity: 1;
    transform: none;
    transition: color 200ms var(--ease-out);
  }

  .hamburger-line {
    transition: none;
  }

  .btn-primary,
  .btn-secondary {
    transition: background-color 200ms var(--ease-out);
  }

  .btn-primary:active,
  .btn-secondary:active {
    transform: none;
  }

  .case-card:hover {
    transform: none;
  }

  .hero-visual::before,
  .cta-section::before {
    display: none;
  }

  .hero-wave .wave-line {
    animation: none;
    stroke-dashoffset: 0;
  }
}

/* ============================================
   RESPONSIVE — Mobile-first adjustments
   ============================================ */

/* Tablet and below */
@media (max-width: 1024px) {
  .nav-links {
    display: none;
  }

  .nav-cta {
    display: none;
  }

  .hamburger {
    display: flex;
  }
}

@media (max-width: 768px) {
  .hero {
    padding-top: 5rem;
    min-height: auto;
    padding-bottom: 3rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-visual {
    order: -1;
    max-width: 400px;
    margin: 0 auto;
  }

  .hero-content {
    text-align: center;
    align-items: center;
  }

  .hero-content p {
    max-width: 50ch;
  }

  .hero-cta {
    justify-content: center;
    flex-wrap: wrap;
  }

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

  .service-card.featured {
    grid-column: auto;
  }

  .mv-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

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

  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

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

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

  .case-card.featured {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .case-card.featured .case-card-visual {
    min-height: 140px;
    border-bottom: 1px solid var(--border);
    border-right: none;
  }

  .clients-grid {
    gap: 2rem 2.5rem;
  }

  .client-logo {
    width: 80px;
    height: 36px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

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

  .philosophy-line p {
    font-size: clamp(1.2rem, 5vw, 1.8rem);
  }
}

@media (max-width: 480px) {
  :root {
    --section-py: 3.5rem;
  }

  .nav-inner {
    padding: 0.5rem 0.5rem 0.5rem 1rem;
  }

  .hero-content h1 {
    font-size: 2rem;
  }
}
