/* =========================================================
   NOX · portfolio
   ========================================================= */

:root {
  --bg: #060608;
  --bg-2: #0b0b10;
  --surface: rgba(255, 255, 255, 0.025);
  --surface-2: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ecebf1;
  --muted: #8d8c99;
  --faint: #55545f;
  --accent: #ff3b3b;
  --accent-soft: rgba(255, 59, 59, 0.14);
  --moon: #c9cbe0;

  --f-display: "Instrument Serif", Georgia, serif;
  --f-sans: "Inter Tight", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #fff; }

a { color: inherit; text-decoration: none; }
em { font-family: var(--f-display); font-style: italic; font-weight: 400; color: var(--moon); }
strong { font-weight: 500; color: var(--text); }

/* ---------- ambiance ---------- */
.grain {
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 100; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); }
}

.cursor-glow {
  position: fixed; top: 0; left: 0;
  width: 600px; height: 600px; margin: -300px 0 0 -300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 203, 224, 0.06), transparent 60%);
  pointer-events: none; z-index: 0;
  transform: translate3d(var(--x, -999px), var(--y, -999px), 0);
  transition: transform 0.15s linear;
}
@media (hover: none) { .cursor-glow { display: none; } }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px var(--gutter);
  transition: background 0.4s var(--ease), padding 0.4s var(--ease), border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(6, 6, 8, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
  padding-top: 14px; padding-bottom: 14px;
}
.nav-logo { font-family: var(--f-display); font-size: 28px; letter-spacing: -0.02em; line-height: 1; }
.dot { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 32px; font-size: 14px; }
.nav-links a { color: var(--muted); transition: color 0.25s; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 1px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.nav-links a.active::after, .nav-links a:not(.nav-cta):hover::after { transform: scaleX(1); transform-origin: left; }
.nav-cta {
  color: var(--text) !important; padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--border-strong); transition: background 0.25s, border-color 0.25s !important;
}
.nav-cta:hover { background: var(--text); color: var(--bg) !important; border-color: var(--text); }
.nav-burger { display: none; background: none; border: 0; width: 32px; height: 32px; cursor: pointer; position: relative; }
.nav-burger span { position: absolute; left: 6px; right: 6px; height: 1.5px; background: var(--text); transition: transform 0.4s var(--ease); }
.nav-burger span:first-child { top: 12px; }
.nav-burger span:last-child { top: 19px; }
.nav.open .nav-burger span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav.open .nav-burger span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px;
  font-size: 15px; font-weight: 500; white-space: nowrap;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s var(--ease);
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: #fff; }
.btn-ghost { border: 1px solid var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); }
.arrow { display: inline-block; transition: transform 0.35s var(--ease); }
a:hover .arrow { transform: translateX(4px); }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 120px var(--gutter) 64px; overflow: hidden;
}
#night { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-moon {
  position: absolute; top: -20vw; right: -14vw;
  width: 62vw; height: 62vw; max-width: 900px; max-height: 900px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(201, 203, 224, 0.12), rgba(201, 203, 224, 0.04) 50%, transparent 100%);
  z-index: 0; pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%;
  background: linear-gradient(to bottom, transparent, var(--bg)); z-index: 1; pointer-events: none;
}
.hero-inner { position: relative; z-index: 2; max-width: var(--max); width: 100%; margin: 0 auto; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted); padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: rgba(255, 255, 255, 0.02); backdrop-filter: blur(6px);
}
.eyebrow sup { font-size: 0.7em; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.4s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(255, 59, 59, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 59, 0); }
}

.hero-title {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(120px, 26vw, 360px);
  line-height: 0.82; letter-spacing: -0.045em;
  margin: 28px 0 24px -0.04em;
}
/* gradient lives on each letter only: a background-clip:text parent
   repaints its transformed children at the wrong place in Chrome */
