/* =========================================================
   Brand vibe: SLEEK / CLEAN / BOLD / MINIMAL / LUX
   ---------------------------------------------------------
   - Tokens first, then base, components, utilities, themes
   - HSL fallback first, OKLCH upgrade via @supports
   - Dark mode with [data-theme="dark"] + color-scheme
   - Fluid type with clamp()
   - Container queries where helpful, with media fallbacks
   - Reduced specificity via :where()
   - Accessible :focus-visible, AA contrast, motion-respect
   ========================================================= */

/* ---------- LAYERS ---------- */
@layer reset, tokens, base, components, utilities, themes, pages;

/* =========================================================
   RESET
   ========================================================= */
@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  * {
    margin: 0;
    padding: 0;
  }
  html:focus-within {
    scroll-behavior: smooth;
  }
  html,
  body {
    height: 100%;
  }
  img,
  picture,
  video,
  canvas,
  svg {
    display: block;
    max-inline-size: 100%;
    block-size: auto;
  }
  input,
  button,
  textarea,
  select {
    font: inherit;
    color: inherit;
  }
  button {
    border: none;
    background: none;
  }
  a {
    text-decoration: none;
    color: inherit;
  }
}

/* =========================================================
   TOKENS (HSL fallback, upgraded to OKLCH in @supports)
   ========================================================= */
@layer tokens {
  :root {
    /* ---- Brand Colors (HSL fallback) ---- */
    --brand-1-hsl: 223 83% 22%; /* #0a2463 */
    --brand-2-hsl: 0 100% 70%; /* #ff6b6b */
    --accent-hsl: 205 76% 66%; /* #63b3ed */
    --fg-hsl: 216 22% 28%; /* #2d3748 */
    --bg-hsl: 220 33% 97%; /* #f5f7fa */
    --surface-hsl: 0 0% 100%;
    --muted-hsl: 216 16% 60%;

    /* Moldovan flag accents */
    --md-blue-hex: #0245a5;
    --md-yellow-hex: #ffcb00;
    --md-red-hex: #d7141a;

    /* Role tokens */
    --brand-1: hsl(var(--brand-1-hsl));
    --brand-2: hsl(var(--brand-2-hsl));
    --accent: hsl(var(--accent-hsl));
    --fg: hsl(var(--fg-hsl));
    --bg: hsl(var(--bg-hsl));
    --surface: hsl(var(--surface-hsl));
    --muted: hsl(var(--muted-hsl));
    --border: hsl(216 12% 86%);

    /* Elevation */
    --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-2: 0 6px 18px rgba(0, 0, 0, 0.1);
    --shadow-3: 0 14px 34px rgba(0, 0, 0, 0.14);

    /* Typography — fluid scale */
    --font-body: system-ui, -apple-system, "Inter", "Segoe UI", Roboto,
      "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
    --font-heading: "Poppins", ui-sans-serif, system-ui, -apple-system,
      "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
      "Liberation Sans", sans-serif;

    --step--2: clamp(0.72rem, 0.72rem + 0.1vw, 0.78rem);
    --step--1: clamp(0.84rem, 0.82rem + 0.25vw, 0.95rem);
    --step-0: clamp(1rem, 0.96rem + 0.45vw, 1.125rem); /* base */
    --step-1: clamp(1.125rem, 1.02rem + 0.8vw, 1.35rem);
    --step-2: clamp(1.35rem, 1.1rem + 1.6vw, 1.7rem);
    --step-3: clamp(1.6rem, 1.24rem + 2.6vw, 2.2rem);
    --step-4: clamp(2rem, 1.5rem + 3.7vw, 2.8rem);
    --step-5: clamp(2.4rem, 1.8rem + 5.2vw, 3.4rem);

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;

    /* Radii & borders */
    --radius-1: 6px;
    --radius-2: 12px;
    --radius-3: 16px;

    /* Layout */
    --container-max: 1440px;
    --grid-columns: 12;
    --grid-gap: 20px;

    /* Focus ring (used as box-shadow) */
    --focus-ring: 0 0 0 3px color-mix(in hsl, var(--accent) 35%, white);

    /* Text wrapping preferences */
    --text-balance: balance;
    --text-pretty: pretty;

    /* Anchor scroll offset */
    --anchor-offset: 96px;

    color-scheme: light;
  }

  @supports (color: oklch(50% 0.12 200)) {
    :root {
      --brand-1: oklch(49% 0.19 264);
      --brand-2: oklch(78% 0.16 26);
      --accent: oklch(78% 0.1 240);
      --fg: oklch(36% 0.03 250);
      --bg: oklch(97% 0.01 220);
      --surface: oklch(100% 0 0);
      --muted: oklch(63% 0.03 250);
      --border: oklch(88% 0.01 220);
      --focus-ring: 0 0 0 3px color-mix(in oklch, var(--accent) 45%, white);
    }
  }
}

