/* ============================================================
   Self-hosted font (Space Grotesk, variable) — DSGVO-safe
   ============================================================ */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../assets/fonts/space-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../assets/fonts/space-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ============================================================
   Erik Imberi — Portfolio (Rework)
   Design tokens
   ============================================================ */
:root {
  --bg: #0b1120;
  --bg-2: #0f172a;
  --surface: rgba(23, 33, 56, 0.55);
  --surface-solid: #131c33;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --text-faint: #64748b;
  --accent: #3b82f6;
  --accent-2: #60a5fa;
  --violet: #8b5cf6;
  --radius: 22px;
  --radius-sm: 12px;
  --maxw: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font: "Space Grotesk", -apple-system, system-ui, sans-serif;
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }
address { font-style: normal; }
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }

/* ============================================================
   Ambient background
   ============================================================ */
.bg-ambient {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(120% 120% at 50% -10%, #101a30 0%, var(--bg) 55%);
  overflow: hidden;
}
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.5;
  will-change: transform;
}
.orb--blue {
  width: 46vw; height: 46vw; left: -12vw; top: -8vw;
  background: radial-gradient(circle, rgba(59,130,246,0.55), transparent 70%);
  animation: drift1 20s var(--ease) infinite alternate;
}
.orb--violet {
  width: 42vw; height: 42vw; right: -12vw; bottom: -10vw;
  background: radial-gradient(circle, rgba(139,92,246,0.42), transparent 70%);
  animation: drift2 24s var(--ease) infinite alternate;
}
@keyframes drift1 { to { transform: translate(8vw, 6vw) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-6vw, -5vw) scale(1.12); } }
.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(148,163,184,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,0.045) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(100% 80% at 50% 0%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(100% 80% at 50% 0%, #000 30%, transparent 80%);
}

/* Cursor glow */
.cursor-glow {
  position: fixed; top: 0; left: 0; z-index: 1;
  width: 400px; height: 400px; margin: -200px 0 0 -200px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(59,130,246,0.10), transparent 60%);
  transform: translate3d(-9999px, -9999px, 0);
  transition: opacity 0.4s ease;
  opacity: 0;
}

/* Scroll progress */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  z-index: 200; border-radius: 0 3px 3px 0;
  box-shadow: 0 0 12px rgba(59,130,246,0.7);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 26px; border-radius: 999px;
  font-size: 0.98rem; font-weight: 600; letter-spacing: 0.01em;
  position: relative; overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.3s ease;
  will-change: transform;
}
.btn svg { transition: transform 0.35s var(--ease); }
.btn--primary {
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(59,130,246,0.65);
}
.btn--primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent-2), var(--violet));
  opacity: 0; transition: opacity 0.35s ease; z-index: -1;
}
.btn--primary:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -10px rgba(59,130,246,0.75); }
.btn--primary:hover::after { opacity: 1; }
.btn--primary:hover svg { transform: translateX(4px); }
.btn--ghost {
  background: rgba(148,163,184,0.06);
  border: 1px solid var(--border-strong);
  color: var(--text);
  backdrop-filter: blur(6px);
}
.btn--ghost:hover { transform: translateY(-3px); background: rgba(148,163,184,0.12); border-color: var(--accent); }
.btn--full { width: 100%; margin-top: 6px; }

/* ============================================================
   Intro gate
   ============================================================ */
