/* ---------- Base / Theme ---------- */
:root {
  --bg: #ffffff;
  --surface: #f6f6f8;
  --surface-2: #eeeef1;
  --text: #121214;
  --muted: #6a6a72;
  --border: rgba(18, 18, 20, 0.1);
  --accent: #18181b;
  --accent-dark: #3f3f46;
  --accent-contrast: #ffffff;
  --shadow: 0 10px 30px rgba(18, 18, 20, 0.08);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

:root[data-theme="dark"] {
  --bg: #0a0a0b;
  --surface: #131315;
  --surface-2: #1b1b1e;
  --text: #f4f4f5;
  --muted: #9a9aa2;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --accent: #1a1d21;
  --accent-dark: #22272d;
  --accent-contrast: #f4f4f5;
  --sky: #7dd3fc;
  --sky-soft: rgba(125, 211, 252, 0.32);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 { line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; color: var(--muted); line-height: 1.6; }

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

svg { width: 22px; height: 22px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn-primary:hover { background: var(--accent-dark); }

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

:root[data-theme="dark"] .btn-primary,
:root[data-theme="dark"] .theme-toggle {
  border: 1px solid var(--sky-soft);
}
:root[data-theme="dark"] .eyebrow,
:root[data-theme="dark"] .project-link { color: var(--sky); }

:root[data-theme="dark"] .btn-primary:hover,
:root[data-theme="dark"] .btn-outline:hover {
  border-color: var(--sky);
  color: var(--sky);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12), 0 6px 24px rgba(56, 189, 248, 0.18);
}

.btn-sm { padding: 10px 20px; font-size: 0.85rem; }
.btn-lg { padding: 16px 34px; font-size: 1.05rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 18px 0;
  pointer-events: none;
}

.nav-wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; pointer-events: auto; }

section[id] { scroll-margin-top: 100px; }

.pill-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 999px;
  padding: 10px 12px 10px 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.28));
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1px 0 rgba(255, 255, 255, 0.15),
    0 10px 36px rgba(18, 18, 20, 0.12);
  position: relative;
  z-index: 0;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
/* Blur lives on a pseudo-layer so the mobile dropdown can run its own backdrop blur. */
.pill-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}

:root[data-theme="dark"] .pill-nav,
.site-header.on-dark .pill-nav {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 10px 36px rgba(0, 0, 0, 0.45);
}

