/* ============================================================
   ЮЖНЫЙ КОНСТРУКТОР — Landing Page Styles
   Visual direction: IBM.com — professional, technological
   ============================================================ */

/* ---------- Custom Properties ---------- */
:root {
  /* Accent (shared) */
  --accent: #0f62fe;
  --accent-hover: #0353e9;
  --accent-blue: var(--accent);
  --accent-blue-hover: var(--accent-hover);
  --accent-green: #24a148;

  /* Neutral anchors */
  --cream: #ffffff;
  --ink: #161616;

  /* Typography */
  --font-sans: 'IBM Plex Sans', Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Layout */
  --container-max: 1440px;
  --grid-gap: 1.5rem;
  --radius: 0;
  --radius-sm: 2px;
  --section-pad-y: 4rem;
  --nav-height: 3.5rem;
  --nav-control-height: 2.5rem;

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-med: 400ms;
  --duration-slow: 900ms;

  /* Icon color filters (black SVG → tint) */
  --filter-accent: invert(32%) sepia(98%) saturate(2500%) hue-rotate(210deg) brightness(100%) contrast(101%);
  --filter-green: invert(48%) sepia(79%) saturate(400%) hue-rotate(90deg) brightness(90%) contrast(90%);
}

/* Dark theme — IBM Gray 100 primary; all sections stay dark */
[data-theme="dark"] {
  --page-bg: #161616;
  --nav-bg: rgba(22, 22, 22, 0.92);
  --nav-text: #ffffff;
  --nav-border: #393939;

  --section-a-bg: #161616;
  --section-a-text: #ffffff;
  --section-a-muted: #c6c6c6;
  --section-a-border: #393939;
  --section-a-title: #ffffff;

  --section-b-bg: #262626;
  --section-b-text: #ffffff;
  --section-b-muted: #c6c6c6;
  --section-b-border: #393939;
  --section-b-title: #ffffff;
  --section-b-card: #161616;

  --surface-bg: #262626;
  --surface-text: #ffffff;
  --surface-muted: #c6c6c6;
  --surface-border: #393939;
  --surface-placeholder: #6f6f6f;

  --footer-bg: #000000;
  --footer-text: #ffffff;
  --footer-muted: #c6c6c6;
  --footer-faint: #6f6f6f;
  --footer-border: #393939;

  --toast-bg: #262626;
  --toast-text: #ffffff;

  --filter-muted: invert(80%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(90%) contrast(90%);
  --filter-nav-icon: invert(100%);
  --filter-footer: invert(80%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(90%) contrast(90%);
  --diagram-dim: #393939;
  --diagram-label: #c6c6c6;
}

/* Light theme — IBM Gray 10 primary */
[data-theme="light"] {
  --page-bg: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.92);
  --nav-text: #161616;
  --nav-border: #e0e0e0;

  --section-a-bg: #ffffff;
  --section-a-text: #161616;
  --section-a-muted: #525252;
  --section-a-border: #e0e0e0;
  --section-a-title: #161616;

  --section-b-bg: #f4f4f4;
  --section-b-text: #161616;
  --section-b-muted: #525252;
  --section-b-border: #e0e0e0;
  --section-b-title: #161616;
  --section-b-card: #ffffff;

  --surface-bg: #ffffff;
  --surface-text: #161616;
  --surface-muted: #525252;
  --surface-border: #e0e0e0;
  --surface-placeholder: #8d8d8d;

  --footer-bg: #161616;
  --footer-text: #ffffff;
  --footer-muted: #c6c6c6;
  --footer-faint: #6f6f6f;
  --footer-border: #393939;

  --toast-bg: #ffffff;
  --toast-text: #161616;

  --filter-muted: invert(35%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(90%) contrast(90%);
  --filter-nav-icon: invert(10%);
  --filter-footer: invert(80%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(90%) contrast(90%);
  --diagram-dim: #e0e0e0;
  --diagram-label: #525252;
}

/* Legacy aliases used across components */
:root,
[data-theme="dark"],
[data-theme="light"] {
  --bg-primary: var(--section-a-bg);
  --bg-secondary: var(--section-b-bg);
  --bg-surface: var(--surface-bg);
  --bg-white: var(--section-b-card);
  --bg-darkest: var(--footer-bg);
  --text-on-dark: var(--section-a-text);
  --text-on-light: var(--section-b-text);
  --text-secondary: var(--section-a-muted);
  --text-muted-light: var(--section-b-muted);
  --border-subtle: var(--section-a-border);
  --border-light: var(--section-b-border);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--section-a-text);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--duration-base) ease, color var(--duration-base) ease;
  overflow-x: clip;
}

img,
svg {
  display: block;
  max-width: 100%;
}

ul {
  list-style: none;
}

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

button,
input,
textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

button {
  cursor: pointer;
}

/* ---------- Scroll Progress Bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 9999;
  pointer-events: none;
  will-change: width;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  top: calc(var(--nav-height) + 1rem);
  right: 1.5rem;
  left: 1.25rem;
  z-index: 10000;
  background: var(--toast-bg);
  color: var(--toast-text);
  border: 1px solid var(--accent);
  padding: 0.875rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition:
    opacity var(--duration-med) var(--ease-out),
    visibility var(--duration-med) var(--ease-out),
    transform var(--duration-med) var(--ease-out);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (min-width: 480px) {
  .toast {
    left: auto;
    max-width: calc(100vw - 3rem);
  }
}

/* ---------- Container / Grid ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  min-width: 0;
}

main,
header,
footer,
section {
  max-width: 100%;
}

/* ---------- Section backgrounds ---------- */
.section-dark {
  background: var(--section-a-bg);
  color: var(--section-a-text);
}

.section-light {
  background: var(--section-b-bg);
  color: var(--section-b-text);
}

.section-darkest {
  background: var(--footer-bg);
  color: var(--footer-text);
}

/* ---------- Site Navigation ---------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  height: var(--nav-height);
  border-bottom: 1px solid var(--nav-border);
}

.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  gap: var(--space-md);
  min-width: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-nav__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 0;
}

.site-nav__logo-mark {
  width: auto;
  height: 28px;
  max-width: min(132px, 42vw);
  display: block;
}

.site-nav__logo-mark--dark {
  display: none;
}

[data-theme="dark"] .site-nav__logo-mark--light {
  display: none;
}

[data-theme="dark"] .site-nav__logo-mark--dark {
  display: block;
}

.site-nav__links {
  display: none;
  align-items: center;
  gap: 0;
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
}

.site-nav__link {
  font-size: 0.875rem;
  color: var(--nav-text);
  padding: 0.5rem 0.75rem;
  transition: color var(--duration-fast) ease;
  white-space: nowrap;
}

.site-nav__link:hover,
.site-nav__link.is-active {
  color: var(--accent);
}

.site-nav__cta {
  flex-shrink: 0;
}

.site-nav__cta--desktop {
  display: none;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
}

.site-nav__actions > .site-nav__cta--desktop {
  display: none;
}

.site-nav__cta--mobile {
  width: 100%;
  margin-top: var(--space-md);
  justify-content: center;
  white-space: normal;
  text-align: center;
}

.site-nav__actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  flex-shrink: 0;
}

.site-nav__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--nav-control-height);
  height: var(--nav-control-height);
  color: var(--nav-text);
  border: 1px solid transparent;
  transition:
    color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    background-color var(--duration-fast) ease;
}

.site-nav__icon-btn:hover {
  color: var(--accent);
  border-color: var(--nav-border);
}

.site-nav__icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-nav__icon-btn svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: block; }

[data-theme="light"] .theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }

.site-nav__burger {
  display: inline-flex;
}

.site-nav__burger .icon-close { display: none; }
.site-nav.is-open .site-nav__burger .icon-menu { display: none; }
.site-nav.is-open .site-nav__burger .icon-close { display: block; }

.site-nav__drawer {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  height: calc(100dvh - var(--nav-height));
  height: calc(100vh - var(--nav-height));
  background: var(--nav-bg);
  border-top: 1px solid var(--nav-border);
  padding: var(--space-md) 1.25rem;
  flex-direction: column;
  gap: 0;
  z-index: 8999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.site-nav__drawer.is-open {
  display: flex;
}

.site-nav__drawer .site-nav__link {
  display: block;
  padding: 1rem 0;
  border-bottom: 1px solid var(--nav-border);
  font-size: 1rem;
  white-space: normal;
}

.site-nav__drawer-nav {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.site-nav__link--legal {
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: 1px solid var(--nav-border);
  border-bottom: none;
}

@media (min-width: 768px) {
  :root {
    --nav-height: 4rem;
  }

  .site-nav__logo-mark {
    height: 36px;
  }

  .site-nav__links {
    display: flex;
  }

  .site-nav__cta--desktop,
  .site-nav__actions > .site-nav__cta--desktop {
    display: inline-flex;
    height: var(--nav-control-height);
    min-height: var(--nav-control-height);
    padding: 0 1rem;
    line-height: 1;
  }

  .site-nav__burger {
    display: none;
  }

  .site-nav__drawer {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .site-nav__link {
    padding: 0.5rem 1rem;
  }
}

/* ---------- Typography ---------- */
.section-title {
  font-weight: 300;
  font-size: 1.75rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-xl);
  color: var(--section-b-title);
}