.hero-name { color: #e4e4ee; }
.hero-name .ch {
  background: linear-gradient(180deg, #fff 30%, #8f90a8 110%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-name .ch, .hero-dot { display: inline-block; }
.hero-dot { color: var(--accent); }
.hero-sub { font-size: clamp(20px, 2.4vw, 28px); line-height: 1.35; color: var(--muted); font-weight: 300; max-width: 560px; }
.hero-sub em { font-size: 1.12em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

.hero-meta {
  position: relative; z-index: 2; max-width: var(--max); width: 100%; margin: 72px auto 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border); padding-top: 20px;
}
.hero-meta div { display: flex; flex-direction: column; gap: 4px; }
.hero-meta .k { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); }
.hero-meta .v { font-size: 15px; }

.scroll-hint {
  position: absolute; z-index: 2; left: 50%; bottom: 28px; transform: translateX(-50%);
  width: 22px; height: 36px; border: 1px solid var(--border-strong); border-radius: 12px;
}
.scroll-hint span {
  position: absolute; top: 7px; left: 50%; width: 2px; height: 7px; margin-left: -1px;
  background: var(--text); border-radius: 2px; animation: scroll 2s var(--ease) infinite;
}
@keyframes scroll { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------- marquee ---------- */
.marquee {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  overflow: hidden; padding: 22px 0; background: var(--bg-2);
  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: 40px; width: max-content; align-items: center; will-change: transform; }
.marquee-track span { font-family: var(--f-display); font-size: clamp(28px, 4vw, 48px); white-space: nowrap; color: var(--muted); }
.marquee-track span:nth-of-type(odd) { font-style: italic; color: var(--text); }
.marquee-track i { font-style: normal; color: var(--accent); font-size: 18px; }

/* ---------- sections ---------- */
.section { position: relative; z-index: 1; max-width: var(--max); margin: 0 auto; padding: clamp(96px, 14vw, 180px) var(--gutter) 0; }
.section-label {
  display: flex; align-items: center; gap: 14px; margin-bottom: 48px;
  font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted);
}
.section-label span { color: var(--accent); }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--border); transform-origin: left; transform: scaleX(0); transition: transform 1.4s var(--ease) 0.2s; }
.section-label.in::after { transform: scaleX(1); }
.section-title { font-family: var(--f-display); font-weight: 400; font-size: clamp(40px, 6vw, 76px); line-height: 1; letter-spacing: -0.025em; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: end; }
.about-statement { font-family: var(--f-display); font-weight: 400; font-size: clamp(38px, 5.2vw, 68px); line-height: 1.04; letter-spacing: -0.02em; }
.about-text p { color: var(--muted); margin-bottom: 18px; }
.about-text p:last-child { margin-bottom: 0; }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); margin-top: clamp(64px, 9vw, 112px);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.stat { padding: 32px 24px 32px 0; display: flex; flex-direction: column; gap: 6px; }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--border); }
.stat-num { font-family: var(--f-display); font-size: clamp(44px, 5vw, 64px); line-height: 1; letter-spacing: -0.02em; }
.stat-label { color: var(--muted); font-size: 14px; }

/* ---------- spotlight (cards that light up under the cursor) ---------- */
.spotlight { position: relative; isolation: isolate; }
.spotlight::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; opacity: 0;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.06), transparent 45%);
  transition: opacity 0.4s;
}
.spotlight::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; opacity: 0; pointer-events: none;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 59, 59, 0.55), transparent 50%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  transition: opacity 0.4s;
}
.spotlight:hover::before, .spotlight:hover::after { opacity: 1; }

/* ---------- feature (Mystral) ---------- */
.feature {
  border: 1px solid var(--border); border-radius: 28px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01) 60%);
  padding: clamp(28px, 5vw, 64px); overflow: hidden;
}
.feature-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; }
.feature-kicker { font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 14px; }
.feature-title { font-family: var(--f-display); font-weight: 400; font-size: clamp(64px, 11vw, 150px); line-height: 0.9; letter-spacing: -0.04em; }
.feature-lead { color: var(--muted); max-width: 560px; margin-top: 22px; font-size: 18px; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; margin-top: clamp(40px, 6vw, 72px); }
.feature-cell { background: var(--bg-2); padding: 26px 24px; display: flex; flex-direction: column; gap: 4px; transition: background 0.3s; }
.feature-cell:hover { background: #111118; }
.cell-k { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); }
.cell-v { font-family: var(--f-display); font-size: 32px; line-height: 1.1; margin-top: 6px; }
.cell-d { color: var(--muted); font-size: 14px; }
.feature-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.chip { font-family: var(--f-mono); font-size: 12px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }

/* ---------- offensive ---------- */
.off-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  border: 1px solid var(--border); border-radius: 22px; background: var(--surface);
  padding: 32px 28px; display: flex; flex-direction: column; gap: 14px;
  transition: transform 0.5s var(--ease), border-color 0.3s;
}
.card-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.card-icon svg { width: 22px; height: 22px; }
.card h3 { font-family: var(--f-display); font-weight: 400; font-size: 32px; line-height: 1.1; margin-top: 10px; }
.card p { color: var(--muted); font-size: 15.5px; flex: 1; }
.card-tag { font-family: var(--f-mono); font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; padding-top: 14px; border-top: 1px solid var(--border); }

.events { margin-top: clamp(64px, 8vw, 104px); }
.events-title { font-family: var(--f-mono); font-weight: 400; font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 28px; }
.timeline { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.timeline::before { content: ""; position: absolute; top: 6px; left: 0; right: 0; height: 1px; background: var(--border-strong); transform-origin: left; transform: scaleX(var(--line, 0)); transition: transform 1.6s var(--ease); }
.events.in .timeline { --line: 1; }
.tl-item { position: relative; padding: 32px 20px 0 0; display: flex; flex-direction: column; gap: 4px; }
.tl-item::before { content: ""; position: absolute; top: 0; left: 0; width: 13px; height: 13px; border-radius: 50%; background: var(--bg); border: 1px solid var(--accent); transition: background 0.3s, box-shadow 0.3s; }
.tl-item:hover::before { background: var(--accent); box-shadow: 0 0 20px var(--accent); }
.tl-year { font-family: var(--f-mono); font-size: 12px; color: var(--accent); }
.tl-name { font-family: var(--f-display); font-size: 34px; line-height: 1.1; }
.tl-desc { color: var(--muted); font-size: 14px; }

/* ---------- parcours ---------- */
.parcours-head { display: flex; flex-direction: column; gap: 32px; margin-bottom: 40px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  font: inherit; font-size: 14px; color: var(--muted); background: transparent; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px; padding: 8px 16px;
  transition: color 0.25s, background 0.25s, border-color 0.25s;
}
.filter:hover { color: var(--text); border-color: var(--border-strong); }
.filter.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.modules { border-top: 1px solid var(--border); }
.mod {
  display: grid; grid-template-columns: 90px 1fr auto 120px; align-items: center; gap: 24px;
  padding: 22px 8px; border-bottom: 1px solid var(--border); position: relative; isolation: isolate;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), padding 0.4s var(--ease);
}
.mod::before { content: ""; position: absolute; inset: 0; background: var(--surface-2); transform: scaleY(0); transform-origin: bottom; transition: transform 0.4s var(--ease); z-index: -1; }
.mod:hover::before { transform: scaleY(1); }
.mod:hover { padding-left: 20px; }
.mod.hidden { display: none; }
.mod-num { font-family: var(--f-mono); font-size: 13px; color: var(--faint); }
.mod-title { font-size: 18px; font-weight: 400; }
.mod-title small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.mod-tag { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px; }
.mod-tag[data-t="secu"] { color: var(--accent); border-color: rgba(255, 59, 59, 0.35); }
.mod-date { font-family: var(--f-mono); font-size: 13px; color: var(--muted); text-align: right; }
.mod-live { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
.mod-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2.4s infinite; }

