/* ==========================================================================
   Gridly — Landing Page Styles
   ========================================================================== */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
  position: relative;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---- Design Tokens ---- */
:root {
  color-scheme: dark;

  /* Dark theme (default) */
  --bg: #08090d;
  --bg-elevated: #0f1117;
  --bg-elevated-2: #14161f;
  --surface: #12141c;
  --surface-hover: #191c27;
  --border: #23262f;
  --border-soft: #1b1d26;

  --text: #f2f3f7;
  --text-dim: #a7abbd;
  --text-faint: #6b6f83;

  --accent: #6366f1;
  --accent-2: #22d3ee;
  --accent-soft: rgba(99, 102, 241, 0.14);
  --accent-2-soft: rgba(34, 211, 238, 0.12);

  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #22d3ee 100%);
  --gradient-text: linear-gradient(90deg, #a5b4fc 0%, #67e8f9 100%);

  --success: #34d399;
  --danger: #f87171;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.24);
  --shadow-md: 0 8px 30px rgba(0,0,0,0.35);
  --shadow-glow: 0 0 0 1px rgba(99,102,241,0.15), 0 20px 60px rgba(99,102,241,0.18);

  --container-w: 1180px;
  --header-h: 76px;
  --banner-h: 40px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* Glassmorphism */
  --glass-bg: rgba(18, 20, 28, 0.55);
  --glass-bg-strong: rgba(20, 22, 31, 0.72);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-highlight: rgba(255, 255, 255, 0.06);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8fb;
  --bg-elevated: #ffffff;
  --bg-elevated-2: #eef0f6;
  --surface: #ffffff;
  --surface-hover: #f2f3f8;
  --border: #e4e6ee;
  --border-soft: #ececf2;

  --text: #14161f;
  --text-dim: #565a6e;
  --text-faint: #8b8fa3;

  --accent-soft: rgba(99, 102, 241, 0.10);
  --accent-2-soft: rgba(6, 182, 212, 0.10);

  --shadow-sm: 0 2px 8px rgba(20,22,31,0.06);
  --shadow-md: 0 8px 30px rgba(20,22,31,0.08);
  --shadow-glow: 0 0 0 1px rgba(99,102,241,0.12), 0 20px 60px rgba(99,102,241,0.14);

  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(20, 22, 31, 0.07);
  --glass-highlight: rgba(255, 255, 255, 0.5);
}

body {
  font-family: 'Inter', 'Noto Sans Georgian', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Noto Sans Georgian', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

/* Prevent long words (URLs, unbroken Georgian compounds) from overflowing
   their container on narrow viewports. */
h1, h2, h3, h4, p, span, a, li,
.btn, .nav-link, .section-tag, .eyebrow, .portfolio-tag {
  overflow-wrap: break-word;
  word-break: break-word;
}

.container {
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: 24px;
}

.text-gradient {
  background: linear-gradient(90deg, #a5b4fc, #67e8f9, #c4b5fd, #a5b4fc);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientMove 6s linear infinite;
}
@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* ---- Glassmorphism ---- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-sm);
}

/* ---- Animated gradient border ---- */
.animated-border {
  position: relative;
  isolation: isolate;
}
.animated-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--border-angle, 0deg), var(--accent), var(--accent-2), #8b5cf6, var(--accent));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: borderSpin 5s linear infinite;
}
@property --border-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@keyframes borderSpin {
  to { --border-angle: 360deg; }
}

/* ---- Tilt + glow interactive elements ---- */
.tilt-glow {
  position: relative;
  transform-style: preserve-3d;
  overflow: hidden;
}
.tilt-glow::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle 140px at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.22), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.tilt-glow:hover::after { opacity: 1; }
.portfolio-card.tilt-glow::after {
  background: radial-gradient(circle 220px at var(--mx, 50%) var(--my, 50%), rgba(99,102,241,0.25), transparent 70%);
}

