:root {
  --cyan: #00f0ff;
  --magenta: #ff00d4;
  --dark-1: #0a0a12;
  --dark-2: #10101c;
  --dark-3: #171726;
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-1: #f4f4fb;
  --text-2: rgba(244, 244, 251, 0.68);
  --text-3: rgba(244, 244, 251, 0.44);
  --font-body: 'Outfit', system-ui, sans-serif;
  --font-head: 'Syne', system-ui, sans-serif;
  --grad: linear-gradient(120deg, var(--cyan), var(--magenta));
}

* { box-sizing: border-box; }
/* Deliberately NOT scroll-behavior:smooth — it fights with GSAP ScrollTrigger's
   scroll-scrubbed camera: a reversed wheel tick redirects an in-flight smooth-scroll
   animation, which briefly reports a jumpy/non-monotonic scroll position and makes
   the 3D scene stutter. Nav-link jumps below get their own lightweight JS smoothing. */
html { overflow-x: hidden; }

body {
  margin: 0;
  background: var(--dark-1);
  color: var(--text-1);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 .5em;
}

p { margin: 0 0 1em; color: var(--text-2); }

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

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--dark-1);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.5rem;
  transition: opacity .6s ease, visibility .6s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-core {
  width: 54px; height: 54px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--cyan);
  border-right-color: var(--magenta);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Canvas ---------- */
#webgl {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh; height: 100dvh;
  z-index: 0;
  display: block;
}
#no-webgl-fallback {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(0,240,255,0.14), transparent 55%),
              radial-gradient(ellipse at 75% 75%, rgba(255,0,212,0.12), transparent 55%),
              var(--dark-1);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
  background: linear-gradient(to bottom, rgba(10,10,18,0.85), transparent);
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; }

.menu-grid { display: flex; gap: .35rem; }
.menu-grid a {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .9rem;
  font-size: .82rem;
  border-radius: 999px;
  color: var(--text-2);
  transition: color .2s, background .2s;
}
.menu-grid a em {
  font-style: normal; font-family: var(--font-head); font-size: .65rem;
  background: rgba(255,255,255,0.08); border-radius: 6px; padding: .15rem .4rem;
  color: var(--text-3);
}
.menu-grid a:hover { color: var(--text-1); background: rgba(255,255,255,0.06); }

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

/* ---------- Panels / layout ---------- */
/* Panels sit above the canvas but shouldn't block clicks in their empty
   space — only actual content elements should be clickable, so 3D hotspot
   raycasting still receives pointer events in open canvas areas. */
#scroll-track, .panel { position: relative; z-index: 1; pointer-events: none; }
.panel * { pointer-events: auto; }
.panel {
  position: relative;
  min-height: 100vh;
  padding: clamp(6rem, 12vh, 9rem) clamp(1.25rem, 6vw, 5rem) 5rem;
  display: flex; flex-direction: column; justify-content: center;
  gap: 2.5rem;
}
.panel-inner { max-width: 760px; }
.eyebrow {
  font-family: var(--font-head); font-size: .8rem; letter-spacing: .25em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: .75rem;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); }
.lead { font-size: 1.05rem; max-width: 640px; }

.cta-row { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0; }
.btn {
  font-family: var(--font-head); font-weight: 600; font-size: .9rem;
  padding: .85rem 1.7rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
  display: inline-block;
}
.btn-primary { background: var(--grad); color: #04040a; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,240,255,0.25); }
.btn-ghost { border-color: var(--card-border); color: var(--text-1); background: rgba(255,255,255,0.03); }
.btn-ghost:hover { border-color: var(--cyan); }

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- Metrics ---------- */
.metric-strip { display: flex; gap: clamp(1.25rem, 4vw, 3rem); flex-wrap: wrap; margin-top: 1rem; }
.metric-value { font-family: var(--font-head); font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 700; display: block; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.metric-label { font-size: .8rem; color: var(--text-3); display: block; margin-top: .25rem; }

/* ---------- Value cards ---------- */
.value-cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1.25rem; max-width: 1100px; }
.value-card, .why-card {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px;
  padding: 1.5rem; backdrop-filter: blur(10px);
  transition: transform .3s, border-color .3s;
}
.value-card:hover, .why-card:hover { transform: translateY(-4px); border-color: rgba(0,240,255,0.35); }
.value-card h3, .why-card h3 { font-size: 1.05rem; margin-bottom: .5rem; }
.value-card p, .why-card p { font-size: .88rem; margin: 0; }

.scroll-hint { position: absolute; bottom: 2rem; left: clamp(1.25rem, 6vw, 5rem); font-size: .78rem; color: var(--text-3); }
.scroll-hint span { display: inline-block; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0);} 50% { transform: translateY(6px);} }

