/*
  Art direction: Construction / property / contractor landing system → premium, modern, conversion-oriented
  Palette: neutral dark surfaces + warm gold accent + crisp light surfaces
  Typography: Oswald display + Inter body for strong headings and clean UI/body copy
  Density: balanced, spacious on landing sections, tighter in utility components
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Oswald:wght@400;500;600;700&display=swap');

[hidden] {
  display: none !important;
}

:root,
[data-theme="light"] {
  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;

  /* Fluid type scale: rem + vw so it adapts to viewport width but respects zoom */
  --text-xs: clamp(0.7rem, 0.62rem + 0.5vw, 0.85rem);
  --text-sm: clamp(0.8rem, 0.7rem + 0.7vw, 1rem);
  --text-base: clamp(0.9rem, 0.8rem + 0.8vw, 1.1rem);
  --text-lg: clamp(1rem, 0.85rem + 1.2vw, 1.4rem);
  --text-xl: clamp(1.3rem, 1.05rem + 1.6vw, 1.9rem);
  --text-2xl: clamp(1.7rem, 1.3rem + 2.4vw, 2.9rem);
  --text-3xl: clamp(2.1rem, 1.4rem + 3.6vw, 4rem);
  --text-hero: clamp(2.3rem, 2rem + 5vw, 5rem);

  /* Spacing scale: purely relative */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --color-bg: #f4f1eb;
  --color-surface: #fcfbf8;
  --color-surface-2: #ffffff;
  --color-surface-offset: #ece7df;
  --color-surface-offset-2: #dfd7cc;
  --color-surface-dynamic: #d7cdbf;
  --color-border: rgba(40, 33, 25, 0.14);
  --color-divider: rgba(40, 33, 25, 0.08);
  --color-text: #191613;
  --color-text-muted: #655e56;
  --color-text-faint: #948a7f;
  --color-text-inverse: #f8f6f1;
  --color-primary: #b67a22;
  --color-primary-hover: #986311;
  --color-primary-active: #774b09;
  --color-primary-highlight: rgba(182, 122, 34, 0.14);
  --color-secondary: #2f3438;
  --color-secondary-hover: #1f2428;
  --color-secondary-active: #11161a;
  --color-secondary-highlight: rgba(47, 52, 56, 0.08);
  --color-success: #3d7a34;
  --color-warning: #9a5b13;
  --color-error: #9a2d2d;
  --color-info: #245c8f;
  --overlay-dark: rgba(10, 12, 14, 0.64);
  --overlay-light: rgba(255, 255, 255, 0.78);

  /* Radii in rem (scale with font size, not pixels) */
  --radius-sm: 0.35rem;
  --radius-md: 0.6rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;
  --radius-full: 9999px;

  /* Shadows: relative blur/spread based on viewport width */
  --shadow-sm: 0 0.1rem 0.2rem rgba(24, 18, 12, 0.06);
  --shadow-md: 0 0.8vw 2vw rgba(24, 18, 12, 0.1);
  --shadow-lg: 0 1.3vw 3.6vw rgba(24, 18, 12, 0.16);
  --shadow-xl: 0 1.8vw 4.8vw rgba(24, 18, 12, 0.22);

  --transition-fast: 160ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-interactive: 220ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 520ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths are already percentage/relative */
  --content-narrow: min(92%, 42rem);
  --content-default: min(92%, 72rem);
  --content-wide: min(94%, 86rem);
  --content-full: 100%;

  /* Header + section sizing via viewport units
     Use dvh/svh where supported for mobile-safe heights.[web:1][web:4] */
  --header-height: clamp(5rem, 6svh, 7rem);
  --section-pad: clamp(3rem, 8svh, 6rem);

  /* Nav spacing: all rem/vw */
  --nav-link-pad-x: clamp(0.6rem, 0.7rem + 0.8vw, 1rem);
  --nav-link-pad-y: clamp(0.5rem, 0.4rem + 0.4vw, 0.8rem);
  --nav-gap: clamp(0.25rem, 0.4rem + 0.6vw, 0.75rem);
  --header-inline-pad: min(3vw, 1.25rem);
}