.intro {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: radial-gradient(120% 120% at 50% 40%, #101a30, #060a14);
  transition: opacity 0.9s var(--ease), visibility 0.9s;
}
.intro.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.intro__inner { display: flex; flex-direction: column; align-items: center; gap: 54px; }
.intro__logo { position: relative; display: grid; place-items: center; }
.intro__logo-img {
  width: 120px; height: auto;
  filter: drop-shadow(0 0 26px rgba(59,130,246,0.35));
  animation: logoPulse 2.6s var(--ease) infinite;
  opacity: 0; transform: scale(0.85);
  animation: introLogoIn 1s var(--ease) forwards, logoPulse 2.8s ease-in-out 1s infinite;
}
@keyframes introLogoIn { to { opacity: 1; transform: scale(1); } }
@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 22px rgba(59,130,246,0.3)); }
  50% { filter: drop-shadow(0 0 40px rgba(59,130,246,0.65)); }
}
.pulse {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  width: 220px; height: 56px; overflow: visible;
}
.pulse__line {
  fill: none; stroke: var(--accent-2); stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(96,165,250,0.9));
  stroke-dasharray: 400; stroke-dashoffset: 400;
  animation: drawPulse 2s var(--ease) 0.6s forwards, ecg 2.4s linear 2.6s infinite;
}
@keyframes drawPulse { to { stroke-dashoffset: 0; } }
@keyframes ecg {
  0% { stroke-dasharray: 0 400; stroke-dashoffset: 0; }
  40% { stroke-dasharray: 400 400; }
  100% { stroke-dasharray: 400 400; stroke-dashoffset: -400; }
}
.intro__btn { opacity: 0; animation: introBtnIn 0.8s var(--ease) 1.5s forwards; padding: 15px 46px; }
@keyframes introBtnIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   Header
   ============================================================ */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  padding: 14px 0;
  transform: translateY(-120%);
  transition: transform 0.6s var(--ease), background 0.4s ease, backdrop-filter 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}
.header.is-visible { transform: translateY(0); }
.header.is-scrolled {
  background: rgba(11,17,32,0.72);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; }
.header__brand img { width: 60px; transition: transform 0.4s var(--ease); }
.header__brand:hover img { transform: scale(1.1) rotate(-4deg); }
.header__nav { display: flex; gap: 28px; }
.nav-link {
  position: relative; font-weight: 500; color: var(--text-dim);
  transition: color 0.3s ease; padding: 4px 0;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  transition: width 0.35s var(--ease);
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { width: 100%; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 120px 0 80px; position: relative; overflow: hidden;
}
.hero__inner { display: flex; flex-direction: column; align-items: center; gap: 26px; position: relative; z-index: 2; }

/* Aurora beams (reactbits-inspired) */
.hero__aurora {
  position: absolute; inset: -20% 0 auto 0; height: 70vh; z-index: 0;
  background:
    conic-gradient(from 180deg at 50% 50%,
      transparent 0deg,
      rgba(59,130,246,0.18) 60deg,
      rgba(139,92,246,0.22) 120deg,
      transparent 200deg,
      rgba(96,165,250,0.16) 300deg,
      transparent 360deg);
  filter: blur(60px);
  opacity: 0.8;
  mask-image: radial-gradient(80% 60% at 50% 30%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(80% 60% at 50% 30%, #000, transparent 75%);
  animation: auroraSpin 22s linear infinite;
  pointer-events: none;
}
@keyframes auroraSpin { to { transform: rotate(360deg); } }

/* Interactive dot field */
.hero__dots { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }

/* Shiny text (reactbits-inspired) */
.shiny {
  position: relative;
  background: linear-gradient(120deg, var(--accent-2) 20%, #ffffff 45%, var(--violet) 50%, var(--accent-2) 75%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 4.5s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--accent-2);
  padding: 8px 18px; border-radius: 999px;
  background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2);
}
.hero__eyebrow-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(59,130,246,0.6); animation: ping 2s var(--ease) infinite;
}
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(59,130,246,0.6); } 70%,100% { box-shadow: 0 0 0 10px rgba(59,130,246,0); } }