/* ---- Background FX ---- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 20%, transparent 75%);
  opacity: 0.6;
}

.bg-glow {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
}
.bg-glow-1 {
  width: 600px; height: 600px;
  top: -200px; left: -150px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
}
.bg-glow-2 {
  width: 500px; height: 500px;
  top: 300px; right: -180px;
  background: radial-gradient(circle, var(--accent-2-soft), transparent 70%);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99,102,241,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(99,102,241,0.45); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--accent); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.btn-sm { padding: 9px 18px; font-size: 0.85rem; }
.btn-lg { padding: 15px 30px; font-size: 1rem; }
.btn-block { width: 100%; white-space: normal; text-align: center; }

/* Header CTA reserves enough room for both the Georgian and English label
   so the header never resizes when the language is toggled. */
.header-actions .btn-sm.btn-primary {
  min-width: 168px;
}

/* ---- Test-mode banner ---- */
.test-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 110;
  min-height: var(--banner-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-block: 8px;
  padding-inline: 16px;
  background: linear-gradient(90deg, #f59e0b, #f97316);
  color: #1a1206;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}
.test-banner svg { flex-shrink: 0; }
.test-banner span {
  white-space: normal;
}

/* ---- Header ---- */
.site-header {
  position: fixed;
  top: var(--banner-h); left: 0; right: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.site-header.scrolled {
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom-color: var(--glass-border);
  box-shadow: inset 0 -1px 0 var(--glass-highlight), var(--shadow-sm);
}
/* Safari/iOS breaks a child's backdrop-filter when an ancestor also has
   one active at the same time — the nested blur silently renders as
   plain transparent. While the mobile dropdown (which has its own
   backdrop-filter) is open, drop the header's blur so the two never
   nest; the solid --glass-bg-strong keeps the header bar itself opaque. */
.site-header.scrolled.nav-open {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--glass-bg-strong);
}

/* Full-width, edge-to-edge header — logo pinned far left, actions pinned far
   right via horizontal padding instead of the centered .container max-width. */
.header-inner {
  width: 100%;
  max-width: 100%;
  margin: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 4%;
}

@media (min-width: 1600px) {
  /* Cap the padding growth on ultra-wide screens so the logo/actions don't
     drift too far from the content edge below. */
  .header-inner { padding: 0 64px; }
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
}
.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--gradient);
  color: #fff;
  font-size: 1.05rem;
  box-shadow: 0 4px 14px rgba(99,102,241,0.4);
}

/* Nav sits in the flexible middle zone; individual links never wrap or shrink,
   so the header's overall shape stays put when GE/EN text lengths differ. */
.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}
.nav-link {
  padding: 9px 16px;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--text); background: var(--surface-hover); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Mobile-drawer-only controls (hidden on desktop; shown centered inside the nav dropdown) */
.nav-tools { display: none; }

/* ---- Language switcher ---- */
.lang-switch {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 60px;
  padding: 3px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
}
.lang-btn {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 28px;
  border: none;
  background: transparent;
  padding: 6px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border-radius: var(--radius-full);
  color: var(--text-faint);
  transition: color 0.3s var(--ease);
}
.lang-btn[aria-pressed="true"] { color: #fff; }
[data-theme="light"] .lang-btn[aria-pressed="true"] { color: #fff; }
.lang-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  border-radius: var(--radius-full);
  background: var(--gradient);
  transition: transform 0.3s var(--ease);
  z-index: 0;
}
.lang-switch[data-active="en"] .lang-thumb { transform: translateX(100%); }

.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s, transform 0.3s var(--ease);
}
.theme-toggle:hover { border-color: var(--accent); transform: rotate(15deg); }
.icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  align-items: center;
}
.menu-toggle span {
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Reveal animation ---- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
[data-reveal].in-view { opacity: 1; transform: translateY(0); }

/* ---- Hero ---- */
.hero {
  padding: calc(var(--header-h) + var(--banner-h) + 72px) 0 100px;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 22px;
}
.eyebrow .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent-2);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 520px;
  margin-bottom: 34px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 48px; }
.hero-actions .btn svg { transition: transform 0.2s var(--ease); }
.hero-actions .btn:hover svg { transform: translateX(3px); }

