/* ============================================================
   bassamai.com — hand-crafted, zero frameworks
   aesthetic: "deep-signal" — near-black space, cyan→violet ion
   accent, film grain, particles behind everything.
   ============================================================ */

@font-face {
  font-family: 'Syne';
  src: url('/fonts/syne-var.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/space-grotesk-var.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono-var.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --bg: #06070c;
  --bg-card: rgba(255, 255, 255, 0.028);
  --line: rgba(255, 255, 255, 0.09);
  --text: #eceaf4;
  --muted: #9b98ad;
  --cyan: #66e0ff;
  --cyan-rgb: 102, 224, 255;
  --violet: #8b5cf6;
  --violet-rgb: 139, 92, 246;
  --coral: #ff6a5e;
  --gold: #ffd166;
  --display: 'Syne', system-ui, sans-serif;
  --body: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(20px, 5vw, 72px);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(var(--cyan-rgb), 0.35); color: #fff; }

.mono {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

a { color: inherit; text-decoration: none; }

/* ---------- atmosphere layers ---------- */

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.nebula {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.nebula i {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: drift 26s ease-in-out infinite alternate;
}
.nebula i:nth-child(1) {
  width: 55vmax; height: 55vmax; top: -25vmax; right: -18vmax;
  background: radial-gradient(circle, rgba(var(--violet-rgb), 0.16), transparent 65%);
}
.nebula i:nth-child(2) {
  width: 45vmax; height: 45vmax; bottom: -20vmax; left: -15vmax;
  background: radial-gradient(circle, rgba(var(--cyan-rgb), 0.10), transparent 65%);
  animation-delay: -9s;
}
.nebula i:nth-child(3) {
  width: 30vmax; height: 30vmax; top: 45%; left: 55%;
  background: radial-gradient(circle, rgba(var(--violet-rgb), 0.08), transparent 65%);
  animation-delay: -17s;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-6vmax, 5vmax, 0) scale(1.15); }
}

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

/* ---------- cursor ---------- */

.cursor { display: none; }
@media (pointer: fine) {
  .cursor { display: block; position: fixed; inset: 0; z-index: 300; pointer-events: none; }
  .cursor-dot, .cursor-ring {
    position: absolute;
    top: 0; left: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    will-change: transform;
  }
  .cursor-dot { width: 6px; height: 6px; background: var(--cyan); }
  .cursor-ring {
    width: 34px; height: 34px;
    border: 1px solid rgba(var(--cyan-rgb), 0.5);
    transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out),
                border-color 0.25s, background 0.25s;
  }
  .cursor.is-hover .cursor-ring {
    width: 56px; height: 56px;
    border-color: rgba(var(--violet-rgb), 0.8);
    background: rgba(var(--violet-rgb), 0.12);
  }
  body { cursor: none; }
  a, button { cursor: none; }
}

/* ---------- progress ---------- */

.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 250;
}
.progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  transform-origin: 0 0;
  transform: scaleX(0);
}

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--pad);
  background: linear-gradient(rgba(6, 7, 12, 0.85), transparent);
  backdrop-filter: blur(2px);
}
.nav-logo {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.nav-logo span {
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-links { display: flex; gap: clamp(16px, 3vw, 36px); }
.nav-links a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  padding: 4px 0;
  transition: color 0.25s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-meta { color: var(--muted); }
@media (max-width: 560px) { .nav-meta { display: none; } }

/* ---------- hero ---------- */

main { position: relative; z-index: 1; }

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px var(--pad) 80px;
  position: relative;
}

.hero-eyebrow { color: var(--cyan); margin-bottom: 8px; }

.hero-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.4rem, 12.5vw, 11.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  user-select: none;
  display: flex;
}
.hero-name .ch {
  display: inline-block;
  background: linear-gradient(180deg, #ffffff 30%, #9f9ab8 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transform: translateY(0.35em) rotate(4deg);
  animation: ch-in 0.9s var(--ease-out) forwards;
  transition: transform 0.3s var(--ease-out);
}
.hero-name .ch:hover {
  transform: translateY(-0.06em) skewX(-6deg);
  background: linear-gradient(180deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
}
.hero-name .ch:nth-child(1) { animation-delay: 0.05s; }
.hero-name .ch:nth-child(2) { animation-delay: 0.12s; }
.hero-name .ch:nth-child(3) { animation-delay: 0.19s; }
.hero-name .ch:nth-child(4) { animation-delay: 0.26s; }
.hero-name .ch:nth-child(5) { animation-delay: 0.33s; }
.hero-name .ch:nth-child(6) { animation-delay: 0.40s; }
@keyframes ch-in {
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

.hero-role {
  font-size: clamp(1.05rem, 2.4vw, 1.6rem);
  color: var(--muted);
  max-width: 40ch;
  margin-top: 20px;
}
.scramble {
  color: var(--text);
  font-weight: 600;
  border-bottom: 1px solid rgba(var(--cyan-rgb), 0.5);
  white-space: nowrap;
}
.hero-role-tail { display: block; }

.hero-cta { display: flex; gap: 16px; margin-top: 40px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: 999px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s, border-color 0.3s, background 0.3s;
  will-change: transform;
}
.btn-solid {
  background: linear-gradient(100deg, var(--cyan), var(--violet));
  color: #060710;
}
.btn-solid:hover { box-shadow: 0 0 42px rgba(var(--violet-rgb), 0.5); }
.btn-ghost {
  border-color: var(--line);
  color: var(--text);
  background: var(--bg-card);
}
.btn-ghost:hover { border-color: rgba(var(--cyan-rgb), 0.6); }
.btn-arrow { transition: transform 0.3s var(--ease-out); }
.btn:hover .btn-arrow { transform: translateY(3px); }

.hero-live {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 36px;
  width: fit-content;
  padding: 9px 16px;
  border: 1px solid rgba(255, 106, 94, 0.3);
  border-radius: 999px;
  background: rgba(255, 106, 94, 0.06);
  color: var(--coral);
  transition: border-color 0.3s, background 0.3s;
}
.hero-live:hover { border-color: rgba(255, 106, 94, 0.7); background: rgba(255, 106, 94, 0.12); }

.pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--coral);
  animation: pulse 1.6s ease-out infinite;
}
.pulse-sm { width: 6px; height: 6px; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 106, 94, 0.6); }
  100% { box-shadow: 0 0 0 12px rgba(255, 106, 94, 0); }
}