[data-theme="dark"] {
  --color-bg: #111315;
  --color-surface: #16191c;
  --color-surface-2: #1b1f23;
  --color-surface-offset: #20252a;
  --color-surface-offset-2: #282f34;
  --color-surface-dynamic: #32393f;
  --color-border: rgba(255, 255, 255, 0.10);
  --color-divider: rgba(255, 255, 255, 0.08);
  --color-text: #f2eee8;
  --color-text-muted: #c0b8ae;
  --color-text-faint: #8f887f;
  --color-text-inverse: #151617;
  --color-primary: #d8a24f;
  --color-primary-hover: #e4b870;
  --color-primary-active: #f0c88c;
  --color-primary-highlight: rgba(216, 162, 79, 0.14);
  --color-secondary: #d8ddd9;
  --color-secondary-hover: #eef1ee;
  --color-secondary-active: #ffffff;
  --color-secondary-highlight: rgba(216, 221, 217, 0.10);
  --color-success: #7cba72;
  --color-warning: #df9e44;
  --color-error: #e18484;
  --color-info: #78a9d4;
  --overlay-dark: rgba(5, 6, 8, 0.74);
  --overlay-light: rgba(20, 22, 24, 0.68);
  --shadow-sm: 0 0.1rem 0.2rem rgba(0, 0, 0, 0.25);
  --shadow-md: 0 0.8vw 2vw rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 1.3vw 3.6vw rgba(0, 0, 0, 0.42);
  --shadow-xl: 0 1.8vw 4.8vw rgba(0, 0, 0, 0.56);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #111315;
    --color-surface: #16191c;
    --color-surface-2: #1b1f23;
    --color-surface-offset: #20252a;
    --color-surface-offset-2: #282f34;
    --color-surface-dynamic: #32393f;
    --color-border: rgba(255, 255, 255, 0.10);
    --color-divider: rgba(255, 255, 255, 0.08);
    --color-text: #f2eee8;
    --color-text-muted: #c0b8ae;
    --color-text-faint: #8f887f;
    --color-text-inverse: #151617;
    --color-primary: #d8a24f;
    --color-primary-hover: #e4b870;
    --color-primary-active: #f0c88c;
    --color-primary-highlight: rgba(216, 162, 79, 0.14);
    --color-secondary: #d8ddd9;
    --color-secondary-hover: #eef1ee;
    --color-secondary-active: #ffffff;
    --color-secondary-highlight: rgba(216, 221, 217, 0.10);
    --color-success: #7cba72;
    --color-warning: #df9e44;
    --color-error: #e18484;
    --color-info: #78a9d4;
    --overlay-dark: rgba(5, 6, 8, 0.74);
    --overlay-light: rgba(20, 22, 24, 0.68);
    --shadow-sm: 0 0.1rem 0.2rem rgba(0, 0, 0, 0.25);
    --shadow-md: 0 0.8vw 2vw rgba(0, 0, 0, 0.32);
    --shadow-lg: 0 1.3vw 3.6vw rgba(0, 0, 0, 0.42);
    --shadow-xl: 0 1.8vw 4.8vw rgba(0, 0, 0, 0.56);
  }
}

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

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background:
    radial-gradient(circle at top left, var(--color-primary-highlight), transparent 34%),
    linear-gradient(180deg, var(--color-bg), var(--color-surface-offset));
  overflow-x: hidden;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
video { object-fit: cover; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: transparent; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

p, li { text-wrap: pretty; }

::selection { background: var(--color-primary-highlight); }

:focus-visible {
  outline: 0.12rem solid var(--color-primary);
  outline-offset: 0.2rem;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

main, section, .section { position: relative; }

.shell, .container, .container-default {
  width: var(--content-default);
  margin-inline: auto;
}

.container-wide {
  width: var(--content-wide);
  margin-inline: auto;
}

.container-narrow {
  width: var(--content-narrow);
  margin-inline: auto;
}

.container-full {
  width: min(96%, 100rem);
  margin-inline: auto;
}

.section, .page-section {
  padding-block: var(--section-pad);
}

.section-tight {
  padding-block: clamp(2rem, 5svh, 4rem);
}

.section-loose {
  padding-block: clamp(4rem, 10svh, 8rem);
}

.stack > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-8); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-light, .theme-dark, .bg-dark { color: var(--color-text-inverse); }
.text-dark, .theme-light, .bg-light { color: var(--color-text); }

.eyebrow, .overline, .section-kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.page-title, .hero-title, .display-title {
  font-size: var(--text-hero);
  max-width: 13ch;
}

.section-title {
  font-size: var(--text-2xl);
  max-width: 14ch;
}

.card-title, .feature-title {
  font-size: var(--text-xl);
}

.lead, .hero-subtitle, .section-intro {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 62ch;
}

.muted { color: var(--color-text-muted); }
.faint { color: var(--color-text-faint); }

/* ── Header ─────────────────────────────────────────────────────────── */

.topbar, .site-header, .landing-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(1.2rem);
  -webkit-backdrop-filter: blur(1.2rem);
  background: color-mix(in srgb, var(--color-surface) 76%, transparent);
  border-bottom: 1px solid var(--color-divider);
}