.section-title--light {
  color: var(--section-a-title);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.9375rem;
  line-height: 1;
  padding: 1rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition:
    background-color var(--duration-fast) ease,
    color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: inset 0 0 0 1px #ffffff;
}

.btn--primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Outline / secondary CTA */
.btn--outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
  z-index: 0;
}

.btn--outline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: var(--accent);
  transition: width var(--duration-base) var(--ease-out);
  z-index: -1;
}

.btn--outline:hover {
  color: #ffffff;
}

.btn--outline:hover::before {
  width: 100%;
}

.btn--outline:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Submit button spinner state */
.btn--submit {
  width: 100%;
  min-height: 3.25rem;
}

.btn__spinner {
  display: none;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn--loading .btn__text {
  display: none;
}

.btn--loading .btn__spinner {
  display: block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Reveal (scroll-triggered) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--duration-med) var(--ease-out),
    transform var(--duration-med) var(--ease-out);
  transition-delay: var(--delay, 0ms);
}

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

/* Horizontal clip-path wipe for production work items */
.reveal--wipe {
  opacity: 1;
  transform: none;
  clip-path: inset(0 100% 0 0);
  transition: clip-path var(--duration-med) var(--ease-out);
  transition-delay: var(--delay, 0ms);
}

.reveal--wipe.show {
  clip-path: inset(0 0 0 0);
}