/* ---------- Services ---------- */
.service-hint { position: absolute; top: 40%; right: clamp(1.25rem, 6vw, 5rem); font-size: .82rem; color: var(--text-3); max-width: 220px; text-align: right; }
.service-panel {
  position: fixed; top: 50%; right: clamp(1rem, 4vw, 3rem); transform: translateY(-50%) translateX(20px);
  width: min(360px, 88vw);
  background: rgba(16,16,28,0.88); border: 1px solid var(--card-border); border-radius: 20px;
  padding: 1.75rem; backdrop-filter: blur(16px);
  opacity: 0; pointer-events: none; transition: opacity .35s ease, transform .35s ease;
  z-index: 50;
}
.service-panel.open { opacity: 1; pointer-events: auto; transform: translateY(-50%) translateX(0); }
.service-panel-close { position: absolute; top: .9rem; right: 1rem; background: none; border: none; color: var(--text-2); font-size: 1.4rem; cursor: pointer; line-height: 1; }
.service-panel-eyebrow { color: var(--cyan); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; margin-bottom: .35rem; }
.service-panel-title { font-size: 1.3rem; margin-bottom: 1rem; }
.service-panel-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .9rem; }
.service-panel-list li { border-top: 1px solid var(--card-border); padding-top: .8rem; }
.service-panel-list li:first-child { border-top: none; padding-top: 0; }
.service-panel-list strong { display: block; font-family: var(--font-head); font-size: .92rem; margin-bottom: .25rem; }
.service-panel-list span { font-size: .82rem; color: var(--text-2); }

/* ---------- Case studies ---------- */
.filter-row { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1.5rem 0; }
.filter-btn {
  font-family: var(--font-head); font-size: .8rem; padding: .5rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--card-border); background: rgba(255,255,255,0.03); color: var(--text-2); cursor: pointer;
  transition: all .2s;
}
.filter-btn.active, .filter-btn:hover { color: #04040a; background: var(--grad); border-color: transparent; }

.case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; max-width: 900px; }
.case-card {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 14px; padding: 1.25rem;
  transition: opacity .35s ease, transform .35s ease;
}
.case-card.filtered-out { opacity: 0; transform: scale(.9); pointer-events: none; position: absolute; }
.case-tag { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); }
.case-card h3 { font-size: 1rem; margin: .5rem 0 .35rem; }
.case-result { font-size: .85rem; color: var(--text-2); margin: 0; }
.illustrative-note { font-size: .75rem; color: var(--text-3); margin-top: 1.25rem; }

/* ---------- Why us ---------- */
.why-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1.25rem; max-width: 1000px; margin-bottom: 3rem; }

.tech-marquee { max-width: 900px; overflow: hidden; }
.tech-marquee-label { font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); margin-bottom: 1rem; }
.tech-track { display: flex; gap: 2.5rem; width: max-content; animation: marquee 22s linear infinite; }
.tech-track span { font-family: var(--font-head); font-size: 1.1rem; color: var(--text-3); white-space: nowrap; }
@keyframes marquee { from { transform: translateX(0);} to { transform: translateX(-50%);} }

/* ---------- About ---------- */
.about-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; max-width: 1100px; align-items: start; }
.about-counters { display: flex; flex-direction: column; gap: 1.5rem; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 18px; padding: 1.75rem; }

/* ---------- Contact ---------- */
.contact-inner { display: grid; grid-template-columns: 1.2fr .8fr; gap: 3rem; max-width: 1100px; }
.contact-form { display: flex; flex-direction: column; gap: .9rem; margin-top: 1.5rem; }
.form-row { display: flex; gap: .9rem; }
.contact-form input, .contact-form textarea {
  width: 100%; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 10px;
  padding: .85rem 1rem; color: var(--text-1); font-family: var(--font-body); font-size: .9rem; resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--cyan); }
.contact-form button { align-self: flex-start; border: none; }
.form-note { font-size: .72rem; color: var(--text-3); margin: 0; }

.contact-info { display: flex; flex-direction: column; gap: 1.5rem; padding-top: 4.5rem; }
.contact-info > div { display: flex; flex-direction: column; gap: .3rem; border-top: 1px solid var(--card-border); padding-top: 1rem; }
.ci-label { font-size: .72rem; letter-spacing: .15em; text-transform: uppercase; color: var(--cyan); }
.contact-info em { font-style: normal; color: var(--text-3); font-size: .78rem; }
.contact-info a { color: var(--text-1); text-decoration: none; transition: color .2s; }
.contact-info a:hover { color: var(--cyan); }
.contact-info address { font-style: normal; }