.header-inner, .nav-shell {
  min-height: var(--header-height);
  width: min(96%, 92rem);
  margin-inline: auto;
  padding-inline: var(--header-inline-pad);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.5rem, 0.4rem + 0.8vw, 1rem);
}

.brand, .site-brand {
  display: inline-flex;
  align-items: center;
  gap: clamp(0.5rem, 0.3rem + 0.8vw, 0.75rem);
  min-height: 2.75rem;
  font-weight: 800;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 42%;
}

.brand-logo, .logo-mark {
  width: clamp(2.3rem, 2rem + 2vw, 4rem);
  aspect-ratio: 1;
  border-radius: 24%;
  object-fit: cover;
  flex: 0 0 auto;
}

.brand-text,
.brand-copy {
  min-width: 0;
}

.brand-subtitle-text {
  display: inline;
  font-size: clamp(0.72rem, 0.6rem + 0.4vw, 0.88rem);
}

.nav-links, .header-links {
  display: flex;
  flex: 1 1 52%;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--nav-gap);
}

.nav-link, .pill-link, .header-link {
  min-height: 2.75rem;
  padding: var(--nav-link-pad-y) var(--nav-link-pad-x);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  white-space: nowrap;
  border-radius: var(--radius-full);
  font-size: clamp(0.8rem, 0.7rem + 0.5vw, 0.96rem);
  font-weight: 600;
  color: var(--color-text-muted);
  transition:
    transform var(--transition-interactive),
    background var(--transition-interactive),
    color var(--transition-interactive);
}

.nav-link:hover, .pill-link:hover, .header-link:hover {
  background: var(--color-primary-highlight);
  color: var(--color-text);
  transform: translateY(-0.06rem);
}

/* Menu scales by percentage before collapsing */
.nav-links > *,
.header-links > * {
  max-width: 100%;
}

@media (max-width: 42.5rem) { /* ~680px */
  .header-inner, .nav-shell {
    width: min(97%, 92rem);
    row-gap: 0.4rem;
  }

  .brand, .site-brand {
    max-width: 55%;
  }

  .nav-links, .header-links {
    flex: 1 1 40%;
    gap: clamp(0.18rem, 0.2rem + 0.6vw, 0.4rem);
  }

  .nav-link, .pill-link, .header-link {
    padding-inline: clamp(0.4rem, 0.3rem + 0.8vw, 0.8rem);
    font-size: clamp(0.76rem, 0.6rem + 1vw, 0.88rem);
  }

  .brand-subtitle-text {
    display: none;
  }
}

@media (max-width: 35rem) {
  .header-inner,
  .nav-shell {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .brand,
  .site-brand {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    justify-content: flex-start;
  }

  .brand-text,
  .brand-copy {
    min-width: 0;
  }

  .brand strong,
  .brand-copy strong {
    display: block;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-subtitle-text {
    display: none;
  }

  .nav-links,
  .header-links {
    flex: 0 0 auto;
    min-width: auto;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
  }

  .mobile-nav-wrap {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
  }

  .mobile-nav-toggle,
  .nav-links > .icon-btn,
  .header-links > .icon-btn {
    flex: 0 0 auto;
  }

  /* Only make CTA buttons full width in action clusters, not in header */
  .cluster.actions .btn,
  .cluster.actions .button,
  .cluster.actions .solid-btn,
  .cluster.actions .ghost-btn,
  .cluster.actions .outline-btn,
  .cluster.actions .cta-btn,
  .hero-actions .btn,
  .hero-actions .button,
  .hero-actions .solid-btn,
  .hero-actions .ghost-btn,
  .hero-actions .outline-btn,
  .hero-actions .cta-btn,
  .cta-actions .btn,
  .cta-actions .button,
  .cta-actions .solid-btn,
  .cta-actions .ghost-btn,
  .cta-actions .outline-btn,
  .cta-actions .cta-btn {
    width: 100%;
  }
}

/* Info bar */

.info-bar {
  background: var(--color-secondary);
  border-top: 1px solid var(--color-divider);
  border-bottom: 0.14rem solid var(--color-secondary);
  padding-block: clamp(0.4rem, 0.3rem + 0.5vh, 0.65rem);
}

.info-bar-inner {
  width: min(94%, 92rem);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.35rem, 0.3rem + 0.7vw, 0.75rem);
  flex-wrap: wrap;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-text-inverse);
  text-align: center;
  padding-inline: min(3vw, 1rem);
}