.hero-stats { display: flex; gap: 36px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.stat strong { font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.82rem; color: var(--text-faint); }

/* Hero visual mock browser */
.hero-visual { position: relative; }
.mock-window {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow);
  overflow: hidden;
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.mock-topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--bg-elevated-2);
  border-bottom: 1px solid var(--border);
}
.mock-dot { width: 9px; height: 9px; border-radius: 50%; }
.mock-dot.red { background: #f87171; }
.mock-dot.yellow { background: #fbbf24; }
.mock-dot.green { background: #34d399; }
.mock-url {
  margin-left: 12px;
  font-size: 0.72rem;
  color: var(--text-faint);
  background: var(--surface);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  flex: 1;
}

.mock-body { padding: 22px; display: flex; flex-direction: column; gap: 22px; }

.mock-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-soft);
}
.mock-logo { width: 24px; height: 24px; border-radius: 6px; background: var(--gradient); }
.mock-line { height: 8px; border-radius: 4px; background: var(--border); }
.mock-line.short { width: 44px; }
.mock-line.w60 { width: 60%; height: 16px; margin-bottom: 10px; }
.mock-line.w40 { width: 40%; }
.mock-line.w70 { width: 70%; }
.mock-line.w50 { width: 50%; }
.mock-cta { margin-left: auto; width: 64px; height: 22px; border-radius: var(--radius-full); background: var(--gradient); }

.mock-hero { display: flex; flex-direction: column; gap: 12px; }
.mock-bar-row { display: flex; gap: 10px; margin-top: 8px; }
.mock-btn { width: 84px; height: 26px; border-radius: var(--radius-full); background: var(--gradient); }
.mock-btn.outline { background: transparent; border: 1px solid var(--border); }

.mock-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mock-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mock-card-icon {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--accent-soft);
  margin-bottom: 4px;
}

.floating-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.floating-chip svg { color: var(--success); flex-shrink: 0; }
.chip-1 { top: -18px; right: -10px; animation: float 6s ease-in-out infinite; animation-delay: 0.5s; }
.chip-2 { bottom: -16px; left: -18px; animation: float 7s ease-in-out infinite; animation-delay: 1s; }

/* ---- Section common ---- */
.section-head {
  max-width: 620px;
  margin: 0 auto 56px;
  text-align: center;
}
.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin-bottom: 14px; }
.section-head p { color: var(--text-dim); font-size: 1.05rem; }

section { padding: 100px 0; }

/* ---- Problem vs Solution ---- */
.ps-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 28px;
  align-items: center;
}
.ps-card {
  padding: 36px;
  border-radius: var(--radius-lg);
}
.ps-problem { border-color: rgba(248,113,113,0.3); }
.ps-solution { border-color: rgba(52,211,153,0.3); background-image: linear-gradient(180deg, var(--accent-soft), transparent 60%); }

.ps-icon {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  background: rgba(248,113,113,0.12);
  color: var(--danger);
  margin-bottom: 20px;
}
.solution-icon { background: rgba(52,211,153,0.14); color: var(--success); }

.ps-card h3 { font-size: 1.4rem; margin-bottom: 18px; }
.ps-list { display: flex; flex-direction: column; gap: 13px; }
.ps-list li {
  position: relative;
  padding-left: 22px;
  color: var(--text-dim);
  font-size: 0.96rem;
}
.ps-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.ps-problem li::before { background: var(--danger); }
.ps-solution li::before { background: var(--success); }

.ps-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  width: 52px; height: 52px;
  border-radius: 50%;
}

/* ---- Services ---- */
.services { background: var(--bg-elevated); border-block: 1px solid var(--border-soft); }
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.service-card {
  padding: 30px;
  border-radius: var(--radius-md);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.service-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.service-icon {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 18px;
}
.service-card h3 { font-size: 1.12rem; margin-bottom: 10px; }
.service-card p { color: var(--text-dim); font-size: 0.92rem; }

/* ---- Price Estimator ----
   Tokens map to the site's theme variables (see :root / [data-theme="light"])
   so this section flips with the light/dark toggle instead of staying dark. */
.estimator {
  --est-card-bg: var(--bg-elevated);
  --est-pill-bg: var(--bg-elevated-2);
  --est-pill-border: var(--border);
  --est-text: var(--text);
  --est-text-dim: var(--text-dim);
  --est-accent: var(--accent);
  --est-accent-2: var(--accent-2);
}

.estimator-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 28px;
  align-items: start;
}

