:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --border: rgba(15, 23, 42, 0.08);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
  --text: #1e3a8a;
  --muted: #3b5998;
  --accent-1: #0038e6;
  --accent-2: #0ea5e9;
  --accent-3: #7c3aed;
  --radius: 20px;
  --nav-height: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  background-color: var(--bg);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-text {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.02em;
}

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

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}

/* Background Canvas & Ambient Orbs */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.ambient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
  animation: floatOrb 12s ease-in-out infinite alternate;
}

.orb-1 {
  width: min(420px, 70vw);
  height: min(420px, 70vw);
  background: var(--accent-1);
  top: -10%;
  left: -10%;
}

.orb-2 {
  width: min(380px, 65vw);
  height: min(380px, 65vw);
  background: var(--accent-2);
  bottom: -10%;
  right: -10%;
  animation-delay: -8s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 30px) scale(1.12); }
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}

.navbar.scrolled {
  background: rgba(248, 250, 252, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.brand-text {
  color: #0038e6;
  font-size: 1.38rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.2s ease;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-1);
  font-weight: 600;
}

.nav-links .nav-cta {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
}

.nav-links .nav-cta:hover {
  border-color: var(--accent-2);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 0 9px;
  z-index: 120;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s 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);
}

/* Compact Apple iOS / Dynamic-Island Popover Menu */
.mobile-drawer {
  position: fixed;
  top: calc(var(--nav-height) + 8px);
  right: clamp(14px, 4vw, 24px);
  width: min(210px, 64vw);
  padding: 10px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 22px 50px rgba(0, 56, 230, 0.16), 0 4px 16px rgba(15, 23, 42, 0.08);
  z-index: 95;
  transform-origin: top right;
  transform: scale(0.32) translateY(-18px);
  opacity: 0;
  filter: blur(6px);
  pointer-events: none;
  transition:
    transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.26s ease,
    filter 0.28s ease;
}

.mobile-drawer.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  filter: blur(0);
  pointer-events: auto;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.mobile-nav-links a {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
  color: #1e3a8a;
  padding: 10px 14px;
  border-radius: 14px;
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.mobile-nav-links a:hover,
.mobile-nav-links a:active {
  background: rgba(0, 56, 230, 0.08);
  color: #0038e6;
  transform: scale(0.98);
}

.mobile-nav-links .mobile-cta {
  margin-top: 4px;
  text-align: center;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
}

/* Main Content & View Switching */
main {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 74px);
}