/* Stagger helpers for grouped cards (nth-child) */
.directions__grid .dir-card:nth-child(1) { --delay: 0ms; }
.directions__grid .dir-card:nth-child(2) { --delay: 60ms; }
.directions__grid .dir-card:nth-child(3) { --delay: 120ms; }
.directions__grid .dir-card:nth-child(4) { --delay: 180ms; }
.directions__grid .dir-card:nth-child(5) { --delay: 240ms; }

.work-list .work-item:nth-child(1) { --delay: 0ms; }
.work-list .work-item:nth-child(2) { --delay: 100ms; }
.work-list .work-item:nth-child(3) { --delay: 200ms; }

/* ============================================================
   BLOCK 1 — HERO
   ============================================================ */
.hero {
  padding-top: calc(var(--nav-height) + var(--section-pad-y));
  padding-bottom: var(--section-pad-y);
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero__brand {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.hero__title {
  font-weight: 300;
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--section-a-text);
  margin-bottom: var(--space-md);
  max-width: 18em;
}

/* Word-by-word entrance */
.hero__title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(12px);
  animation: wordIn 0.4s var(--ease-out) forwards;
}

@keyframes wordIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__sub {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--section-a-muted);
  max-width: 42rem;
  margin-bottom: var(--space-xl);
}

.hero__cta {
  margin-bottom: var(--space-xl);
}

.hero__triggers {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  max-width: 48rem;
}

.trigger-chip {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--section-a-muted);
  padding: 0.75rem 0;
  border-top: 1px solid var(--section-a-border);
}

.trigger-chip__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--accent);
  margin-top: 0.1rem;
}

.trigger-chip__icon img {
  width: 20px;
  height: 20px;
  filter: var(--filter-accent);
}

/* Icon pulse once on reveal */
.trigger-chip.show .trigger-chip__icon {
  animation: iconPulse 0.4s var(--ease-out) 1;
}