/* ---- Option panel: two clean horizontal rows of grouped pill-toggles ---- */
.estimator-options {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.est-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.est-group {
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: var(--est-card-bg);
  border: 1px solid var(--est-pill-border);
}
.est-group h3 {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--est-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.est-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Pill-shaped toggle card. white-space: nowrap keeps each label intact —
   a pill wraps to the next line as a whole unit instead of breaking mid-word. */
.est-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px 9px 30px;
  border-radius: var(--radius-full);
  border: 1px solid var(--est-pill-border);
  background: var(--est-pill-bg);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.est-pill::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  transform: translateY(-50%) scale(0.85);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.est-pill:hover { border-color: var(--est-accent); transform: translateY(-1px); }
.est-pill:has(input:checked) {
  border-color: var(--est-accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.4), 0 0 20px rgba(99, 102, 241, 0.22);
}
.est-pill:has(input:checked)::before {
  background: var(--est-accent-2);
  transform: translateY(-50%) scale(1);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.85);
}
.est-pill:has(input:focus-visible) { outline: 2px solid var(--est-accent); outline-offset: 2px; }
.est-pill--locked,
.est-pill:has(input:disabled) { cursor: default; }
.est-pill:has(input:disabled):hover { transform: none; }

.est-pill input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.est-pill-text { font-size: 0.86rem; font-weight: 600; color: var(--est-text); white-space: nowrap; }

.est-pill-price {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  color: var(--est-accent-2);
  background: var(--accent-2-soft);
}
.est-pill-price--free { color: var(--success); background: rgba(52, 211, 153, 0.14); }

/* ---- Summary: sticky "receipt" card ---- */
.estimator-summary {
  position: sticky;
  top: calc(var(--header-h) + var(--banner-h) + 20px);
  padding: 32px 28px;
  border-radius: var(--radius-lg);
  background: var(--est-card-bg);
  border: 1px solid var(--est-pill-border);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.est-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--est-text-dim);
}

.est-currency-switch {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 76px;
  padding: 3px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--est-pill-border);
}
.est-currency-btn {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  border: none;
  background: transparent;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--est-text-dim);
  border-radius: var(--radius-full);
  transition: color 0.3s var(--ease);
}
.est-currency-btn[aria-pressed="true"] { color: #fff; }
.est-currency-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--est-accent), var(--est-accent-2));
  transition: transform 0.3s var(--ease);
  z-index: 0;
}
.est-currency-switch[data-active="USD"] .est-currency-thumb { transform: translateX(100%); }

.est-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--est-text);
}
.est-total-currency { font-size: 1.1rem; font-weight: 600; color: var(--est-text-dim); }

.est-timeframe {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--est-text-dim);
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--est-pill-border);
}
.est-timeframe svg { color: var(--est-accent-2); flex-shrink: 0; }
.est-timeframe strong { color: var(--est-text); }

/* Receipt-style line items */
.est-receipt {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.est-receipt li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  font-size: 0.84rem;
  color: var(--est-text-dim);
  border-bottom: 1px dashed var(--border-soft);
}
.est-receipt li:last-child { border-bottom: none; }
.est-receipt .est-receipt-label { color: var(--est-text); }
.est-receipt .est-receipt-price { flex-shrink: 0; font-weight: 700; color: var(--est-accent-2); white-space: nowrap; }

.est-disclaimer { font-size: 0.76rem; color: var(--est-text-dim); text-align: center; }

/* ---- Portfolio ---- */
.portfolio { background: var(--bg-elevated); border-block: 1px solid var(--border-soft); }
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.portfolio-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.portfolio-card:hover { transform: translateY(-8px) scale(1.015); box-shadow: var(--shadow-glow); border-color: var(--accent); }
.portfolio-card.tilt-glow { transition: transform 0.15s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease); }