/* =========================================================
   BASE
   ========================================================= */
@layer base {
  html {
    font-size: 100%;
  }
  body {
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.6;
    color: var(--fg);
    background: var(--bg);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
  }

  h1,
  h2,
  h3,
  h4 {
    font-family: var(--font-heading);
    line-height: 1.2;
    color: var(--brand-1);
    text-wrap: var(--text-balance);
  }
  h1 {
    font-size: var(--step-5);
  }
  h2 {
    font-size: var(--step-4);
  }
  h3 {
    font-size: var(--step-3);
  }
  h4 {
    font-size: var(--step-2);
  }

  p,
  li {
    text-wrap: var(--text-pretty);
    overflow-wrap: anywhere;
  }
  small {
    font-size: var(--step--1);
    color: var(--muted);
  }

  a {
    color: var(--brand-1);
  }
  a:hover {
    color: var(--brand-2);
  }

  :where(a, button, [role="button"], .chip, .btn):focus-visible {
    outline: 2px solid transparent; /* fallback so outline exists */
    outline-offset: 2px;
    box-shadow: var(--focus-ring); /* primary visible focus ring */
    border-radius: var(--radius-1);
  }

  .container {
    max-inline-size: var(--container-max);
    margin-inline: auto;
    padding-inline: clamp(var(--space-4), 4vw, var(--space-7));
    container-type: inline-size;
  }

  .grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), 1fr);
    gap: var(--grid-gap);
    align-items: start;
  }

  section[id] {
    scroll-margin-top: var(--anchor-offset);
  }

  @media (prefers-reduced-motion: reduce) {
    * {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
    .bg-video__media {
      display: none;
    }
  }
}

/* =========================================================
   COMPONENTS
   ========================================================= */