@keyframes iconPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ============================================================
   BLOCK 2 — DIRECTIONS
   ============================================================ */
.directions {
  padding-top: var(--section-pad-y);
  padding-bottom: var(--section-pad-y);
}

.directions__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--grid-gap);
}

.dir-card {
  background: var(--section-b-card);
  border: 1px solid var(--section-b-border);
  border-radius: var(--radius-sm);
  padding: var(--space-lg);
  transition:
    border-color var(--duration-base) ease,
    transform var(--duration-base) ease;
}

.dir-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.dir-card__icon {
  width: 32px;
  height: 32px;
  margin-bottom: var(--space-md);
  color: var(--accent);
  transition: transform var(--duration-base) ease;
}

.dir-card__icon img {
  width: 32px;
  height: 32px;
  filter: var(--filter-accent);
}

.dir-card:hover .dir-card__icon {
  transform: rotate(8deg);
}

.dir-card__title {
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.35;
  margin-bottom: var(--space-sm);
  color: var(--section-b-text);
}

.dir-card__desc {
  font-weight: 400;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--section-b-muted);
}

/* ============================================================
   BLOCK 3 — PRODUCTION
   ============================================================ */
.production {
  padding-top: var(--section-pad-y);
  padding-bottom: var(--section-pad-y);
}

.production__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.production__text {
  color: var(--section-a-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: var(--space-xl);
  max-width: 36rem;
}

.work-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: var(--space-xl);
}

.work-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-top: 1px solid var(--section-a-border);
}

.work-item:last-child {
  border-bottom: 1px solid var(--section-a-border);
}

.work-item__label {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  flex-shrink: 0;
  padding-top: 0.15rem;
}

.work-item__body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.work-item__body strong {
  font-weight: 600;
  font-size: 1rem;
  color: var(--section-a-text);
}

.work-item__body span {
  font-size: 0.9375rem;
  color: var(--section-a-muted);
  line-height: 1.55;
}

.production__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-bg);
  border: 1px solid var(--section-a-border);
  padding: var(--space-lg);
  min-height: 280px;
}

.part-diagram {
  width: 100%;
  max-width: 400px;
}

/* SVG draw-on-scroll for diagram */
.trace-path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}

.production__visual.show .trace-path {
  animation: drawPath 1.2s ease-out forwards;
}

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

/* ============================================================
   BLOCK 4 — TRUST / WHY US
   ============================================================ */
.trust {
  padding-top: var(--section-pad-y);
  padding-bottom: var(--section-pad-y);
}

.trust__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--grid-gap);
}

.trust-item {
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--section-b-border);
}

.trust-item__icon {
  width: 48px;
  height: 48px;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.trust-item__icon svg {
  width: 48px;
  height: 48px;
}

.trust-item__number {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 400;
  line-height: 1;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.trust-item__title {
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: var(--space-sm);
  color: var(--section-b-text);
}

.trust-item__desc {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--section-b-muted);
}

.trust-item__desc strong {
  color: var(--section-b-text);
  font-weight: 600;
}

/* SVG stroke-draw icons */
.draw-path {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
}

.trust-item.show .draw-path {
  animation: drawStroke 0.8s var(--ease-out) forwards;
}

.trust-item.show .draw-path:nth-child(2) {
  animation-delay: 0.15s;
}

.trust-item.show .draw-path:nth-child(3) {
  animation-delay: 0.3s;
}

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

/* ============================================================
   BLOCK 5 — FORM
   ============================================================ */
.form-section {
  padding-top: var(--section-pad-y);
  padding-bottom: var(--section-pad-y);
}

.form-card {
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: var(--space-lg);
  max-width: 720px;
  margin: 0 auto;
}

.form-card__header {
  margin-bottom: var(--space-xl);
}

.form-card .section-title {
  margin-bottom: var(--space-md);
}

.form-card__text {
  color: var(--surface-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
  margin-bottom: var(--space-md);
}

/* Online indicator */
.online-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-green);
}

.online-indicator__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: pulseDot 1.5s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(36, 161, 72, 0.5);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 0 6px rgba(36, 161, 72, 0);
  }
}

/* Form fields */
.quote-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.form-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--surface-muted);
  text-transform: uppercase;
}

