/* ============================================================
   MARSOFT — design tokens
   ============================================================ */
:root{
  --bg-0: #0a0714;
  --bg-1: #0e0a1c;
  --bg-2: #150e29;

  --violet: #7c5cf0;
  --violet-2: #b9a6ff;
  --lilac: #6a7bf0;
  --lilac-2: #a9b4ff;

  --violet-rgb: 124,92,240;
  --violet-2-rgb: 185,166,255;
  --lilac-rgb: 106,123,240;
  --lilac-2-rgb: 169,180,255;

  --ink: #f4f1fb;
  --ink-dim: #ada5c9;
  --ink-faint: #726c8c;

  --shadow-rgb: 4,2,14;
  --specular-edge: rgba(255,255,255,.08);

  --glass-bg: linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,.02));
  --glass-bg-strong: linear-gradient(135deg, rgba(255,255,255,.13), rgba(255,255,255,.03));
  --glass-border: rgba(255,255,255,.14);
  --glass-border-hi: rgba(255,255,255,.32);
  --glass-shadow: 0 10px 40px rgba(var(--shadow-rgb),.5), inset 0 1px 0 rgba(255,255,255,.16);

  --ghost-bg: rgba(255,255,255,.04);
  --ghost-bg-hover: rgba(255,255,255,.09);
  --btn-ink: #f8f6ff;

  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;

  --ease: cubic-bezier(.16,.84,.32,1);
  --ease-soft: cubic-bezier(.22,.61,.36,1);

  --container: 1180px;

  color-scheme: dark;
}

html[data-theme="light"]{
  --bg-0: #f3f0fb;
  --bg-1: #ece5fa;
  --bg-2: #e3d9f7;

  --violet: #6d4fd6;
  --violet-2: #8f74e8;
  --lilac: #4c5bd8;
  --lilac-2: #7382e8;

  --violet-rgb: 109,79,214;
  --violet-2-rgb: 143,116,232;
  --lilac-rgb: 76,91,216;
  --lilac-2-rgb: 115,130,232;

  --ink: #1c1430;
  --ink-dim: #4f4768;
  --ink-faint: #645e7a;

  --shadow-rgb: 76,60,140;
  --specular-edge: rgba(90,70,150,.14);

  --glass-bg: linear-gradient(135deg, rgba(255,255,255,.72), rgba(255,255,255,.38));
  --glass-bg-strong: linear-gradient(135deg, rgba(255,255,255,.86), rgba(255,255,255,.5));
  --glass-border: rgba(90,70,150,.16);
  --glass-border-hi: rgba(90,70,150,.34);
  --glass-shadow: 0 10px 34px rgba(var(--shadow-rgb),.16), inset 0 1px 0 rgba(255,255,255,.65);

  --ghost-bg: rgba(90,70,150,.06);
  --ghost-bg-hover: rgba(90,70,150,.12);

  color-scheme: light;
}

*,*::before,*::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin:0;
  background: var(--bg-0);
  color: var(--ink);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .5s var(--ease), color .5s var(--ease);
}

h1,h2,h3{
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
  color: var(--ink);
}

p{ margin: 0 0 1em; color: var(--ink-dim); }
a{ color: inherit; text-decoration: none; }
ul{ list-style: none; margin:0; padding:0; }
svg{ display:block; }

