/* ============================================================
   Musa Rioba — core theme, base, nav, hero
   ============================================================ */
:root {
  --bg: #0a0a0f;
  --bg-alt: #101018;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --text: #eef0f6;
  --muted: #9aa0b4;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-3: #ff5c8a;
  --grad: linear-gradient(120deg, #7c5cff, #22d3ee 55%, #ff5c8a);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --nav-h: 72px;
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
html[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-alt: #ffffff;
  --surface: rgba(10, 10, 20, 0.04);
  --surface-2: rgba(10, 10, 20, 0.07);
  --border: rgba(10, 10, 25, 0.12);
  --text: #141527;
  --muted: #5a6076;
  --shadow: 0 20px 50px rgba(30, 30, 70, 0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--accent), var(--accent-2)); border-radius: 8px; }

.container { width: min(1180px, 92vw); margin-inline: auto; }
.container--narrow { width: min(880px, 92vw); }
.accent { color: var(--accent); }
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: grid; place-items: center;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.preloader.is-done { opacity: 0; visibility: hidden; }
.preloader__inner { display: grid; justify-items: center; gap: 16px; }
.preloader__logo {
  font-size: 2rem; font-weight: 700; letter-spacing: 0.2em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.preloader__bar { width: 220px; height: 3px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.preloader__bar span { display: block; height: 100%; width: 0; background: var(--grad); transition: width 0.2s linear; }
.preloader__pct { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }

/* ---------- cursor ---------- */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 300; border-radius: 50%; display: none; }
.cursor-dot { width: 8px; height: 8px; background: var(--accent-2); transform: translate(-50%, -50%); }
.cursor-ring {
  width: 36px; height: 36px; border: 1.5px solid var(--accent);
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--ease), height 0.25s var(--ease), background 0.25s, border-color 0.25s;
}
.cursor-ring.is-hot { width: 58px; height: 58px; background: rgba(124, 92, 255, 0.15); border-color: var(--accent-2); }
@media (pointer: fine) { .cursor-dot, .cursor-ring { display: block; } }

/* ---------- scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--grad); z-index: 120;
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 110;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding-inline: max(4vw, 20px);
  transition: background 0.35s var(--ease), box-shadow 0.35s, border-color 0.35s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.nav__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; }
.nav__brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 10px; background: var(--grad); color: #fff;
  font-weight: 700; box-shadow: 0 6px 18px rgba(124, 92, 255, 0.4);
}
.nav__links { display: flex; gap: 6px; }
.nav__link {
  position: relative; padding: 8px 14px; border-radius: 99px;
  font-size: 0.92rem; color: var(--muted);
  transition: color 0.25s, background 0.25s;
}
.nav__link:hover { color: var(--text); background: var(--surface); }
.nav__link.is-active { color: var(--text); }
.nav__link.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: 1px;
  width: 16px; height: 2px; border-radius: 2px;
  background: var(--grad); transform: translateX(-50%);
}
.nav__actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted);
  transition: color 0.25s, transform 0.25s, border-color 0.25s;
}
.icon-btn:hover { color: var(--text); transform: translateY(-2px); border-color: var(--accent); }
.icon-sun { display: none; }
html[data-theme="light"] .icon-sun { display: block; }
html[data-theme="light"] .icon-moon { display: none; }
.nav__burger { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); position: relative; }
.nav__burger span { position: absolute; left: 11px; width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s var(--ease), opacity 0.2s; }
.nav__burger span:nth-child(1) { top: 14px; }
.nav__burger span:nth-child(2) { top: 20px; }
.nav__burger span:nth-child(3) { top: 26px; }
.nav__burger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- side dots ---------- */
.dots {
  position: fixed; right: 22px; top: 50%; transform: translateY(-50%);
  z-index: 100; display: grid; gap: 14px;
}
.dots a { display: flex; align-items: center; gap: 10px; flex-direction: row-reverse; }
.dots i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s var(--ease), background 0.3s;
}
.dots em {
  font-style: normal; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); opacity: 0; transform: translateX(8px);
  transition: opacity 0.3s, transform 0.3s;
}
.dots a:hover em { opacity: 1; transform: translateX(0); }
.dots a.is-active i { background: var(--grad); transform: scale(1.5); border-color: transparent; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 99px;
  font-weight: 600; font-size: 0.95rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, background 0.3s, border-color 0.3s;
  will-change: transform;
}
.btn--primary {
  background: var(--grad); color: #fff;
  box-shadow: 0 10px 30px rgba(124, 92, 255, 0.35);
}
.btn--primary:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(124, 92, 255, 0.5); }
.btn--ghost { border: 1px solid var(--border); background: var(--surface); }
.btn--ghost:hover { border-color: var(--accent); transform: translateY(-3px); }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  padding: calc(var(--nav-h) + 40px) max(4vw, 20px) 80px;
  overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; z-index: -1; }
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 75%);
  opacity: 0.5;
}
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; animation: float 14s ease-in-out infinite; }
.orb--1 { width: 460px; height: 460px; background: #7c5cff; top: -120px; left: -100px; }
.orb--2 { width: 380px; height: 380px; background: #22d3ee; bottom: -80px; right: -60px; animation-delay: -4s; }
.orb--3 { width: 300px; height: 300px; background: #ff5c8a; top: 40%; left: 55%; opacity: 0.3; animation-delay: -8s; }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(30px, -40px) scale(1.08); } }
#particles { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero__content { width: min(1180px, 92vw); margin-inline: auto; position: relative; z-index: 2; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.06em;
  color: var(--muted); padding: 8px 16px;
  border: 1px solid var(--border); border-radius: 99px; background: var(--surface);
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }

.hero__title { margin-top: 26px; font-weight: 700; line-height: 1.05; }
.hero__line { display: block; font-size: clamp(1.1rem, 2.6vw, 1.6rem); color: var(--muted); font-weight: 500; }
.hero__name { display: block; font-size: clamp(3rem, 10vw, 7rem); letter-spacing: -0.02em; }
.hero__name .char {
  display: inline-block; opacity: 0; transform: translateY(60%) rotate(6deg);
  animation: charIn 0.7s var(--ease) forwards;
  background: linear-gradient(180deg, var(--text) 30%, color-mix(in srgb, var(--text) 55%, transparent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__name .char:nth-child(1) { animation-delay: 0.05s; }
.hero__name .char:nth-child(2) { animation-delay: 0.11s; }
.hero__name .char:nth-child(3) { animation-delay: 0.17s; }
.hero__name .char:nth-child(4) { animation-delay: 0.23s; }
.hero__name .char:nth-child(6) { animation-delay: 0.32s; }
.hero__name .char:nth-child(7) { animation-delay: 0.38s; }
.hero__name .char:nth-child(8) { animation-delay: 0.44s; }
.hero__name .char:nth-child(9) { animation-delay: 0.5s; }
.hero__name .char:nth-child(10) { animation-delay: 0.56s; }
@keyframes charIn { to { opacity: 1; transform: translateY(0) rotate(0); } }

.hero__role { display: block; margin-top: 10px; font-size: clamp(1.2rem, 3.4vw, 2.2rem); font-weight: 600; min-height: 1.4em; }
.hero__role-label {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.caret {
  display: inline-block; width: 3px; height: 1em; margin-left: 4px;
  background: var(--accent-2); vertical-align: -0.12em;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__desc { max-width: 560px; margin-top: 22px; color: var(--muted); font-size: clamp(0.98rem, 1.6vw, 1.1rem); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; margin-top: 44px; }
.hero__social { display: flex; gap: 10px; }

/* full-bleed hero photo — card on small screens, right-half background on desktop */
.hero__media {
  position: relative;
  width: min(340px, 80vw);
  margin-top: 34px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: bob 7s ease-in-out infinite;
}
.hero__media img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 30%;
  transition: transform 0.6s var(--ease);
}
.hero__media:hover img { transform: scale(1.04); }
.hero__shade { display: none; }
@media (min-width: 1240px) {
  .hero__media {
    position: absolute;
    inset: 0 0 0 auto;
    width: 50%;
    height: 100%;
    margin-top: 0;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    animation: none;
    z-index: 1;
    pointer-events: none;
  }
  .hero__media img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
    object-position: 58% center;
    transition: none;
  }
  .hero__shade {
    display: block;
    position: absolute;
    inset: 0;
    background:
      linear-gradient(90deg,
        color-mix(in srgb, var(--bg) 92%, transparent) 0%,
        color-mix(in srgb, var(--bg) 70%, transparent) 32%,
        transparent 68%),
      linear-gradient(180deg, color-mix(in srgb, var(--bg) 60%, transparent) 0%, transparent 16%),
      linear-gradient(0deg, color-mix(in srgb, var(--bg) 50%, transparent) 0%, transparent 12%);
  }
}
/* phones & tablets — same full-bleed photo as desktop, with a stronger shade so text stays readable */
@media (max-width: 1239px) {
  .hero__media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin-top: 0;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    animation: none;
    z-index: 1;
    pointer-events: none;
  }
  .hero__media img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
    object-position: 68% 20%;
    transition: none;
  }
  .hero__shade {
    display: block;
    position: absolute;
    inset: 0;
    background:
      linear-gradient(180deg,
        color-mix(in srgb, var(--bg) 55%, transparent) 0%,
        color-mix(in srgb, var(--bg) 72%, transparent) 45%,
        color-mix(in srgb, var(--bg) 90%, transparent) 100%);
  }
}
.hero__social a {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); transition: transform 0.3s var(--ease), color 0.3s, border-color 0.3s;
}
.hero__social a:hover { transform: translateY(-4px); color: var(--text); border-color: var(--accent); }

.code-card {
  width: min(400px, 86vw); border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border); background: rgba(8, 8, 16, 0.75);
  backdrop-filter: blur(10px); box-shadow: var(--shadow);
  transform: rotate(-1.5deg);
  transition: transform 0.4s var(--ease);
}
.code-card:hover { transform: rotate(0deg) translateY(-4px); }
.code-card__head {
  display: flex; align-items: center; gap: 7px; padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--mono); font-size: 0.72rem; color: #8b90a8;
}
.code-card__head i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.code-card__head i:nth-child(2) { background: #febc2e; }
.code-card__head i:nth-child(3) { background: #28c840; }
.code-card__head span { margin-left: 8px; }
.code-card pre { padding: 16px 18px; font-family: var(--mono); font-size: 0.78rem; line-height: 1.75; color: #cdd2e6; overflow-x: auto; }
.c-kw { color: #c792ea; }
.c-str { color: #a5e6a1; }
.c-cm { color: #5b6178; }

.hero__scroll {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 2;
  display: grid; justify-items: center; gap: 8px;
  color: var(--muted); font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase;
}
.hero__scroll-track { width: 2px; height: 46px; background: var(--surface-2); border-radius: 2px; overflow: hidden; position: relative; }
.hero__scroll-thumb { position: absolute; top: -50%; left: 0; width: 100%; height: 50%; background: var(--grad); animation: scrollHint 1.8s var(--ease) infinite; }
@keyframes scrollHint { 0% { top: -50%; } 100% { top: 110%; } }

/* ---------- marquee ---------- */
.marquee {
  overflow: hidden; padding: 18px 0;
  border-block: 1px solid var(--border);
  background: var(--bg-alt);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: marquee 30s linear infinite; }
.marquee__track span {
  font-size: clamp(0.95rem, 2vw, 1.25rem); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--text) 55%, transparent);
}
.marquee__track b { color: var(--accent); -webkit-text-stroke: 0; margin-inline: 10px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { padding: clamp(70px, 10vw, 130px) 0; position: relative; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section__head { margin-bottom: clamp(36px, 6vw, 64px); }
.section__index {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent-2);
}
.section__title { font-size: clamp(1.9rem, 4.6vw, 3.2rem); line-height: 1.1; margin-top: 12px; letter-spacing: -0.02em; }
.section__sub { max-width: 560px; margin-top: 14px; color: var(--muted); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal:nth-child(2) { transition-delay: 0.06s; }
.reveal:nth-child(3) { transition-delay: 0.12s; }
.reveal:nth-child(4) { transition-delay: 0.18s; }

@media (max-width: 980px) {
  .dots { display: none; }
  .nav__links {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; gap: 4px; padding: 18px max(4vw, 20px) 26px;
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(16px); border-bottom: 1px solid var(--border);
    transform: translateY(-130%); transition: transform 0.4s var(--ease);
  }
  .nav__links.is-open { transform: translateY(0); }
  .nav__link { font-size: 1.05rem; padding: 12px 14px; }
  .nav__burger { display: block; }
  .hero__meta { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .hero { padding-bottom: 90px; }
  .code-card { display: none; }
  .btn { padding: 12px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