.info-bar-sep {
  color: var(--color-text-muted);
}

.info-bar a {
  color: var(--color-primary);
  font-weight: 700;
}

/* ── Hero ────────────────────────────────────────────────────────────── */

.hero, .hero-section, .landing-hero {
  min-height: min(96dvh, 68rem);
  display: flex;
  align-items: center;
  padding-block: clamp(4rem, 10svh, 8rem);
}

.hero-grid, .split-hero, .media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
  gap: clamp(1.5rem, 1.2rem + 2vw, 4rem);
  align-items: center;
}

.hero-copy, .hero-content {
  display: grid;
  gap: var(--space-5);
}

.hero-panel, .hero-media, .glass-panel {
  position: relative;
  border-radius: var(--radius-2xl);
  background: color-mix(in srgb, var(--color-surface) 86%, transparent);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  isolation: isolate;
}

.hero-panel,
.hero-media {
  aspect-ratio: 16 / 11;
}

.panel-bar, .window-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 3.1rem;
  padding-inline: var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  background: color-mix(in srgb, var(--color-surface-offset) 88%, transparent);
}

.dot { width: 0.7rem; aspect-ratio: 1; border-radius: 50%; background: var(--color-surface-dynamic); }
.dot.r { background: #ff5f57; }
.dot.y { background: #febc2e; }
.dot.g { background: #28c840; }

.surface, .card, .section-card, .content-card, .panel, .tile {
  background: color-mix(in srgb, var(--color-surface-2) 88%, transparent);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.card, .section-card, .content-card, .panel {
  padding: clamp(1.25rem, 1rem + 1.5vw, 2.5rem);
}

.card-hover, .feature-card, .service-card, .info-card, .popup-card {
  transition:
    transform var(--transition-slow),
    box-shadow var(--transition-slow),
    border-color var(--transition-interactive),
    background var(--transition-interactive);
  transform-style: preserve-3d;
}

.card-hover:hover, .feature-card:hover, .service-card:hover, .info-card:hover, .popup-card:hover {
  transform: translateY(-0.4rem) rotateX(2deg) rotateY(-2deg);
  box-shadow: var(--shadow-xl);
  border-color: color-mix(in srgb, var(--color-primary) 28%, var(--color-border));
}

.grid, .auto-grid {
  display: grid;
  gap: clamp(1rem, 0.8rem + 1vw, 2rem);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
  gap: clamp(1rem, 0.8rem + 1vw, 2rem);
}

.grid-3, .feature-grid, .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: clamp(1rem, 0.8rem + 1vw, 2rem);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: clamp(1rem, 0.8rem + 1vw, 2rem);
}

.auto-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1rem, 0.8rem + 1vw, 1.5rem);
}

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: 1 / -1; }

.media-cover, .bg-cover, .image-fill, .card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame, .image-frame {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius-xl) - var(--space-1));
  background: var(--color-surface-offset);
}

.image-zoom, .hover-zoom img {
  transition: transform var(--transition-slow), filter var(--transition-slow);
}

.hover-zoom:hover img, .image-zoom:hover {
  transform: scale(1.05);
  filter: saturate(1.06);
}

.video-hero, .background-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.background-video, .hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-overlay-dark::after, .hero-overlay-dark::after, .scrim-dark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 6, 8, 0.18), var(--overlay-dark));
  pointer-events: none;
}

.video-overlay-light::after, .scrim-light::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), var(--overlay-light));
  pointer-events: none;
}