.hero-scroll {
  position: absolute;
  bottom: 32px;
  right: var(--pad);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}
.hero-scroll-line {
  display: block;
  width: 56px; height: 1px;
  background: var(--muted);
  overflow: hidden;
  position: relative;
}
.hero-scroll-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--cyan);
  animation: scroll-line 2s var(--ease-out) infinite;
}
@keyframes scroll-line {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* ---------- marquee ---------- */

.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 18px 0;
  background: rgba(6, 7, 12, 0.6);
  position: relative;
  z-index: 1;
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 28px;
  width: max-content;
  animation: marquee 36s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.25s;
}
.marquee-track span:hover { color: var(--cyan); }
.marquee-track i { color: rgba(var(--violet-rgb), 0.6); font-style: normal; font-size: 0.6rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */

.section {
  padding: clamp(90px, 14vh, 160px) var(--pad);
  max-width: 1240px;
  margin: 0 auto;
  position: relative;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 22px;
  margin-bottom: clamp(48px, 7vw, 84px);
}
.section-num { color: var(--cyan); }
.section-head h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.section-head h2 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- projects ---------- */

.project {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(24px, 3.5vw, 44px);
  margin-bottom: 36px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg-card);
  backdrop-filter: blur(6px);
  transition: border-color 0.4s, box-shadow 0.4s;
  transform-style: preserve-3d;
  will-change: transform;
}
.project:hover {
  border-color: rgba(var(--cyan-rgb), 0.35);
  box-shadow: 0 24px 70px -30px rgba(var(--violet-rgb), 0.35);
}
@media (max-width: 820px) {
  .project { grid-template-columns: 1fr; }
}

.project-viz {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #05060a;
  min-height: 240px;
  transform: translateZ(30px);
}
.project-viz canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.project-body { transform: translateZ(18px); }
.project-body h3 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  letter-spacing: -0.01em;
  margin: 16px 0 12px;
}
.project-body h3 a { transition: color 0.25s; display: inline-block; }
.project-body h3 a:hover { color: var(--cyan); }
.project-body h3 .ext { font-size: 0.6em; vertical-align: super; color: var(--violet); }
.project-body p { color: var(--muted); max-width: 58ch; }
.project-body p + p { margin-top: 12px; }
.project-body strong, .project-body em { color: var(--text); }