@layer components {
  /* ---------- Header / Navigation ---------- */
  header {
    position: fixed;
    inset-block-start: 0;
    inline-size: 100%;
    background: var(--surface);
    box-shadow: var(--shadow-1);
    z-index: 1000;
  }
  .nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: var(--space-5);
  }
  .logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: 700;
    font-size: var(--step-1);
    color: var(--brand-1);
  }
  .logo-icon {
    inline-size: 32px;
    block-size: 32px;
    border-radius: 8px;
    background: linear-gradient(
      135deg,
      var(--md-blue-hex) 0%,
      var(--md-yellow-hex) 50%,
      var(--md-red-hex) 100%
    );
    box-shadow: var(--shadow-1);
  }
  .nav-menu {
    display: flex;
    list-style: none;
    gap: clamp(var(--space-4), 3vw, var(--space-6));
  }
  .nav-link {
    font-weight: 600;
    color: var(--fg);
    position: relative;
  }
  .nav-link::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: -6px;
    block-size: 2px;
    transform: scaleX(0);
    transform-origin: right;
    background: currentColor;
    transition: transform 0.25s;
  }
  .nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
  }

  .language-toggle {
    display: inline-flex;
    gap: var(--space-2);
    padding: 4px;
    background: color-mix(in hsl, var(--bg) 60%, white);
    border-radius: 999px;
    box-shadow: var(--shadow-1);
  }
  .lang-btn {
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
  }
  .lang-btn.active {
    background: var(--surface);
    box-shadow: var(--shadow-1);
  }
  .lang-btn:active {
    transform: translateY(1px);
  }

  .hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
  }
  .hamburger span {
    inline-size: 24px;
    block-size: 3px;
    background: var(--brand-1);
    border-radius: 2px;
  }

  /* ---------- Hero ---------- */
  .hero {
    padding-block: 120px 80px;
    background: transparent;
    position: relative;
    overflow: clip;
  }
  .hero-content {
    grid-column: 1 / span 7;
    color: white;
    background: color-mix(in hsl, black 40%, transparent);
    padding: var(--space-6);
    border-radius: var(--radius-2);
    box-shadow: var(--shadow-1);
  }
  .subheading {
    font-size: var(--step-1);
    color: color-mix(in hsl, white 92%, transparent);
    margin-block-end: var(--space-5);
    font-weight: 500;
  }
  .hero-bullets {
    margin-block: var(--space-4) var(--space-5);
    padding-inline-start: 1.1rem;
    color: white;
    font-size: var(--step-0);
  }
  .hero-bullets li {
    margin-block-end: 0.45rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    background: color-mix(in hsl, black 30%, transparent);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    display: inline-block;
  }
  .hero-image {
    grid-column: 8 / span 5;
    position: relative;
  }
  .hero-device {
    inline-size: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow-3);
    transform: translateZ(0) perspective(800px) rotateY(-15deg);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .hero-device:hover {
    transform: translateZ(0) perspective(800px) rotateY(-5deg);
  }
  .hero-bg-shape {
    position: absolute;
    inline-size: 420px;
    block-size: 420px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--brand-2) 100%);
    opacity: 0.12;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    inset-block-start: -100px;
    inset-inline-end: -100px;
    animation: float 15s ease-in-out infinite;
  }
  @keyframes float {
    0%,
    100% {
      transform: translateY(0) rotate(0);
    }
    50% {
      transform: translateY(-18px) rotate(5deg);
    }
  }

  /* ---------- Buttons ---------- */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: var(--radius-1);
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s, background 0.18s, color 0.18s;
    will-change: transform;
  }
  .btn-primary {
    background: var(--brand-2);
    color: white;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  }
  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(255, 107, 107, 0.28);
  }
  .btn-secondary {
    background: color-mix(in hsl, white 20%, transparent);
    color: white;
    position: relative;
  }
  .btn[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
  }

  /* ---------- Sections ---------- */
  .services {
    padding-block: var(--space-8);
  }
  .section-title {
    grid-column: 1 / -1;
    text-align: center;
    margin-block-end: var(--space-7);
    padding: var(--space-4);
    background: color-mix(in hsl, white 85%, transparent);
    border-radius: var(--radius-2);
    box-shadow: var(--shadow-1);
  }
  .section-title h2 {
    display: inline-block;
    color: var(--brand-1);
  }

  .service-card {
    grid-column: span 3;
    text-align: center;
    padding: var(--space-6);
    background: var(--surface);
    border-radius: var(--radius-2);
    box-shadow: var(--shadow-2);
    transition: transform 0.25s, box-shadow 0.25s;
  }
  .service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-3);
  }
  .service-icon {
    inline-size: 80px;
    block-size: 80px;
    margin-inline: auto;
    margin-block-end: var(--space-4);
    display: grid;
    place-items: center;
    background: color-mix(in hsl, var(--bg) 80%, white);
    border-radius: 50%;
    color: var(--brand-1);
    font-size: 32px;
    border: 2px solid var(--brand-1);
    box-shadow: var(--shadow-1);
  }
  .service-title {
    font-size: var(--step-2);
    margin-block-end: var(--space-3);
  }
  .service-desc {
    color: var(--fg);
  }

  /* ---------- Social Proof ---------- */
  .social-proof {
    padding-block: var(--space-8);
    background: color-mix(in hsl, var(--bg) 85%, white);
    backdrop-filter: blur(6px);
  }
  .clients {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-6);
    justify-content: space-around;
    align-items: center;
    margin-block-end: var(--space-7);
  }
  .client-logo {
    block-size: 60px;
    filter: grayscale(100%);
    opacity: 0.75;
    transition: filter 0.25s, opacity 0.25s;
  }
  .client-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
  }

  .testimonial {
    grid-column: span 6;
    background: var(--surface);
    padding: var(--space-6);
    border-radius: var(--radius-2);
    box-shadow: var(--shadow-2);
  }
  .testimonial-content {
    font-style: italic;
    margin-block-end: var(--space-4);
    position: relative;
  }
  .testimonial-content::before {
    content: "“";
    font-size: 60px;
    color: var(--accent);
    opacity: 0.2;
    position: absolute;
    inset-block-start: -20px;
    inset-inline-start: -10px;
  }
  .testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--space-3);
  }
  .author-avatar {
    inline-size: 50px;
    block-size: 50px;
    border-radius: 50%;
    background: linear-gradient(
      135deg,
      var(--md-blue-hex) 0%,
      var(--md-yellow-hex) 50%,
      var(--md-red-hex) 100%
    );
  }
  .author-name {
    font-weight: 700;
    color: var(--brand-1);
  }
  .author-company {
    font-size: var(--step--1);
    color: var(--muted);
  }

  /* ---------- Pricing ---------- */
  .pricing {
    padding-block: var(--space-8);
    background: transparent;
  }
  .pricing-grid {
    background: transparent;
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
    margin-block-start: var(--space-5);
    backdrop-filter: saturate(1.1) blur(4px);
    border-radius: 22px;
    padding: clamp(8px, 1.5vw, 16px);
  }
  .price-card {
    background: transparent;
    border-radius: var(--radius-2);
    padding: var(--space-6);
    box-shadow: var(--shadow-2);
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    border: 1px solid var(--border);
    color: var(--surface);
  }
  .price-card.card1 {
    background-image: url("/assets/hero-screen-preturi1.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }
  .price-card.card2 {
    background-image: url("/assets/hero-screen-preturi2.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }
  .price-card.card3 {
    background-image: url("/assets/hero-screen-preturi3.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }
  .price-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-3);
  }
  .price-card h3 {
    margin-block-end: var(--space-3);
    color: var(--brand-1);
  }
  .price-card ul {
    list-style: none;
    margin: var(--space-3) 0 var(--space-5);
  }
  .price-card li {
    position: relative;
    margin-block: 0.45rem;
    padding-inline-start: 1.4rem;
    border-radius: 4px;
    padding-block: 0.25rem;
  }
  .price-card li::before {
    content: "✓";
    position: absolute;
    inset-inline-start: 0.35rem;
    inset-block-start: 0.05rem;
    color: var(--accent);
    font-weight: 800;
  }

  /* ---------- Contact ---------- */
  .contact-hero {
    background: transparent;
    padding-block: 120px 40px;
    position: relative;
  }
  .contact-wrap {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: var(--grid-gap);
    align-items: start;
  }
  .form-card,
  .info-card {
    background: color-mix(in hsl, white 94%, transparent);
    backdrop-filter: blur(8px) saturate(120%);
    border-radius: var(--radius-3);
    border: 1px solid color-mix(in hsl, var(--border) 80%, white);
    box-shadow: var(--shadow-2);
    padding: var(--space-7);
  }
  .field {
    position: relative;
    margin-block-end: 1.25rem;
  }
  .input,
  .textarea,
  .select {
    inline-size: 100%;
    padding: 1.1rem 1rem;
    border-radius: 12px;
    border: 1px solid color-mix(in hsl, var(--border) 85%, white);
    background: var(--surface);
    color: var(--fg);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  }
  .textarea {
    min-block-size: 140px;
    resize: vertical;
  }
  .input:focus,
  .textarea:focus,
  .select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in hsl, var(--accent) 25%, white);
  }
  .label {
    position: absolute;
    inset-inline-start: 0.9rem;
    inset-block-start: 0.95rem;
    padding: 0 0.35rem;
    background: var(--surface);
    color: color-mix(in hsl, var(--fg) 70%, white);
    transition: transform 0.18s ease, color 0.18s ease,
      inset-block-start 0.18s ease;
    pointer-events: none;
  }
  .input:not(:placeholder-shown) + .label,
  .input:focus + .label,
  .textarea:not(:placeholder-shown) + .label,
  .textarea:focus + .label,
  .select:focus + .label {
    inset-block-start: -0.55rem;
    transform: scale(0.9);
    color: var(--brand-1);
  }
  .help {
    font-size: var(--step--1);
    color: color-mix(in hsl, var(--fg) 60%, white);
    margin-block-start: 0.35rem;
  }

  .chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-block-end: 1rem;
  }
  .chip {
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    border: 1px solid color-mix(in hsl, var(--border) 85%, white);
    background: var(--surface);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.12s;
  }
  .chip[aria-checked="true"] {
    background: var(--brand-1);
    color: white;
    border-color: var(--brand-1);
  }
  .chip:active {
    transform: translateY(1px);
  }
  .chip-group:has(.chip[aria-checked="true"]) .chip:not([aria-checked="true"]) {
    opacity: 0.85;
  }

  .range-wrap {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: center;
  }
  .range {
    inline-size: 100%;
  }
  .badge {
    background: var(--md-yellow-hex);
    color: #1a1a1a;
    font-weight: 800;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    min-inline-size: 72px;
    text-align: center;
  }

  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .form-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-block-start: 0.5rem;
  }
  .spinner {
    inline-size: 18px;
    block-size: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-block-start-color: white;
    display: inline-block;
    animation: spin 0.8s linear infinite;
  }
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
  .status {
    margin-block-start: 0.75rem;
    font-size: var(--step--1);
  }
  .status.success {
    color: #0a8a4d;
  }
  .status.error {
    color: #b00020;
  }

  /* Hero-only scrim for readability on video bg */
  .contact-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
      ellipse at 40% 35%,
      rgba(0, 0, 0, 0.45),
      rgba(0, 0, 0, 0.35) 45%,
      rgba(0, 0, 0, 0.2) 100%
    );
    z-index: 0;
  }
  .contact-hero > .container {
    position: relative;
    z-index: 1;
  }

  /* ---------- Process ---------- */
  .process {
    padding-block: var(--space-8);
    background: color-mix(in hsl, white 90%, transparent);
    backdrop-filter: blur(5px);
  }
  .process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-5);
    margin-block-start: var(--space-7);
  }
  .step {
    text-align: center;
    position: relative;
    background: var(--surface);
    padding: var(--space-4);
    border-radius: var(--radius-2);
    box-shadow: var(--shadow-1);
  }
  .step:not(:last-child)::after {
    content: "";
    position: absolute;
    inset-block-start: 40px;
    inset-inline-end: -50%;
    inline-size: 100%;
    block-size: 2px;
    background: color-mix(in hsl, var(--bg) 80%, white);
    z-index: -1;
  }
  .step-number {
    inline-size: 80px;
    block-size: 80px;
    border-radius: 50%;
    background: var(--brand-1);
    color: white;
    display: grid;
    place-items: center;
    font-size: var(--step-3);
    font-weight: 800;
    margin: 0 auto var(--space-4);
  }
  .step-title {
    font-size: var(--step-2);
    margin-block-end: var(--space-3);
  }
  .step-desc {
    color: var(--fg);
  }

  /* ---------- FAQ ---------- */
  .faq {
    padding-block: var(--space-8);
    background: transparent;
  }
  .faq-list {
    max-inline-size: 900px;
    margin-inline: auto;
  }
  .faq-list details {
    background: var(--surface);
    border-radius: var(--radius-2);
    padding: var(--space-5);
    margin-block-end: var(--space-4);
    box-shadow: var(--shadow-1);
    border: 1px solid var(--border);
  }
  .faq-list summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--brand-1);
    list-style: none;
  }
  .faq-list details[open] summary {
    color: var(--brand-2);
  }
  .faq-list details p {
    margin-block-start: var(--space-3);
    color: var(--fg);
  }

  /* ---------- CTA ---------- */
  .cta-section {
    padding-block: var(--space-8);
    color: white;
    text-align: center;
    background: linear-gradient(
      135deg,
      color-mix(in hsl, var(--brand-1) 90%, black) 0%,
      color-mix(in hsl, var(--brand-1) 80%, black) 100%
    );
    backdrop-filter: blur(5px);
  }
  .cta-section h2 {
    color: white;
  }
  .cta-container {
    grid-column: 3 / span 8;
  }

  /* ---------- Footer ---------- */
  footer {
    position: relative;
    padding-block: var(--space-8) var(--space-6);
    color: white;
    isolation: isolate;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
    background: var(--brand-1);
    overflow: hidden;
    z-index: 1;
    --footer-height: auto;
  }
  .footer-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
      135deg,
      rgba(10, 36, 99, 0.95) 0%,
      rgba(10, 36, 99, 0.8) 100%
    );
    z-index: -1;
  }
  .footer-bg-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  }
  .footer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-6);
    align-items: start;
    padding-block-end: var(--space-6);
  }
  .footer-col {
    min-width: 0;
  }
  .footer-col h3 {
    position: relative;
    color: white;
    font-size: var(--step-1);
    margin-block-end: var(--space-4);
    padding-block-end: var(--space-3);
    text-wrap: balance;
  }
  .footer-col h3::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    inset-block-end: 0;
    inline-size: 40px;
    block-size: 3px;
    background: var(--accent);
    border-radius: 2px;
  }
  .brand-col p {
    margin-block-end: var(--space-4);
    font-size: var(--step--1);
    line-height: 1.5;
    max-width: 28ch;
    opacity: 0.9;
  }
  .social-links {
    display: flex;
    gap: var(--space-3);
    margin-block-start: var(--space-4);
  }
  .social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.2s ease;
  }
  .social-link:hover {
    background: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  }

  .footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  .footer-links li {
    margin-block-end: var(--space-2);
  }
  .footer-links a {
    display: inline-block;
    color: rgba(255, 255, 255, 0.85);
    padding-block: var(--space-2);
    transition: all 0.2s ease;
    position: relative;
    text-decoration: none;
    font-size: var(--step--1);
  }
  .footer-links a:hover {
    color: white;
    transform: translateX(4px);
  }
  .footer-links a::before {
    content: "›";
    margin-inline-end: var(--space-2);
    opacity: 0;
    transform: translateX(-8px);
    display: inline-block;
    transition: all 0.2s ease;
  }
  .footer-links a:hover::before {
    opacity: 1;
    transform: translateX(0);
  }

  .contact-col address {
    font-style: normal;
  }
  .contact-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
  }
  .contact-info p {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--step--1);
    color: rgba(255, 255, 255, 0.85);
  }
  .contact-info a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.2s ease;
    overflow-wrap: break-word;
    word-break: break-all;
    padding-block: var(--space-1);
  }
  .contact-info a:hover {
    color: white;
    text-decoration: underline;
  }

  .footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-block-start: var(--space-5);
    border-block-start: 1px solid rgba(255, 255, 255, 0.15);
  }
  .copyright {
    font-size: var(--step--1);
    color: rgba(255, 255, 255, 0.7);
  }
  .back-to-top {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    transition: all 0.3s ease;
  }
  .back-to-top:hover {
    background: var(--accent);
    transform: translateY(-4px);
  }

  footer :where(a, button, [role="button"]):focus-visible {
    outline: 2px solid white;
    outline-offset: 4px;
    border-radius: 4px;
  }

  @media (max-width: 1024px) {
    .footer-grid {
      grid-template-columns: repeat(2, 1fr);
      row-gap: var(--space-7);
    }
  }
  @media (max-width: 768px) {
    .footer-grid {
      grid-template-columns: 1fr;
      gap: var(--space-6);
    }
    .footer-bottom {
      flex-direction: column;
      gap: var(--space-4);
    }
    .back-to-top {
      margin-inline: auto;
    }
  }
  @supports (padding: max(0px)) {
    footer {
      padding-block-end: max(
        var(--space-6),
        env(safe-area-inset-bottom, var(--space-6))
      );
      padding-inline: max(
        var(--space-4),
        env(safe-area-inset-right, var(--space-4))
      );
    }
  }
  footer :where(p, li, h3, a, span) {
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
    max-width: 100%;
  }

  /* ---------- Background video (site-wide) ---------- */
  .bg-video {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    /* Stop at footer if you later set a concrete height */
    height: calc(100% - var(--footer-height, 0px));
    min-height: 100%;
  }
  .bg-video__media {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 50%;
    min-inline-size: 100%;
    min-block-size: 100%;
    inline-size: 100vw;
    block-size: 100vh;
    transform: translate(-50%, -50%);
    object-fit: cover;
    object-position: center;
    filter: none;
  }
  .bg-video::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.75) 0%,
      rgba(0, 0, 0, 0.85) 100%
    );
    pointer-events: none;
  }
  @supports (height: 100dvh) {
    .bg-video {
      height: 100dvh;
    }
  }
}