.glass, .blur-panel, .blurred-background {
  background: color-mix(in srgb, var(--color-surface) 72%, transparent);
  backdrop-filter: blur(1rem);
  -webkit-backdrop-filter: blur(1rem);
  border: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-xl);
}

/* Buttons, badges, controls */

.btn, .button, .solid-btn, .ghost-btn, .outline-btn, .icon-btn, .cta-btn {
  min-height: 2.75rem;
  min-width: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.92em 1.25em;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1;
  transition:
    transform var(--transition-interactive),
    box-shadow var(--transition-interactive),
    background var(--transition-interactive),
    color var(--transition-interactive),
    border-color var(--transition-interactive);
}

.btn:hover, .button:hover, .solid-btn:hover, .ghost-btn:hover, .outline-btn:hover, .icon-btn:hover, .cta-btn:hover {
  transform: translateY(-0.12rem);
}

.btn-primary, .solid-btn, .cta-btn {
  background: linear-gradient(180deg, var(--color-primary), var(--color-primary-hover));
  color: #fffaf1;
  box-shadow: 0 0.9rem 2rem rgba(182, 122, 34, 0.28);
}

.btn-primary:hover, .solid-btn:hover, .cta-btn:hover {
  background: linear-gradient(180deg, var(--color-primary-hover), var(--color-primary-active));
}

.btn-secondary, .ghost-btn, .outline-btn {
  background: color-mix(in srgb, var(--color-surface) 88%, transparent);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover, .ghost-btn:hover, .outline-btn:hover {
  background: var(--color-surface-offset);
  border-color: color-mix(in srgb, var(--color-primary) 30%, var(--color-border));
}

.btn-dark { background: var(--color-secondary); color: var(--color-text-inverse); }
.btn-light { background: var(--color-surface-2); color: var(--color-text); border: 1px solid var(--color-border); }

.underline-link, .text-link {
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  color: var(--color-primary);
}

.icon-btn {
  width: 2.8rem;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--color-border);
  background: color-mix(in srgb, var(--color-surface) 86%, transparent);
}

.badge, .meta-chip, .tag, .chip, .status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.58em 0.95em;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--color-primary) 18%, var(--color-border));
  background: var(--color-primary-highlight);
  color: var(--color-text);
}

/* Themes */

.theme-dark, .bg-dark, .section-dark, .dark-surface {
  background: linear-gradient(180deg, #101214, #1a1f23);
  color: var(--color-text-inverse);
}

.theme-dark .muted, .bg-dark .muted, .section-dark .muted {
  color: rgba(248, 244, 237, 0.74);
}

.theme-dark .card, .theme-dark .section-card, .bg-dark .card, .bg-dark .section-card, .section-dark .card, .section-dark .section-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.10);
}

.theme-light, .bg-light, .section-light {
  background: linear-gradient(180deg, var(--color-surface-2), var(--color-bg));
  color: var(--color-text);
}

/* Stats */

.stats-row, .metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--space-4);
}

.stat-card, .metric-card {
  padding: clamp(1.25rem, 1rem + 1vw, 2rem);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--color-surface-2) 92%, transparent);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

.stat-value, .metric-value, .stat-num {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  line-height: 0.95;
  color: var(--color-primary);
}

.stat-label, .metric-label, .stat-copy {
  margin-top: var(--space-3);
  color: var(--color-text-muted);
}

/* Forms */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: var(--space-4);
}

.field, .form-field { display: grid; gap: var(--space-2); }

.label, .field-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.input, .textarea, .select, .input-field {
  width: 100%;
  min-height: 3.1rem;
  padding: 0.9em 1em;
  background: color-mix(in srgb, var(--color-surface-2) 88%, transparent);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition:
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive),
    background var(--transition-interactive);
}

.textarea {
  min-height: 9rem;
  resize: vertical;
}

.input:focus, .textarea:focus, .select:focus, .input-field:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--color-primary) 55%, var(--color-border));
  box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--color-primary) 18%, transparent);
}

/* Overlays / modal */

.popup, .modal, .drawer, .overlay-panel {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: min(5%, 2rem);
  background: rgba(8, 10, 12, 0.62);
  backdrop-filter: blur(0.7rem);
}

.popup-card, .modal-card, .dialog-card {
  width: min(92%, 42rem);
  max-height: min(88dvh, 52rem);
  overflow: auto;
  padding: clamp(1.25rem, 1rem + 2vw, 2.5rem);
  border-radius: var(--radius-2xl);
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xl);
}