.container{
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

.text-accent{
  background: linear-gradient(100deg, var(--violet-2), var(--lilac-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow{
  display:inline-block;
  font-family:'Space Grotesk', sans-serif;
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--lilac-2);
  margin-bottom: 14px;
}
html[data-theme="light"] .eyebrow{ color: var(--violet); }

/* ============================================================
   Background field: animated liquid blobs + grain
   ============================================================ */
.bg-field{
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.bg-field .blob{
  position:absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .55;
  will-change: transform;
  transition: opacity .5s ease;
}
.blob-a{
  width: 620px; height: 620px;
  top: -160px; left: -120px;
  background: radial-gradient(circle at 30% 30%, var(--violet), transparent 70%);
  animation: drift1 26s ease-in-out infinite;
}
.blob-b{
  width: 560px; height: 560px;
  top: 30%; right: -180px;
  background: radial-gradient(circle at 60% 40%, var(--lilac), transparent 70%);
  animation: drift2 32s ease-in-out infinite;
}
.blob-c{
  width: 480px; height: 480px;
  bottom: -200px; left: 20%;
  background: radial-gradient(circle at 50% 50%, var(--violet-2), transparent 72%);
  opacity: .35;
  animation: drift3 38s ease-in-out infinite;
}
html[data-theme="light"] .blob-a,
html[data-theme="light"] .blob-b{ opacity: .3; }
html[data-theme="light"] .blob-c{ opacity: .16; }
@keyframes drift1{
  0%,100%{ transform: translate(0,0) scale(1); }
  50%{ transform: translate(60px,80px) scale(1.12); }
}
@keyframes drift2{
  0%,100%{ transform: translate(0,0) scale(1); }
  50%{ transform: translate(-70px,-40px) scale(1.08); }
}
@keyframes drift3{
  0%,100%{ transform: translate(0,0) scale(1); }
  50%{ transform: translate(40px,-60px) scale(1.15); }
}
.grain{
  position:absolute; inset:0;
  background-image: radial-gradient(rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
  opacity: .5;
}

.cursor-glow{
  position: fixed;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--violet-rgb),.16), rgba(var(--lilac-rgb),.09) 45%, transparent 70%);
  transform: translate(-50%,-50%);
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
  transition: opacity .3s ease;
  opacity: 0;
}
html[data-theme="light"] .cursor-glow{ mix-blend-mode: multiply; }
@media (hover:hover) and (pointer:fine){
  .cursor-glow.active{ opacity: 1; }
}

.scroll-progress{
  position: fixed; top:0; left:0; height: 3px;
  background: linear-gradient(90deg, var(--violet), var(--lilac));
  width: 0%;
  z-index: 500;
  transition: width .1s linear;
}

/* ============================================================
   Glass surface
   ============================================================ */
.glass{
  background: var(--glass-bg);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-md);
  position: relative;
  transition: background .5s var(--ease), border-color .5s var(--ease), box-shadow .5s var(--ease);
}
.glass::before{
  content:'';
  position:absolute; inset:0;
  border-radius: inherit;
  padding:1px;
  background: linear-gradient(135deg, rgba(255,255,255,.35), transparent 40%, transparent 70%, var(--specular-edge));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ============================================================
   Nav
   ============================================================ */
.nav{
  position: fixed;
  top: 18px; left: 0; right: 0;
  z-index: 400;
  padding: 0 20px;
}
.nav-inner{
  max-width: var(--container);
  margin: 0 auto;
  display:flex; align-items:center; gap: 24px;
  padding: 10px 14px 10px 18px;
  border-radius: 999px;
  transition: background .4s var(--ease), box-shadow .4s var(--ease);
}
.nav.scrolled .nav-inner{
  background: var(--glass-bg-strong);
  box-shadow: 0 12px 40px rgba(var(--shadow-rgb),.5), inset 0 1px 0 rgba(255,255,255,.2);
}

.brand{ display:flex; align-items:center; gap:10px; margin-right: auto; }
.brand-word{
  font-family:'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
}
.brand-mark{
  position: relative;
  width: 30px; height: 30px;
  flex: none;
}
.brand-mark.small{ width:24px; height:24px; }
.brand-core{
  position:absolute; inset: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 32%, var(--violet-2), var(--violet) 70%);
  box-shadow: 0 0 14px rgba(var(--violet-rgb),.7);
}
.brand-mark.small .brand-core{ inset:6px; }
.brand-ring{
  position:absolute; inset:0;
  border: 1.5px solid var(--lilac-2);
  border-radius: 50%;
  opacity: .8;
  transform: rotate(-20deg);
  border-top-color: transparent;
  border-right-color: transparent;
}

.nav-links{ display:flex; gap: 28px; }
.nav-link{
  font-size: .92rem;
  color: var(--ink-dim);
  position: relative;
  padding: 6px 2px;
  transition: color .25s ease;
}
.nav-link::after{
  content:'';
  position:absolute; left:0; bottom:0;
  width:0; height:1.5px;
  background: linear-gradient(90deg, var(--violet-2), var(--lilac-2));
  transition: width .3s var(--ease);
}
.nav-link:hover{ color: var(--ink); }
.nav-link:hover::after{ width: 100%; }

.nav-cta{ flex: none; }

.theme-toggle{
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  display: flex; align-items:center; justify-content:center;
  cursor: pointer;
  color: var(--ink);
  flex: none;
  padding: 0;
  transition: transform .35s var(--ease), border-color .3s ease;
}
.theme-toggle:hover{ transform: rotate(-14deg) scale(1.06); border-color: var(--glass-border-hi); }
.theme-toggle svg{ width: 18px; height: 18px; }
.theme-toggle .icon-sun{ display: none; }
html[data-theme="light"] .theme-toggle .icon-moon{ display: none; }
html[data-theme="light"] .theme-toggle .icon-sun{ display: block; }

.nav-toggle{
  display:none;
  flex-direction:column; justify-content:center; gap:5px;
  width: 38px; height: 38px;
  background: transparent; border:none; cursor:pointer;
  flex: none;
}
.nav-toggle span{
  display:block; height:2px; width:100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn{
  --btn-pad-y: 14px;
  --btn-pad-x: 26px;
  display: inline-flex;
  align-items:center; justify-content:center;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border-radius: 999px;
  font-family:'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .4s ease, border-color .4s ease;
}
.btn span{ position:relative; z-index:2; }
.btn:hover{ transform: translateY(-2px); }
.btn:active{ transform: translateY(0); }

.btn-primary{
  background: linear-gradient(120deg, var(--violet), #4b3aa0);
  color: var(--btn-ink);
  box-shadow: 0 10px 30px rgba(var(--violet-rgb),.35);
}
.btn-primary::before{
  content:'';
  position:absolute; inset:0;
  background: linear-gradient(120deg, var(--violet-2), var(--lilac));
  opacity:0;
  transition: opacity .35s ease;
  z-index: 1;
}
.btn-primary:hover::before{ opacity: 1; }
.btn-primary:hover{ box-shadow: 0 14px 36px rgba(var(--violet-rgb),.5); }

.btn-ghost{
  background: var(--ghost-bg);
  border-color: var(--glass-border);
  color: var(--ink);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover{
  background: var(--ghost-bg-hover);
  border-color: var(--glass-border-hi);
}

.btn-small{ --btn-pad-y: 10px; --btn-pad-x: 20px; font-size: .86rem; }
.btn-full{ width: 100%; }

.ripple{
  position:absolute;
  border-radius:50%;
  background: rgba(255,255,255,.5);
  transform: scale(0);
  animation: ripple .6s ease-out;
  pointer-events:none;
  z-index: 1;
}
@keyframes ripple{ to{ transform: scale(3); opacity:0; } }

/* ============================================================
   Reveal on scroll
   ============================================================ */
.reveal{
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease-soft), transform .8s var(--ease-soft);
}
.reveal.in-view{ opacity: 1; transform: translateY(0); }
.js .reveal{ transition-delay: var(--delay, 0s); }

/* ============================================================
   Hero
   ============================================================ */
.hero{
  position: relative;
  z-index: 2;
  padding: 200px 0 120px;
  min-height: 92vh;
  display:flex;
  align-items:center;
}
.hero-grid{
  display:grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 60px;
  align-items:center;
}
.hero-title{
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  margin-bottom: .5em;
}
.hero-sub{
  font-size: 1.08rem;
  max-width: 520px;
  margin-bottom: 2em;
}
.hero-actions{
  display:flex; gap: 16px; flex-wrap: wrap;
  margin-bottom: 3em;
}
.hero-stats{
  display:flex; gap: 40px; flex-wrap: wrap;
}
.stat{ display:flex; flex-direction:column; }
.stat-num{
  font-family:'Space Grotesk', sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--ink);
}
.stat-label{ font-size: .82rem; color: var(--ink-faint); }

.hero-visual{ position: relative; height: 500px; }
.orbit-scene{
  position: relative;
  width: 100%; height: 100%;
}
.orbit-glow{
  position:absolute; top:50%; left:50%;
  width: 260px; height:260px;
  transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(var(--violet-rgb),.35), transparent 70%);
  filter: blur(30px);
  animation: pulseGlow 5s ease-in-out infinite;
}
@keyframes pulseGlow{
  0%,100%{ opacity:.7; transform: translate(-50%,-50%) scale(1); }
  50%{ opacity:1; transform: translate(-50%,-50%) scale(1.15); }
}
.planet-photo,
.planet-svg{
  position:absolute; top:50%; left:50%;
  width: 116px; height:116px;
  margin: -58px 0 0 -58px;
  border-radius: 50%;
  filter: drop-shadow(0 0 22px rgba(var(--violet-rgb),.55)) drop-shadow(0 0 46px rgba(var(--violet-rgb),.3));
  animation: planetSpin 90s linear infinite;
}
.planet-photo{
  object-fit: cover;
}
/* Same photo in both themes (true alpha-cut PNG, no blend-mode trick).
   The procedural SVG only shows if the photo fails to load. */
.planet-svg{ display: none; }
.orbit-scene.planet-fallback .planet-photo{ display: none; }
.orbit-scene.planet-fallback .planet-svg{ display: block; }
@keyframes planetSpin{
  from{ transform: rotate(0deg); }
  to{ transform: rotate(360deg); }
}
.orbit-ring{
  position:absolute; top:50%; left:50%;
  border: 1px solid var(--glass-border-hi);
  border-radius: 50%;
  transform: translate(-50%,-50%) rotate(-25deg);
}
.ring-1{ width: 200px; height:200px; animation: spin 22s linear infinite; }
.ring-2{ width: 300px; height:300px; border-color: rgba(var(--lilac-2-rgb),.22); animation: spin 34s linear infinite reverse; }
.ring-3{ width: 390px; height:390px; animation: spin 48s linear infinite; }
@keyframes spin{ to{ transform: translate(-50%,-50%) rotate(335deg); } }

.tech-orbit{ position:absolute; inset:0; }
.tech-badge{
  position:absolute; top:50%; left:50%;
  padding: 6px 13px;
  border-radius: 999px;
  font-family:'Space Grotesk', sans-serif;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--ink);
  white-space: nowrap;
  animation-name: techOrbit;
  animation-duration: var(--dur);
  animation-delay: var(--delay);
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.tech-badge.rev{ animation-direction: reverse; }
@keyframes techOrbit{
  from{ transform: translate(-50%,-50%) rotate(-25deg) translateX(var(--radius)) rotate(25deg); }
  to{ transform: translate(-50%,-50%) rotate(335deg) translateX(var(--radius)) rotate(-335deg); }
}

.dot{ width:8px; height:8px; border-radius:50%; flex: none; display:inline-block; }
.dot-violet{ background: var(--violet-2); box-shadow: 0 0 8px var(--violet-2); }
.dot-lilac{ background: var(--lilac-2); box-shadow: 0 0 8px var(--lilac-2); }
.dot.pulse{ animation: dotPulse 2.4s ease-in-out infinite; }
@keyframes dotPulse{
  0%,100%{ opacity:1; transform: scale(1); }
  50%{ opacity:.5; transform: scale(1.3); }
}

.scroll-cue{
  position:absolute; bottom: 34px; left:50%;
  transform: translateX(-50%);
  width: 22px; height: 36px;
  border: 1.5px solid var(--glass-border-hi);
  border-radius: 20px;
}
.scroll-cue span{
  position:absolute; top:6px; left:50%;
  width:4px; height:4px;
  margin-left:-2px;
  border-radius:50%;
  background: var(--lilac-2);
  animation: cueMove 1.8s ease-in-out infinite;
}
@keyframes cueMove{
  0%{ opacity:1; transform: translateY(0); }
  70%{ opacity:0; transform: translateY(14px); }
  100%{ opacity:0; }
}

/* ============================================================
   Sections generic
   ============================================================ */
section{ position:relative; z-index:2; padding: 120px 0; }
.section-head{ max-width: 640px; margin: 0 auto 64px; text-align:center; }
.section-head h2{ font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
.section-sub{ font-size: 1.02rem; }
.section-head .section-sub{ margin: 0 auto; }

/* ============================================================
   Services
   ============================================================ */
.services-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.service-card{
  padding: 30px 26px;
  overflow: hidden;
  transition: transform .45s var(--ease), border-color .45s ease, box-shadow .45s ease;
}
.service-card::after{
  content:'';
  position:absolute; top:0; left:-60%;
  width: 50%; height:100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.14), transparent);
  transform: skewX(-20deg);
  transition: left .8s var(--ease);
}
.service-card:hover::after{ left: 130%; }
.service-card:hover{
  transform: translateY(-6px);
  border-color: var(--glass-border-hi);
  box-shadow: 0 20px 50px rgba(var(--shadow-rgb),.5), inset 0 1px 0 rgba(255,255,255,.2);
}
.service-icon{
  width: 52px; height:52px;
  display:flex; align-items:center; justify-content:center;
  border-radius: 14px;
  margin-bottom: 20px;
  color: var(--violet-2);
  background: linear-gradient(135deg, rgba(var(--violet-rgb),.18), rgba(var(--lilac-rgb),.08));
  border: 1px solid var(--glass-border);
}
.service-icon svg{ width: 26px; height:26px; }
.service-card:nth-child(even) .service-icon{ color: var(--lilac-2); }
.service-card h3{ font-size: 1.12rem; margin-bottom: .4em; }
.service-card p{ font-size: .92rem; margin-bottom: 0; }

