/* ============================================================
   shareef.dev — handcrafted, zero frameworks
   ============================================================ */

:root {
  --bg: #06070c;
  --bg-raise: #0c0e16;
  --bg-glass: rgba(18, 21, 33, 0.55);
  --line: rgba(227, 179, 65, 0.14);
  --line-soft: rgba(255, 255, 255, 0.07);
  --text: #eae7df;
  --text-dim: #9a97a3;
  --gold: #e3b341;
  --gold-soft: rgba(227, 179, 65, 0.35);
  --teal: #2dd4bf;
  --indigo: #6366f1;
  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --font-ar: "Noto Kufi Arabic", sans-serif;
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

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

/* film grain */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 9990;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%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(-4%, 3%); }
  40% { transform: translate(3%, -4%); }
  60% { transform: translate(-3%, -2%); }
  80% { transform: translate(4%, 2%); }
}

::selection { background: var(--gold); color: #171204; }

::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #23263a; border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-soft); }

.mono { font-family: var(--font-mono); }
.accent { color: var(--gold); }
.ar { font-family: var(--font-ar); color: var(--gold); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ============ aurora background ============ */
.bg-aurora {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  filter: blur(90px) saturate(120%);
}
.blob { position: absolute; border-radius: 50%; opacity: 0.16; }
.blob-a {
  width: 55vw; height: 55vw; left: -12vw; top: -18vw;
  background: radial-gradient(circle, var(--gold), transparent 65%);
  animation: drift-a 34s ease-in-out infinite alternate;
}
.blob-b {
  width: 46vw; height: 46vw; right: -14vw; top: 24vh;
  background: radial-gradient(circle, var(--indigo), transparent 65%);
  animation: drift-b 41s ease-in-out infinite alternate;
}
.blob-c {
  width: 40vw; height: 40vw; left: 28vw; bottom: -22vw;
  background: radial-gradient(circle, var(--teal), transparent 65%);
  animation: drift-c 47s ease-in-out infinite alternate;
}
@keyframes drift-a { to { transform: translate(14vw, 10vh) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-10vw, -8vh) scale(0.9); } }
@keyframes drift-c { to { transform: translate(-12vw, -14vh) scale(1.2); } }

/* ============ progress bar ============ */
.progress-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 1000;
}
#progress-fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  box-shadow: 0 0 12px var(--gold-soft);
}

