/* ==========================================================================
   Paul Adeleke Aladenusi (Leke) — Portfolio
   Full-stack engineer. Single long-scroll page.
   ========================================================================== */

:root {
  --accent: #60a5fa;              /* electric blue */
  --accent-dim: rgba(96,165,250,0.13); /* accent @ ~13% alpha (hex "22") */
  --accent-line: rgba(96,165,250,0.3);
  --accent-border: rgba(96,165,250,0.4);
  --bg: #080808;
  --bg2: #0f0f0f;
  --bg3: #151515;
  --text: #efefef;
  --muted: #555;
  --border: rgba(255,255,255,0.07);
  --font-display: 'Syne', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  line-height: 1.6;
}

/* Full-page fractal-noise overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 999;
  opacity: 0.4;
}
::selection { background: var(--accent); color: #000; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── NAV ─────────────────────────────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 64px;
  transition: all 0.4s;
  border-bottom: 1px solid transparent;
}
nav.scrolled {
  background: rgba(8,8,8,0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: var(--border);
}
.nav-logo { font-family: var(--font-mono); font-size: 14px; color: var(--accent); letter-spacing: 0.05em; }
.nav-links { display: flex; gap: 36px; list-style: none; }
.nav-links a { font-size: 13px; font-family: var(--font-mono); color: var(--muted); letter-spacing: 0.05em; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta { font-size: 13px; font-family: var(--font-mono); color: var(--accent); border: 1px solid var(--accent); padding: 8px 20px; transition: all 0.2s; }
.nav-cta:hover { background: var(--accent); color: #000; }

/* ── HERO ────────────────────────────────────────────────────────────────── */
#home {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 64px 72px;
  position: relative;
  overflow: hidden;
}
/* Hero entrance animations are held until fonts load (.fonts-ready, set in main.js)
   so the name never appears in the fallback font — see the .fonts-ready block below. */
.hero-eyebrow {
  font-family: var(--font-mono); font-size: 13px; color: var(--accent);
  letter-spacing: 0.12em; margin-bottom: 24px;
  opacity: 0; /* revealed once fonts are ready */
}
.hero-name { line-height: 0.88; margin-bottom: 40px; }
.hero-name .line {
  font-family: var(--font-display);
  font-size: var(--name-size, clamp(72px,11vw,190px));
  font-weight: 800; letter-spacing: -0.02em;
  display: block; overflow: hidden; white-space: nowrap;
}
.hero-name .line span {
  display: block; transform: translateY(100%); /* held below the mask until fonts ready */
}
.hero-name .line:nth-child(2) span { color: rgba(239,239,239,0.35); }
.hero-bottom {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 40px; opacity: 0; /* revealed once fonts are ready */
}
.hero-role { font-size: clamp(15px,1.5vw,20px); color: var(--muted); max-width: 520px; }
.hero-role strong { color: var(--text); }
#role-text { color: var(--accent); }
.hero-actions { display: flex; gap: 16px; flex-shrink: 0; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #000;
  font-family: var(--font-body); font-weight: 600; font-size: 14px;
  padding: 14px 28px; transition: all 0.2s; border: 1px solid var(--accent);
}
.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); color: var(--muted);
  font-size: 14px; padding: 14px 28px; transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--muted); color: var(--text); }
.hero-scroll {
  position: absolute; right: 64px; bottom: 72px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  opacity: 0; /* revealed once fonts are ready */
}
.hero-scroll span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.1em; writing-mode: vertical-rl; }

/* Hero entrance — triggered only after fonts load (prevents flash of fallback font) */
.fonts-ready .hero-eyebrow { animation: fadeUp 0.6s 0.2s forwards; }
.fonts-ready .hero-name .line span { animation: slideUp 0.8s cubic-bezier(0.16,1,0.3,1) forwards; }
.fonts-ready .hero-name .line:nth-child(1) span { animation-delay: 0.3s; }
.fonts-ready .hero-name .line:nth-child(2) span { animation-delay: 0.45s; }
.fonts-ready .hero-bottom { animation: fadeUp 0.6s 0.8s forwards; }
.fonts-ready .hero-scroll { animation: fadeIn 1s 1.2s forwards; }
.scroll-line { width: 1px; height: 60px; background: linear-gradient(to bottom, var(--accent), transparent); }