/* ============================================================
   Projects page
   ============================================================ */
.nav-link.is-active{ color: var(--ink); }
.nav-link.is-active::after{ width: 100%; }

.projects-hero{
  min-height: auto;
  padding: 190px 0 60px;
  display: block;
}
.projects-intro{ max-width: 680px; }
.projects-intro .hero-sub{ max-width: 100%; }

.projects-section{ padding-top: 40px; }
.projects-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.project-card{
  overflow: hidden;
  padding: 14px;
  cursor: pointer;
  outline: none;
  transition: transform .4s var(--ease), border-color .4s ease, box-shadow .4s ease;
}
/* Fallback for touch / reduced-motion / no-JS: the JS tilt effect (see
   js/main.js) takes over with inline transforms on capable pointers and
   overrides this; this rule keeps a sensible lift on everything else. */
.project-card:hover,
.project-card:focus-visible{
  transform: translateY(-6px);
  border-color: var(--glass-border-hi);
  box-shadow: 0 20px 50px rgba(var(--shadow-rgb),.5), inset 0 1px 0 rgba(255,255,255,.2);
}
.project-card::after{
  content:'';
  position:absolute; top:0; left:-60%;
  width: 50%; height:100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.14), transparent);
  transform: skewX(-20deg);
  transition: left .8s var(--ease);
  pointer-events: none;
}
.project-card:hover::after{ left: 130%; }

