/* =========================================================
   DDLIT — Stable, Responsive, Beautiful CSS
   ---------------------------------------------------------
   Goals: no layout shift (CLS), clear grid, mobile polish,
   sticky header, consistent spacing & typography
   ========================================================= */

/* Base reset & media */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: #1f1f1f;
  background-color: #f9f6fb; /* mauve-50 */
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;          /* reserve height to reduce CLS */
}

/* Type helpers */
.font-display { font-family: 'Bebas Neue', Impact, 'Inter', sans-serif; letter-spacing: .5px; }
.font-body { font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }

/* Palette tokens */
:root{
  --white: #ffffff;
  --mauve-50:#f9f6fb;
  --mauve-200:#e3d8ee;
  --mauve-300:#ccb7de;
  --mauve-600:#8559b0;
  --mauve-700:#6f459a;
  --mauve-800:#59377c;
  --neutral-600:#525252;
  --neutral-900:#1a1a1a;

  --radius-xl: 1rem;
  --radius-2xl: 1rem;
  --radius-3xl: 1.5rem;

  --shadow-soft: 0 10px 30px rgba(17, 12, 34, 0.06);
  --ring: 1px solid #e5e5e5;

  --container: 1200px;
  --header-h: 70px; /* lock header height to prevent jump */
}

/* Utility colors */
.bg-white { background-color: var(--white); }
.bg-mauve-50 { background-color: var(--mauve-50); }
.bg-mauve-200 { background-color: var(--mauve-200); }
.bg-mauve-300 { background-color: var(--mauve-300); }
.bg-mauve-600 { background-color: var(--mauve-600); }
.bg-mauve-700 { background-color: var(--mauve-700); }
.bg-mauve-800 { background-color: var(--mauve-800); }

.text-white { color: var(--white); }
.text-neutral-600 { color: var(--neutral-600); }
.text-neutral-900 { color: var(--neutral-900); }
.text-mauve-700 { color: var(--mauve-700); }
.text-mauve-800 { color: var(--mauve-800); }

/* Shadows & blur */
.shadow-soft { box-shadow: var(--shadow-soft); }
.blur-bg { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* Radii */
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-3xl { border-radius: var(--radius-3xl); }

/* Layout container */
.container {
  width: 100%;
  max-width: var(--container);
  padding: 0 1.5rem;
  margin: 0 auto;
}

/* =========================================
   HEADER (sticky, stable, non-wrapping)
   ========================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: var(--ring);
  min-height: var(--header-h); /* reserve height */
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h); /* consistent height */
  padding: 0.75rem 0;
  gap: 1rem;
  flex-wrap: nowrap; /* prevent reflow/wrap */
}