/* ---------- contact ---------- */
.contact { padding-bottom: clamp(96px, 12vw, 160px); }
.contact-title { font-family: var(--f-display); font-weight: 400; font-size: clamp(44px, 7.5vw, 104px); line-height: 1; letter-spacing: -0.03em; }
.contact-mail {
  display: inline-flex; flex-direction: column; gap: 6px; margin-top: 48px; cursor: pointer;
}
.mail-text {
  font-size: clamp(22px, 3.4vw, 40px); font-weight: 300; position: relative;
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 0 1px no-repeat;
  transition: background-size 0.5s var(--ease); padding-bottom: 4px;
}
.contact-mail:hover .mail-text { background-size: 100% 1px; }
.mail-hint { font-family: var(--f-mono); font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.1em; }
.socials { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 48px; }
.socials a { padding: 12px 22px; border: 1px solid var(--border); border-radius: 999px; font-size: 15px; transition: border-color 0.3s, background 0.3s; }
.socials a:hover { border-color: var(--border-strong); background: var(--surface-2); }

/* ---------- footer ---------- */
.footer {
  position: relative; z-index: 1; overflow: hidden;
  border-top: 1px solid var(--border);
  font-family: var(--f-mono); font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em;
}
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 28px var(--gutter); }
.footer a:hover { color: var(--text); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 200;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 20px; border-radius: 999px; font-size: 14px; font-weight: 500;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .feature-head { flex-direction: column; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .off-grid { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .timeline::before { display: none; }
  .mod { grid-template-columns: 64px 1fr auto; }
  .mod-date { grid-column: 2 / -1; text-align: left; margin-top: -14px; }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed; inset: 0; z-index: -1; flex-direction: column; justify-content: center; gap: 28px;
    background: rgba(6, 6, 8, 0.96); backdrop-filter: blur(20px); font-size: 28px;
    font-family: var(--f-display); opacity: 0; pointer-events: none; transition: opacity 0.4s var(--ease);
  }
  .nav.open .nav-links { opacity: 1; pointer-events: auto; }
  .nav-burger { display: block; }
  .hero-meta { grid-template-columns: 1fr; gap: 14px; }
  .scroll-hint { display: none; }
  .eyebrow { font-size: 10.5px; letter-spacing: 0; padding: 6px 12px; }
  .mod { grid-template-columns: 1fr auto; gap: 10px 16px; }
  .mod-num { grid-column: 1 / -1; }
  .mod-date { grid-column: 1 / -1; margin-top: 0; }
  .timeline { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stat + .stat { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); }
}

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


/* =========================================================
   MOTION LAYER
   ========================================================= */

body.loading { overflow: hidden; }

/* ---------- loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 1000; background: #050507;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.1s cubic-bezier(0.76, 0, 0.24, 1);
}
.loader.out { clip-path: inset(0 0 100% 0); }
.loader.gone { display: none; }
.loader-word { font-family: var(--f-display); font-size: clamp(80px, 16vw, 200px); line-height: 1; letter-spacing: -0.04em; display: flex; overflow: hidden; padding: 0.06em 0.04em 0.12em; }
.loader-word span { display: inline-block; transform: translateY(110%); animation: rise 0.9s var(--ease) forwards; }
.loader-word span:nth-child(2) { animation-delay: 0.06s; }
.loader-word span:nth-child(3) { animation-delay: 0.12s; }
.loader-word span:nth-child(4) { animation-delay: 0.3s; }
@keyframes rise { to { transform: translateY(0); } }
.loader-bottom {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 32px;
  display: flex; justify-content: space-between; align-items: flex-end;
  font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted);
}
.loader-count { font-family: var(--f-display); font-size: clamp(48px, 8vw, 96px); line-height: 0.8; letter-spacing: -0.02em; color: var(--text); text-transform: none; }

/* ---------- hero intro ---------- */
.js .hero-name .ch, .js .hero-dot { opacity: 0; transform: translateY(40%) rotate(4deg); filter: blur(14px); }
.js .hero-dot { transform: translateY(-120%) scale(0.4); }
.ready .hero-name .ch, .ready .hero-dot {
  opacity: 1; transform: none; filter: blur(0);
  transition: opacity 1.2s var(--ease), transform 1.4s var(--ease), filter 1.2s var(--ease);
  transition-delay: calc(var(--i, 0) * 0.09s + 0.1s);
}
.ready .hero-dot { transition: opacity 0.4s, transform 1s cubic-bezier(0.34, 1.8, 0.64, 1), filter 0.4s; transition-delay: 0.55s; }
.hero-inner { will-change: transform, opacity; }
.hero-moon { will-change: transform; }

/* ---------- scroll progress ---------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
  background: linear-gradient(90deg, transparent, var(--accent));
  transform-origin: left; transform: scaleX(var(--p, 0));
}

/* ---------- custom cursor ---------- */
.cursor, .cursor-ring { position: fixed; top: 0; left: 0; z-index: 300; pointer-events: none; border-radius: 50%; opacity: 0; transition: opacity 0.3s; }
.has-cursor .cursor, .has-cursor .cursor-ring { opacity: 1; }
.cursor { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent); }
.cursor-ring {
  width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: opacity 0.3s, width 0.4s var(--ease), height 0.4s var(--ease), margin 0.4s var(--ease), background 0.3s, border-color 0.3s;
}
.cursor-ring.hover { width: 72px; height: 72px; margin: -36px 0 0 -36px; background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.6); backdrop-filter: blur(2px); }
.cursor-ring.down { width: 28px; height: 28px; margin: -14px 0 0 -14px; }
.has-cursor, .has-cursor a, .has-cursor button { cursor: none; }