.project-shot{
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(var(--violet-rgb),.16), rgba(var(--lilac-rgb),.08));
  border: 1px solid var(--glass-border);
  display:flex; align-items:center; justify-content:center;
}
.shot-mesh{
  position:absolute; inset: -30%;
  background:
    radial-gradient(circle at 28% 32%, rgba(var(--violet-rgb),.4), transparent 60%),
    radial-gradient(circle at 72% 68%, rgba(var(--lilac-rgb),.32), transparent 60%);
  filter: blur(30px);
  animation: shotDrift 12s ease-in-out infinite;
}
@keyframes shotDrift{
  0%,100%{ transform: translate(0,0) scale(1); }
  50%{ transform: translate(4%,-3%) scale(1.08); }
}
.shot-grid{
  position:absolute; inset:0;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: .6;
}
.shot-icon{
  position: relative; z-index: 1;
  width: 25%; height:25%;
  color: var(--violet-2);
  filter: drop-shadow(0 0 20px rgba(var(--violet-rgb),.5));
  transition: transform .4s var(--ease);
}
.project-card:hover .shot-icon{ transform: scale(1.08); }
.shot-badge{
  position:absolute; top:12px; right:12px; z-index:1;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: .64rem;
  font-family: 'Space Grotesk', sans-serif;
  background: rgba(var(--shadow-rgb),.4);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: var(--ink-dim);
}

.project-body{ padding: 20px 12px 10px; }
.project-tag{
  font-family:'Space Grotesk', sans-serif;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--lilac-2);
  margin-bottom: 8px;
}
html[data-theme="light"] .project-tag{ color: var(--violet); }
.project-body h3{ font-size: 1.15rem; margin-bottom: .4em; }
.project-body p:not(.project-tag){ font-size: .9rem; margin-bottom: 14px; }
.project-more{
  display:inline-flex; align-items:center; gap: 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: .84rem;
  font-weight: 600;
  color: var(--lilac-2);
}
.project-more svg{ width: 15px; height:15px; transition: transform .3s var(--ease); }
.project-card:hover .project-more svg{ transform: translateX(4px); }