.hero__title {
  font-size: clamp(2.8rem, 9vw, 5.4rem);
  font-weight: 700; line-height: 1.02; letter-spacing: -0.02em;
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .word {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
}
.is-ready .hero__title .word { animation: wordUp 0.9s var(--ease-out) forwards; }
.hero__title .line:nth-child(1) .word:nth-child(1) { animation-delay: 0.05s; }
.hero__title .line:nth-child(1) .word:nth-child(2) { animation-delay: 0.13s; }
.hero__title .line:nth-child(2) .word:nth-child(1) { animation-delay: 0.21s; }
.hero__title .line:nth-child(2) .word:nth-child(2) { animation-delay: 0.29s; }
@keyframes wordUp { to { transform: translateY(0); opacity: 1; } }
.word--accent {
  background: linear-gradient(120deg, var(--accent-2), var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__subtitle { max-width: 560px; color: var(--text-dim); font-size: 1.12rem; }
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

.hero__scroll { position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); opacity: 0.7; transition: opacity 0.3s; }
.hero__scroll:hover { opacity: 1; }
.mouse { display: block; width: 26px; height: 42px; border: 2px solid var(--text-dim); border-radius: 14px; position: relative; }
.wheel { position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px; background: var(--accent-2); border-radius: 2px; animation: wheel 1.6s var(--ease) infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ============================================================
   Section head
   ============================================================ */
.section-head { text-align: center; margin-bottom: 60px; }
.section-head__tag {
  display: inline-block; font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--accent-2);
  margin-bottom: 14px;
}
.section-head__title { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; letter-spacing: -0.02em; }
.section-head__lead { color: var(--text-dim); margin-top: 12px; font-size: 1.05rem; }

/* ============================================================
   Skills / cards
   ============================================================ */
.skills { padding: 100px 0; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card {
  position: relative; padding: 34px 32px; border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s ease, box-shadow 0.4s ease;
  transform-style: preserve-3d;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent 40%);
  opacity: 0; transition: opacity 0.4s ease;
}
.card:hover { border-color: var(--border-strong); box-shadow: 0 30px 60px -30px rgba(0,0,0,0.7); }
.card:hover::before { opacity: 1; }
.card__glow {
  position: absolute; width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,0.18), transparent 65%);
  top: var(--my, 50%); left: var(--mx, 50%); transform: translate(-50%,-50%);
  opacity: 0; transition: opacity 0.4s ease; pointer-events: none;
}
.card:hover .card__glow { opacity: 1; }
.card__icon {
  display: inline-grid; place-items: center; width: 54px; height: 54px;
  border-radius: 15px; color: var(--accent-2);
  background: linear-gradient(135deg, rgba(59,130,246,0.16), rgba(139,92,246,0.1));
  border: 1px solid rgba(59,130,246,0.22);
  margin-bottom: 22px;
  transition: transform 0.5s var(--ease);
}
.card:hover .card__icon { transform: translateY(-3px) rotate(-6deg) scale(1.06); }
.card__title { font-size: 1.4rem; font-weight: 700; margin-bottom: 18px; letter-spacing: -0.01em; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pill {
  font-size: 0.82rem; font-weight: 500; color: var(--text-dim);
  padding: 6px 14px; border-radius: 999px;
  background: rgba(148,163,184,0.07); border: 1px solid var(--border);
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}
.card:hover .pill { color: var(--text); }
.pill:hover { border-color: var(--accent); background: rgba(59,130,246,0.14); transform: translateY(-2px); }
.card__desc { color: var(--text-faint); font-size: 0.98rem; }

/* ============================================================
   Contact
   ============================================================ */
.contact { padding: 100px 0 120px; }
.contact__inner {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 60px; align-items: start;
  padding: 50px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.contact__title { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 700; margin: 12px 0 24px; letter-spacing: -0.02em; }
.contact__name { font-size: 1.2rem; font-weight: 600; margin-bottom: 6px; }
.contact__address { color: var(--text-dim); margin-bottom: 22px; }
.contact__mail {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--accent-2); font-weight: 600;
  padding: 10px 16px; border-radius: 999px;
  background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2);
  transition: background 0.3s ease, transform 0.3s var(--ease);
}
.contact__mail:hover { background: rgba(59,130,246,0.16); transform: translateY(-2px); }
.contact__socials { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.social-btn {
  display: inline-grid; place-items: center; width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 999px; color: var(--accent-2);
  background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2);
  transition: background 0.3s ease, transform 0.3s var(--ease), color 0.3s ease, border-color 0.3s ease;
}
.social-btn:hover { background: rgba(59,130,246,0.16); border-color: var(--accent); transform: translateY(-2px); }