/* ============ header ============ */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem clamp(1.2rem, 4vw, 3rem);
  background: linear-gradient(to bottom, rgba(6, 7, 12, 0.85), transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.logo {
  color: var(--text); text-decoration: none;
  font-weight: 700; font-size: 1.05rem; letter-spacing: 0.02em;
}
.site-nav { display: flex; gap: clamp(0.8rem, 2.5vw, 2rem); }
.site-nav a {
  color: var(--text-dim); text-decoration: none; font-size: 0.92rem;
  transition: color 0.25s;
  display: inline-block;
}
.site-nav a:hover { color: var(--gold); }

/* ============ hero ============ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  padding-bottom: 12vh;
}
#hero-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  cursor: pointer;
}
.hero-content {
  position: relative; z-index: 2; text-align: center;
  max-width: 720px; padding: 0 1.4rem;
  pointer-events: none;
}
.hero-content a { pointer-events: auto; }
.hero-kicker {
  color: var(--text-dim); font-size: 0.82rem; letter-spacing: 0.06em;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal); box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.6);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(45, 212, 191, 0); }
  100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0); }
}
.hero-sub {
  margin-top: 0.9rem;
  font-size: clamp(1.15rem, 2.6vw, 1.55rem);
  font-weight: 500; color: var(--text);
}
.hero-tag {
  margin-top: 0.7rem; color: var(--text-dim);
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  max-width: 560px; margin-inline: auto;
}
.hero-cta { margin-top: 1.6rem; display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }
.hero-hint {
  position: absolute; top: 16vh; z-index: 2;
  color: var(--text-dim); font-size: 0.72rem; opacity: 0.65;
  letter-spacing: 0.05em; pointer-events: none;
}
.scroll-cue {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  width: 26px; height: 44px; border: 1.5px solid var(--line-soft);
  border-radius: 20px; z-index: 2;
}
.scroll-cue span {
  position: absolute; top: 8px; left: 50%; width: 4px; height: 8px;
  margin-left: -2px; border-radius: 4px; background: var(--gold);
  animation: cue 1.8s var(--ease-spring) infinite;
}
@keyframes cue {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(16px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ============ buttons ============ */
.btn {
  display: inline-block; padding: 0.8rem 1.7rem; border-radius: 999px;
  text-decoration: none; font-weight: 500; font-size: 0.95rem;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s, background 0.3s, color 0.3s;
  will-change: transform;
}
.btn-solid {
  background: var(--gold); color: #171204;
  box-shadow: 0 4px 30px rgba(227, 179, 65, 0.25);
}
.btn-solid:hover { box-shadow: 0 6px 44px rgba(227, 179, 65, 0.45); }
.btn-ghost {
  color: var(--text); border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.btn-ghost:hover { border-color: var(--gold-soft); color: var(--gold); }
.btn-xl { padding: 1.05rem 2.4rem; font-size: 1.1rem; }

/* ============ sections ============ */
.section {
  max-width: 1080px; margin: 0 auto;
  padding: clamp(4.5rem, 10vh, 8rem) clamp(1.2rem, 4vw, 2.5rem);
}
.section-head {
  display: flex; align-items: baseline; gap: 1rem; margin-bottom: 2.4rem;
}
.section-num {
  color: var(--gold); font-size: 0.85rem; letter-spacing: 0.1em;
}
.section-head h2 {
  font-size: clamp(1.9rem, 4.5vw, 2.8rem); font-weight: 700;
  letter-spacing: -0.02em;
}
.section-sub { color: var(--text-dim); margin: -1.4rem 0 2.4rem; max-width: 640px; }
.inline-link {
  color: var(--gold); text-decoration: none;
  border-bottom: 1px dashed var(--gold-soft);
}
.inline-link:hover { border-bottom-style: solid; }

/* ============ about ============ */
.about-grid {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 2.6rem;
  align-items: start;
}
.about-text p { margin-bottom: 1.1rem; color: var(--text-dim); }
.about-text .lede { font-size: 1.18rem; color: var(--text); }
.about-text strong { color: var(--text); }
.about-cards { display: flex; flex-direction: column; gap: 1rem; }
.stat-card {
  padding: 1.2rem 1.4rem; border-radius: 16px;
  background: var(--bg-glass); border: 1px solid var(--line-soft);
  backdrop-filter: blur(8px);
  display: flex; flex-direction: column; gap: 0.15rem;
}
.stat-card strong { font-size: 1.02rem; }
.stat-card span:last-child { color: var(--text-dim); font-size: 0.88rem; }
.stat-icon { font-size: 1.3rem; margin-bottom: 0.3rem; }

/* ============ timeline ============ */
.timeline { position: relative; padding-left: 2.2rem; }
.timeline-track {
  position: absolute; left: 8px; top: 0; bottom: 0; width: 2px;
  background: var(--line-soft); border-radius: 2px; overflow: hidden;
}
#timeline-fill {
  display: block; width: 100%; height: 100%;
  background: linear-gradient(to bottom, var(--gold), var(--teal));
  transform-origin: top; transform: scaleY(0);
}
.milestone { position: relative; margin-bottom: 2.2rem; }
.milestone:last-child { margin-bottom: 0; }
.milestone-dot {
  position: absolute; left: calc(-2.2rem + 2px); top: 1.35rem;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--text-dim);
  transition: border-color 0.4s, box-shadow 0.4s;
}
.milestone-dot--gold { border-color: var(--gold); box-shadow: 0 0 16px var(--gold-soft); }
.milestone-dot--now {
  border-color: var(--teal);
  animation: pulse 2.2s infinite;
}
.milestone-card {
  padding: 1.35rem 1.6rem; border-radius: 18px;
  background: var(--bg-glass); border: 1px solid var(--line-soft);
  backdrop-filter: blur(8px);
}
.milestone-card--gold { border-color: var(--line); }
.milestone-era {
  color: var(--gold); font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase;
}
.milestone-card h3 { margin: 0.35rem 0 0.4rem; font-size: 1.15rem; }
.milestone-card p { color: var(--text-dim); font-size: 0.95rem; }
.milestone-card strong { color: var(--text); }