/* (Optional) utilities layer placeholder */
@layer utilities {
}

/* =========================================================
   THEMES (dark mode via [data-theme="dark"])
   ========================================================= */
@layer themes {
  [data-theme="dark"] {
    color-scheme: dark;
    --fg: oklch(92% 0 0 / 0.92);
    --bg: oklch(14% 0.02 250);
    --surface: oklch(20% 0.02 250);
    --muted: oklch(70% 0.02 250 / 0.75);
    --border: oklch(30% 0.02 250);
    --brand-1: oklch(63% 0.16 264); /* lift blue for contrast on dark */
    --brand-2: oklch(70% 0.16 26);
    --accent: oklch(80% 0.08 240);
    --focus-ring: 0 0 0 3px color-mix(in oklch, var(--accent) 40%, white);

    @supports not (color: oklch(50% 0.12 200)) {
      --fg-hsl: 0 0% 98%;
      --bg-hsl: 220 25% 10%;
      --surface-hsl: 220 20% 14%;
      --muted-hsl: 220 12% 70%;
      --border-hsl: 220 10% 28%;
      --brand-1-hsl: 223 83% 62%;
      --brand-2-hsl: 0 100% 68%;
      --accent-hsl: 205 76% 72%;
      --fg: hsl(var(--fg-hsl));
      --bg: hsl(var(--bg-hsl));
      --surface: hsl(var(--surface-hsl));
      --muted: hsl(var(--muted-hsl));
      --border: hsl(var(--border-hsl));
      --brand-1: hsl(var(--brand-1-hsl));
      --brand-2: hsl(var(--brand-2-hsl));
      --accent: hsl(var(--accent-hsl));
    }
  }
}