.form-field input,
.form-field textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--surface-border);
  padding: 0.75rem 0;
  color: var(--surface-text);
  font-size: 1rem;
  transition: border-color var(--duration-base) ease;
  width: 100%;
  resize: vertical;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--surface-placeholder);
}

/* Animated underline on focus via pseudo-element */
.form-field::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-base) var(--ease-out);
  pointer-events: none;
}

.form-field:focus-within::after {
  transform: scaleX(1);
}

.form-field:focus-within input,
.form-field:focus-within textarea {
  border-bottom-color: transparent;
}

/* File upload */
.file-upload {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px dashed var(--surface-border);
  cursor: pointer;
  transition: border-color var(--duration-base) ease;
  position: relative;
}

.file-upload:hover {
  border-color: var(--accent);
}

.file-upload__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.file-upload__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.file-upload__icon img {
  width: 20px;
  height: 20px;
  filter: var(--filter-muted);
}

.file-upload__icon.has-file img {
  filter: var(--filter-green);
}

.file-upload__icon.bounce {
  animation: fileBounce 0.3s var(--ease-out);
}

@keyframes fileBounce {
  0%   { transform: scale(0.8); }
  50%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.file-upload__text {
  font-size: 0.875rem;
  color: var(--surface-muted);
}

.file-upload__name {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent-green);
  opacity: 0;
  transition: opacity var(--duration-base) ease;
  flex: 1 1 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-upload__name.show {
  opacity: 1;
}

.form-field--file::after {
  display: none;
}

/* ============================================================
   BLOCK 6 — FOOTER
   ============================================================ */
.footer {
  padding-top: var(--section-pad-y);
  padding-bottom: var(--space-lg);
  border-top: 1px solid var(--footer-border);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer__company {
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: var(--space-xs);
  color: var(--footer-text);
}

.footer__slogan {
  font-size: 0.9375rem;
  color: var(--footer-muted);
}

.footer__contacts {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--footer-muted);
  text-align: left;
  padding: 0;
  background: none;
  border: none;
  position: relative;
  transition: color var(--duration-fast) ease;
}

.footer__row--copy {
  cursor: pointer;
}

.footer__row--copy:hover {
  color: var(--accent);
}

.footer__row--copy:hover .footer__icon {
  filter: var(--filter-accent);
}

.footer__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 0.1rem;
  filter: var(--filter-footer);
  transition: filter var(--duration-fast) ease;
}

.footer__hours-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--footer-muted);
  white-space: nowrap;
}

.copy-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 0.35rem);
  transform: none;
  background: var(--accent);
  color: var(--text-on-dark);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  padding: 0.25rem 0.5rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

@media (min-width: 480px) {
  .copy-tooltip {
    left: calc(100% + 0.5rem);
    top: 50%;
    transform: translateY(-50%);
  }
}

.copy-tooltip.show {
  opacity: 1;
}

.footer__bottom {
  border-top: 1px solid var(--footer-border);
  padding-top: var(--space-md);
  font-size: 0.75rem;
  color: var(--footer-faint);
  font-family: var(--font-mono);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.footer__legal-link {
  color: var(--footer-muted);
  transition: color var(--duration-fast) ease;
  border-bottom: 1px solid transparent;
}

.footer__legal-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Consent checkbox */
.form-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--surface-muted);
}

.form-consent span {
  min-width: 0;
}

.form-consent input[type="checkbox"] {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.form-consent a {
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-fast) ease;
}

.form-consent a:hover {
  border-bottom-color: var(--accent);
}

/* Privacy policy page */
.legal-page {
  padding-top: calc(var(--nav-height) + var(--section-pad-y));
  padding-bottom: var(--section-pad-y);
  background: var(--section-a-bg);
  color: var(--section-a-text);
  min-height: 100vh;
}

.legal-page__inner {
  max-width: 48rem;
}

.legal-page__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.legal-page h1 {
  font-weight: 300;
  font-size: 1.75rem;
  line-height: 1.25;
  margin-bottom: var(--space-md);
  color: var(--section-a-title);
}

.legal-page__meta {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--section-a-muted);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--section-a-border);
}