/* ---------- Services index (crawlable list of the 3D modules) ---------- */
.service-index {
  list-style: none; padding: 0; margin: 1.75rem 0 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem;
}
.service-index a {
  display: block; height: 100%; padding: 1rem 1.1rem;
  /* near-opaque so the 3D modules floating behind don't hurt readability */
  background: rgba(16,16,28,0.82); backdrop-filter: blur(6px);
  border: 1px solid var(--card-border); border-radius: 14px;
  transition: border-color .2s, transform .2s;
}
.service-index a:hover, .service-index a:focus-visible { border-color: rgba(0,240,255,0.45); transform: translateY(-2px); }
.service-index h3 { font-size: .98rem; margin-bottom: .3rem; }
.service-index h3::after { content: ' →'; color: var(--cyan); }
.service-index p { font-size: .8rem; margin: 0; color: var(--text-3); }

/* ---------- FAQ ---------- */
.faq-list { margin-top: 1.5rem; }
.faq-list details { border-top: 1px solid var(--card-border); padding: .9rem 0; }
.faq-list details:last-child { border-bottom: 1px solid var(--card-border); }
.faq-list summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem;
  font-family: var(--font-head); font-weight: 600; color: var(--text-1);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; color: var(--cyan); font-size: 1.25rem; line-height: 1; }
.faq-list details[open] summary::after { content: '−'; }
.faq-list details p { margin: .6rem 0 0; font-size: .95rem; }

/* ---------- Floating WhatsApp / Call buttons ---------- */
.float-contact {
  position: fixed; right: 20px; bottom: 20px; z-index: 150;
  display: flex; flex-direction: column; gap: 14px;
}
.float-btn {
  position: relative; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; text-decoration: none;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35); transition: transform .2s ease, box-shadow .2s ease;
}
.float-btn svg { width: 28px; height: 28px; position: relative; z-index: 1; }
.float-btn::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: inherit; opacity: .6; animation: float-pulse 2s ease-out infinite; z-index: 0;
}
.float-btn:hover { transform: scale(1.08); box-shadow: 0 8px 26px rgba(0,0,0,0.45); }
.float-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.float-wa { background: #25d366; }
.float-call { background: #0a84ff; }
.float-call svg { width: 24px; height: 24px; }
@keyframes float-pulse {
  0% { transform: scale(1); opacity: .6; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Footer — same layout as the content pages (css/page.css) */
.site-footer { border-top: 1px solid var(--card-border); margin-top: 3rem; padding-top: 2.5rem; font-size: .88rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; max-width: 1100px; margin: 0 auto; }
.footer-heading { font-family: var(--font-head); font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--cyan); margin: 0 0 .75rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--cyan); }
.site-footer address { font-style: normal; color: var(--text-2); line-height: 1.7; }
.footer-copy { text-align: center; color: var(--text-3); font-size: .8rem; margin: 2rem 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .menu-grid {
    display: none; position: fixed; top: 66px; left: 1rem; right: 1rem;
    flex-direction: column; gap: .25rem; background: rgba(10,10,18,0.96);
    border: 1px solid var(--card-border); border-radius: 16px; padding: .75rem;
    backdrop-filter: blur(14px);
  }
  .menu-grid.open { display: flex; }
  .menu-toggle { display: flex; }
  .value-cards, .why-grid { grid-template-columns: 1fr; }
  .about-inner, .contact-inner { grid-template-columns: 1fr; }
  .service-panel {
    top: auto; bottom: 1rem; left: 1rem; right: 1rem; transform: translateY(20px); width: auto;
    max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); overflow-y: auto;
  }
  .service-panel.open { transform: translateY(0); }
  /* On desktop this floats absolutely beside the scene; on mobile there's no hover to
     anchor it to, so let it flow inline under the lead paragraph instead of hiding it. */
  .service-hint { position: static; text-align: left; max-width: none; margin-top: -1rem; }
  .contact-info { padding-top: 0; }
  .form-row { flex-direction: column; }
  .service-index { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .metric-strip { gap: 1.25rem; }
  .float-contact { right: 14px; bottom: 14px; gap: 12px; }
  .float-btn { width: 50px; height: 50px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: opacity .3s ease; transform: none !important; }
  .tech-track { animation: none; }
  .scroll-hint span { animation: none; }
  .float-btn::before { animation: none; opacity: 0; }
}