/* =========================================================
   PAGES (scoped overrides that never leak)
   ========================================================= */
@layer pages {
  .page--lighttext .content-grid {
    color: var(--surface);
  }
  .page--lighttext .content-image img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 18px;
    border: 1px solid color-mix(in oklch, canvas, canvastext 10%);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 12px 24px rgba(0, 0, 0, 0.1);
    background: color-mix(in oklch, canvas, canvastext 3%);
  }
  .page--lighttext .content-image {
    backdrop-filter: saturate(1.1) blur(4px);
    border-radius: 22px;
    padding: clamp(8px, 1.5vw, 16px);
  }
}

/* ===============================
   MOBILE POLISH PACK
   (add AFTER your existing CSS)
   =============================== */

/* Handy breakpoints (still using container queries for components) */
@layer tokens {
  :root {
    --bp-md: 960px;
    --bp-sm: 720px;
    --bp-xs: 480px;
  }
}

/* ---------------------------------
   GLOBAL MOBILE SAFETY NET
---------------------------------- */
@layer utilities {
  /* Reduce horizontal squeeze on small screens */
  @container (max-width: 960px) {
    .container {
      padding-inline: clamp(var(--space-4), 5vw, var(--space-7));
    }
  }

  /* Stop anything from overflowing the viewport */
  body,
  html {
    overflow-x: hidden;
  }

  /* Big, tappable buttons on mobile */
  @container (max-width: 720px) {
    .btn {
      inline-size: 100%;
    }
  }

  /* Safe areas (like you did in footer) */
  @supports (padding: max(0px)) {
    main,
    .container {
      padding-inline: max(var(--space-4), env(safe-area-inset-left, 0));
    }
  }
}

