/* ==========================================
   Steven Pinto — Personal Site
   Dark-first, glassmorphism, minimal
   ========================================== */

/* --- CSS Variables --- */
:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Dark theme (default) */
  --bg: #0f0f11;
  --bg-alt: #161619;
  --surface: rgba(255, 255, 255, 0.04);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text: #e4e4e7;
  --text-muted: #8b8b9e;
  --text-dim: #5a5a6e;
  --accent: #60a5fa;
  --accent-glow: rgba(96, 165, 250, 0.15);
  --gradient-1: #667eea;
  --gradient-2: #764ba2;
  --nav-bg: rgba(15, 15, 17, 0.85);
  --card-hover: rgba(255, 255, 255, 0.08);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --dot-color: var(--accent);
}

[data-theme="light"] {
  --bg: #fafafa;
  --bg-alt: #f0f0f3;
  --surface: rgba(0, 0, 0, 0.03);
  --glass: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.08);
  --text: #1a1a2e;
  --text-muted: #64648a;
  --text-dim: #9e9eb0;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.1);
  --nav-bg: rgba(250, 250, 250, 0.85);
  --card-hover: rgba(0, 0, 0, 0.04);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

img {
  max-width: 100%;
  display: block;
}

/* --- Utility --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 120px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 48px;
  color: var(--text);
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 40px;
}

/* --- Glass Card --- */
.glass-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* --- Reveal Animation --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.4s ease;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -1px;
}

.nav-logo:hover {
  opacity: 1;
  color: var(--accent);
}

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

.nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  opacity: 1;
}

.nav-links a.active {
  color: var(--accent);
}

.nav.scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 120px 24px 80px;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.3;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
}

.hero-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.hero-name {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 16px;
  letter-spacing: -2px;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.dot {
  color: var(--accent);
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-dim);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-8px); }
  60% { transform: translateX(-50%) translateY(-4px); }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 14px 32px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  font-family: var(--font-main);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--glass-border);
}

.btn-outline:hover {
  opacity: 1;
  background: var(--glass);
  border-color: var(--text-muted);
}

/* --- About --- */
.about-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 64px;
  align-items: start;
}

.photo-frame {
  width: 280px;
  height: 340px;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid var(--glass-border);
  background: var(--glass);
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 1.05rem;
}

.about-stats {
  display: flex;
  gap: 48px;
  margin-top: 36px;
  padding-top: 36px;
  border-top: 1px solid var(--glass-border);
}

.stat-number {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* --- Timeline --- */
.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--glass-border);
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
}

.timeline-marker {
  position: absolute;
  left: -40px;
  top: 28px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--text-dim);
  z-index: 1;
}

.timeline-marker.current {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.timeline-marker.sabbatical {
  border-color: #f59e0b;
  background: #f59e0b;
}

.timeline-marker.education {
  border-color: var(--gradient-1);
  background: var(--gradient-1);
}

.timeline-content {
  padding: 28px 32px;
}

.timeline-date {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-mono);
}

.timeline-content h4 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 8px 0 4px;
}

.timeline-company {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.timeline-detail {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.timeline-detail::before {
  content: '— ';
}

.timeline-content p:last-of-type {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.timeline-tags span {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--accent-glow);
  color: var(--accent);
  font-family: var(--font-mono);
}

/* --- Projects --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  overflow: hidden;
}

.project-image {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.project-icon {
  font-size: 3rem;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.project-info {
  padding: 24px;
}

.project-info h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.project-info p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.project-tech span {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-dim);
  font-family: var(--font-mono);
  border: 1px solid var(--glass-border);
}

.project-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

/* --- Articles --- */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.article-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--text);
}

.article-card:hover {
  color: var(--text);
}

.article-date {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 500;
}

.article-card h4 {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.article-source {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* --- Interests --- */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.interest-item {
  padding: 28px 20px;
  text-align: center;
}

.interest-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 12px;
}

.interest-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.interest-detail {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* --- Ask Steve AI Section --- */
.asksteve-section {
  text-align: center;
}

.asksteve-section .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

.asksteve-cta {
  margin-bottom: 40px;
}

.btn-lg {
  padding: 18px 40px;
  font-size: 1.1rem;
  border-radius: 14px;
}

.btn-icon {
  margin-right: 8px;
  font-size: 1.2rem;
}

.asksteve-hint {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 12px;
}

.asksteve-examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 700px;
  margin: 0 auto;
}

.example-chip {
  font-size: 0.82rem;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-style: italic;
  cursor: default;
}

/* --- Contact / Footer --- */
.footer {
  padding-bottom: 40px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 64px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.contact-item:hover {
  color: var(--text);
  opacity: 1;
}

.contact-item svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.footer-bottom {
  text-align: center;
  padding-top: 40px;
  border-top: 1px solid var(--glass-border);
}

.footer-bottom p {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .section {
    padding: 80px 0;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 20px 24px;
    gap: 16px;
    border-bottom: 1px solid var(--glass-border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .photo-frame {
    width: 200px;
    height: 240px;
    margin: 0 auto;
  }

  .about-stats {
    gap: 24px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }

  .interests-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-name {
    letter-spacing: -1px;
  }

  .timeline {
    padding-left: 32px;
  }

  .timeline-marker {
    left: -32px;
  }

  .timeline-content {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .interests-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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