/* ── SECTION SHARED ──────────────────────────────────────────────────────── */
section { padding: 120px 64px; }
.section-label { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 16px; }
.section-title { font-family: var(--font-display); font-size: clamp(40px,5vw,72px); font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.7s, transform 0.7s; }
.reveal.visible { opacity: 1; transform: none; }
.stagger .reveal:nth-child(2) { transition-delay: 0.1s; }
.stagger .reveal:nth-child(3) { transition-delay: 0.2s; }
.stagger .reveal:nth-child(4) { transition-delay: 0.3s; }
.stagger .reveal:nth-child(5) { transition-delay: 0.4s; }

/* ── ABOUT ───────────────────────────────────────────────────────────────── */
#about { background: var(--bg2); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; margin-top: 60px; align-items: start; }
.about-text p { font-size: 17px; color: rgba(239,239,239,0.7); line-height: 1.8; margin-bottom: 20px; }
.about-text p strong { color: var(--text); }
.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 40px; }
.stat { border: 1px solid var(--border); padding: 24px; }
.stat-num { font-family: var(--font-display); font-size: 40px; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.code-block {
  background: var(--bg3); border: 1px solid var(--border); padding: 28px;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.8;
  position: relative; overflow: hidden;
}
.code-block::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.code-top { display: flex; gap: 8px; margin-bottom: 20px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.code-line { display: block; }
.c-purple { color: #c084fc; } .c-blue { color: #60a5fa; } .c-green { color: #4ade80; }
.c-amber { color: #fbbf24; } .c-muted { color: #555; } .c-white { color: #efefef; }
.cursor { display: inline-block; width: 2px; height: 1em; background: var(--accent); vertical-align: text-bottom; animation: blink 1s infinite; }

/* ── SKILLS GLOBE ────────────────────────────────────────────────────────── */
#skills { text-align: center; }
#skills .section-label, #skills .section-title { text-align: left; }
.globe-container { position: relative; margin: 60px auto 0; width: min(600px,90vw); height: min(600px,90vw); }
#globe-canvas { width: 100%; height: 100%; cursor: grab; }
#globe-canvas:active { cursor: grabbing; }

/* ── PROJECTS ────────────────────────────────────────────────────────────── */
#projects { background: var(--bg2); }
.projects-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 0; }
.project-list { margin-top: 16px; border-top: 1px solid var(--border); }
.project-item {
  position: relative; border-bottom: 1px solid var(--border); padding: 40px 0;
  display: grid; grid-template-columns: 80px 1fr auto; gap: 32px; align-items: center;
  cursor: pointer; transition: background 0.3s; color: inherit;
}
.project-item--static { cursor: default; }
.project-item:hover { background: rgba(255,255,255,0.02); }
.project-num { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.project-title { font-family: var(--font-display); font-size: clamp(22px,3vw,36px); font-weight: 800; letter-spacing: -0.02em; transition: color 0.2s; }
.project-item:hover .project-title { color: var(--accent); }
.project-sub { font-size: 14px; color: var(--muted); margin-top: 4px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag { font-family: var(--font-mono); font-size: 11px; color: var(--muted); border: 1px solid var(--border); padding: 4px 10px; letter-spacing: 0.04em; transition: all 0.2s; }
.project-item:hover .tag { border-color: var(--accent-line); color: var(--accent); }
.project-arrow { font-size: 24px; color: var(--muted); transition: all 0.3s; flex-shrink: 0; }
.project-item:hover .project-arrow { color: var(--accent); transform: translate(4px,-4px); }
.project-badge {
  font-family: var(--font-mono); font-size: 10px; background: var(--accent); color: #000;
  padding: 3px 8px; font-weight: 500; margin-left: 12px; vertical-align: middle;
  white-space: nowrap;
}

/* Floating hover preview */
.project-preview {
  position: fixed; pointer-events: none; z-index: 50;
  width: 420px; height: 280px; overflow: hidden;
  opacity: 0; transform: scale(0.92);
  transition: opacity 0.3s, transform 0.3s;
  border: 1px solid var(--border);
}
.project-preview img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.project-preview.active { opacity: 1; transform: scale(1); }

/* ── EXPERIENCE ──────────────────────────────────────────────────────────── */
.timeline { margin-top: 60px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--border); }
.tl-item { padding: 0 0 56px 40px; position: relative; }
.tl-item::before { content: ''; position: absolute; left: -4px; top: 6px; width: 9px; height: 9px; background: var(--bg); border: 1px solid var(--muted); border-radius: 50%; }
.tl-item.current::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px var(--accent); }
.tl-date { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: 0.08em; margin-bottom: 8px; }
.tl-role { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.tl-company { font-size: 15px; color: var(--muted); margin-top: 2px; }
.tl-desc { font-size: 14px; color: rgba(239,239,239,0.6); margin-top: 12px; max-width: 600px; line-height: 1.7; }

/* ── CERTIFICATIONS ──────────────────────────────────────────────────────── */
#certifications { background: var(--bg2); }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 24px; margin-top: 60px; }
.cert-card { border: 1px solid var(--border); padding: 28px; position: relative; overflow: hidden; transition: border-color 0.3s; }
.cert-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, var(--accent-dim), transparent); opacity: 0; transition: opacity 0.3s; }
.cert-card:hover { border-color: var(--accent-border); }
.cert-card:hover::before { opacity: 1; }
.cert-issuer { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.1em; margin-bottom: 8px; position: relative; }
.cert-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; position: relative; }
.cert-date { font-size: 13px; color: var(--muted); position: relative; }
.cert-link { position: absolute; top: 28px; right: 28px; font-size: 18px; color: var(--muted); transition: color 0.2s; }
.cert-card:hover .cert-link { color: var(--accent); }

/* ── CONTACT ─────────────────────────────────────────────────────────────── */
#contact { text-align: center; padding: 160px 64px; }
.contact-big { font-family: var(--font-display); font-size: clamp(48px,8vw,120px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; margin-bottom: 48px; }
.contact-big em { color: var(--accent); font-style: normal; }
.contact-email { font-size: 16px; padding: 18px 40px; }
.contact-links { display: flex; justify-content: center; gap: 32px; margin-top: 48px; flex-wrap: wrap; }
.contact-link { font-family: var(--font-mono); font-size: 13px; color: var(--muted); letter-spacing: 0.06em; border-bottom: 1px solid var(--border); padding-bottom: 4px; transition: all 0.2s; }
.contact-link:hover { color: var(--accent); border-color: var(--accent); }

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
footer { border-top: 1px solid var(--border); padding: 28px 64px; display: flex; justify-content: space-between; align-items: center; }
footer span { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.footer-tag { color: var(--accent); }

/* ── TOAST (copy-to-clipboard confirmation) ──────────────────────────────── */
.toast {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em;
  padding: 14px 22px; z-index: 300;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s, transform 0.4s; /* subtle, in step with the scroll reveals */
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── ANIMATIONS ──────────────────────────────────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }

/* ── RESPONSIVE (≤900px) ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  nav { padding: 20px 28px; }
  .nav-links { display: none; }
  section, #home, #contact { padding: 80px 28px; }
  #home { padding-bottom: 60px; }
  .about-grid { grid-template-columns: 1fr; }
  .project-item { grid-template-columns: 50px 1fr auto; }
  .project-preview { display: none; }
  footer { padding: 20px 28px; }
  .hero-scroll { display: none; }
  .hero-bottom { flex-direction: column; align-items: flex-start; gap: 24px; }
  .contact-big { font-size: clamp(40px,12vw,80px); }
}

/* ── REDUCED MOTION ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-eyebrow, .hero-bottom, .hero-scroll { opacity: 1; }
  .hero-name .line span { transform: none; }
  .reveal { opacity: 1; transform: none; }
}
