/* =========================================================
   InnovGates — main stylesheet
   Colors and fonts are set once in :root below.
   ========================================================= */

:root {
  --bg: #05060f;
  --bg-2: #0b0d1f;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.10);
  --text: #eef0ff;
  --muted: #a2a7c7;
  --primary: #7c5cff;
  --accent: #22d3ee;
  --pink: #f472b6;
  --grad: linear-gradient(135deg, #7c5cff 0%, #22d3ee 55%, #f472b6 100%);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font-head: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --container: 1200px;
  --header-h: 72px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, video, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }

.container { width: min(100% - 32px, var(--container)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 1000; background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

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

/* ---------- Background glow ---------- */
.bg-orbs { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-orbs span { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .35; }
.bg-orbs span:nth-child(1) { width: 520px; height: 520px; background: #7c5cff; top: -160px; left: -140px; }
.bg-orbs span:nth-child(2) { width: 460px; height: 460px; background: #22d3ee; bottom: -180px; right: -120px; opacity: .22; }
.bg-orbs span:nth-child(3) { width: 360px; height: 360px; background: #f472b6; top: 45%; left: 55%; opacity: .14; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(5, 6, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: var(--border);
}
.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; }
.brand img { width: 36px; height: 36px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: .95rem; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.btn-primary { color: #fff; }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; padding: 10px; }
.nav-toggle span { display: block; height: 2px; background: var(--text); margin: 5px 0; transition: transform .3s, opacity .3s; border-radius: 2px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s;
  white-space: nowrap;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px rgba(124, 92, 255, .35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(124, 92, 255, .5); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); transform: translateY(-2px); }
.btn-sm { padding: 9px 16px; font-size: .85rem; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--header-h) + 40px) 0 80px; overflow: hidden; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-fallback { position: absolute; inset: 0; z-index: 0; background: radial-gradient(circle at 70% 45%, rgba(124, 92, 255, .35), transparent 45%), radial-gradient(circle at 80% 70%, rgba(34, 211, 238, .25), transparent 40%); }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 160px; background: linear-gradient(to bottom, transparent, var(--bg)); z-index: 1; pointer-events: none; }
.hero-content { position: relative; z-index: 2; max-width: 680px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: .85rem; font-weight: 500; margin-bottom: 22px;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); font-weight: 700; margin-bottom: 20px; }
.hero p.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 560px; margin-bottom: 32px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 36px; margin-top: 52px; }
.hero-stats strong { display: block; font-family: var(--font-head); font-size: 1.9rem; }
.hero-stats span { color: var(--muted); font-size: .9rem; }
.scroll-hint { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 2; width: 26px; height: 42px; border: 2px solid var(--border); border-radius: 20px; }
.scroll-hint::before { content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; background: var(--text); border-radius: 2px; animation: scrollDot 1.8s infinite; }
@keyframes scrollDot { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Sections ---------- */
section { position: relative; }
.section { padding: 110px 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 60px; }
.section-head .tag { display: inline-block; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 14px; }
.section-head h2 { font-size: clamp(2rem, 4vw, 3rem); }
.section-head p { color: var(--muted); font-size: 1.08rem; }

/* ---------- Glass card + 3D tilt ---------- */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px; transition: border-color .3s, background .3s; transform-style: preserve-3d;
}
.card:hover { border-color: rgba(124, 92, 255, .5); background: var(--surface-2); }
.tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .15s ease-out, border-color .3s, background .3s; will-change: transform; }
.tilt .lift { transform: translateZ(40px); }
.card .glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .10), transparent 45%); opacity: 0; transition: opacity .3s; }
.card:hover .glare { opacity: 1; }

/* ---------- Services ---------- */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.service-icon {
  width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(124, 92, 255, .25), rgba(34, 211, 238, .18)); border: 1px solid var(--border);
}
.service-icon svg { width: 28px; height: 28px; stroke: #fff; }
.card h3 { font-size: 1.3rem; }
.card p { color: var(--muted); margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: .78rem; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--border); color: var(--muted); }

