@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');
@import url('variables.css');

/* ========================================
   Reset & Base
   ======================================== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* offset for fixed header */
}
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Skip-to-content link (WCAG 2.1 AA) */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 0.75rem 1.5rem;
  background: var(--accent-primary);
  color: #fff;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: top 0.2s ease;
}
.skip-nav:focus {
  top: 0;
  color: #fff;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-main);
  overflow-x: hidden;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
  color: #fff;
}

a {
  color: var(--accent-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-primary);
}

p {
  margin-bottom: var(--spacing-md);
}

ul {
  list-style: none;
}

/* ========================================
   3D Canvas Background
   ======================================== */
#canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: var(--z-canvas);
  pointer-events: none;
}

/* ========================================
   Header / Navigation
   ======================================== */
header {
  padding: var(--spacing-md) var(--spacing-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: var(--z-header);
  background: rgba(13, 15, 18, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
  text-decoration: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

nav ul {
  display: flex;
  list-style: none;
  gap: var(--spacing-lg);
}

nav ul li a {
  color: var(--text-color);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  position: relative;
  padding-bottom: 4px;
}

nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--accent-primary);
}

nav ul li a:hover::after,
nav ul li a.active::after {
  width: 100%;
}

/* ========================================
   Layout — Sections
   ======================================== */
main {
  position: relative;
  z-index: var(--z-base);
}

section {
  padding: var(--spacing-xxl) var(--spacing-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Hero section gets full viewport height */
.hero-section {
  min-height: 100vh;
}

/* Subtle alternating background gradient */
section:nth-child(even)::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(139, 92, 246, 0.03), transparent);
  pointer-events: none;
  z-index: -1;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-xl);
  text-align: center;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  margin: var(--spacing-sm) auto 0;
  border-radius: 2px;
}

/* ========================================
   Hero Section
   ======================================== */
.hero-section {
  align-items: flex-start;
  padding-top: calc(var(--spacing-xxl) + 80px); /* account for fixed header */
}

.hero-eyebrow {
  text-transform: uppercase;
  color: var(--accent-primary);
  letter-spacing: 3px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: var(--spacing-sm);
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--spacing-md);
  max-width: 700px;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: var(--spacing-lg);
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
  flex-wrap: wrap;
}

/* CTA visibility ensured by GSAP clearProps — no !important needed */

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn:hover {
  opacity: 0.9;
  transform: scale(1.05);
  color: white;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
}

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

.btn-outline:hover {
  background: rgba(139, 92, 246, 0.1);
  color: var(--text-primary);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
}

/* ========================================
   Glass Cards
   ======================================== */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ========================================
   About Section
   ======================================== */
.about-layout {
  display: flex;
  gap: var(--spacing-xl);
  align-items: flex-start;
}

.about-photo {
  flex-shrink: 0;
}

.headshot {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-primary);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

.about-text p:last-child {
  margin-bottom: 0;
}

/* ========================================
   Skills Grid
   ======================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
}

.skill-category {
  display: flex;
  flex-direction: column;
}

.skill-category h3 {
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  font-size: 1.1rem;
  color: var(--accent-secondary);
  font-weight: 600;
}

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

.skill-tag {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: var(--text-primary);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.3s ease, border-color 0.3s ease;
  white-space: nowrap;
}

.skill-tag:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: rgba(139, 92, 246, 0.5);
}

/* ========================================
   Experience Timeline
   ======================================== */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  align-items: center;
  width: 100%;
  margin: 0 auto;
}

.experience-list > .glass-card,
.experience-list > .experience-subheading {
  width: 100%;
  max-width: 800px;
}

.experience-subheading {
  color: var(--accent-secondary);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0;
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--card-border);
}

.experience-item h4 {
  margin-bottom: 0.25rem;
  font-size: 1.15rem;
}

.experience-item .date {
  color: var(--accent-secondary);
  font-size: 0.85rem;
  margin-bottom: var(--spacing-sm);
  display: inline-block;
  font-weight: 500;
}

.experience-item p {
  margin-bottom: var(--spacing-sm);
}

.experience-item ul {
  list-style: disc;
  padding-left: 1.2rem;
  margin-top: var(--spacing-sm);
}

.experience-item ul li {
  margin-bottom: var(--spacing-xs);
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ========================================
   Projects Grid
   ======================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-lg);
}

.project-card {
  display: flex;
  flex-direction: column;
}

.project-card a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-card a:hover {
  color: inherit;
}

.project-img-wrapper {
  width: 100%;
  height: 180px;
  overflow: hidden;
  border-radius: calc(var(--border-radius) - 4px);
  margin-bottom: var(--spacing-md);
  background: rgba(0, 0, 0, 0.3);
}