.legal-page h2 {
  font-weight: 600;
  font-size: 1.125rem;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  color: var(--section-a-title);
}

.legal-page h3 {
  font-weight: 600;
  font-size: 1rem;
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
  color: var(--section-a-title);
}

.legal-page p,
.legal-page li {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--section-a-muted);
  margin-bottom: var(--space-sm);
}

.legal-page ul,
.legal-page ol {
  padding-left: 1.25rem;
  margin-bottom: var(--space-md);
}

.legal-page ul {
  list-style: disc;
}

.legal-page ol {
  list-style: decimal;
}

.legal-page a {
  color: var(--accent);
}

.legal-page__back {
  display: inline-flex;
  margin-top: var(--space-xl);
}

.form-card .section-title--light {
  color: var(--surface-text);
}

.form-section .section-title--light {
  color: var(--section-a-title);
}

/* Light theme: lift form card off the section background */
[data-theme="light"] .form-section {
  background: var(--section-b-bg);
}

[data-theme="light"] .form-card {
  background: #ffffff;
  border-color: var(--section-b-border);
}

[data-theme="light"] .production__visual {
  background: var(--section-b-bg);
}

[data-theme="dark"] .form-section {
  background: var(--section-a-bg);
}

[data-theme="dark"] .form-card {
  background: var(--surface-bg);
  border-color: var(--surface-border);
}

/* Constructivist section accents */
.directions,
.trust {
  position: relative;
}

.directions::before,
.trust::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 6px;
  background: var(--accent);
}

.directions .section-title::after,
.trust .section-title::after {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 0.75rem;
  vertical-align: middle;
  background: var(--accent);
  transform: translateY(-0.15em);
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   Mobile-first: base = < 480px
   ============================================================ */

/* --- Mobile overflow guards --- */
@media (max-width: 479px) {
  .btn {
    white-space: normal;
    text-align: center;
  }

  .hero__cta,
  .btn--submit {
    width: 100%;
  }

  .hero__title,
  .section-title {
    overflow-wrap: anywhere;
  }

  .footer__row span:not(.copy-tooltip) {
    min-width: 0;
  }
}

/* --- 480px --- */
@media (min-width: 480px) {
  .hero__title {
    font-size: 2rem;
  }

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

  .section-title {
    font-size: 2rem;
  }

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

/* --- 768px (tablet) --- */
@media (min-width: 768px) {
  :root {
    --section-pad-y: 5rem;
  }

  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .hero__title {
    font-size: 2.5rem;
  }

  .hero__sub {
    font-size: 1.0625rem;
  }

  .section-title {
    font-size: 2.25rem;
  }

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

  .production__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
  }

  .trust__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl) var(--space-2xl);
  }

  .form-card {
    padding: var(--space-2xl);
  }

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

/* --- 1024px (desktop) --- */
@media (min-width: 1024px) {
  :root {
    --section-pad-y: 6rem;
  }

  .container {
    padding-left: 3rem;
    padding-right: 3rem;
  }

  .hero__title {
    font-size: 3rem;
    max-width: 16em;
  }

  .hero__triggers {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm) var(--space-lg);
  }

  .directions__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* 5th card spans remaining space elegantly */
  .directions__grid .dir-card:nth-child(4),
  .directions__grid .dir-card:nth-child(5) {
    /* stay in 3-col flow: cards 4 and 5 land on row 2 */
  }

  .section-title {
    font-size: 2.5rem;
  }

  .trust-item__number {
    font-size: 3.5rem;
  }
}

/* --- 1440px (wide) --- */
@media (min-width: 1440px) {
  :root {
    --section-pad-y: 6rem;
  }

  .container {
    padding-left: 4rem;
    padding-right: 4rem;
  }

  .hero__title {
    font-size: 3.25rem;
  }

  .hero__sub {
    font-size: 1.125rem;
    max-width: 48rem;
  }
}

/* ============================================================
   prefers-reduced-motion
   ============================================================ */
@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;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .reveal--wipe {
    clip-path: none;
  }

  .hero__title .word {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .trace-path,
  .draw-path {
    stroke-dashoffset: 0;
    animation: none;
  }

  .online-indicator__dot {
    animation: none;
  }

  .scroll-progress {
    transition: none;
  }
}