/* Logo */
.logo { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.logo img {
  height: 40px;
  width: auto;
  display: block;
  max-width: none; /* stops unexpected shrink */
}
.brand-name { font-size: 1.5rem; color: var(--neutral-900); white-space: nowrap; }

/* Navigation */
.nav {
  display: flex; gap: 1.25rem; align-items: center;
  flex-wrap: nowrap; /* keep single line */
  white-space: nowrap;
}
.nav a {
  text-decoration: none; color: inherit; font-size: .95rem; line-height: 1;
  transition: color .15s ease;
}
.nav a:hover { color: var(--mauve-700); }

/* Primary CTA */
.cta,
.button.primary,
.button-outline,
.button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .6rem 1.1rem; border-radius: 1rem; text-decoration: none;
  font-size: .95rem; font-weight: 600; white-space: nowrap;
  transition: background .15s ease, color .15s ease, transform .12s ease, box-shadow .12s ease;
}
.cta,
.button.primary { background-color: var(--mauve-700); color: #fff; box-shadow: 0 8px 20px rgba(111,69,154,.25); }
.cta:hover,
.button.primary:hover { background-color: var(--mauve-800); transform: translateY(-1px); }

.button-outline {
  border: 1px solid #ccc; color: #1f1f1f; background: #fff;
}
.button-outline:hover { border-color: #b292cf; color: var(--mauve-800); }

/* =========================================
   HERO (stable two-column, smooth stack)
   ========================================= */
.hero {
  position: relative;
  padding: 4.5rem 0;
  background-color: var(--mauve-50);
  overflow: hidden; /* prevent decorative overflow scrollbars */
}

.hero-blur {
  position: absolute; border-radius: 50%;
  filter: blur(60px); opacity: .6; pointer-events: none; transform: translateZ(0);
}
.hero-blur.top-right { top: -6rem; right: -6rem; width: 18rem; height: 18rem; background-color: var(--mauve-200); }
.hero-blur.bottom-left { bottom: -6rem; left: -6rem; width: 18rem; height: 18rem; background-color: var(--mauve-300); }

.hero-content {
  display: grid;
  gap: 2rem;
  align-items: center;
  grid-template-columns: 1fr 1fr; /* stable on desktop */
}
@media (max-width: 900px) { .hero-content { grid-template-columns: 1fr; } }

.hero-text { min-width: 0; }
.hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1; margin: 0 0 1rem 0; color: var(--neutral-900);
}
.hero-paragraph { color: var(--neutral-600); max-width: 650px; line-height: 1.6; margin: 0; }
.hero-buttons { margin-top: 1.25rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.note { margin-top: .65rem; font-size: .85rem; color: #888; }

/* Hero media/card */
.card,
.product-card,
.hero .card {
  width: 100%;
  background-color: #fff;
  border-radius: var(--radius-3xl);
  box-shadow: var(--shadow-soft);
  padding: 2rem;
  text-align: center;
  border: var(--ring);
}
.card-title { font-size: 2rem; color: var(--mauve-800); margin: 0; }
.card-text { color: var(--neutral-600); max-width: 480px; margin: 1rem auto 0; line-height: 1.6; }

.product-box {
  background: var(--mauve-800);
  color: #fff;
  padding: 2rem;
  border-radius: 16px;
  height: 260px; /* reserve height for stability */
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}

/* =========================================
   SECTIONS & GRIDS
   ========================================= */
.section { padding: 3.5rem 0; }
.section-sm { padding: 2.5rem 0; }

.section .section-eyebrow {
  display: inline-block; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--mauve-700); background: #f1e9f8; padding: .4rem .7rem; border-radius: 999px; border: 1px solid #e6d7f3;
}
.section .section-title {
  margin-top: .8rem; font-size: clamp(2rem, 3.2vw, 2.5rem); line-height: 1.1; color: var(--neutral-900);
}

/* Grid helpers */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Service cards */
.service-card {
  background: #fff; border-radius: 1.25rem; padding: 1.5rem;
  box-shadow: var(--shadow-soft); border: var(--ring);
  transition: transform .2s ease, box-shadow .2s ease;
}
.service-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(17,12,34,.08); }
.service-card h3 { font-size: 1.5rem; color: var(--mauve-800); margin: 0 0 .35rem 0; }
.service-card p { color: var(--neutral-600); margin: 0 0 .75rem 0; }
.service-meta { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }

/* Clean list */
.ul-clean { list-style: none; padding: 0; margin: .5rem 0 0 0; }
.ul-clean li { display: flex; gap: .5rem; align-items: flex-start; color: #424242; margin: .3rem 0; }
.dot { margin-top: .45rem; width: .4rem; height: .4rem; border-radius: 50%; background: var(--mauve-700); flex: none; }

/* Features section (if you use it) */
.features { padding: 3rem 0; }
.features .intro { color: #6B6B6B; max-width: 58ch; }
.feature-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px,1fr));
  gap: 1.2rem;
}
.feature {
  padding: 1.2rem;
  border: var(--ring);
  border-radius: 16px;
  background: #fff;
  transition: transform .12s ease, box-shadow .12s ease;
}
.feature:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.06); }

/* =========================================
   SECURITY (dark block)
   ========================================= */
.security { background: var(--mauve-800); color: #fff; }
.security-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 2rem;
  align-items: center;
}
@media (max-width: 900px) { .security-inner { grid-template-columns: 1fr; } }

.security-list {
  display:grid; grid-template-columns: repeat(2,1fr);
  gap: .8rem;
}
@media (max-width: 640px) { .security-list { grid-template-columns: 1fr; } }

.security-list li {
  list-style: none;
  background:#111214;
  border:1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: .9rem 1rem;
}

/* =========================================
   PRICING
   ========================================= */
.pricing { padding: 3rem 0; }
.pricing-card {
  max-width: var(--container);
  margin: 0 auto;
  display:flex; gap: 1rem; justify-content: space-between; align-items: center;
  border: var(--ring); background:#fff; border-radius: 20px; padding: 1.5rem;
  box-shadow: var(--shadow-soft);
}
@media (max-width: 900px) { .pricing-card { flex-direction: column; align-items: flex-start; } }

/* =========================================
   CTA BAND / DIVIDER
   ========================================= */
.cta-band {
  background: var(--mauve-800); color: #fff; border-radius: 1.25rem; padding: 2rem; text-align: center;
}
.cta-band .cta-invert {
  display: inline-flex; align-items: center; gap: .5rem; margin-top: 1rem;
  padding: .7rem 1rem; border-radius: 1rem; background: #fff; color: var(--mauve-800); text-decoration: none;
}
.cta-band .cta-invert:hover { background: #f1e9f8; }

.divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(204,183,222,0), rgba(204,183,222,.8), rgba(204,183,222,0));
  margin: 2rem 0;
}

/* =========================================
   FORMS (contact)
   ========================================= */
.contact { padding: 3rem 0; }
.contact form {
  display:grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 720px;
}
.contact textarea { grid-column: 1 / -1; }
.contact input, .contact textarea {
  padding: .9rem 1rem; border-radius: .75rem; border: var(--ring);
  font-size: .95rem; font-family: 'Inter', sans-serif; background:#fff;
}
.contact input:focus, .contact textarea:focus {
  outline: none; border-color: #b292cf; box-shadow: 0 0 0 2px var(--mauve-200);
}
@media (max-width: 640px) { .contact form { grid-template-columns: 1fr; } }

