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

/* =====================
   CUSTOM PROPERTIES
   ===================== */
:root {
  --bg-primary:    #0d0d0d;
  --bg-secondary:  #141414;
  --bg-card:       #1a1a1a;
  --accent-blue:   #00b4ff;
  --accent-teal:   #00ffd5;
  --text-primary:  #f0f0f0;
  --text-muted:    #888888;
  --border:        #2a2a2a;
  --font-heading:  'Space Grotesk', sans-serif;
  --font-body:     'Inter', sans-serif;
  --nav-height:    68px;
  --max-width:     1100px;
  --radius:        10px;
  --transition:    0.25s ease;
}

/* =====================
   BASE
   ===================== */
html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

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

/* =====================
   UTILITIES
   ===================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 56px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--accent-blue);
  color: #000;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid var(--accent-blue);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn:hover {
  background: var(--accent-teal);
  border-color: var(--accent-teal);
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 180, 255, 0.25);
}

.btn-outline {
  background: transparent;
  color: var(--accent-blue);
}

.btn-outline:hover {
  background: var(--accent-teal);
  border-color: var(--accent-teal);
  color: #000;
}

/* =====================
   FADE-IN ANIMATION
   ===================== */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =====================
   NAVBAR
   ===================== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  transition: background var(--transition), backdrop-filter var(--transition), border-bottom var(--transition);
}

#navbar.scrolled {
  background: rgba(13, 13, 13, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 1px;
}

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

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

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-family: var(--font-heading);
  font-weight: 500;
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-blue);
  transition: width var(--transition);
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

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

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: transform var(--transition), opacity var(--transition);
}

#navbar.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#navbar.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
#navbar.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =====================
   HERO
   ===================== */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--nav-height);
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 40%, rgba(0, 180, 255, 0.07) 0%, transparent 60%),
              radial-gradient(ellipse at 20% 80%, rgba(0, 255, 213, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
  padding-top: 48px;
  padding-bottom: 48px;
}

.hero-eyebrow {
  display: block;
  color: var(--accent-blue);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 12px;
  opacity: 0;
  animation: hello-in 0.6s ease forwards;
  animation-delay: 0.7s;
}

@keyframes hello-in {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: translateX(0); }
}

.hero-text h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -1px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 40%, var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-role {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--accent-teal);
  font-weight: 600;
  margin-bottom: 20px;
}

.hero-bio {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 480px;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-visual {
  position: relative;
  height: 400px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

#particles {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* =====================
   PROJECTS
   ===================== */
#projects {
  padding: 100px 0;
  background: var(--bg-secondary);
  clip-path: polygon(0 32px, 100% 0, 100% calc(100% - 32px), 0 100%);
  padding: 120px 0;
}

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

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-blue);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform var(--transition), box-shadow var(--transition), border-left-color var(--transition);
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 180, 255, 0.12);
  border-left-color: var(--accent-teal);
}

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

.card-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-links {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.card-links a {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.card-links a:hover { color: var(--accent-teal); }

.project-card > p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 20px;
}

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

.card-tags span {
  background: rgba(0, 180, 255, 0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(0, 180, 255, 0.2);
  font-size: 0.75rem;
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

/* =====================
   PROJECTS — WIDE CARDS
   ===================== */
.projects-wide-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.project-card-wide {
  background: var(--bg-card);
  border: 1.5px solid rgba(200, 168, 75, 0.35);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.project-card-wide:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(200, 168, 75, 0.18);
  border-color: rgba(200, 168, 75, 0.65);
}

.project-card-wide-inner {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 260px;
}

.project-card-wide-info {
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

.project-card-wide-info h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.project-card-wide-info > p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.75;
  margin-bottom: 20px;
}

/* Gold-tinted tags and links inside wide project cards */
.project-card-wide .card-tags {
  margin-bottom: 20px;
}

.project-card-wide .card-tags span {
  background: rgba(200, 168, 75, 0.1);
  color: #c8a84b;
  border-color: rgba(200, 168, 75, 0.25);
}

.project-card-wide .card-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: rgba(200, 168, 75, 0.12);
  border: 1.5px solid rgba(200, 168, 75, 0.5);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: #c8a84b;
  letter-spacing: 0.02em;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.project-card-wide .card-links a:hover {
  background: rgba(200, 168, 75, 0.22);
  border-color: #c8a84b;
  color: #e8c86a;
}

/* Right image panel */
.project-card-wide-image {
  position: relative;
  overflow: hidden;
}

.project-card-wide-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Gradient fades the image into the card background on the left edge */
.project-card-wide-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--bg-card) 0%, rgba(26, 26, 26, 0.55) 35%, transparent 75%);
  z-index: 1;
  pointer-events: none;
}

/* Mobile: stack image below info */
@media (max-width: 768px) {
  .project-card-wide-inner {
    grid-template-columns: 1fr;
  }

  .project-card-wide-info {
    padding: 28px 24px;
  }

  .project-card-wide-image {
    height: 200px;
  }

  /* On mobile the gradient fades down from the top instead of left */
  .project-card-wide-image::before {
    background: linear-gradient(to bottom, var(--bg-card) 0%, transparent 50%);
  }
}