.portfolio-preview {
  height: 190px;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  background-size: cover;
}
.preview-salon { background: linear-gradient(135deg, #f5c2d0 0%, #d68fa3 50%, #6b3a4d 100%); }
.preview-restaurant { background: linear-gradient(135deg, #f6d78c 0%, #d99a4e 50%, #7a4319 100%); }
.preview-auto { background: linear-gradient(135deg, #93c5fd 0%, #3b82f6 50%, #1e3a8a 100%); }

.portfolio-tag {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
}

.portfolio-info { padding: 22px; }
.portfolio-info h3 { font-size: 1.1rem; margin-bottom: 8px; }
.portfolio-info p { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 18px; }

/* ---- FAQ ---- */
.faq-list {
  max-width: 760px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.faq-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.3s var(--ease);
}
.faq-item:has(.faq-question[aria-expanded="true"]) { border-color: var(--accent); }

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.faq-icon {
  flex-shrink: 0;
  color: var(--accent);
  transition: transform 0.35s var(--ease);
}
.faq-question[aria-expanded="true"] .faq-icon { transform: rotate(135deg); }

.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease);
}
.faq-answer > p {
  overflow: hidden;
  min-height: 0;
  padding: 0 24px;
  color: var(--text-dim);
  font-size: 0.94rem;
  line-height: 1.65;
}
.faq-question[aria-expanded="true"] + .faq-answer {
  grid-template-rows: 1fr;
}
.faq-question[aria-expanded="true"] + .faq-answer > p {
  padding-bottom: 22px;
}

/* ---- Contact ---- */
.contact-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: start;
}
.contact-copy h2 { font-size: clamp(1.9rem, 3.4vw, 2.5rem); margin: 12px 0 16px; }
.contact-copy p { color: var(--text-dim); font-size: 1.02rem; margin-bottom: 26px; }
.contact-points { display: flex; flex-direction: column; gap: 14px; }
.contact-points li { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; color: var(--text-dim); }
.contact-points svg { color: var(--success); flex-shrink: 0; }

.contact-form {
  border-radius: var(--radius-lg);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-row { display: flex; flex-direction: column; gap: 8px; position: relative; }
.form-row label { font-size: 0.88rem; font-weight: 600; color: var(--text-dim); }
.form-row .optional { font-weight: 400; color: var(--text-faint); }

.form-row input,
.form-row select,
.form-row textarea {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--text-faint); }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-row.invalid input, .form-row.invalid select { border-color: var(--danger); }
.field-error { font-size: 0.78rem; color: var(--danger); min-height: 1px; display: none; }
.form-row.invalid .field-error { display: block; }

.form-success {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(52,211,153,0.12);
  color: var(--success);
  font-size: 0.9rem;
  font-weight: 600;
}
.form-success svg { flex-shrink: 0; }
.form-success.show { display: flex; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border-soft);
  padding-top: 64px;
  background: var(--bg-elevated);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
}
.footer-brand p { color: var(--text-faint); margin-top: 12px; font-size: 0.9rem; max-width: 260px; }
.footer-links, .footer-contact { display: flex; flex-direction: column; gap: 12px; }
.footer-links h4, .footer-contact h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-faint); margin-bottom: 6px; }
.footer-links a, .footer-contact a { color: var(--text-dim); font-size: 0.92rem; transition: color 0.2s; }
.footer-links a:hover, .footer-contact a:hover { color: var(--accent); }

.social-links { display: flex; gap: 10px; margin-top: 8px; }
.social-links a {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: border-color 0.2s, color 0.2s;
}
.social-links a:hover { border-color: var(--accent); color: var(--accent); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 22px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-faint);
  font-size: 0.84rem;
}

/* ---- Back to top ---- */
.back-to-top {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  border: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(99,102,241,0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  z-index: 90;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-3px); }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translate(-50%, 20px);
  padding: 14px 22px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  z-index: 200;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ==========================================================================
   Responsive
   Breakpoints: >1024px desktop · 768–1024px tablet · <768px mobile
   ========================================================================== */