.custom-dev{ padding-top: 20px; }
.custom-dev-panel{
  display:flex; align-items:center; gap: 32px;
  padding: 42px 44px;
  flex-wrap: wrap;
}
.custom-dev-icon{
  flex: none;
  width: 68px; height:68px;
  display:flex; align-items:center; justify-content:center;
  border-radius: 18px;
  color: var(--violet-2);
  background: linear-gradient(135deg, rgba(var(--violet-rgb),.2), rgba(var(--lilac-rgb),.1));
  border: 1px solid var(--glass-border);
}
.custom-dev-icon svg{ width: 34px; height:34px; }
.custom-dev-copy{ flex: 1 1 320px; }
.custom-dev-copy h2{ font-size: clamp(1.4rem, 2.6vw, 1.8rem); margin-bottom: .3em; }
.custom-dev-copy p{ margin-bottom: 0; }
.custom-dev-panel .btn{ flex: none; }

.tech-showcase{ padding-top: 20px; }
.tech-wall{
  display:flex; flex-wrap:wrap; justify-content:center; gap: 12px;
  max-width: 840px; margin: 0 auto;
}
.tech-chip{
  padding: 12px 22px;
  border-radius: 999px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink);
  transition: transform .3s var(--ease), border-color .3s ease, box-shadow .3s ease;
}
.tech-chip:hover{
  transform: translateY(-4px) scale(1.05);
  border-color: var(--glass-border-hi);
  box-shadow: 0 12px 26px rgba(var(--violet-rgb),.3);
}

/* ============================================================
   Project detail modal
   ============================================================ */
.project-modal{
  position: fixed; inset: 0;
  z-index: 600;
  display: flex; align-items:center; justify-content:center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.project-modal.open{ opacity: 1; pointer-events: auto; }
.project-modal-backdrop{
  position: absolute; inset: 0;
  background: rgba(var(--shadow-rgb),.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.project-modal-panel{
  position: relative; z-index: 1;
  width: min(920px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  border-radius: var(--radius-lg);
  transform: scale(.94) translateY(16px);
  opacity: 0;
  transition: transform .35s var(--ease), opacity .3s ease;
}
.project-modal.open .project-modal-panel{ transform: scale(1) translateY(0); opacity: 1; }

.project-modal-close{
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 36px; height:36px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  background: rgba(var(--shadow-rgb),.45);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: var(--ink);
  cursor: pointer;
  transition: transform .3s var(--ease), border-color .3s ease;
}
.project-modal-close:hover{ transform: rotate(90deg); border-color: var(--glass-border-hi); }
.project-modal-close svg{ width: 16px; height:16px; }

.modal-media{ position: relative; min-height: 280px; }
.modal-shot{
  position: relative;
  height: 100%; min-height: 280px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(var(--violet-rgb),.18), rgba(var(--lilac-rgb),.09));
  display:flex; align-items:center; justify-content:center;
}
.modal-shot .shot-icon{ width: 30%; height:30%; transition: opacity .3s ease; }
.modal-img{
  display:none;
  position: absolute; inset: 0;
  width: 100%; height:100%;
  object-fit: cover;
}
.modal-shot.has-image .shot-mesh,
.modal-shot.has-image .shot-grid,
.modal-shot.has-image .shot-icon{ opacity: 0; }
.modal-shot.has-image .modal-img{ display:block; }

.modal-nav{
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height:38px; border-radius: 50%;
  display: none; align-items:center; justify-content:center;
  background: rgba(var(--shadow-rgb),.5);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: var(--ink);
  cursor: pointer;
  z-index: 1;
  transition: border-color .3s ease, transform .3s ease;
}
.modal-nav:hover{ border-color: var(--glass-border-hi); }
.modal-nav svg{ width:18px; height:18px; }
.modal-prev{ left: 14px; }
.modal-next{ right: 14px; }
.modal-nav.show{ display:flex; }

.modal-dots{
  position: absolute; bottom: 14px; left: 50%;
  transform: translateX(-50%);
  display: none; gap: 6px;
  z-index: 1;
}
.modal-dots.show{ display:flex; }
.modal-dot{
  width: 6px; height:6px; border-radius: 50%;
  background: rgba(255,255,255,.4);
  cursor: pointer;
  transition: background .3s ease, transform .3s ease;
}
.modal-dot.active{ background: var(--lilac-2); transform: scale(1.3); }

.modal-info{
  padding: 40px 38px;
  display:flex; flex-direction:column;
}
.modal-info h3{ font-size: 1.55rem; margin-bottom: .35em; }
.modal-actions{ margin-top: auto; padding-top: 22px; display:flex; flex-direction:column; gap: 10px; align-items:flex-start; }
.modal-actions .btn{ display:none; }
.modal-actions .btn.show{ display:inline-flex; }
.modal-empty-note{
  font-size: .82rem;
  color: var(--ink-faint);
  margin: 0;
  display: none;
}
.modal-empty-note.show{ display:block; }

/* ============================================================
   About
   ============================================================ */
.about-grid{
  display:grid;
  grid-template-columns: 1fr .85fr;
  gap: 60px;
  align-items: center;
}
.values-list{ margin-top: 36px; display:flex; flex-direction:column; gap:14px; }
.value-item{
  display:flex; gap:18px; align-items:flex-start;
  padding: 20px 22px;
  transition: transform .35s var(--ease), border-color .35s ease;
}
.value-item:hover{ transform: translateX(6px); border-color: var(--glass-border-hi); }
.value-num{
  font-family:'Space Grotesk', sans-serif;
  font-weight:700;
  font-size: 1rem;
  color: var(--violet-2);
  padding-top: 2px;
}
.value-item h3{ font-size: 1rem; margin-bottom:.25em; }
.value-item p{ font-size: .88rem; margin-bottom:0; }

.panel-glass{
  padding: 36px 32px;
  overflow:hidden;
}
.panel-shine{
  position:absolute; top:-40%; left:-20%;
  width: 160%; height: 160%;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.12), transparent 55%);
  animation: shineMove 9s ease-in-out infinite;
}
@keyframes shineMove{
  0%,100%{ transform: translate(0,0); }
  50%{ transform: translate(6%, 5%); }
}
.panel-row{ display:flex; align-items:center; gap:14px; margin-bottom: 22px; position:relative; }
.panel-row:last-child{ margin-bottom:0; }
.panel-bar{
  flex:1; height:8px; border-radius:999px;
  background: rgba(255,255,255,.08);
  overflow:hidden;
}
.panel-bar span{
  display:block; height:100%; border-radius:999px;
  background: linear-gradient(90deg, var(--violet), var(--lilac));
  animation: barGrow 1.6s var(--ease-soft) both;
}
@keyframes barGrow{ from{ width:0 !important; } }

/* ============================================================
   Coverage
   ============================================================ */
.coverage-grid{
  display:grid;
  grid-template-columns: .85fr 1fr;
  gap: 60px;
  align-items:center;
}
.coverage-tags{ display:flex; gap:12px; flex-wrap:wrap; margin-top: 28px; }
.coverage-tags li{
  padding: 10px 18px;
  border-radius: 999px;
  font-size: .86rem;
  font-family:'Space Grotesk', sans-serif;
}
.coverage-visual{ display:flex; flex-direction:column; align-items:center; }

/* ============================================================
   Process
   ============================================================ */
.process-track{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.process-step{
  padding: 32px 26px;
  transition: transform .35s var(--ease), border-color .35s ease;
}
.process-step:hover{ transform: translateY(-6px); border-color: var(--glass-border-hi); }
.step-num{
  display:inline-flex; align-items:center; justify-content:center;
  width: 40px; height:40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--lilac));
  color: var(--btn-ink);
  font-family:'Space Grotesk', sans-serif;
  font-weight:700;
  margin-bottom: 18px;
}
.process-step h3{ font-size: 1.05rem; }
.process-step p{ font-size: .88rem; margin-bottom:0; }