button.contact-submit,
button,
input[type="submit"] {
  margin-top: .25rem; background: var(--mauve-700); color: #fff; border: 0; border-radius: 1rem;
  padding: .75rem 1.25rem; font-size: .95rem; cursor: pointer;
  transition: background .15s ease, transform .12s ease, box-shadow .12s ease;
}
button:hover,
input[type="submit"]:hover { background: var(--mauve-800); transform: translateY(-1px); box-shadow: 0 10px 20px rgba(111,69,154,.25); }

/* =========================================
   WORK / CARDS (optional)
   ========================================= */
.work-grid { display: grid; gap: 2rem; grid-template-columns: repeat(2,minmax(0,1fr)); }
@media(max-width:900px){ .work-grid{ grid-template-columns:1fr; } }

.case {
  background:#fff; border: var(--ring); border-radius:1.5rem;
  box-shadow: var(--shadow-soft); overflow:hidden;
  display:flex; flex-direction:column; transition:transform .2s ease, box-shadow .2s ease;
}
.case:hover{ transform:translateY(-6px); box-shadow:0 16px 40px rgba(17,12,34,.08); }
.case-img img{ width:100%; display:block; }
.case-body{ padding:1.5rem; }
.case-title{ font-family:'Bebas Neue',sans-serif; font-size:1.8rem; color:var(--mauve-800); margin:0; }
.case-sub{ font-size:.9rem; text-transform:uppercase; letter-spacing:.06em; color:var(--mauve-700); margin-bottom:.4rem; }
.case-text{ color:#525252; margin:.75rem 0; line-height:1.6; }
.case-cta{ margin-top:1rem; display:inline-flex; padding:.6rem 1rem; border-radius:1rem; background:var(--mauve-700); color:#fff; text-decoration:none; font-size:.9rem; }
.case-cta:hover{ background:var(--mauve-800); }

/* =========================================
   FOOTER
   ========================================= */
.footer {
  border-top: var(--ring);
  padding: 1rem 1.5rem;
  display:flex; justify-content:space-between; align-items:center;
  color: #6B7280;
}
.footer a { color: inherit; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* =========================================
   HAMBURGER + MOBILE MENU (added)
   ========================================= */
.nav-toggle {
  display: none;
  width: 40px;
  height: 36px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  margin: 5px auto;
  background: #1a1a1a;
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
/* Animate to X when open (when your React button has .open) */
.nav-toggle.open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu panel */
.mobile-nav {
  display: grid;
  background: #fff;
  border-top: 1px solid #e5e5e5;
}
.mobile-nav a {
  display: block;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: #1a1a1a;
  border-bottom: 1px solid #f2eef6;
}
.mobile-nav a:hover { background: #f7f3fb; color: var(--mauve-700); }

/* =========================================
   RESPONSIVE NAV handling
   ========================================= */
@media (max-width: 900px) {
  .nav, .cta { display: none; }     /* hide desktop nav + CTA */
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* =========================================
   Motion preference
   ========================================= */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
/* --- Stability & no horizontal scroll on small screens --- */
html, body { width: 100%; overflow-x: hidden; }
.header { contain: layout paint; } /* isolates header to reduce layout thrash */

/* Tighten header on very small devices */
@media (max-width: 480px) {
  .header-inner { padding: 0.55rem 0; gap: .5rem; }
  .brand-name { font-size: 1.15rem; max-width: 48vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .logo img, .logo-icon { height: 34px; }
}

/* If space is still tight under 360px, hide brand text but keep the logo */
@media (max-width: 360px) {
  .brand-name { display: none; }
}

/* --- Mobile hamburger + overlay menu (full screen, scrollable) --- */
@media (max-width: 900px) {
  /* Show hamburger, hide desktop nav + CTA */
  .nav, .cta { display: none; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 36px;
  }
}

/* Mobile menu as fixed overlay (no clipping on tiny screens) */
.mobile-nav {
  position: fixed;
  z-index: 60;
  top: var(--header-h);
  left: 0; right: 0;
  bottom: 0;
  display: grid;
  background: #ffffff;
  border-top: 1px solid #e5e5e5;
  /* iOS safe area + scrolling */
  padding-bottom: max(env(safe-area-inset-bottom), 16px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Larger tap targets, compact spacing on small devices */
.mobile-nav a {
  display: block;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: #1a1a1a;
  border-bottom: 1px solid #f2eef6;
  font-size: 1.05rem;
}
@media (max-width: 380px) {
  .mobile-nav a { padding: 0.9rem 1rem; font-size: 0.98rem; }
}

/* Animate hamburger into an “X” (already in your CSS; repeated here for clarity) */
.nav-toggle.open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Make hero more forgiving on tiny screens so nothing overflows */
@media (max-width: 480px) {
  .hero { padding: 3rem 0 2.4rem; }
  .hero-title { font-size: clamp(1.7rem, 7vw, 2.2rem); }
  .hero-paragraph { font-size: 0.98rem; }
  .card { padding: 1.25rem; }
}

/* Ensure container padding breathes on very small widths */
@media (max-width: 420px) {
  .container { padding: 0 1rem; }
}

/* Prevent long words/URLs from causing sideways scroll anywhere */
* { word-wrap: break-word; overflow-wrap: anywhere; }