/* ---------- nav hide on scroll ---------- */
.nav { transition: background 0.4s var(--ease), padding 0.4s var(--ease), border-color 0.4s, transform 0.5s var(--ease); }
.nav.hide:not(.open) { transform: translateY(-110%); }

/* ---------- link roll ---------- */
.roll { display: inline-block; overflow: hidden; vertical-align: top; position: relative; line-height: 1.3; }
.roll > span { display: inline-block; position: relative; transition: transform 0.5s var(--ease); }
.roll > span::after { content: attr(data-t); position: absolute; left: 0; top: 100%; color: var(--text); white-space: nowrap; }
a:hover .roll > span { transform: translateY(-100%); }

/* ---------- split words (mask reveal) ---------- */
.wm { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 0.06em 0.14em 0; margin: 0 -0.06em -0.14em 0; }
.wm > .w { display: inline-block; transform: translateY(110%) rotate(3deg); transform-origin: left top; transition: transform 1.1s var(--ease); transition-delay: calc(var(--i, 0) * 0.04s); }
[data-split].in .wm > .w { transform: none; }

/* ---------- scroll-highlighted statement ---------- */
[data-highlight] .hw { opacity: 0.14; transition: opacity 0.35s linear; }
[data-highlight] .hw.on { opacity: 1; }

/* ---------- Mystral title fill ---------- */
.fill-text { position: relative; color: transparent; -webkit-text-stroke: 1px rgba(236, 235, 241, 0.28); }
.fill-text::after {
  content: attr(data-text); position: absolute; left: 0; top: 0; color: var(--text); -webkit-text-stroke: 0;
  clip-path: inset(-10% calc(100% - var(--fill, 0%)) -20% 0);
}

/* ---------- 3D tilt cards ---------- */
.card.reveal.in {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0px));
}
.card.in:hover { --ty: -6px; transition: transform 0.15s linear, border-color 0.3s, opacity 1s; }
.card-icon { transition: transform 0.6s var(--ease); }
.card:hover .card-icon { transform: rotate(-8deg) scale(1.1); }

/* ---------- magnetic ---------- */
[data-magnetic] { will-change: transform; }