/* ============================================================
   FAQ
   ============================================================ */
.faq-list{
  display:flex; flex-direction:column; gap: 14px;
  max-width: 760px; margin: 0 auto;
}
.faq-item{ overflow:hidden; }
.faq-question{
  width: 100%;
  display:flex; align-items:center; justify-content:space-between; gap: 16px;
  background: none; border: none; cursor: pointer; text-align: left;
  padding: 22px 26px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: .98rem;
  font-weight: 600;
  color: var(--ink);
}
.faq-icon{
  width: 20px; height:20px; flex: none;
  color: var(--lilac-2);
  transition: transform .35s var(--ease);
}
.faq-question[aria-expanded="true"] .faq-icon{ transform: rotate(180deg); }
.faq-answer{
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s var(--ease);
}
.faq-answer p{
  padding: 0 26px 22px;
  margin: 0;
  font-size: .92rem;
}

/* ============================================================
   Contact
   ============================================================ */
.contact-grid{
  display:grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 60px;
}
.contact-info{ margin-top: 28px; display:flex; flex-direction:column; gap: 14px; }
.contact-info li{
  display:flex; align-items:center; gap: 14px;
  padding: 16px 20px;
  font-size: .92rem;
}
.contact-info svg{ width:20px; height:20px; color: var(--lilac-2); flex:none; }