.drawer-right { align-items: stretch; justify-items: end; }

.drawer-right .drawer-panel {
  width: min(92%, 30rem);
  height: 100dvh;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  box-shadow: var(--shadow-xl);
  padding: var(--space-6);
}

/* Tables */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  background: color-mix(in srgb, var(--color-surface-2) 92%, transparent);
}

.table {
  width: 100%;
  min-width: 42rem;
  border-collapse: collapse;
}

.table th, .table td {
  padding: 1em;
  text-align: left;
  border-bottom: 1px solid var(--color-divider);
}

.table th {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
}

/* Icons */

.icon, .ui-icon, .service-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
}

.icon-wrap, .icon-box {
  width: clamp(3rem, 3rem + 2vw, 4.5rem);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 24%;
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  border: 1px solid color-mix(in srgb, var(--color-primary) 16%, var(--color-border));
}

/* Motion */

.floating, .float-card, .depth-float {
  animation: floatY 6s ease-in-out infinite;
  will-change: transform;
}

.reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition:
    opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

.delay-1 { transition-delay: 80ms; }
.delay-2 { transition-delay: 160ms; }
.delay-3 { transition-delay: 240ms; }
.delay-4 { transition-delay: 320ms; }

.fade-in { animation: fadeIn 720ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.slide-up { animation: slideUp 720ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.slide-left { animation: slideLeft 720ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.slide-right { animation: slideRight 720ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.zoom-in { animation: zoomIn 680ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.pop-in { animation: popIn 560ms cubic-bezier(0.16, 1, 0.3, 1) both; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(2rem); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideLeft { from { opacity: 0; transform: translateX(2rem); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideRight { from { opacity: 0; transform: translateX(-2rem); } to { opacity: 1; transform: translateX(0); } }
@keyframes zoomIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }
@keyframes popIn {
  0% { opacity: 0; transform: scale(0.92) translateY(0.8rem); }
  70% { opacity: 1; transform: scale(1.02) translateY(0); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-0.6rem); }
}

/* Utilities */

.separator, .divider, .rule {
  width: 100%;
  height: 1px;
  background: var(--color-divider);
}

.list-clean { list-style: none; }

.check-list {
  list-style: none;
  display: grid;
  gap: var(--space-3);
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.check-list li::before {
  content: "✓";
  color: var(--color-primary);
  font-weight: 800;
  flex: 0 0 auto;
}

.aspect-square { aspect-ratio: 1 / 1; }
.aspect-video { aspect-ratio: 16 / 9; }
.aspect-portrait { aspect-ratio: 4 / 5; }
.aspect-landscape { aspect-ratio: 5 / 4; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.hidden { display: none !important; }
.mobile-only { display: none; }
.desktop-only { display: initial; }

@media (max-width: 68.75rem) { /* 1100px */
  .span-7, .span-8, .span-6, .span-5, .span-4, .span-3 {
    grid-column: span 6;
  }
}

@media (max-width: 51.25rem) { /* 820px */
  .hero, .hero-section, .landing-hero {
    min-height: auto;
    padding-block: clamp(3rem, 7svh, 5rem);
  }

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

  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-12 {
    grid-column: auto;
  }

  .page-title, .hero-title, .display-title {
    max-width: 10ch;
  }

  .container, .container-default, .container-wide, .container-narrow, .shell {
    width: min(92%, 100%);
  }

  .desktop-only { display: none; }
  .mobile-only { display: block; }

  .hero-panel,
  .hero-media {
    aspect-ratio: 16 / 12;
  }
}

@media (max-width: 35rem) { /* 560px */
  .btn, .button, .solid-btn, .ghost-btn, .outline-btn, .cta-btn {
    width: 100%;
  }

  .cluster.actions, .hero-actions, .cta-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
  }

  .cluster.actions > *,
  .hero-actions > *,
  .cta-actions > * {
    flex: 1 1 100%;
  }

  .popup, .modal, .drawer, .overlay-panel {
    padding: var(--space-3);
  }

  .popup-card, .modal-card, .dialog-card {
    width: 100%;
    border-radius: var(--radius-xl);
  }
}

/* Simple hero intro animation: left to right */

.hero-intro > * {
  opacity: 0;
  transform: translateX(-1.5rem);
  animation: heroItemInX 700ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-intro > *:nth-child(1) { animation-delay: 80ms; }
.hero-intro > *:nth-child(2) { animation-delay: 180ms; }
.hero-intro > *:nth-child(3) { animation-delay: 300ms; }
.hero-intro > *:nth-child(4) { animation-delay: 420ms; }

@keyframes heroItemInX {
  from {
    opacity: 0;
    transform: translateX(-1.5rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-intro > * {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* Mobile menu */

.mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 999;
  padding: clamp(0.75rem, 0.5rem + 1vw, 1rem);
  display: grid;
  gap: var(--space-2);
  background: color-mix(in srgb, var(--color-surface) 94%, transparent);
  backdrop-filter: blur(1.2rem);
  -webkit-backdrop-filter: blur(1.2rem);
  border-bottom: 1px solid var(--color-divider);
  box-shadow: var(--shadow-lg);
}

/* Footer brand/logo: remove hard pixel sizes */

footer .brand {
  align-items: flex-start;
  gap: 0.5rem;
}

footer .brand strong {
  display: block;
}

/* Desktop / default footer logo */
footer .brand img {
  height: 8vh;       /* scales with viewport height */
  max-height: 8rem;
  width: auto;
  flex: 0 0 auto;
}

/* Mobile: keep it readable and not skinny */
@media (max-width: 51.25rem) { /* 820px */
  footer .brand {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  footer .brand img {
    height: 9vh;        /* in a 700–900px tall phone, ~63–81px */
    max-height: 6rem;
    width: auto;
    max-width: 70vw;
    margin: 0 0 0.5rem 0;
  }

  footer .brand strong {
    display: block;
    max-width: 22ch;
  }
}

/* Header logo: use CSS instead of inline height:128px */
.brand-logo,
header .brand img {
  height: clamp(2.8rem, 3.4vh + 2vw, 5rem);
  width: auto;
  flex: 0 0 auto;
}

/* Footer logo: also class-based, not fixed px */
footer .brand img {
  height: clamp(3.5rem, 4vh + 2vw, 6rem);
  width: auto;
  flex: 0 0 auto;
}

/* Generic icon button: fixed tap target, no flex-grow */
.icon-btn {
  flex: 0 0 auto;             /* don't stretch in flex rows */
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  max-width: 3rem;
  max-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;                 /* icon-only */
  border-radius: 9999px;
  border: 1px solid var(--color-border);
  background: color-mix(in srgb, var(--color-surface) 86%, transparent);
}

/* Make sure inner SVG respects the button box */
.icon-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

/* In nav-links row: do not allow icon to grow larger than content */
.header-inner .nav-links > .icon-btn {
  flex: 0 0 auto;
}

/* Mobile nav wrap: keep toggle and menu from pushing each other weirdly */
.mobile-nav-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Safety: prevent nav items from stretching unevenly at tiny widths */
.nav-links > * {
  flex-shrink: 0;
}

/* Optional: when super narrow, cluster icon to the right with fixed space */
@media (max-width: 35rem) {
  .nav-links {
    justify-content: flex-end;
  }

  .nav-links > .icon-btn {
    margin-left: var(--space-2);
  }
}

.site-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: clamp(var(--space-8), 4vw, var(--space-16));
  padding-bottom: var(--space-10);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer-grid > * {
  min-width: 0;
}

.footer-contact,
.footer-contact p,
.footer-contact a,
footer .brand,
footer .brand strong {
  min-width: 0;
  max-width: 100%;
}

.footer-contact a,
.footer-contact p {
  overflow-wrap: break-word;
  word-break: break-word;
}

.footer-contact a {
  display: block;
  width: 100%;
  padding-block: var(--space-1);
}

@media (max-width: 51.25rem) {
  .site-footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    justify-items: center;
    text-align: center;
  }

  .site-footer-grid > * {
    width: min(100%, 30rem);
    text-align: center;
  }

  .footer-contact,
  .footer-contact a,
  .footer-contact p,
  footer .brand,
  footer .brand strong {
    text-align: center;
    margin-inline: auto;
  }

  footer .brand {
    align-items: center;
    justify-content: center;
  }

   .site-footer-grid .footer-blurb {
      text-align: center !important;
      margin-inline: auto;
    }
}
