/* ---------- Design tokens ---------- */
:root {
  --bg: #0b0f14;
  --bg-alt: #10161d;
  --surface: #161d26;
  --border: #232c37;
  --text: #e7edf3;
  --text-muted: #9aa7b5;
  --accent: #5eead4;
  --accent-soft: rgba(94, 234, 212, 0.12);
  --accent-warm: #ff9466;
  --accent-warm-soft: rgba(255, 148, 102, 0.12);
  /* hard-stop split (rather than a full blend) avoids the muddy-brown midpoint
     you get from linearly interpolating between teal and orange in sRGB */
  --gradient: linear-gradient(90deg, var(--accent) 0%, var(--accent) 42%, var(--accent-warm) 58%, var(--accent-warm) 100%);

  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --max-width: 1000px;
  --radius: 10px;
}

/* ---------- Scrollbar ---------- */
* { scrollbar-color: var(--border) var(--bg); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---------- Grain overlay ---------- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

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

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

ul { list-style: none; margin: 0; padding: 0; }

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

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--gradient);
  z-index: 100;
  transition: width 0.1s ease-out;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 15, 20, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.logo:hover { text-decoration: none; color: var(--accent); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav {
  display: flex;
  gap: 28px;
}

.resume-btn {
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}
.resume-btn:hover {
  background: var(--accent);
  color: #04231d;
  text-decoration: none;
}

.nav a {
  position: relative;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding-bottom: 4px;
}
.nav a:hover { color: var(--accent); text-decoration: none; }
.nav a.active { color: var(--accent); }

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}
.nav a:hover::after,
.nav a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 40px;
  padding-bottom: 40px;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.22;
  z-index: -1;
  animation: blobFloat 14s ease-in-out infinite;
}
.hero::before {
  background: var(--accent);
  top: -160px;
  left: -140px;
}
.hero::after {
  background: var(--accent-warm);
  bottom: -180px;
  right: -140px;
  animation-delay: -7s;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before, .hero::after { animation: none; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero .container > * {
  opacity: 0;
  animation: fadeInUp 0.7s ease forwards;
}
.hero .eyebrow        { animation-delay: 0.05s; }
.hero h1               { animation-delay: 0.15s; }
.hero .hero-subtitle   { animation-delay: 0.25s; }
.hero .hero-text       { animation-delay: 0.35s; }
.hero .hero-actions    { animation-delay: 0.45s; }

@media (prefers-reduced-motion: reduce) {
  .hero .container > * { animation: none; opacity: 1; }
}

.eyebrow {
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  margin: 0 0 12px;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.hero-subtitle {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(1.3rem, 3.5vw, 2rem);
  color: var(--text-muted);
  margin: 0 0 20px;
}

.hero-text {
  max-width: 560px;
  color: var(--text-muted);
  margin: 0 0 32px;
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: #04231d;
}
.btn-primary:hover {
  background: #7ff2df;
  box-shadow: 0 10px 20px -8px rgba(94, 234, 212, 0.4);
}

.btn-outline {
  border: 1px solid var(--accent);
  color: var(--accent);
}
.btn-outline:hover { background: var(--accent-soft); }

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding: 100px 24px;
}
.section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-warm), transparent);
  opacity: 0.55;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  margin: 0 0 40px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.section-number {
  color: var(--accent);
  font-size: 1.1rem;
}

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

.about-text p { color: var(--text-muted); margin: 0 0 16px; }

.about-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin-top: 16px;
}
.about-list li {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text);
}
.about-list li::before { content: "▹ "; color: var(--accent); }

.education-block {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.education-label {
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
}
.education-degree {
  color: var(--text);
  font-weight: 600;
  margin: 0 0 4px;
}
.education-school {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.photo-placeholder {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: var(--font-heading);
}

.about-photo img {
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  object-fit: cover;
  object-position: 50% 15%;
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  perspective: 1200px;
}

.project-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 16px 32px -16px rgba(94, 234, 212, 0.3);
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), var(--accent-warm-soft), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.project-card:hover::before { opacity: 1; }

.project-card > * { position: relative; z-index: 1; }

.project-card h4 {
  font-family: var(--font-heading);
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.project-card .project-role {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0 0 12px;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0 0 16px;
  flex: 1;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.tag-list li {
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 999px;
}

.project-links {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------- Skills marquee ---------- */
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  gap: 16px;
  animation: marqueeScroll 24s linear infinite;
}
.skill-pill {
  flex: 0 0 auto;
  padding: 16px 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1rem;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.skill-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; flex-wrap: wrap; }
}

/* ---------- Contact ---------- */
.contact-section { text-align: center; }

.contact-card {
  position: relative;
  overflow: hidden;
  padding: 72px 40px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.contact-card::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: var(--gradient);
  filter: blur(140px);
  opacity: 0.18;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
}

.contact-card > * {
  position: relative;
  z-index: 1;
}

.contact-card .eyebrow { justify-content: center; }

.contact-heading {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 16px;
  color: var(--accent);
}

.contact-text {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 36px;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

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

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.social-icon svg { width: 20px; height: 20px; }
.social-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px);
  text-decoration: none;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 32px 24px 48px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Scroll-triggered reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* stagger children within a revealed group */
.projects-grid.reveal.visible .project-card,
.about-list.reveal.visible li {
  opacity: 1;
  transform: none;
}
.projects-grid .project-card,
.about-list li {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.projects-grid.reveal.visible .project-card:nth-child(1) { transition-delay: 0.05s; }
.projects-grid.reveal.visible .project-card:nth-child(2) { transition-delay: 0.15s; }
.projects-grid.reveal.visible .project-card:nth-child(3) { transition-delay: 0.25s; }
.projects-grid.reveal.visible .project-card:nth-child(4) { transition-delay: 0.05s; }
.projects-grid.reveal.visible .project-card:nth-child(5) { transition-delay: 0.15s; }
.projects-grid.reveal.visible .project-card:nth-child(6) { transition-delay: 0.25s; }

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .projects-grid .project-card,
  .about-list li {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav-toggle { display: flex; }
  .nav-right { gap: 12px; }
  .resume-btn { padding: 7px 12px; font-size: 0.78rem; }

  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 240px; }

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

  .contact-card { padding: 48px 24px; }
}