.contact-form{ padding: 34px; }
.form-row{ margin-bottom: 20px; }
.form-row label{
  display:block;
  font-size: .85rem;
  color: var(--ink-dim);
  margin-bottom: 8px;
}
.form-row .opt{ color: var(--ink-faint); font-size: .78rem; }
.form-row input,
.form-row textarea{
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: var(--ink);
  font-family: 'Manrope', sans-serif;
  font-size: .95rem;
  resize: vertical;
  transition: border-color .3s ease, background .3s ease;
}
html[data-theme="light"] .form-row input,
html[data-theme="light"] .form-row textarea{
  background: rgba(255,255,255,.5);
}
.form-row input:focus,
.form-row textarea:focus{
  outline:none;
  border-color: var(--lilac-2);
  background: rgba(255,255,255,.08);
}
.form-note{
  margin: 14px 0 0;
  font-size: .85rem;
  color: var(--lilac-2);
  min-height: 1.2em;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer{
  position: relative; z-index: 2;
  padding: 40px 0;
  border-top: 1px solid var(--glass-border);
}
.footer-grid{
  display:flex; align-items:center; justify-content:space-between;
  flex-wrap: wrap; gap: 20px;
}
.footer-brand{ display:flex; align-items:center; gap:8px; }
.footer-brand .brand-word{ font-size: .92rem; }
.footer-links{ display:flex; gap:22px; }
.footer-links a{ font-size: .88rem; color: var(--ink-dim); transition: color .25s ease; }
.footer-links a:hover{ color: var(--ink); }
.footer-copy{ font-size: .8rem; color: var(--ink-faint); margin:0; }

/* ============================================================
   Service mini-previews
   ============================================================ */
.card-tags{
  display:flex; flex-wrap:wrap; gap:6px;
  margin: 14px 0 16px;
}
.card-tags li{
  font-size: .7rem;
  font-family: 'Space Grotesk', sans-serif;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(var(--violet-rgb),.12);
  border: 1px solid var(--glass-border);
  color: var(--ink-dim);
}
.mini-preview{
  margin-top: auto;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(var(--shadow-rgb),.18);
  border: 1px solid var(--glass-border);
  min-height: 64px;
}
html[data-theme="light"] .mini-preview{ background: rgba(var(--violet-rgb),.05); }
.service-card{ display:flex; flex-direction:column; }

.mp-dots{ display:flex; gap:5px; margin-bottom: 12px; }
.mp-dots span{ width:6px; height:6px; border-radius:50%; background: var(--glass-border-hi); }
.mp-bars{ display:flex; align-items:flex-end; gap:6px; height: 34px; }
.mp-bars span{
  flex:1; height: var(--h); border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--violet-2), var(--lilac));
  opacity: .8;
}

.mp-ledger{ display:flex; flex-direction:column; gap:10px; }
.mp-row{ display:flex; align-items:center; gap:10px; }
.mp-line{ height:6px; border-radius:3px; background: var(--glass-border-hi); flex:none; }
.mp-amount{ height:6px; border-radius:3px; background: linear-gradient(90deg, var(--violet), var(--lilac)); margin-left:auto; }

.mp-api{ display:flex; flex-direction:column; gap:8px; font-family:'Space Grotesk',sans-serif; font-size:.68rem; }
.mp-api-line{ display:flex; align-items:center; gap:8px; }
.mp-method{
  padding:2px 7px; border-radius:5px; font-weight:700;
  background: rgba(var(--violet-rgb),.25); color: var(--violet-2);
}
.mp-method.post{ background: rgba(var(--lilac-rgb),.25); color: var(--lilac-2); }
.mp-path{ color: var(--ink-dim); }
.mp-status{
  margin-left:auto; padding:2px 7px; border-radius:5px;
  background: rgba(var(--lilac-rgb),.2); color: var(--lilac-2); font-weight:700;
}

.mp-grid{ display:grid; grid-template-columns: repeat(3,1fr); gap:8px; width: 84px; margin:0 auto; }
.mp-grid span{ aspect-ratio:1; border-radius:4px; background: var(--glass-border-hi); }
.mp-grid span.on{ background: linear-gradient(135deg, var(--violet-2), var(--lilac)); }

.mp-cube-wrap{ display:flex; align-items:center; justify-content:center; height: 70px; }
.mp-cube{ position:relative; width:36px; height:36px; }
.mp-cube .face{ position:absolute; }
.mp-cube .top{
  width:36px; height:20px; top:-14px; left:0;
  background: linear-gradient(135deg, var(--violet-2), var(--lilac-2));
  clip-path: polygon(50% 0, 100% 30%, 50% 60%, 0 30%);
  opacity: .9;
}
.mp-cube .left{
  width:18px; height:30px; top:6px; left:0;
  background: var(--violet); opacity:.7;
  clip-path: polygon(0 0, 100% 15%, 100% 100%, 0 85%);
}
.mp-cube .right{
  width:18px; height:30px; top:6px; left:18px;
  background: var(--lilac); opacity:.55;
  clip-path: polygon(0 15%, 100% 0, 100% 85%, 0 100%);
}

.mp-checklist{ display:flex; flex-direction:column; gap:8px; font-size:.76rem; color: var(--ink-dim); }
.mp-check{ display:flex; align-items:center; gap:8px; }
.mp-check span{
  width:14px; height:14px; border-radius:50%; flex:none;
  border: 1.5px solid var(--glass-border-hi);
}
.mp-check.done span{
  background: linear-gradient(135deg, var(--violet-2), var(--lilac));
  border-color: transparent;
}
.mp-check.done{ color: var(--ink); }

.mp-roadmap{ display:flex; align-items:center; height: 40px; }
.mp-node{
  width:10px; height:10px; border-radius:50%; flex:none;
  background: var(--glass-border-hi);
}
.mp-node.done{ background: var(--violet-2); }
.mp-node.active{
  background: var(--lilac-2); box-shadow: 0 0 10px var(--lilac-2);
  animation: dotPulse 2s ease-in-out infinite;
}
.mp-track{ flex:1; height:2px; background: var(--glass-border-hi); }
.mp-track.done{ background: linear-gradient(90deg, var(--violet-2), var(--lilac-2)); }

.mp-shield{ position:relative; display:flex; align-items:center; justify-content:center; height: 70px; color: var(--violet-2); }
.mp-shield svg{ width:36px; height:40px; overflow:hidden; }
.mp-scan{
  position:absolute; left:50%; top:6px;
  width: 30px; height:2px; margin-left:-15px;
  background: linear-gradient(90deg, transparent, var(--lilac-2), transparent);
  animation: scanMove 2.6s ease-in-out infinite;
}
@keyframes scanMove{
  0%,100%{ transform: translateY(0); opacity:.9; }
  50%{ transform: translateY(28px); opacity:.4; }
}