.project-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}
.tag-live { border-color: rgba(255, 106, 94, 0.5); color: var(--coral); display: inline-flex; align-items: center; gap: 7px; }
.tag-oss { border-color: rgba(var(--cyan-rgb), 0.5); color: var(--cyan); }
.tag-lab { border-color: rgba(255, 209, 102, 0.5); color: var(--gold); }

/* classified card */
.project-classified { border-style: dashed; }
.project-viz-redacted {
  position: relative;
  border-radius: 12px;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(-45deg, transparent 0 22px, rgba(255, 209, 102, 0.04) 22px 44px),
    #05060a;
  min-height: 240px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 36px;
}
.stamp {
  position: absolute;
  top: 24px; right: -34px;
  transform: rotate(35deg);
  padding: 6px 44px;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.55);
  color: var(--gold);
  letter-spacing: 0.3em;
}
.redact {
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(255,255,255,0.14), rgba(255,255,255,0.07));
  animation: redact-shimmer 2.6s ease-in-out infinite;
}
.redact.r1 { width: 82%; } .redact.r2 { width: 64%; animation-delay: 0.2s; }
.redact.r3 { width: 91%; animation-delay: 0.4s; } .redact.r4 { width: 45%; animation-delay: 0.6s; }
.redact.r5 { width: 72%; animation-delay: 0.8s; }
@keyframes redact-shimmer {
  0%, 100% { opacity: 0.55; } 50% { opacity: 1; }
}
.redact-inline { color: rgba(255, 255, 255, 0.35); letter-spacing: -0.06em; }

.countdown { margin-top: 18px; color: var(--gold); }
.countdown span { font-variant-numeric: tabular-nums; }

.more-link { text-align: center; color: var(--muted); margin-top: 20px; }
.more-link a { color: var(--cyan); border-bottom: 1px solid rgba(var(--cyan-rgb), 0.4); }
.more-link a:hover { border-bottom-color: var(--cyan); }

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }

.about-lede {
  font-size: clamp(1.25rem, 2.6vw, 1.8rem);
  line-height: 1.5;
  font-weight: 500;
}
.about-lede em {
  font-style: normal;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  background: var(--bg-card);
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
}
.stat:hover { border-color: rgba(var(--violet-rgb), 0.5); transform: translateY(-4px); }
.stat-num {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label { color: var(--muted); display: block; margin-top: 6px; }

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: clamp(48px, 7vw, 80px);
}
@media (max-width: 820px) { .principles { grid-template-columns: 1fr; } }
.principle {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s;
}
.principle::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}
.principle:hover { border-color: rgba(var(--cyan-rgb), 0.3); }
.principle:hover::before { transform: scaleX(1); }
.principle-num { color: var(--violet); }
.principle h4 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  margin: 12px 0 8px;
}
.principle p { color: var(--muted); font-size: 0.95rem; }

/* ---------- contact ---------- */

.section-contact { text-align: left; padding-bottom: 140px; }
.contact-lede { color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.35rem); max-width: 48ch; }
.contact-actions { display: flex; gap: 18px; margin-top: 44px; flex-wrap: wrap; }
.btn-big { padding: 20px 36px; font-size: clamp(0.95rem, 2vw, 1.15rem); border: none; }
button.btn { font-family: var(--body); }
.copy-hint { opacity: 0.55; font-size: 0.6em; }

/* ---------- footer ---------- */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 28px var(--pad);
  border-top: 1px solid var(--line);
  color: var(--muted);
  position: relative;
  z-index: 1;
}
.footer-hint #egg-hint { color: rgba(var(--cyan-rgb), 0.7); }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 20px);
  z-index: 400;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(var(--cyan-rgb), 0.5);
  background: rgba(6, 7, 12, 0.92);
  color: var(--cyan);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- reveal ---------- */

html.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--d, 0s);
}
html.js .reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- reduced motion ---------- */

@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; }
  .hero-name .ch { opacity: 1; transform: none; }
  .grain { display: none; }
}