.contact__form { display: flex; flex-direction: column; gap: 26px; }
.field { position: relative; }
.field input, .field textarea {
  width: 100%; padding: 16px 4px 10px; font-size: 1rem; color: var(--text);
  background: transparent; border: none; border-bottom: 1.5px solid var(--border-strong);
  font-family: inherit; resize: vertical; transition: border-color 0.3s ease;
}
.field textarea { min-height: 96px; }
.field input:focus, .field textarea:focus { outline: none; }
.field label {
  position: absolute; left: 4px; top: 16px; color: var(--text-faint);
  pointer-events: none; transition: all 0.3s var(--ease);
}
.field input:focus + label, .field textarea:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:not(:placeholder-shown) + label {
  top: -8px; font-size: 0.76rem; color: var(--accent-2); letter-spacing: 0.04em;
}
.field__bar {
  position: absolute; left: 0; bottom: 0; height: 1.5px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  transition: width 0.4s var(--ease);
}
.field input:focus ~ .field__bar, .field textarea:focus ~ .field__bar { width: 100%; }
.form-status { font-size: 0.9rem; color: var(--accent-2); min-height: 1em; text-align: center; }
.form-status.error { color: #f87171; }

/* ============================================================
   Footer
   ============================================================ */
.footer { border-top: 1px solid var(--border); padding: 34px 0; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer__brand img { width: 40px; opacity: 0.8; transition: opacity 0.3s; }
.footer__brand:hover img { opacity: 1; }
.footer__nav { display: flex; align-items: center; gap: 16px; color: var(--text-faint); font-size: 0.92rem; }
.footer__nav a { color: var(--text-dim); transition: color 0.3s ease; }
.footer__nav a:hover { color: var(--accent-2); }
.footer__sep { color: var(--text-faint); }

/* ============================================================
   Reveal on scroll
   ============================================================ */
.reveal { opacity: 0; transform: translateY(34px); filter: blur(10px); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out), filter 0.8s var(--ease-out); }
.reveal.is-in { opacity: 1; transform: translateY(0); filter: blur(0); }
.card.reveal { transition-delay: calc(var(--i) * 0.08s); }

/* ============================================================
   Projects page
   ============================================================ */
.proj-hero {
  padding: 160px 0 40px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.proj-hero__eyebrow {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--accent-2);
}
.proj-hero__title { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 700; letter-spacing: -0.02em; }
.proj-hero__lead { color: var(--text-dim); max-width: 620px; font-size: 1.08rem; }

.modules { padding: 40px 0 80px; display: flex; flex-direction: column; gap: 90px; }
.module {
  display: grid; grid-template-columns: 1fr 1fr; gap: 54px; align-items: center;
}
.module:nth-child(even) .module__media { order: -1; }
.module__index {
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.2em; color: var(--accent-2);
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.module__index::before { content: ""; width: 28px; height: 1.5px; background: var(--accent); }
.module__title { font-size: clamp(1.6rem, 3.5vw, 2.3rem); font-weight: 700; letter-spacing: -0.01em; margin-bottom: 6px; }
.module__subtitle {
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-2); margin-bottom: 18px;
}
.module__desc { color: var(--text-dim); margin-bottom: 22px; font-size: 1.02rem; }
.module .pills { margin-bottom: 0; }

.module__media {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid rgba(148,163,184,0.35);
  background: linear-gradient(150deg, #ffffff 0%, #eaf1fb 55%, #dce7f7 100%);
  padding: clamp(14px, 2.6vw, 30px);
  box-shadow: 0 40px 80px -40px rgba(0,0,0,0.8), 0 0 0 1px rgba(59,130,246,0.08),
              inset 0 1px 0 rgba(255,255,255,0.9);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.4s ease;
}
.module__media::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.5), transparent 45%);
  opacity: 0; transition: opacity 0.5s ease; pointer-events: none;
}
.module__media:hover {
  transform: translateY(-6px);
  box-shadow: 0 55px 100px -40px rgba(0,0,0,0.9), 0 0 40px -6px rgba(59,130,246,0.4),
              inset 0 1px 0 rgba(255,255,255,0.9);
  border-color: rgba(96,165,250,0.6);
}
.module__media:hover::after { opacity: 1; }
.module__media img { width: 100%; height: auto; display: block; border-radius: 10px; }

