/* ============================================================
   J. Gavin Ray — Portfolio
   Dark theme, custom CSS only (no Bootstrap)
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --bg:           #0F1117;
  --bg-alt:       #141720;
  --surface:      #1C2030;
  --border:       #252A3A;
  --text:         #E2E8F0;
  --text-muted:   #8B9CB6;
  --text-faint:   #4A5568;
  --accent:       #3B82F6;
  --accent-cyan:  #06B6D4;
  --accent-glow:  rgba(59,130,246,0.15);
  --radius:       8px;
  --radius-lg:    12px;
  --font:         'Inter', system-ui, -apple-system, sans-serif;
  --nav-h:        64px;
  --max-w:        860px;
  --transition:   0.25s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-cyan); }

ul { list-style: none; }

/* ── Navigation ─────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  transition: background var(--transition), border-color var(--transition), backdrop-filter var(--transition);
}

.nav.scrolled {
  background: rgba(15, 17, 23, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.08em;
}
.nav-logo:hover { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--text); }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: calc(var(--nav-h) + 40px) 24px 80px;
  text-align: center;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(59,130,246,0.12) 0%, transparent 70%),
    var(--bg);
}

.hero-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 0 24px rgba(59,130,246,0.3);
  margin-bottom: 24px;
}

.hero-eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 16px;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 24px;
}

.hero-tagline {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.6;
  margin-bottom: 40px;
}

.br-desktop { display: none; }
@media (min-width: 640px) { .br-desktop { display: block; } }

.hero-location {
  font-size: 0.875rem;
  color: var(--text-faint);
  margin-bottom: 32px;
  letter-spacing: 0.02em;
}

/* Buttons */
.hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn-primary:hover {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 0 24px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* Socials */
.hero-socials {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-socials a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition);
}
.hero-socials a:hover { color: var(--accent); }

/* Scroll hint */
.hero-scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
}
.hero-scroll-hint span {
  display: block;
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scroll-pulse 2s ease-in-out infinite;
}
@keyframes scroll-pulse {
  0%, 100% { opacity: 0.2; transform: scaleY(0.6); }
  50%       { opacity: 0.8; transform: scaleY(1); }
}

/* ── Sections ────────────────────────────────────────────── */
.section {
  padding: 100px 24px;
}
.section-alt {
  background: var(--bg-alt);
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── About ───────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}
@media (min-width: 700px) {
  .about-grid { grid-template-columns: 3fr 2fr; gap: 64px; }
}

.about-text p {
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.8;
  margin-bottom: 20px;
}
.about-text p:last-child { margin-bottom: 0; }

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.stat {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--accent);
}
.stat-value {
  display: block;
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.stat-label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Timeline / Experience ───────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--border) 85%, transparent);
}

.timeline-item {
  position: relative;
  padding-bottom: 56px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -34px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.timeline-header {
  margin-bottom: 16px;
}

.timeline-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.timeline-company {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.timeline-company a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition);
}
.timeline-company a:hover { color: var(--accent); }

.badge-acquired {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan) !important;
  border: 1px solid rgba(6, 182, 212, 0.3);
  text-decoration: none;
  transition: all var(--transition);
}
.badge-acquired:hover {
  background: rgba(6, 182, 212, 0.22) !important;
  border-color: var(--accent-cyan) !important;
  color: var(--accent-cyan) !important;
}

.timeline-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-list li {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
  padding-left: 20px;
  position: relative;
}
.timeline-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent-cyan);
  font-size: 0.75rem;
  top: 3px;
}

/* ── Projects ───────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 700px) {
  .projects-grid { grid-template-columns: 1fr 1fr; }
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  border-top: 3px solid var(--accent);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(59,130,246,0.12);
}

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.project-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}

.project-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(6,182,212,0.1);
  border: 1px solid rgba(6,182,212,0.25);
  padding: 3px 10px;
  border-radius: 4px;
  white-space: nowrap;
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 18px;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Skills ─────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 540px) {
  .skills-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 760px) {
  .skills-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition);
}
.skill-group:hover {
  border-color: var(--accent);
}

.skill-category {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 14px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  background: rgba(59,130,246,0.08);
  color: var(--text);
  border: 1px solid rgba(59,130,246,0.2);
  transition: all var(--transition);
}
.tag:hover {
  background: rgba(59,130,246,0.18);
  border-color: var(--accent);
  color: #fff;
}

/* ── Contact ─────────────────────────────────────────────── */
.contact-intro {
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.7;
  max-width: 540px;
  margin-bottom: 40px;
}

.contact-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 540px) {
  .contact-links { grid-template-columns: 1fr 1fr; }
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
}
.contact-card svg { color: var(--accent); flex-shrink: 0; }
.contact-card:hover {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent-glow);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
}
.footer p {
  color: var(--text-faint);
  font-size: 0.8125rem;
}
.footer a {
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer a:hover { color: var(--accent); }

/* ── Fade-in animation ───────────────────────────────────── */
.fade-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js-loaded .fade-in {
  opacity: 0;
  transform: translateY(24px);
}
.js-loaded .fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children in timeline */
.timeline-item:nth-child(1) { transition-delay: 0.05s; }
.timeline-item:nth-child(2) { transition-delay: 0.1s; }
.timeline-item:nth-child(3) { transition-delay: 0.15s; }
.timeline-item:nth-child(4) { transition-delay: 0.2s; }

.skill-group:nth-child(1) { transition-delay: 0.05s; }
.skill-group:nth-child(2) { transition-delay: 0.1s; }
.skill-group:nth-child(3) { transition-delay: 0.15s; }
.skill-group:nth-child(4) { transition-delay: 0.2s; }
.skill-group:nth-child(5) { transition-delay: 0.25s; }
.skill-group:nth-child(6) { transition-delay: 0.3s; }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 540px) {
  .nav-links { gap: 20px; }
  .section { padding: 72px 20px; }
  .hero-ctas { flex-direction: column; align-items: center; }
  .hero-ctas .btn { width: 100%; justify-content: center; max-width: 280px; }
}