/* ---------- Process ---------- */
.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: step; }
.process .card::before {
  counter-increment: step; content: "0" counter(step);
  display: block; font-family: var(--font-head); font-size: 2.6rem; font-weight: 700; margin-bottom: 10px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Portfolio ---------- */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 40px; }
.filters button { background: var(--surface); border: 1px solid var(--border); color: var(--muted); padding: 8px 18px; border-radius: 999px; cursor: pointer; font-size: .9rem; transition: all .2s; }
.filters button.active, .filters button:hover { color: #fff; border-color: var(--primary); background: rgba(124, 92, 255, .18); }
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 24px; }
.project { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.project.hidden { display: none; }
.project-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-2); }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.project:hover .project-thumb img { transform: scale(1.06); }
.play-btn {
  position: absolute; left: 16px; bottom: 16px; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(5, 6, 15, .6); backdrop-filter: blur(6px); display: grid; place-items: center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); transition: transform .25s, background .25s;
}
.play-btn:hover { transform: scale(1.1); background: var(--primary); }
.play-btn svg { width: 22px; height: 22px; fill: #fff; margin-left: 3px; }
.project-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.project-cat { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.project-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 18px; }
.portfolio-note { text-align: center; color: var(--muted); margin-top: 40px; font-size: .95rem; }

/* ---------- Tech marquee ---------- */
.marquee { overflow: hidden; 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; gap: 16px; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track li { padding: 12px 22px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-weight: 500; white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Why us ---------- */
.why { display: grid; grid-template-columns: 1.1fr 1fr; gap: 60px; align-items: center; }
.why-list li { display: flex; gap: 16px; margin-bottom: 22px; }
.why-list .check { flex: 0 0 32px; height: 32px; border-radius: 10px; background: rgba(34, 211, 238, .14); display: grid; place-items: center; color: var(--accent); font-weight: 700; }
.why-list h3 { font-size: 1.1rem; margin-bottom: 4px; }
.why-list p { color: var(--muted); margin: 0; }
.cube-wrap { perspective: 1000px; display: grid; place-items: center; min-height: 360px; }
.cube { position: relative; width: 200px; height: 200px; transform-style: preserve-3d; animation: spin 18s linear infinite; }
.cube div {
  position: absolute; inset: 0; border: 1px solid rgba(124, 92, 255, .6); border-radius: 18px;
  background: linear-gradient(135deg, rgba(124, 92, 255, .18), rgba(34, 211, 238, .10));
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.cube div:nth-child(1) { transform: translateZ(100px); }
.cube div:nth-child(2) { transform: rotateY(180deg) translateZ(100px); }
.cube div:nth-child(3) { transform: rotateY(90deg) translateZ(100px); }
.cube div:nth-child(4) { transform: rotateY(-90deg) translateZ(100px); }
.cube div:nth-child(5) { transform: rotateX(90deg) translateZ(100px); }
.cube div:nth-child(6) { transform: rotateX(-90deg) translateZ(100px); }
@keyframes spin { from { transform: rotateX(-18deg) rotateY(0); } to { transform: rotateX(-18deg) rotateY(360deg); } }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; margin: 0 auto; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; padding: 0 22px; transition: border-color .3s; }
.faq details[open] { border-color: rgba(124, 92, 255, .5); }
.faq summary { cursor: pointer; padding: 20px 0; font-weight: 600; font-family: var(--font-head); font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--accent); transition: transform .3s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding-bottom: 20px; margin: 0; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; }
.contact-info li { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }
.contact-info .ico { flex: 0 0 44px; height: 44px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; }
.contact-info .ico svg { width: 20px; height: 20px; stroke: var(--accent); }
.contact-info small { color: var(--muted); display: block; }
.contact-info a:hover { color: var(--accent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-size: .88rem; font-weight: 500; margin-bottom: 6px; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 13px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: rgba(0, 0, 0, .25); color: var(--text); font: inherit; transition: border-color .2s, box-shadow .2s;
}
select option { background: var(--bg-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124, 92, 255, .25); }
textarea { min-height: 140px; resize: vertical; }
.hp { position: absolute; left: -9999px; }
.form-status { margin-top: 14px; font-size: .95rem; min-height: 1.5em; }
.form-status.ok { color: #4ade80; }
.form-status.err { color: #f87171; }
.form-status .fallback-link { color: var(--accent); font-weight: 600; text-decoration: underline; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; padding: 70px 30px; border-radius: 28px; background: linear-gradient(135deg, rgba(124, 92, 255, .25), rgba(34, 211, 238, .14)); border: 1px solid var(--border); }
.cta-band h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
.cta-band p { color: var(--muted); max-width: 560px; margin: 0 auto 28px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 60px 0 30px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.site-footer h4 { font-size: 1rem; margin-bottom: 16px; }
.site-footer li { margin-bottom: 10px; }
.site-footer a, .site-footer p { color: var(--muted); font-size: .93rem; }
.site-footer a:hover { color: var(--text); }
.socials { display: flex; gap: 10px; margin-top: 16px; }
.socials a { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); }
.socials a:hover { border-color: var(--primary); }
.socials svg { width: 18px; height: 18px; fill: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border); margin-top: 40px; padding-top: 24px; }
.footer-bottom p { margin: 0; font-size: .85rem; }

/* ---------- Video modal ---------- */
.modal { position: fixed; inset: 0; z-index: 500; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .82); backdrop-filter: blur(6px); }
.modal.open { display: flex; }
.modal-inner { position: relative; width: min(960px, 100%); aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); }
.modal-inner video, .modal-inner iframe { width: 100%; height: 100%; border: 0; }
.modal-close { position: absolute; top: 16px; right: 16px; z-index: 2; color: #fff; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-size: 1.4rem; line-height: 1; }
.modal-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); }

/* ---------- Inner pages ---------- */
.page-hero { padding: calc(var(--header-h) + 80px) 0 50px; text-align: center; }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.page-hero p { color: var(--muted); max-width: 680px; margin: 0 auto; font-size: 1.1rem; }
.breadcrumb { display: flex; justify-content: center; gap: 8px; color: var(--muted); font-size: .88rem; margin-bottom: 18px; }
.breadcrumb a:hover { color: var(--text); }
.prose { max-width: 800px; margin: 0 auto; }
.prose h2 { font-size: 1.6rem; margin-top: 1.6em; }
.prose p, .prose li { color: var(--muted); }
.prose ul { list-style: disc; padding-left: 1.3em; margin-bottom: 1em; }
.prose a { color: var(--accent); text-decoration: underline; }
.video-frame { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #000; margin-bottom: 40px; }
.video-frame video, .video-frame iframe { width: 100%; height: 100%; border: 0; }
.meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 40px; }
.meta-grid .card { padding: 20px; }
.meta-grid small { display: block; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin: 0 0 30px; }
.gallery figure { margin: 0; padding: 0; overflow: hidden; }
.gallery img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.gallery figcaption { padding: 12px 16px; font-size: .9rem; color: var(--muted); }
.page-hero .eyebrow { margin-bottom: 16px; }
@media (max-width: 600px) { .gallery { grid-template-columns: 1fr; } }
.doc-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 10px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .process { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .meta-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: #05060f; border-bottom: 1px solid var(--border); padding: 12px 16px 20px;
    transform: translateY(-120%); transition: transform .35s ease; visibility: hidden;
  }
  .nav-links.open { transform: none; visibility: visible; }
  .nav-links a { padding: 14px 4px; border-bottom: 1px solid var(--border); font-size: 1.05rem; }
  .nav-links .btn { margin-top: 14px; border-bottom: 0; }
  .why, .contact { grid-template-columns: 1fr; }
  .cube-wrap { min-height: 280px; }
  #hero-canvas { opacity: .55; }
  .section { padding: 80px 0; }
}
@media (max-width: 600px) {
  .services-grid, .process, .form-grid, .footer-grid, .meta-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 24px; }
  .card { padding: 24px; }
  .cta-band { padding: 50px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