/* reveal directions for modules */
.module__text.reveal { transform: translateX(-40px); }
.module:nth-child(even) .module__text.reveal { transform: translateX(40px); }
.module__media.reveal { transform: translateX(40px) translateY(20px); }
.module:nth-child(even) .module__media.reveal { transform: translateX(-40px) translateY(20px); }
.module__text.reveal.is-in, .module__media.reveal.is-in { transform: translateX(0) translateY(0); }

@media (max-width: 860px) {
  .module { grid-template-columns: 1fr; gap: 28px; }
  .module:nth-child(even) .module__media { order: 0; }
  .module__text.reveal, .module:nth-child(even) .module__text.reveal,
  .module__media.reveal, .module:nth-child(even) .module__media.reveal { transform: translateY(30px); }
}

/* ============================================================
   Legal pages
   ============================================================ */
.legal { padding: 140px 0 100px; }
.legal__wrap { max-width: 800px; }
.legal h1 { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 700; margin-bottom: 8px; letter-spacing: -0.02em; }
.legal .legal__back {
  display: inline-flex; align-items: center; gap: 8px; color: var(--accent-2);
  font-weight: 600; margin-bottom: 40px;
}
.legal .legal__back:hover { text-decoration: underline; }
.legal h2 { font-size: 1.4rem; font-weight: 700; margin: 36px 0 14px; }
.legal h3 { font-size: 1.1rem; font-weight: 600; margin: 24px 0 8px; color: var(--text); }
.legal p { color: var(--text-dim); margin-bottom: 14px; }
.legal a { color: var(--accent-2); word-break: break-word; }
.legal address { color: var(--text-dim); margin: 8px 0 14px; line-height: 1.8; }
.legal .muted { color: var(--text-faint); font-size: 0.9rem; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .cards { grid-template-columns: 1fr; }
  .contact__inner { grid-template-columns: 1fr; gap: 40px; padding: 34px 26px; }
}
@media (max-width: 560px) {
  .header__nav { gap: 18px; }
  .hero__actions { width: 100%; }
  .btn { width: 100%; }
  .footer__inner { flex-direction: column; text-align: center; }
}

/* ============================================================
   Grain overlay
   ============================================================ */
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.055; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* ============================================================
   Spotlight border on cards (mouse-following)
   ============================================================ */
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%),
    rgba(96,165,250,0.95), rgba(139,92,246,0.4) 42%, transparent 68%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.45s ease; pointer-events: none; z-index: 3;
}
.card:hover::after { opacity: 1; }

/* ============================================================
   Active nav indicator
   ============================================================ */
.nav-link.is-active { color: var(--text); }
.nav-link.is-active::after { width: 100%; }

/* ============================================================
   Count-up stats
   ============================================================ */