.project-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-img-wrapper img {
  transform: scale(1.08);
}

.project-card h4 {
  font-size: 1.1rem;
  margin-bottom: var(--spacing-sm);
}

.project-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex-grow: 1;
}

.project-card .skill-tags {
  margin-top: auto;
  padding-top: var(--spacing-md);
}

/* ========================================
   Writing Section
   ======================================== */
.writing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

.writing-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.writing-card:hover {
  color: inherit;
  transform: translateY(-4px);
  border-color: var(--accent-primary);
}

.writing-card h3 {
  font-size: 1.15rem;
  line-height: 1.4;
  margin-bottom: var(--spacing-xs);
}

.writing-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0;
  line-height: 1.6;
}

.read-more {
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: auto;
  transition: transform 0.3s ease;
  display: inline-block;
}

.writing-card:hover .read-more {
  transform: translateX(4px);
}

/* Coming Soon / Upcoming cards */
.writing-card--upcoming {
  opacity: 0.65;
  cursor: default;
  pointer-events: none;
}

.writing-card--upcoming .read-more {
  color: var(--text-muted);
  font-style: italic;
}

/* ========================================
   Contact Section
   ======================================== */
#contact .glass-card {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.contact-links {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
}

.contact-links li a {
  display: block;
  background: var(--card-bg);
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--border-radius);
  border: 1px solid var(--card-border);
  color: var(--text-color);
  font-weight: 500;
  transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease;
}

.contact-links li a:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.08);
}

/* ========================================
   Footer
   ======================================== */
.glass-footer {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: var(--spacing-lg) 5%;
  margin-top: var(--spacing-xl);
  position: relative;
  z-index: var(--z-base);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: var(--spacing-md);
}

.footer-brand h3 {
  margin-bottom: var(--spacing-xs);
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0;
}

.footer-socials {
  display: flex;
  gap: var(--spacing-lg);
}

.footer-socials a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-socials a svg {
  transition: transform 0.3s ease;
}

.footer-socials a:hover {
  color: var(--accent-primary);
}

.footer-socials a:hover svg {
  transform: translateY(-2px);
}

.footer-bottom {
  text-align: center;
  margin-top: var(--spacing-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ========================================
   Hamburger Menu
   ======================================== */
.hamburger {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
  z-index: 101;
  padding: 4px;
  margin-left: auto;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 2.5px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ========================================
   Responsive — Mobile
   ======================================== */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  nav ul {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background: rgba(13, 15, 18, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xl);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
  }

  nav ul.open {
    right: 0;
  }

  .hamburger.active span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
  }
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
  }

  header {
    padding: var(--spacing-md);
  }

  section {
    padding: var(--spacing-xl) var(--spacing-md);
  }

  .hero-section {
    padding-top: calc(var(--spacing-xl) + 70px);
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .hero-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-title {
    font-size: 2rem;
  }

  .glass-card {
    padding: var(--spacing-md);
  }

  .about-layout {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .headshot {
    width: 140px;
    height: 140px;
  }

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

  .experience-list > .glass-card,
  .experience-list > .experience-subheading {
    width: 92%;
    margin-left: auto;
    margin-right: auto;
  }

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

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

  .footer-content {
    flex-direction: column;
    gap: var(--spacing-md);
    text-align: center;
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
  }
}

/* Tablet tweaks */
@media (min-width: 769px) and (max-width: 1024px) {
  section {
    padding: var(--spacing-xl) var(--spacing-lg);
  }

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

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

/* ========================================
   Utility — legacy .grid class
   ======================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

/* ========================================
   Accessibility & Selection
   ======================================== */
::selection {
  background: rgba(139, 92, 246, 0.3);
  color: #fff;
}

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

/* ========================================
   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;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ========================================
   Email Modal
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: var(--spacing-md);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  max-width: 450px;
  width: 100%;
  text-align: center;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(30, 41, 59, 0.7) !important;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--accent-primary);
}

.email-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  margin: var(--spacing-lg) 0;
}

#email-address {
  font-family: monospace;
  font-size: 1.1rem;
  color: var(--accent-secondary);
}

.btn-copy {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease, transform 0.2s ease;
}

.btn-copy:hover {
  color: var(--accent-primary);
  transform: scale(1.1);
}

.btn-copy:active {
  transform: scale(0.9);
}

.copy-feedback {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-primary);
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.copy-feedback.show {
  opacity: 1;
}

.modal-actions {
  display: flex;
  justify-content: center;
  margin-top: var(--spacing-md);
}

@media (max-width: 480px) {
  .email-display {
    flex-direction: column;
    padding: 1rem;
  }
  
  #email-address {
    font-size: 0.95rem;
    word-break: break-all;
  }
}