/* ============ work ============ */
.work-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem;
}
.work-card {
  position: relative; padding: 1.5rem 1.5rem 1.4rem; border-radius: 20px;
  background: var(--bg-glass); border: 1px solid var(--line-soft);
  backdrop-filter: blur(8px);
  overflow: hidden;
  display: flex; flex-direction: column; gap: 0.55rem;
  transition: border-color 0.35s;
}
.work-card:hover { border-color: var(--line); }
/* pointer-tracked glare */
.work-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%),
              rgba(227, 179, 65, 0.09), transparent 45%);
  opacity: 0; transition: opacity 0.35s;
}
.work-card:hover::before { opacity: 1; }
.work-card--feature { grid-column: span 2; }
.work-card--framework { border-style: dashed; }
.work-card--gold {
  border-color: var(--gold-soft);
  background:
    linear-gradient(160deg, rgba(227, 179, 65, 0.07), transparent 60%),
    var(--bg-glass);
}
.work-more {
  margin-top: 1.6rem; text-align: center;
  color: var(--text-dim); font-size: 0.82rem; opacity: 0.85;
}
.work-tag { color: var(--gold); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }
.work-card h3 { font-size: 1.22rem; }
.work-card p { color: var(--text-dim); font-size: 0.93rem; flex: 1; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  font-family: var(--font-mono); font-size: 0.72rem;
  padding: 0.28rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--line-soft); color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
  transition: color 0.25s, border-color 0.25s, transform 0.25s;
}
.chip:hover { color: var(--gold); border-color: var(--gold-soft); transform: translateY(-2px); }
.chip--lg { font-size: 0.8rem; padding: 0.45rem 1rem; }
.stack-strip {
  margin-top: 2.6rem; display: flex; align-items: center; gap: 1.2rem;
  flex-wrap: wrap;
}
.stack-label { color: var(--gold); font-size: 0.8rem; }
.stack-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ============ framework orbit ============ */
.framework-wrap {
  display: grid; grid-template-columns: minmax(300px, 460px) 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
}
.orbit {
  position: relative; aspect-ratio: 1; width: 100%; max-width: 460px;
  margin: 0 auto;
}
.orbit-ring {
  position: absolute; inset: 11%; border-radius: 50%;
  border: 1px dashed var(--line);
  background:
    radial-gradient(closest-side, transparent 96%, rgba(227, 179, 65, 0.06));
  animation: ring-spin 60s linear infinite;
}
@keyframes ring-spin { to { transform: rotate(360deg); } }
.orbit-core {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 34%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #171a28, #0a0c14 70%);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.1rem;
  box-shadow: 0 0 60px rgba(227, 179, 65, 0.08), inset 0 0 30px rgba(0,0,0,0.5);
}
.orbit-core .mono { font-size: clamp(0.85rem, 1.8vw, 1.05rem); font-weight: 700; letter-spacing: 0.04em; }
.orbit-core small { color: var(--text-dim); font-size: 0.68rem; }
.orbit-node {
  position: absolute; left: 50%; top: 50%;
  width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; border: 1px solid var(--line-soft);
  background: var(--bg-raise);
  color: var(--text-dim);
  font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, box-shadow 0.3s, background 0.3s;
  will-change: transform;
  padding: 0;
}
.orbit-node:hover, .orbit-node.active {
  color: #171204; background: var(--gold); border-color: var(--gold);
  box-shadow: 0 0 26px var(--gold-soft);
}
.framework-detail {
  padding: 1.8rem 2rem; border-radius: 22px;
  background: var(--bg-glass); border: 1px solid var(--line-soft);
  backdrop-filter: blur(8px);
  min-height: 230px;
}
.detail-letter {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(227, 179, 65, 0.12); color: var(--gold);
  font-size: 1.2rem; font-weight: 700; margin-bottom: 0.8rem;
}
.framework-detail h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.framework-detail p { color: var(--text-dim); }
.detail-check { margin-top: 1rem; color: var(--gold); font-size: 0.85rem; }