/* ---------------------------------
   NAVIGATION (real mobile behavior)
---------------------------------- */
@layer components {
  /* Show hamburger, hide inline menu under ~900-960px */
  @media (max-width: 960px) {
    .hamburger {
      display: flex;
    }
    .nav-menu {
      position: fixed;
      inset-block-start: calc(var(--anchor-offset) - 20px);
      inset-inline: 0;
      display: none;
      flex-direction: column;
      gap: 0;
      background: var(--surface);
      border-block-start: 1px solid var(--border);
      box-shadow: var(--shadow-2);
      padding: var(--space-4);
      z-index: 1100;
    }
    .nav-menu.active {
      display: flex;
    }
    .nav-menu .nav-link {
      padding-block: 0.85rem;
      padding-inline: 0.25rem;
      font-size: var(--step-1);
    }
  }
}

/* ---------------------------------
   HERO (stack & spacing)
---------------------------------- */
@layer components {
  /* Use the container on your .hero section for precision */
  .hero > .container {
    container-type: inline-size;
  }

  @container (max-width: 960px) {
    .hero {
      padding-block: 104px 56px;
    }
    .hero-content {
      grid-column: 1 / -1;
    }
    .hero-image {
      grid-column: 1 / -1;
      margin-block-start: var(--space-5);
    }
  }

  @container (max-width: 720px) {
    .subheading {
      font-size: var(--step-0);
    }
    .hero-bullets {
      font-size: var(--step--1);
    }
    .hero-device {
      transform: none;
    } /* avoid 3D tilt jitters on tiny screens */
  }
}