/* ============================================================
   Interactive Chile regions map
   ============================================================ */
.map-hint{
  text-align:center;
  font-size: .82rem;
  color: var(--ink-faint);
  margin-bottom: 18px;
  transition: color .3s ease;
}
.chile-map{
  position: relative;
  width: 160px;
  height: 743px;
  margin: 0 auto;
}
.map-frame{
  position: absolute;
  inset: 0;
}
.map-photo{
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(var(--violet-rgb),.4));
}

/* Region glow that appears at the active region's latitude on hover/tap,
   also masked to the coastline so it reads as "lighting up that part". */
.map-highlight{
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 100px;
  transform: translateY(-50%);
  background: radial-gradient(ellipse at center, rgba(var(--violet-rgb),.95), rgba(var(--lilac-rgb),.3) 60%, transparent 80%);
  -webkit-mask-image: url('../assets/img/mapa-cutout.png');
  mask-image: url('../assets/img/mapa-cutout.png');
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  opacity: 0;
  transition: opacity .35s ease, top .35s var(--ease);
  pointer-events: none;
}
.map-highlight.active{ opacity: 1; }

.region-node{
  position: absolute;
  top: var(--y);
  display:flex; align-items:center; gap:8px;
  white-space: nowrap;
  background: none; border: none; padding: 8px; margin: -8px;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-size: .68rem;
  color: var(--ink-faint);
  transform: translateY(-50%);
  transition: color .3s ease;
}
/* Every dot sits on the map's own vertical center line: label-r anchors its
   left edge there (dot first, label grows right); label-l anchors its right
   edge there and reverses direction (label grows left, dot stays put). */
.region-node.label-r{ left: 50%; }
.region-node.label-l{ right: 50%; flex-direction: row-reverse; }

.region-dot{
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--glass-border-hi);
  transition: background .3s ease, box-shadow .3s ease, transform .3s ease;
}
/* The dot can sit either on the transparent margin (near-white page bg) or
   on the map's own dark-gray fill, so it needs a color and a light ring
   that both read clearly against either backdrop, not just one. */
html[data-theme="light"] .region-dot{
  background: var(--violet-2);
  box-shadow: 0 0 0 2px rgba(255,255,255,.65);
}
html[data-theme="light"] .region-node{
  text-shadow: 0 0 5px var(--bg-0), 0 0 3px var(--bg-0);
}
.region-node:hover,
.region-node:focus-visible,
.region-node.active{
  color: var(--ink);
  font-weight: 600;
  outline: none;
}
.region-node:hover .region-dot,
.region-node:focus-visible .region-dot,
.region-node.active .region-dot{
  background: var(--lilac-2);
  box-shadow: 0 0 10px var(--lilac-2);
  transform: scale(1.5);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px){
  .hero-grid{ grid-template-columns: 1fr; }
  .hero-visual{ height: 380px; order: -1; }
  .orbit-scene{ transform: scale(.78); }
  .about-grid, .coverage-grid, .contact-grid{ grid-template-columns: 1fr; }
  .services-grid{ grid-template-columns: repeat(2, 1fr); }
  .process-track{ grid-template-columns: repeat(2, 1fr); }
  .projects-grid{ grid-template-columns: repeat(2, 1fr); }
  .coverage-visual{ margin-top: 20px; }
  .chile-map{ width: 130px; height: 604px; }
  .region-node{ font-size: .62rem; }
  .project-modal-panel{ grid-template-columns: 1fr; }
  .modal-media{ min-height: 220px; }
  .modal-shot{ min-height: 220px; }

  .nav-inner{ gap: 14px; }
  .theme-toggle, .nav-toggle{ width:36px; height:36px; }

  .nav-links{
    position: fixed;
    top: 82px; right: 20px; left: 20px;
    flex-direction: column;
    gap: 4px;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 16px;
    box-shadow: var(--glass-shadow);
    transform-origin: top right;
    transform: scale(.95);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s var(--ease), transform .3s var(--ease);
  }
  .nav-links.open{ opacity:1; transform: scale(1); pointer-events: auto; }
  .nav-link{ padding: 12px 10px; }
  .nav-cta{ display:none; }
  .nav-toggle{ display:flex; }
}

@media (max-width: 640px){
  .container{ padding: 0 20px; }
  .hero{ padding: 150px 0 80px; min-height: auto; }
  .services-grid{ grid-template-columns: 1fr; }
  .process-track{ grid-template-columns: 1fr; }
  .projects-grid{ grid-template-columns: 1fr; }
  .custom-dev-panel{ padding: 32px 26px; }
  .modal-info{ padding: 28px 24px; }
  .tech-chip{ padding: 10px 16px; font-size: .8rem; }
  .hero-stats{ gap: 24px; }
  section{ padding: 80px 0; }
  .tech-badge{ font-size: .58rem; padding: 4px 9px; }
  .brand-word{ font-size: .92rem; letter-spacing: .1em; }
  .chile-map{ width: 100px; height: 464px; }
  .region-node .region-label{ display: none; }
  .mini-preview{ padding: 12px; }
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html{ scroll-behavior: auto; }
}