/* ============ terminal ============ */
.term {
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line-soft);
  background: #0a0c12f2;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.term-bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1rem; background: #10131c;
  border-bottom: 1px solid var(--line-soft);
}
.term-dot { width: 12px; height: 12px; border-radius: 50%; }
.term-dot--r { background: #ff5f57; }
.term-dot--y { background: #febc2e; }
.term-dot--g { background: #28c840; }
.term-title { margin-left: 0.6rem; color: var(--text-dim); font-size: 0.78rem; }
.term-body {
  padding: 1.1rem 1.2rem 1.3rem; min-height: 320px; max-height: 440px;
  overflow-y: auto; font-size: 0.88rem; line-height: 1.75;
  cursor: text; outline: none;
}
.term-lines { white-space: pre-wrap; word-break: break-word; }
.term-lines .t-cmd { color: var(--text); }
.term-lines .t-out { color: var(--text-dim); }
.term-lines .t-gold { color: var(--gold); }
.term-lines .t-teal { color: var(--teal); }
.term-lines .t-err { color: #ff6b6b; }
.term-lines a { color: var(--teal); }
.term-input-row { display: flex; align-items: baseline; flex-wrap: wrap; }
.term-prompt { color: var(--teal); margin-right: 0.55rem; }
.term-typed { color: var(--text); }
.term-caret {
  display: inline-block; width: 9px; height: 1.15em;
  background: var(--gold); margin-left: 2px; vertical-align: text-bottom;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
#term-input {
  position: absolute; opacity: 0; width: 1px; height: 1px;
  border: 0; padding: 0;
}

/* ============ contact ============ */
.section--contact { text-align: center; padding-bottom: 6rem; }
.section--contact .section-head { justify-content: center; }
.contact-lede {
  font-size: clamp(1.15rem, 2.6vw, 1.5rem); max-width: 620px;
  margin: 0 auto 2.2rem;
}
.contact-row {
  display: flex; gap: 1rem; justify-content: center; align-items: center;
  flex-wrap: wrap;
}

/* ============ footer ============ */
.site-footer {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.6rem clamp(1.2rem, 4vw, 3rem);
  border-top: 1px solid var(--line-soft);
  color: var(--text-dim); font-size: 0.75rem;
}

/* ============ custom cursor ============ */
.cursor { display: none; }
@media (pointer: fine) {
  .cursor { display: block; position: fixed; inset: 0; pointer-events: none; z-index: 9999; }
  .cursor-dot, .cursor-ring {
    position: absolute; top: 0; left: 0; border-radius: 50%;
    transform: translate(-50%, -50%);
  }
  .cursor-dot {
    width: 6px; height: 6px; background: var(--gold);
  }
  .cursor-ring {
    width: 34px; height: 34px;
    border: 1.5px solid var(--gold-soft);
    transition: width 0.25s, height 0.25s, border-color 0.25s;
    mix-blend-mode: difference;
  }
  .cursor.is-hover .cursor-ring {
    width: 56px; height: 56px; border-color: var(--gold);
  }
}

/* ============ reveal on scroll ============ */
.reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.8s var(--ease-spring), transform 0.8s var(--ease-spring);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* ============ tilt ============ */
.tilt { transform-style: preserve-3d; will-change: transform; }

/* ============ responsive ============ */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: 1fr 1fr; }
  .work-card--feature { grid-column: span 2; }
  .framework-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .site-nav a:not(:last-child) { display: none; }
  .work-grid { grid-template-columns: 1fr; }
  .work-card--feature { grid-column: span 1; }
  .hero-hint { top: 13vh; }
  .orbit { max-width: 340px; }
  .orbit-node { width: 44px; height: 44px; margin: -22px 0 0 -22px; font-size: 0.95rem; }
}

/* ============ reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  body::after { animation: none; }
}