/* ---------------------------------
   SERVICES GRID
---------------------------------- */
@layer components {
  .services > .container {
    container-type: inline-size;
  }

  /* 3 → 2 → 1 cards */
  @container (max-width: 1024px) {
    .service-card {
      grid-column: span 6;
    }
  }
  @container (max-width: 720px) {
    .service-card {
      grid-column: 1 / -1;
    }
    .service-icon {
      inline-size: 64px;
      block-size: 64px;
      font-size: 28px;
    }
    .service-title {
      font-size: var(--step-1);
    }
  }
}

/* ---------------------------------
   TESTIMONIALS
---------------------------------- */
@layer components {
  .social-proof > .container {
    container-type: inline-size;
  }

  @container (max-width: 960px) {
    .testimonial {
      grid-column: 1 / -1;
    }
  }
}

/* ---------------------------------
   PRICING
---------------------------------- */
@layer components {
  .pricing > .container {
    container-type: inline-size;
  }

  /* 3 columns → 2 on tablets */
  @container (max-width: 1024px) {
    .pricing-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }
  /* → 1 column on phones */
  @container (max-width: 720px) {
    .pricing-grid {
      grid-template-columns: 1fr;
    }
    .price-card {
      padding: var(--space-5);
    }
    .price-card h3 {
      font-size: var(--step-2);
    }
  }
}