.view-section {
  display: none;
  animation: viewFadeIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.view-section.active {
  display: block;
}

.hero.view-section {
  display: none;
}

.hero.view-section.active {
  display: flex;
}

.view-section:not(.hero) {
  padding-top: calc(var(--nav-height) + 48px);
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero */
.hero {
  min-height: 100svh;
  align-items: center;
  padding: calc(var(--nav-height) + 40px) 0 48px;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

/* Kinetic Masked Headline Reveal */
.line-wrap {
  display: block;
  overflow: hidden;
}

.line-anim {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  animation: lineSlideUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) var(--d, 0s) forwards;
}

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

/* Infinite Smooth Platform Marquee */
.hero-marquee {
  width: 100%;
  overflow: hidden;
  margin-top: 10px;
  padding: 12px 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 22px;
  width: max-content;
  animation: marqueeScroll 24s linear infinite;
}

.marquee-track span {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: #1e3a8a;
  opacity: 0.72;
  white-space: nowrap;
}

.marquee-track span:nth-child(4n+1) { color: #0038e6; }
.marquee-track span:nth-child(4n+3) { color: #059669; }

@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: #0284c7;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent-2);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

.hero-title {
  font-size: clamp(2.2rem, 6.5vw, 4.5rem);
  line-height: 1.08;
  font-weight: 700;
  max-width: 16ch;
  word-wrap: break-word;
  color: #1e1b4b;
}

.gradient-text {
  background: linear-gradient(120deg, #0038e6, #0ea5e9, #7c3aed);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}

@keyframes shimmer {
  to { background-position: 200% center; }
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  color: #0e7490;
  font-weight: 500;
  max-width: 42ch;
}

.hero-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(10px, 2.5vw, 14px);
  margin-top: 4px;
}

@media (max-width: 480px) {
  .hero-actions {
    width: 100%;
  }
  .hero-actions .btn {
    flex: 1 1 0;
    padding: 12px 14px;
    font-size: 0.88rem;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(6, 182, 212, 0.35);
}

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
  width: 100%;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  padding: 14px 20px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 140px;
  flex: 1 1 140px;
  max-width: 220px;
}

.stat-pill:nth-child(1) strong {
  color: #0038e6;
}
.stat-pill:nth-child(2) strong {
  color: #059669;
}
.stat-pill:nth-child(3) strong {
  color: #7c3aed;
}

.stat-pill strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
}

.stat-pill span {
  font-size: 0.82rem;
  color: #475569;
}

/* Sections */
.section {
  padding: clamp(56px, 8vw, 96px) 0;
}

.section-header {
  margin-bottom: clamp(28px, 4vw, 44px);
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #0284c7;
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  line-height: 1.15;
  background: linear-gradient(120deg, #1e3a8a, #0038e6, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Cards Grid — guaranteed no overflow on any screen */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 20px;
}

.glass-card,
.work-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.glass-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.glass-card:hover,
.work-card:hover {
  border-color: rgba(6, 182, 212, 0.45);
  background: var(--surface-hover);
}

.card-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: transparent;
}

.service-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.bugfix-blend {
  mix-blend-mode: multiply;
}

.glass-card h3,
.work-body h3,
.process-step h3 {
  font-size: 1.34rem;
  font-weight: 700;
}

/* Vibrant multi-color card headings */
#services .glass-card:nth-child(1) h3 { color: #0284c7; }
#services .glass-card:nth-child(2) h3 { color: #2563eb; }
#services .glass-card:nth-child(3) h3 { color: #059669; }
#services .glass-card:nth-child(4) h3 { color: #4f46e5; }
#services .glass-card:nth-child(5) h3 { color: #7c3aed; }
#services .glass-card:nth-child(6) h3 { color: #e11d48; }

#work .work-card:nth-child(1) h3 { color: #0038e6; }
#work .work-card:nth-child(2) h3 { color: #7c3aed; }
#work .work-card:nth-child(3) h3 { color: #059669; }

#process .process-step:nth-child(1) h3 { color: #0038e6; }
#process .process-step:nth-child(2) h3 { color: #0284c7; }
#process .process-step:nth-child(3) h3 { color: #7c3aed; }

.glass-card p,
.work-body p,
.process-step p {
  font-size: 0.98rem;
  font-weight: 500;
  color: #334155;
}

/* Work Cards */
.work-visual {
  height: 200px;
  padding: 14px;
  display: flex;
  align-items: flex-end;
  position: relative;
  overflow: hidden;
  background: #f1f5f9;
}

.work-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.work-card:hover .work-img {
  transform: scale(1.05);
}

.work-chip {
  position: relative;
  z-index: 2;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
}

.mock-ui {
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mock-bar {
  display: flex;
  gap: 5px;
}

.mock-bar span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
}

.mock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text);
}

.mock-row em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent-1);
}

.mock-dot.live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  margin-right: 6px;
}

.mock-progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.mock-progress div {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
}

.visual-1 {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(6, 182, 212, 0.25));
}
.visual-2 {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35), rgba(99, 102, 241, 0.25));
}
.visual-3 {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.35), rgba(16, 185, 129, 0.25));
}

.work-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
}

.work-body {
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Process Grid */
.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 20px;
}

.process-step {
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}

/* Contact Box */
.contact-box {
  width: 100%;
  padding: clamp(32px, 5vw, 56px) clamp(18px, 4vw, 48px);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.12), rgba(6, 182, 212, 0.08));
  border: 1px solid var(--border);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.contact-title {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  max-width: 18ch;
  line-height: 1.15;
}

.contact-sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 8px;
}

/* Footer */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: clamp(12px, 3vw, 22px);
}

.footer-links a {
  color: var(--muted);
  font-size: clamp(0.74rem, 3.1vw, 0.88rem);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-1);
}

/* Wider containers & cards for Policies and Connect */
#privacy .container,
#terms .container,
#cookies .container,
#contact .container {
  max-width: 1240px;
}

.policy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(24px, 3.5vw, 44px) clamp(18px, 3.5vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 100%;
}

@media (max-width: 640px) {
  #privacy .container,
  #terms .container,
  #cookies .container,
  #contact .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .policy-card {
    padding: 22px 16px;
  }

  .contact-box {
    padding: 32px 18px;
  }
}

.policy-card h3 {
  font-size: 1.2rem;
  color: #0038e6;
  margin-top: 8px;
}

.policy-card p {
  color: #334155;
  font-size: 0.96rem;
  line-height: 1.7;
}

.policy-card ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.65;
}

.policy-card strong {
  color: #1e3a8a;
}

.policy-card a {
  color: var(--accent-1);
  text-decoration: underline;
}

/* Scroll Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--nav-height) + 32px);
    padding-bottom: 48px;
  }

  .stat-pill {
    max-width: none;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .ambient-orb,
  .pulse-dot,
  .gradient-text {
    animation: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