.stats { display: flex; gap: clamp(24px, 6vw, 68px); justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.stat { text-align: center; }
.stat__num {
  font-size: clamp(1.9rem, 4.4vw, 2.8rem); font-weight: 700; line-height: 1;
  background: linear-gradient(120deg, var(--accent-2), var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat__label { font-size: 0.8rem; color: var(--text-dim); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 10px; }

/* ============================================================
   Scrollytelling (pinned MCP sequence)
   ============================================================ */
.story { padding: 30px 0 70px; }
.story__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.story__media { position: sticky; top: 108px; }
.story__frame {
  position: relative; aspect-ratio: 1214 / 880; border-radius: var(--radius); overflow: hidden;
  border: 1px solid rgba(148,163,184,0.35);
  background: linear-gradient(150deg, #ffffff 0%, #eaf1fb 55%, #dce7f7 100%);
  padding: clamp(14px, 2.4vw, 28px);
  box-shadow: 0 40px 80px -40px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.9);
}
.story__img {
  position: absolute; inset: clamp(14px, 2.4vw, 28px);
  width: auto; height: auto; max-width: calc(100% - 2 * clamp(14px, 2.4vw, 28px));
  margin: auto; border-radius: 10px;
  opacity: 0; transform: scale(1.04); clip-path: inset(0 100% 0 0);
  transition: opacity 0.7s var(--ease), transform 0.9s var(--ease), clip-path 0.9s var(--ease);
}
.story__img.is-active { opacity: 1; transform: scale(1); clip-path: inset(0 0 0 0); }
.story__dots { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }
.story__dot {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em; color: var(--text-faint);
  padding: 6px 13px; border-radius: 999px; border: 1px solid var(--border);
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.story__dot.is-active { color: var(--accent-2); border-color: var(--accent); background: rgba(59,130,246,0.12); }
.story__content { display: flex; flex-direction: column; }
.story__step { min-height: 76vh; display: flex; flex-direction: column; justify-content: center; opacity: 0.3; transition: opacity 0.5s var(--ease); }
.story__step.is-active { opacity: 1; }
.story__step-media { display: none; }

@media (max-width: 860px) {
  .story__grid { grid-template-columns: 1fr; gap: 0; }
  .story__media { display: none; }
  .story__step { min-height: auto; padding: 44px 0; opacity: 1; }
  .story__step-media {
    display: block; margin-bottom: 22px; border-radius: var(--radius); overflow: hidden;
    border: 1px solid rgba(148,163,184,0.35);
    background: linear-gradient(150deg, #ffffff, #e8eef7); padding: 16px;
  }
  .story__step-media img { width: 100%; border-radius: 8px; }
}

/* ============================================================
   Page transition overlay
   ============================================================ */
.page-transition {
  position: fixed; inset: 0; z-index: 300; pointer-events: none;
  background: radial-gradient(120% 120% at 50% 50%, #101a30, #060a14);
  display: grid; place-items: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.45s var(--ease), visibility 0.45s var(--ease);
}
.page-transition.instant { transition: none; }
.page-transition.cover { opacity: 1; visibility: visible; }
.page-transition__logo { width: 84px; opacity: 0; transition: opacity 0.35s ease; filter: drop-shadow(0 0 24px rgba(59,130,246,0.5)); }
.page-transition.cover .page-transition__logo { opacity: 1; animation: logoPulse 1.6s ease-in-out infinite; }

/* ============================================================
   Back-to-top button
   ============================================================ */
.back-to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 80;
  width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #2563eb); color: #fff;
  box-shadow: 0 12px 26px -8px rgba(59,130,246,0.7);
  opacity: 0; transform: translateY(20px) scale(0.8); pointer-events: none;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), box-shadow 0.3s ease;
}
.back-to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-3px); box-shadow: 0 18px 34px -10px rgba(59,130,246,0.8); }

/* ============================================================
   Form success animation
   ============================================================ */
.form-success {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  color: #4ade80; font-weight: 600; margin-top: 8px;
  max-height: 0; opacity: 0; overflow: hidden; transition: max-height 0.5s var(--ease), opacity 0.4s ease;
}
.form-success.is-show { max-height: 60px; opacity: 1; }
.check { width: 24px; height: 24px; flex-shrink: 0; }
.check circle { fill: none; stroke: #4ade80; stroke-width: 2.4; stroke-dasharray: 82; stroke-dashoffset: 82; }
.check path { fill: none; stroke: #4ade80; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; }
.form-success.is-show .check circle { animation: drawStroke 0.55s var(--ease) forwards; }
.form-success.is-show .check path { animation: drawStroke 0.4s var(--ease) 0.25s forwards; }
@keyframes drawStroke { to { stroke-dashoffset: 0; } }

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal, .hero__title .word { opacity: 1 !important; transform: none !important; filter: none !important; }
  .orb { animation: none; }
  .story__img { opacity: 1 !important; clip-path: inset(0 0 0 0) !important; transform: none !important; }
  .story__img:not(.is-active) { opacity: 0 !important; }
  .story__step { opacity: 1 !important; }
  .page-transition { display: none !important; }
}