/* ---------------------------------------------------------------------
   Tablet (max-width: 1024px)
   --------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .container { padding-inline: 20px; }

  /* ---- Header: switch to the hamburger menu at tablet width too, so
     nav links + actions never collide with the header's edge-to-edge
     padding on narrower desktops/tablets. ---- */
  .header-inner { padding: 0 24px; }
  .menu-toggle { display: flex; width: 44px; height: 44px; }
  .header-actions .lang-switch,
  .header-actions .theme-toggle { display: none; }
  .header-actions .btn-sm.btn-primary { display: none; }
  .header-actions { gap: 8px; }

  /* The panel stays mounted (position: absolute, full styling, backdrop-filter
     and all) at all times instead of display:none/flex-toggling — it's just
     invisible and non-interactive via opacity/visibility until nav-open. This
     keeps its GPU compositing layer warm, because toggling display forces
     Safari to build that layer from scratch each time the menu opens, which
     is what caused the backdrop-filter to visibly "kick in" a beat late.
     transform: translateZ(0) reinforces that own layer so scrolling with the
     menu open doesn't drop the blur either. Keep position: absolute here:
     making it position: fixed instead just trades that bug for a worse one,
     since the header's own backdrop-filter (added by .scrolled once you
     scroll) turns it into a *new* containing block for fixed descendants,
     which would silently re-anchor this panel to the header box instead of
     the viewport. */
  .main-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(100vh - var(--header-h) - var(--banner-h));
    overflow-y: auto;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    padding: 16px 20px 24px;
    gap: 4px;
    text-align: center;
    z-index: 9999;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s var(--ease), visibility 0.2s var(--ease);
  }
  .site-header.nav-open .main-nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .site-header.nav-open .nav-link {
    width: 100%;
    max-width: 320px;
    padding: 14px 16px;
    font-size: 1rem;
  }

  /* Mobile-drawer-only controls: centered under the nav links */
  .nav-tools {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 320px;
    margin-top: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border-soft);
  }
  .nav-tools .lang-switch { align-self: center; }
  .nav-tools .theme-toggle { width: 48px; height: 48px; }
  .nav-tools .btn { width: 100%; min-height: 48px; }

  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .hero-visual { order: -1; max-width: 480px; margin-inline: auto; width: 100%; }

  /* Balanced 2-column grid for the 6-item services grid */
  .services-grid { grid-template-columns: repeat(2, 1fr); }

  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .portfolio-grid .portfolio-card:nth-child(3) { grid-column: 1 / -1; }
  .portfolio-grid .portfolio-card:nth-child(3) .portfolio-preview { height: 220px; }

  .estimator-grid { grid-template-columns: 1fr; gap: 24px; }
  .estimator-summary { position: static; }

  .ps-grid { grid-template-columns: 1fr; gap: 20px; }
  .ps-arrow { transform: rotate(90deg); margin-inline: auto; }

  .contact-inner { grid-template-columns: 1fr; gap: 44px; }
  .contact-form { max-width: 560px; margin-inline: auto; width: 100%; }

  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------------
   Mobile (max-width: 767px)
   --------------------------------------------------------------------- */