/* =====================
   WRITING
   ===================== */
#writing {
  padding: 100px 0;
}

.writing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.writing-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  color: var(--text-primary);
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.writing-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(0, 180, 255, 0.1);
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.writing-card h3 {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
}

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

.writing-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-heading);
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.writing-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
  width: fit-content;
}

.writing-tag.energy {
  background: rgba(0, 180, 255, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(0, 180, 255, 0.25);
}

.writing-tag.history {
  background: rgba(255, 165, 0, 0.1);
  color: #ffaa33;
  border: 1px solid rgba(255, 165, 0, 0.2);
}

.writing-tag.politics {
  background: rgba(0, 255, 213, 0.1);
  color: var(--accent-teal);
  border: 1px solid rgba(0, 255, 213, 0.2);
}

.writing-tag.academic {
  background: rgba(180, 100, 255, 0.1);
  color: #bb77ff;
  border: 1px solid rgba(180, 100, 255, 0.2);
}

.writing-tag.newsletter {
  background: rgba(80, 200, 120, 0.1);
  color: #50c878;
  border: 1px solid rgba(80, 200, 120, 0.2);
}

.writing-cta {
  text-align: center;
}

/* =====================
   RESUME
   ===================== */
#resume {
  padding: 100px 0;
}

.resume-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.resume-timeline h3,
.resume-skills h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 28px;
}

.timeline-h3 { margin-top: 48px !important; }

.timeline {
  list-style: none;
  position: relative;
  padding-left: 24px;
}

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

.timeline li {
  position: relative;
  margin-bottom: 36px;
}

.timeline li::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-blue);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 0 2px var(--accent-blue);
}

.timeline-date {
  display: block;
  font-size: 0.78rem;
  color: var(--accent-teal);
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.timeline li strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.timeline-company {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.timeline li p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.skill-group {
  margin-bottom: 32px;
}

.skill-group h4 {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.skill-bar {
  margin-bottom: 12px;
}

.skill-label {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.bar {
  height: 5px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-teal));
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.resume-skills.visible .bar-fill {
  width: var(--pct);
}

.resume-dl {
  margin-top: 36px;
}

.program-callout {
  margin-top: 56px;
  padding: 32px 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-teal);
  border-radius: var(--radius);
}

.program-callout h4 {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-teal);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.program-callout p {
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.75;
  max-width: 780px;
  margin-bottom: 16px;
}

.program-link {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-blue);
  transition: color var(--transition);
}

.program-link:hover { color: var(--accent-teal); }

/* =====================
   CONTACT
   ===================== */
#contact {
  padding: 100px 0;
  background: var(--bg-secondary);
  clip-path: polygon(0 0, 100% 32px, 100% 100%, 0 100%);
  padding-top: 132px;
}

.contact-wrap {
  max-width: 600px;
  margin: 0 auto;
}

.contact-email-cta {
  text-align: center;
  margin-bottom: 48px;
  padding: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.contact-email-cta p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 28px;
  line-height: 1.8;
}

.contact-socials p {
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
  margin-bottom: 20px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.social-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: var(--font-heading);
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.social-links a:hover {
  color: var(--accent-teal);
  border-color: var(--accent-teal);
  background: rgba(0, 255, 213, 0.05);
}

/* =====================
   FOOTER
   ===================== */
footer {
  padding: 28px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

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

/* =====================
   MEDIA QUERIES
   ===================== */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-inner { justify-content: flex-end; }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(13, 13, 13, 0.97);
    backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: center;
    padding: 32px 0;
    gap: 28px;
    transform: translateY(-120%);
    transition: transform 0.3s ease;
    border-bottom: 1px solid var(--border);
  }

  #navbar.nav-open .nav-links {
    transform: translateY(0);
  }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-bio { margin-left: auto; margin-right: auto; }

  .hero-actions { justify-content: center; }

  .hero-visual { display: none; }

  .resume-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  #projects {
    clip-path: polygon(0 16px, 100% 0, 100% calc(100% - 16px), 0 100%);
    padding: 80px 0;
  }

  #contact {
    clip-path: polygon(0 0, 100% 16px, 100% 100%, 0 100%);
    padding-top: 100px;
  }

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

@media (max-width: 480px) {
  .projects-grid { grid-template-columns: 1fr; }

  .hero-actions { flex-direction: column; align-items: center; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}

/* =====================
   LOADER
   ===================== */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

#loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-inner span {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 6px;
  animation: loader-pulse 0.9s ease-in-out infinite alternate;
}

@keyframes loader-pulse {
  from { opacity: 0.3; }
  to   { opacity: 1; }
}


/* =====================
   FOOTER (updated)
   ===================== */
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-badges {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-heading);
  transition: color var(--transition);
}

.footer-badge:hover { color: var(--accent-blue); }

.footer-sep { color: var(--border); }