/* ---------------------------------
   CONTACT (form + info)
---------------------------------- */
@layer components {
  .contact-hero > .container {
    container-type: inline-size;
  }

  @container (max-width: 1024px) {
    .contact-wrap {
      grid-template-columns: 1fr;
    }
    .info-card {
      order: 2;
    }
    .form-card {
      order: 1;
    }
  }

  @container (max-width: 720px) {
    .form-row {
      grid-template-columns: 1fr;
    }
  }
}

/* ---------------------------------
   PROCESS STEPS
---------------------------------- */
@layer components {
  .process > .container {
    container-type: inline-size;
  }

  @container (max-width: 1024px) {
    .process-steps {
      grid-template-columns: repeat(2, 1fr);
    }
  }
  @container (max-width: 720px) {
    .process-steps {
      grid-template-columns: 1fr;
    }
    .step-number {
      inline-size: 64px;
      block-size: 64px;
      font-size: var(--step-2);
    }
  }
}

/* ---------------------------------
   FAQ
---------------------------------- */
@layer components {
  .faq > .container {
    container-type: inline-size;
  }
  @container (max-width: 720px) {
    .faq-list details {
      padding: var(--space-4);
    }
    .faq-list summary {
      font-size: var(--step-1);
    }
  }
}

/* ---------------------------------
   TYPOGRAPHY & SPACING ON MOBILE
---------------------------------- */
@layer base {
  @media (max-width: 480px) {
    h1 {
      font-size: clamp(1.8rem, 4.8vw, 2.2rem);
    }
    h2 {
      font-size: clamp(1.4rem, 4.2vw, 1.8rem);
    }
    p {
      line-height: 1.7;
    }
    section {
      padding-block: clamp(2rem, 6vw, 3rem);
    }
  }
}

/* ---------------------------------
   BACKGROUND VIDEO (avoid layout fights)
---------------------------------- */
@layer components {
  /* If the video ever causes jank on small devices, dim or disable it */
  @media (max-width: 480px) {
    .bg-video__media {
      opacity: 0.85;
    }
  }
  @media (max-width: 360px) {
    .bg-video {
      display: none;
    } /* last-resort hard off for very small phones */
  }
}

/* ---------------------------------
   OVERFLOW GUARDRAILS (texts/urls)
---------------------------------- */
@layer base {
  :where(p, li, a, small) {
    overflow-wrap: anywhere; /* already used globally; reinforce for anchors */
  }
  /* Long URLs in contact/footer/info columns */
  .contact-info a {
    word-break: break-all;
  }
}

/* ---------------------------------
   OPTIONAL: quick layout debugger
   (toggle by adding data-debug to <body>)
---------------------------------- */
@layer utilities {
  [data-debug] * {
    outline: 1px dashed rgba(0, 0, 0, 0.12);
  }
}