.site-header.on-dark .logo,
.site-header.on-dark .nav-actions .btn-outline { color: #f4f4f5; }
.site-header.on-dark .nav-actions .btn-outline { border-color: rgba(255, 255, 255, 0.22); }
.site-header.on-dark .nav-toggle span { background: #f4f4f5; }
.site-header.on-dark .theme-toggle { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18); }

@media (min-width: 721px) {
  .site-header.on-dark .nav-links a { color: rgba(244, 244, 245, 0.7); }
  .site-header.on-dark .nav-links a:hover { color: #fff; }
}

.logo {
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  font-size: 1.05rem;
  white-space: nowrap;
}
.logo-img { display: block; height: 34px; width: auto; }
.logo-for-dark { display: none; }
:root[data-theme="dark"] .logo-for-light,
.site-header.on-dark .logo-for-light { display: none; }
:root[data-theme="dark"] .logo-for-dark,
.site-header.on-dark .logo-for-dark { display: block; }

.nav-links {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--muted);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--accent-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 88px 0 56px;
  overflow: hidden;
  color: #fff;
  background: #040507;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: -2;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,8,10,0.6) 0%, rgba(8,8,10,0.25) 42%, rgba(8,8,10,0.35) 60%, rgba(8,8,10,0.78) 100%);
  z-index: -1;
}

.eyebrow-light {
  color: rgba(255, 255, 255, 0.7);
}

.hero-inner h1 {
  font-size: clamp(2.1rem, 6.2vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 18px 0 0;
  color: #fff;
}

.hero-bar {
  margin-top: 88px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: end;
}

.hero-bar .lede {
  max-width: 560px;
  margin: 0;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.75);
}


.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-bar .hero-actions { justify-self: end; }

.hero .btn-outline {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}
.hero .btn-outline:hover { border-color: #fff; color: #fff; }

.hero .btn-primary,
.cta .btn-primary {
  background: #f4f4f5;
  color: #0a0a0b;
}
.hero .btn-primary:hover,
.cta .btn-primary:hover { background: #d4d4d8; }

:root[data-theme="dark"] .hero .btn-primary,
:root[data-theme="dark"] .cta .btn-primary {
  background: #1a1d21;
  color: #f4f4f5;
  border-color: var(--sky-soft);
}
:root[data-theme="dark"] .hero .btn-primary:hover,
:root[data-theme="dark"] .cta .btn-primary:hover {
  background: #22272d;
  border-color: var(--sky);
  color: var(--sky);
}

.hero .eyebrow { color: rgba(255, 255, 255, 0.6); }

/* Dark mode hero: neutral, no sky accent */
:root[data-theme="dark"] .hero .eyebrow { color: rgba(255, 255, 255, 0.6); }
:root[data-theme="dark"] .hero .btn-primary {
  background: #f4f4f5;
  color: #0a0a0b;
  border-color: transparent;
}
:root[data-theme="dark"] .hero .btn-primary:hover {
  background: #d4d4d8;
  color: #0a0a0b;
  border-color: transparent;
  box-shadow: none;
}
:root[data-theme="dark"] .hero .btn-outline {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}
:root[data-theme="dark"] .hero .btn-outline:hover {
  border-color: #fff;
  color: #fff;
  box-shadow: none;
}

/* Light mode hero */
:root:not([data-theme="dark"]) .hero { color: var(--text); background: #f3f5f8; }
:root:not([data-theme="dark"]) img.hero-bg { filter: invert(1) brightness(1.02); opacity: 0.9; }
:root:not([data-theme="dark"]) .hero-overlay {
  background: linear-gradient(180deg, rgba(243,245,248,0.55) 0%, rgba(243,245,248,0.15) 42%, rgba(243,245,248,0.25) 60%, rgba(243,245,248,0.7) 100%);
}
:root:not([data-theme="dark"]) .hero-inner h1 { color: var(--text); }
:root:not([data-theme="dark"]) .hero-bar .lede { color: #3f3f46; }
:root:not([data-theme="dark"]) .hero .eyebrow { color: var(--muted); }
:root:not([data-theme="dark"]) .hero .btn-primary { background: var(--accent); color: var(--accent-contrast); }
:root:not([data-theme="dark"]) .hero .btn-primary:hover { background: var(--accent-dark); }
:root:not([data-theme="dark"]) .hero .btn-outline {
  border-color: rgba(18, 18, 20, 0.18);
  color: var(--text);
  background: rgba(255, 255, 255, 0.5);
}
:root:not([data-theme="dark"]) .hero .btn-outline:hover { border-color: var(--text); color: var(--text); }

/* Tech strip */
.tech-strip {
  margin-top: 48px;
  padding-top: 36px;
  padding-bottom: 48px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}
.tech-strip-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.tech-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin: 0;
  padding: 0;
}
.tech-list li {
  font-weight: 700;
  color: var(--text);
  opacity: 0.6;
  font-size: 1rem;
}
.tech-list .tech-more { font-weight: 500; font-style: italic; opacity: 0.45; }

/* ---------- Section head ---------- */
.section-head { max-width: 640px; margin-bottom: 48px; }
.eyebrow {
  display: block;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 16px;
}

/* ---------- Services ---------- */
.services {
  position: relative;
  padding: 90px 0;
  background: var(--surface);
  overflow: hidden;
  isolation: isolate;
}

.services-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  opacity: 0.16;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 22%, #000 78%, transparent 100%);
}
:root[data-theme="dark"] .services-bg { opacity: 0.3; }

.services .service-card {
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
:root[data-theme="dark"] .services .service-card {
  background: rgba(10, 10, 11, 0.78);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.service-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 12px;
  row-gap: 10px;
  align-content: start;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.service-icon {
  color: var(--text);
  display: flex;
}
.service-icon svg { width: 20px; height: 20px; }

.service-card h3 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.service-card p { font-size: 0.92rem; grid-column: 1 / -1; }

/* ---------- Capability / AI ---------- */
.capability { padding: 90px 0; }

.capability-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.capability-image {
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.capability-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.capability-copy h2 {
  font-size: clamp(1.8rem, 3vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 16px;
}
.capability-copy p { font-size: 1rem; max-width: 440px; }

/* ---------- Projects ---------- */
.projects { padding: 90px 0; background: var(--surface); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  display: block;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
a.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.project-thumb {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
}

.project-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.thumb-empty {
  align-items: center;
  justify-content: center;
}
.thumb-empty img { filter: grayscale(1) brightness(0.4); }
.thumb-empty-overlay {
  position: relative;
  z-index: 1;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 16px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 999px;
}

.project-body { padding: 22px 24px 26px; }
.project-body h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.project-body p { font-size: 0.92rem; margin-bottom: 14px; }

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
}
.project-link svg { width: 16px; height: 16px; }

.project-card-empty { opacity: 0.7; }

/* ---------- Packages ---------- */
.packages {
  position: relative;
  padding: 90px 0;
  overflow: hidden;
  isolation: isolate;
}

.packages-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  opacity: 0.4;
  /* Keep the heading area clear; let the photo show behind the cards */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.15) 22%, #000 50%, #000 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.15) 22%, #000 50%, #000 80%, transparent 100%);
}
:root:not([data-theme="dark"]) .package-card { background: rgba(255, 255, 255, 0.78); }

.packages-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.package-card {
  display: flex;
  flex-direction: column;
  background: rgba(246, 246, 248, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 24px 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.package-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.package-tier {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.package-card h3 { font-size: 1.15rem; font-weight: 700; margin: 10px 0 18px; }

.package-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}
:root[data-theme="dark"] .package-card { background: rgba(19, 19, 21, 0.78); }

/* Same line box as a numeric price so the cards stay aligned */
.package-price-custom { font-size: 1.6rem; line-height: 1.3125; }
.package-from { font-size: 0.85rem; font-weight: 600; letter-spacing: 0; color: var(--muted); }

.package-desc { font-size: 0.9rem; margin: 14px 0 20px; }

.package-features {
  list-style: none;
  margin: 0 0 24px;
  padding: 20px 0 0;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 10px;
  flex: 1;
  align-content: start;
}
.package-features li {
  display: flex;
  gap: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
}
.package-features svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--muted); }
:root[data-theme="dark"] .package-features svg { color: rgba(244, 244, 245, 0.7); }

.package-btn { justify-content: center; width: 100%; }

.packages-note { margin-top: 28px; font-size: 0.85rem; max-width: 720px; }

/* ---------- CTA ---------- */
.cta {
  position: relative;
  padding: 100px 0;
  background: #0a0a0b;
  color: #f4f4f5;
  overflow: hidden;
}
.cta-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.25;
}
.cta-inner { position: relative; z-index: 1; text-align: center; max-width: 560px; margin: 0 auto; }
.cta h2 {
  color: #f4f4f5;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 18px;
}
.cta p { color: rgba(244,244,245,0.7); margin-bottom: 34px; }
.cta-note {
  margin-top: 18px;
  font-size: 0.85rem;
  color: rgba(244,244,245,0.55);
}

/* ---------- Footer ---------- */
.site-footer {
  --f-bg: #f6f6f8;
  --f-strong: #121214;
  --f-text: rgba(18, 18, 20, 0.62);
  --f-soft: rgba(18, 18, 20, 0.55);
  --f-icon: rgba(18, 18, 20, 0.8);
  --f-line: rgba(18, 18, 20, 0.1);
  padding: 64px 0 26px;
  background: var(--f-bg);
  color: var(--f-strong);
  border-top: 1px solid var(--f-line);
}
:root[data-theme="dark"] .site-footer {
  --f-bg: #0c0d10;
  --f-strong: #ffffff;
  --f-text: rgba(244, 244, 245, 0.62);
  --f-soft: rgba(244, 244, 245, 0.55);
  --f-icon: rgba(244, 244, 245, 0.85);
  --f-line: rgba(255, 255, 255, 0.1);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr);
  gap: 56px;
  padding-bottom: 44px;
}

.footer-brand .logo-img { height: 38px; }
.footer-brand p {
  max-width: 280px;
  margin-top: 16px;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--f-text);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.footer-block h4 {
  margin: 4px 0 16px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--f-strong);
}
.footer-block ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-block li,
.footer-block a {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--f-text);
}
.footer-block a { transition: color 0.2s ease; }
.footer-block a:hover { color: var(--f-strong); }

.footer-contact li { display: flex; align-items: center; gap: 10px; }
.footer-contact svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--f-icon); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 22px;
  border-top: 1px solid var(--f-line);
}
.footer-bottom p { font-size: 0.8rem; color: var(--f-soft); }