@media (max-width: 767px) {
  .container { padding-inline: 18px; max-width: 100%; }

  /* Banner text now wraps to two lines on narrow screens instead of being
     ellipsis-truncated, so --banner-h has to grow to match — everything
     else (header position, hero padding) reads from this same variable. */
  :root { --banner-h: 52px; }
  .test-banner { font-size: 0.72rem; padding-inline: 12px; gap: 6px; }
  .test-banner svg { width: 14px; height: 14px; }

  /* ---- Containment: nothing may exceed the viewport width ---- */
  .hero-inner,
  .hero-copy,
  .hero-visual,
  .ps-card,
  .service-card,
  .portfolio-card,
  .contact-form,
  .faq-item,
  .mock-window,
  .estimator-options,
  .estimator-summary {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  /* Grid items default to min-width: auto, which lets their content's
     min-content width push them wider than their 1fr track — the extra
     width then gets clipped by the page's overflow-x: hidden instead of
     shrinking, which is what pushed the price list off-screen. */
  .estimator-grid,
  .estimator-options,
  .estimator-summary,
  .est-row,
  .est-group {
    min-width: 0;
  }

  /* ---- Section rhythm: tighter, consistent vertical spacing ---- */
  section { padding: 64px 0; }
  .section-head { margin-bottom: 40px; }
  .section-head h2 { font-size: clamp(1.6rem, 7vw, 2.1rem); }

  .header-inner { padding: 0 18px; }

  /* ---- Hero: centered content, stacked & centered CTAs ---- */
  .hero { padding: calc(var(--header-h) + var(--banner-h) + 40px) 0 64px; }
  .hero-copy { text-align: center; display: flex; flex-direction: column; align-items: center; }
  .hero-title { font-size: max(1.8rem, 5vw); }
  .hero-sub { max-width: 440px; }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 320px;
    margin-inline: auto;
    gap: 12px;
    margin-bottom: 36px;
  }
  .hero-actions .btn { width: 100%; min-height: 48px; }
  .hero-stats {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    gap: 18px;
  }
  .stat { align-items: center; }

  .hero-visual { max-width: 100%; padding-inline: 8px; }
  .floating-chip { font-size: 0.72rem; padding: 8px 12px; }
  .chip-1 { top: -10px; right: 0; }
  .chip-2 { bottom: -10px; left: 0; }

  /* ---- Problem vs Solution ---- */
  .ps-grid { grid-template-columns: 1fr; gap: 16px; }
  .ps-card { padding: 22px 20px; text-align: center; }
  .ps-icon { margin-inline: auto; }
  .ps-list { text-align: left; }

  /* ---- Services: single column ---- */
  .services-grid { grid-template-columns: 1fr; gap: 16px; }
  .service-card { padding: 24px 20px; text-align: center; }
  .service-icon { margin-inline: auto; }

  /* ---- Portfolio: single column ---- */
  .portfolio-grid { grid-template-columns: 1fr; gap: 20px; }
  .portfolio-grid .portfolio-card:nth-child(3) { grid-column: auto; }
  .portfolio-info { padding: 20px; text-align: center; }
  .portfolio-info .btn { min-height: 48px; }

  /* ---- FAQ ---- */
  .faq-question { padding: 18px 44px 18px 20px; text-align: center; justify-content: center; position: relative; }
  .faq-icon { position: absolute; top: 50%; right: 20px; transform: translateY(-50%); }
  .faq-question[aria-expanded="true"] .faq-icon { transform: translateY(-50%) rotate(135deg); }
  .faq-answer > p { padding-inline: 20px; text-align: center; }

  /* ---- Contact: centered copy, full-width form ---- */
  .contact-copy { text-align: center; }
  /* A fixed, capped width (not shrink-to-fit) so every row shares the exact
     same box: ticks land on one vertical line, wrapped text never forces
     the list wider than the viewport, and the whole block still centers
     under the heading via the auto side margins. */
  .contact-points { align-items: stretch; width: 100%; max-width: 320px; margin-inline: auto; }
  .contact-points li { justify-content: flex-start; text-align: left; }
  .contact-form { padding: 24px 20px; }
  .form-row input,
  .form-row select,
  .form-row textarea {
    min-height: 48px;
    font-size: 16px; /* prevents iOS Safari auto-zoom on focus */
  }
  .contact-form .btn { min-height: 48px; }

  /* ---- Estimator: single column groups, full-width controls ---- */
  .est-row { grid-template-columns: 1fr; gap: 16px; }
  .est-group { padding: 20px 18px; }
  .estimator-summary { padding: 24px 20px; }
  .est-total { font-size: 2.1rem; }
  #est-send-btn, #est-pdf-btn { min-height: 48px; }

  /* Pills no longer force a single line here — a long label + price tag can
     be wider than the phone screen itself, which pushed the whole page into
     horizontal scroll. Let the label wrap onto a second line instead. */
  .est-pill {
    max-width: 100%;
    white-space: normal;
    padding: 9px 14px 9px 28px;
  }
  .est-pill-text { white-space: normal; overflow-wrap: break-word; min-width: 0; }

  /* ---- Footer: centered ---- */
  .footer-inner { grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .footer-brand { display: flex; flex-direction: column; align-items: center; }
  .footer-brand p { max-width: 280px; }
  .logo { justify-content: center; }
  .footer-links, .footer-contact { align-items: center; }
  .social-links { justify-content: center; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

  .back-to-top { bottom: 20px; right: 20px; width: 46px; height: 46px; }
}

/* ---------------------------------------------------------------------
   Small phones (max-width: 400px)
   --------------------------------------------------------------------- */
@media (max-width: 400px) {
  .mock-cards { grid-template-columns: 1fr 1fr; }
  .mock-cards .mock-card:last-child { display: none; }
  .lang-btn { padding: 6px 9px; font-size: 0.7rem; }
  .toast {
    left: 18px;
    right: 18px;
    width: auto;
    border-radius: var(--radius-md);
    text-align: center;
    transform: translateY(20px);
  }
  .toast.show { transform: translateY(0); }
}

/* ==========================================================================
   Strict Mobile Containment (safety net)
   Forces zero horizontal scroll on phones/tablets regardless of any
   individual component's own width math.
   ========================================================================== */
body {
  overflow-x: hidden !important;
  position: relative;
  width: 100%;
}

@media (max-width: 768px) {
  /* NOTE: intentionally 100% here, not 100vw — 100vw includes the vertical
     scrollbar's width in most browsers and is a common self-inflicted
     source of a few pixels of horizontal overflow. */
  html, body { max-width: 100%; overflow-x: hidden !important; }

  section, div, header, main, footer, article, nav, form,
  .container, .site-header, .header-inner, .hero, .hero-inner,
  .hero-copy, .hero-actions, .hero-stats {
    max-width: 100%;
    box-sizing: border-box !important;
  }

  /* Nothing should touch the raw screen edge */
  body > main > section > .container,
  .site-footer .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* ---- Hero re-order: text first, mockup second ---- */
  .hero-inner {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .hero-copy {
    order: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .hero-visual {
    order: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    margin: 0 auto !important;
    padding: 0 10px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
  }

  /* ---- Hard-scaled mockup: shrinks to fit with breathing room on every
     phone width instead of relying purely on internal clipping. ---- */
  .mock-window {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    transform: scale(0.9) !important;
    transform-origin: top center !important;
    animation: none !important;
    order: 2;
  }
  .mock-body,
  .mock-nav,
  .mock-cards {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  /* Flex children default to a min-width of "auto" (their own content size),
     which lets fixed-width placeholder bars refuse to shrink and silently
     overflow their row. Force them shrinkable so the mockup never has to
     grow wider than its box on narrow phones. */
  .mock-nav {
    flex-wrap: nowrap;
    gap: 8px;
  }
  .mock-nav > * {
    min-width: 0;
    flex-shrink: 1;
  }
  .mock-line.short { width: 28px; }
  .mock-cta { width: 44px; flex-shrink: 0; }
  .mock-cards { gap: 8px; }
  .mock-body { padding: 16px; gap: 16px; }

  /* ---- Badge pills (eyebrow + floating stat chips): pulled out of
     absolute positioning and forced to wrap/shrink instead of forcing
     the page wider than the viewport. ---- */
  .eyebrow,
  .floating-chip {
    position: static !important;
    transform: none !important;
    margin: 10px auto !important;
    width: fit-content !important;
    max-width: 90% !important;
    text-align: center !important;
  }
  /* A flex container's text children default to a no-wrap "max-content"
     width, which is what was pushing the long Georgian eyebrow/badge
     copy past the screen edge. min-width: 0 lets them wrap normally. */
  .eyebrow > *,
  .floating-chip > * {
    min-width: 0;
  }
  .eyebrow span:last-child,
  .floating-chip span:last-child {
    white-space: normal;
    overflow-wrap: break-word;
  }
  .floating-chip { order: 1; }
  .chip-2 { order: 3; }

  /* ---- Any wide/flex rows, tables, or code blocks ---- */
  table, pre, code, .mock-cards, .hero-stats {
    max-width: 100% !important;
    overflow-x: auto !important;
  }
}