/* ---------- module rows ---------- */
.mod.reveal { transform: translateY(18px); transition-duration: 0.8s; }
.mod.reveal.in { transform: none; }
.mod-title { transition: color 0.3s; }
.mod:hover .mod-title { color: #fff; }
.mod:hover .mod-num { color: var(--accent); }

/* ---------- footer big ---------- */
.footer-big {
  font-family: var(--f-display); text-transform: none; letter-spacing: -0.05em; line-height: 0.75;
  font-size: clamp(140px, 34vw, 520px);
  padding: 0.12em var(--gutter) 0; display: flex; justify-content: center;
  background: linear-gradient(180deg, rgba(236, 235, 241, 0.9), rgba(236, 235, 241, 0.04) 85%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  transform: translateY(var(--fy, 30%)); will-change: transform;
}
.footer-big .dot { -webkit-text-fill-color: var(--accent); }
.footer-row { border-top: 1px solid var(--border); position: relative; background: var(--bg); }
.footer-clock { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .js .hero-name .ch, .js .hero-dot { opacity: 1; transform: none; filter: none; }
  .wm > .w { transform: none; }
  [data-highlight] .hw { opacity: 1; }
  .fill-text { color: var(--text); -webkit-text-stroke: 0; }
  .fill-text::after { display: none; }
  .loader { display: none; }
  .section-label::after { transform: none; }
  .footer-big { transform: none; }
}

/* =========================================================
   DYNAMIC CONTENT
   ========================================================= */

/* grids adapt to how many items the admin defines */
.stats[data-cols="1"] { grid-template-columns: 1fr; }
.stats[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
.stats[data-cols="4"] { grid-template-columns: repeat(4, 1fr); }
.feature-grid[data-cols="1"] { grid-template-columns: 1fr; }
.feature-grid[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
.feature-grid[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
.timeline[data-cols="1"] { grid-template-columns: 1fr; }
.timeline[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
.timeline[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
.timeline { row-gap: 40px; }

/* availability pill */
.availability {
  position: absolute; z-index: 2; right: var(--gutter); top: 112px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 16px; border-radius: 999px; font-size: 13.5px;
  border: 1px solid rgba(74, 222, 128, 0.25); background: rgba(74, 222, 128, 0.06); color: #c6f6d5;
  backdrop-filter: blur(6px);
}
.avail-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); animation: pulse-green 2.4s infinite; }
@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.btn-link { color: var(--muted); padding-left: 10px; padding-right: 10px; }
.btn-link:hover { color: var(--text); }

/* contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(40px, 6vw, 96px); margin-top: 56px; align-items: start; }
.contact-grid.no-form { grid-template-columns: 1fr; }
.contact-side .contact-mail { margin-top: 0; }

.contact-form { display: flex; flex-direction: column; gap: 28px; }
.field { position: relative; }
.field input, .field textarea {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--border-strong);
  color: var(--text); font: inherit; font-size: 18px; font-weight: 300; padding: 22px 0 12px; outline: none; resize: vertical;
  border-radius: 0; transition: border-color 0.3s;
}
.field textarea { min-height: 140px; line-height: 1.5; }
.field label {
  position: absolute; left: 0; top: 22px; color: var(--muted); font-size: 18px; font-weight: 300; pointer-events: none;
  transform-origin: left top; transition: transform 0.4s var(--ease), color 0.3s;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { transform: translateY(-22px) scale(0.7); color: var(--faint); }
.field::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform 0.6s var(--ease);
}
.field:focus-within::after { transform: scaleX(1); }
.field.invalid input, .field.invalid textarea { border-bottom-color: rgba(255, 59, 59, 0.6); }
.field.invalid::before {
  content: attr(data-error); position: absolute; right: 0; top: 2px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--accent);
}
.field textarea + label { top: 22px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-foot { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 4px; }
.form-foot button { border: 0; cursor: pointer; font: inherit; font-size: 15px; font-weight: 500; }
.form-status { color: var(--muted); font-size: 14px; }
.contact-form.sending button { opacity: 0.6; pointer-events: none; }
.contact-form.sent button { background: #4ade80; color: #04120a; }
.contact-form.sent .form-status { color: #c6f6d5; }
.contact-form.error .form-foot { animation: shake 0.45s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
  .stats[data-cols="4"] { grid-template-columns: repeat(2, 1fr); }
  .feature-grid[data-cols="3"] { grid-template-columns: 1fr; }
  .timeline[data-cols] { grid-template-columns: repeat(2, 1fr); }
  .availability { position: relative; top: auto; right: auto; margin: 28px auto 0; max-width: var(--max); width: fit-content; align-self: flex-start; }
}
@media (max-width: 720px) {
  .stats[data-cols] { grid-template-columns: 1fr; }
  .timeline[data-cols] { grid-template-columns: 1fr; }
  .feature-grid[data-cols] { grid-template-columns: 1fr; }
}