.footer-top-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--f-text);
  transition: color 0.2s ease;
}
.footer-top-link:hover { color: var(--f-strong); }
.footer-top-link svg { width: 14px; height: 14px; }

:root[data-theme="dark"] .footer-block a:hover,
:root[data-theme="dark"] .footer-top-link:hover { color: var(--sky); }

/* ---------- Scroll animation ---------- */
[data-animate] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-animate].in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Chat modal ---------- */
.chat-modal {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  overflow: auto;
}
.chat-modal::backdrop {
  background: rgba(8, 8, 10, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.chat-modal[open] { animation: chat-in 0.22s ease-out; }
@keyframes chat-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-modal[open] { animation: none; }
}

.chat-form { position: relative; padding: 36px 32px 32px; }
.chat-form h2 { font-size: 1.7rem; font-weight: 800; margin-bottom: 8px; }
.chat-sub { margin-bottom: 26px; font-size: 0.95rem; }
.chat-sub a { color: var(--text); text-decoration: underline; }

.chat-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.chat-close:hover { color: var(--text); border-color: var(--text); }
.chat-close svg { width: 16px; height: 16px; }

.chat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > span { font-size: 0.85rem; font-weight: 600; }
.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field textarea { resize: vertical; min-height: 110px; }
.field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 42px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a6a72' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}
:root[data-theme="dark"] .field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9aa2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
.field input::placeholder,
.field textarea::placeholder { color: var(--muted); opacity: 0.8; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(18, 18, 20, 0.08);
}
:root[data-theme="dark"] .field input:focus,
:root[data-theme="dark"] .field select:focus,
:root[data-theme="dark"] .field textarea:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.field-error { display: none; font-size: 0.8rem; color: #dc2626; }
:root[data-theme="dark"] .field-error { color: #f87171; }
.field.invalid input,
.field.invalid textarea { border-color: #dc2626; }
:root[data-theme="dark"] .field.invalid input,
:root[data-theme="dark"] .field.invalid textarea { border-color: #f87171; }
.field.invalid .field-error { display: block; }

.chat-submit { width: 100%; justify-content: center; margin-top: 6px; }
.chat-submit:disabled { opacity: 0.6; cursor: progress; transform: none; }
.chat-error {
  margin: 4px 0 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
}
:root[data-theme="dark"] .chat-error { color: #fca5a5; background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.3); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.chat-done { text-align: left; }
.chat-done .btn { margin-top: 4px; }

body.chat-open { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { padding: 48px 0 64px; }
  .hero-bar { grid-template-columns: 1fr; gap: 28px; margin-top: 48px; }
  .hero-bar .hero-actions { justify-self: start; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .packages-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .capability-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    gap: 16px;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.5));
    border-color: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
  }
  :root[data-theme="dark"] .nav-links,
  .site-header.on-dark .nav-links {
    background: linear-gradient(135deg, rgba(30, 30, 34, 0.82), rgba(20, 20, 24, 0.66));
    border-color: rgba(255, 255, 255, 0.14);
  }
  .site-header.on-dark .nav-links a { color: rgba(244, 244, 245, 0.75); }
  .nav-toggle { display: flex; order: 3; }
  .nav-actions { order: 2; }
  .logo { order: 1; }
  .pill-nav { flex-wrap: wrap; }

  .projects-grid { grid-template-columns: 1fr; }
  .hero-overlay {
    background: linear-gradient(180deg, rgba(8,8,10,0.6) 0%, rgba(8,8,10,0.3) 45%, rgba(8,8,10,0.35) 100%);
  }
}

@media (max-width: 560px) {
  .services-grid { grid-template-columns: 1fr; }
  .packages-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .chat-row { grid-template-columns: 1fr; gap: 0; }
  .pill-nav .logo-img { height: 26px; }
  .pill-nav { padding-left: 16px; }
  .nav-actions { gap: 6px; }
  .nav-actions .btn-sm { padding: 8px 14px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .chat-form { padding: 30px 20px 22px; }
  .hero-bar .hero-actions { justify-self: stretch; }
  .hero-actions .btn { justify-content: center; }
}

@media (max-width: 400px) {
  .pill-nav { padding: 8px 8px 8px 14px; }
  .pill-nav .logo-img { height: 22px; }
  .nav-actions { margin-left: auto; gap: 6px; }
  .nav-actions .btn-sm { padding: 7px 12px; font-size: 0.8rem; }
  .theme-toggle { width: 34px; height: 34px; }
  .theme-toggle svg { width: 16px; height: 16px; }
  .nav-toggle { padding: 6px 4px 6px 8px; }
}

@media (max-width: 340px) {
  .pill-nav .logo-img { height: 19px; }
  .nav-actions { gap: 4px; }
  .nav-actions .btn-sm { padding: 6px 10px; font-size: 0.76rem; }
  .theme-toggle { width: 30px; height: 30px; }
}

@media (max-width: 720px) {
  .footer-explore { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .site-footer { padding: 44px 0 22px; }
  .footer-top { gap: 26px; padding-bottom: 28px; }
  .footer-brand p { margin-top: 12px; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .footer-block h4 { margin-bottom: 12px; }
  .footer-bottom { flex-wrap: nowrap; padding-top: 18px; }
  .footer-bottom p { font-size: 0.75rem; }
  .footer-top-link { font-size: 0.75rem; flex-shrink: 0; }
}

/* Dark mode: neutral header controls and white contact CTA */
:root[data-theme="dark"] .theme-toggle {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: none;
}
:root[data-theme="dark"] .nav-actions .btn-outline {
  border-color: rgba(255, 255, 255, 0.22);
  color: #f4f4f5;
}
:root[data-theme="dark"] .nav-actions .btn-outline:hover {
  border-color: #fff;
  color: #fff;
  box-shadow: none;
}
:root[data-theme="dark"] .cta .btn-primary {
  background: #f4f4f5;
  color: #0a0a0b;
  border-color: transparent;
}
:root[data-theme="dark"] .cta .btn-primary:hover {
  background: #d4d4d8;
  color: #0a0a0b;
  border-color: transparent;
  box-shadow: none;
}

/* Mobile footer: brand on the left half, link columns on the right half */
@media (max-width: 720px) {
  .footer-top { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 24px 20px; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; min-width: 0; }
  .footer-contact li { align-items: flex-start; }
  .footer-contact svg { margin-top: 3px; }
  .footer-contact a { overflow-wrap: break-word; }
  .footer-brand .logo-img { height: 26px; }
  .footer-brand p { margin-top: 12px; font-size: 0.8rem; line-height: 1.6; }
}
@media (max-width: 340px) {
  .footer-brand .logo-img { height: 22px; }
}
