:root {
  --bg: #05060a;
  --bg-alt: #0d1117;
  --card: rgba(13, 17, 23, 0.8);
  --card-light: rgba(255, 255, 255, 0.03);
  --text: #f5f7ff;
  --muted: #9fb0d7;
  --accent: #7b5dff;
  --accent-2: #33ffd8;
  --border: rgba(255, 255, 255, 0.15);
  --shadow: 0 25px 60px rgba(4, 6, 12, 0.55);
  font-size: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body.post-body {
  min-height: auto;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

.background-animation {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(123, 93, 255, 0.3), transparent 50%),
    radial-gradient(circle at 80% 0%, rgba(51, 255, 216, 0.2), transparent 60%),
    radial-gradient(circle at 50% 80%, rgba(123, 93, 255, 0.15), transparent 55%);
  filter: blur(60px);
  z-index: -2;
}

#constellation {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
  opacity: 0.6;
}

.hero {
  padding: 2.5rem clamp(1.5rem, 5vw, 6rem) 1rem;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  position: relative;
  z-index: 5;
}

.logo {
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.2rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.nav-cta {
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--accent-2);
  color: var(--accent-2);
  font-size: 0.9rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 0.3rem;
  background: transparent;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
}

.hero-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
  align-items: center;
}

.hero-text h1 {
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  margin-bottom: 0.75rem;
}

.hero-text .tagline {
  font-size: 1.3rem;
  color: var(--accent-2);
  margin-bottom: 0.75rem;
}

.hero-text .sub-tagline,
.hero-text .availability {
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.85rem;
  color: var(--accent-2);
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn.small {
  padding: 0.65rem 1.1rem;
  font-size: 0.85rem;
}

.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0b0d16;
  box-shadow: 0 15px 35px rgba(123, 93, 255, 0.3);
}

.btn.ghost {
  border-color: rgba(255, 255, 255, 0.3);
}

.btn.inline {
  margin-top: 1rem;
}

.btn:hover {
  transform: translateY(-2px) scale(1.01);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.hero-meta .meta-label {
  display: block;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.6);
}

.hero-visual {
  position: relative;
  min-height: 360px;
}

.hero-visual .orb {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 60% 60% 75% 65%;
  background: radial-gradient(circle at 30% 30%, rgba(123, 93, 255, 0.8), rgba(11, 13, 22, 0));
  animation: float 10s ease-in-out infinite;
}

.hero-visual .orb:nth-child(1) {
  top: 10%;
  left: 5%;
}

.hero-visual .orb:nth-child(2) {
  bottom: 5%;
  right: 10%;
  animation-duration: 12s;
  background: radial-gradient(circle at 30% 30%, rgba(51, 255, 216, 0.7), rgba(11, 13, 22, 0));
}

.floating-card {
  position: absolute;
  padding: 1.1rem 1.3rem;
  background: rgba(5, 6, 10, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  width: 220px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: drift 14s ease-in-out infinite;
}

.floating-card:nth-of-type(1) {
  top: 15%;
  right: 15%;
}

.floating-card:nth-of-type(2) {
  bottom: 25%;
  left: 0;
  animation-delay: 1.5s;
}

.floating-card:nth-of-type(3) {
  top: 55%;
  right: 5%;
  animation-delay: 3s;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 3rem 0;
}

.stat-card {
  padding: 1.5rem;
  border-radius: 1.2rem;
  border: 1px solid var(--border);
  background: var(--card-light);
  text-align: left;
  transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.stat-card .stat {
  font-size: 2.2rem;
  font-weight: 600;
}

.stat-card sup,
.stat-card span {
  font-size: 1rem;
  margin-left: 0.2rem;
}

.stat-card:hover {
  transform: translateY(-6px);
  border-color: rgba(51, 255, 216, 0.4);
  box-shadow: 0 20px 50px rgba(5, 6, 10, 0.7);
}

main {
  padding: 0 clamp(1.5rem, 5vw, 6rem) 4rem;
}

.panel {
  margin-bottom: 4rem;
  padding: 2.5rem;
  border-radius: 1.8rem;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.6s ease, border-color 0.6s ease, box-shadow 0.6s ease;
}

.panel::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 1.6rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.panel:hover {
  transform: translateY(-6px);
  border-color: rgba(123, 93, 255, 0.5);
  box-shadow: 0 35px 90px rgba(5, 6, 10, 0.75);
}

.panel:hover::after {
  border-color: rgba(255, 255, 255, 0.12);
}

.panel-heading h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-top: 0.7rem;
}

.about-grid {
  display: grid;
  gap: 1.6rem;
  margin-top: 1.5rem;
}

.about-list {
  list-style: none;
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.about-list li::before {
  content: '>';
  margin-right: 0.5rem;
  color: var(--accent-2);
}

.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pill-grid span {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.9rem;
}

.project-grid,
.skills-grid,
.awards-grid,
.focus-grid,
.contact-grid,
.research-grid,
.coursework-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.project-card,
.research-grid article,
.skills-grid article,
.focus-grid article,
.awards-grid article,
.timeline article,
.writing-list article {
  padding: 1.5rem;
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  transition: transform 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease;
}

.project-card::before,
.research-grid article::before,
.focus-grid article::before,
.timeline article::before,
.writing-list article::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(123, 93, 255, 0.08), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.project-card:hover::before,
.research-grid article:hover::before,
.focus-grid article:hover::before,
.timeline article:hover::before,
.writing-list article:hover::before {
  opacity: 1;
}

.project-card:hover,
.research-grid article:hover,
.skills-grid article:hover,
.focus-grid article:hover,
.awards-grid article:hover,
.timeline article:hover,
.writing-list article:hover {
  transform: translateY(-6px);
  border-color: rgba(123, 93, 255, 0.35);
  box-shadow: 0 25px 70px rgba(5, 6, 10, 0.65);
}

.project-card ul,
.research-grid ul,
.timeline article ul,
.awards-grid ul,
.writing-list p {
  margin-top: 0.8rem;
  color: var(--muted);
}

.project-card ul li,
.research-grid ul li,
.timeline article ul li,
.awards-grid ul li {
  margin-left: 1.2rem;
  margin-bottom: 0.4rem;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.8rem;
}

.project-card h3,
.research-grid h3,
.skills-grid h3,
.focus-grid h3,
.timeline h3,
.writing-list h3,
.awards-grid h3 {
  font-size: 1.25rem;
  margin-bottom: 0.6rem;
}

.timeline {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.timeline-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  color: var(--muted);
}

.timeline article {
  position: relative;
  padding-left: 2rem;
}

.timeline article::after {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 1rem;
  bottom: 1rem;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), transparent);
}

.timeline article::before {
  content: '';
  position: absolute;
  left: 0.1rem;
  top: 1rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  border: 2px solid var(--accent-2);
  background: var(--bg);
  z-index: 2;
}

.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.tech-badges span {
  font-size: 0.8rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.focus-grid article {
  min-height: 160px;
}

.skills-grid article p,
.writing-list article p {
  color: var(--muted);
}

.coursework-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.coursework-list li::before {
  content: '-';
  margin-right: 0.4rem;
  color: var(--accent-2);
}

.writing-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.writing-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}

.writing-list article h3 a {
  color: var(--text);
}

.writing-list article h3 a:hover {
  color: var(--accent-2);
}

.writing-cta {
  margin-top: 2rem;
  padding: 1.5rem;
  border-radius: 1.3rem;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.contact-grid {
  gap: 2.5rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.25rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.95rem;
}

.contact-links a {
  padding: 0.4rem 0.8rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.contact-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: rgba(5, 6, 10, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
  color: var(--text);
  font-family: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent-2);
}

footer {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

.post-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 4rem clamp(1.5rem, 5vw, 6rem) 5rem;
}

.post-panel {
  margin-bottom: 2rem;
}

.post-panel h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  margin: 0.8rem 0;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.8rem;
  margin-bottom: 1.5rem;
}

.post-panel p {
  margin-bottom: 1rem;
  color: var(--muted);
}

.post-panel ul {
  margin: 1rem 0 1rem 1.4rem;
  color: var(--muted);
}

.post-panel li {
  margin-bottom: 0.4rem;
}

.back-link {
  margin-bottom: 1.5rem;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Animations & interactions */
[data-tilt] {
  will-change: transform;
  transition: transform 0.3s ease;
}

.panel,
.project-card,
.research-grid article,
.timeline article,
.focus-grid article,
.skills-grid article,
.writing-list article,
.awards-grid article,
.stat-card {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.panel.visible,
.project-card.visible,
.research-grid article.visible,
.timeline article.visible,
.focus-grid article.visible,
.skills-grid article.visible,
.writing-list article.visible,
.awards-grid article.visible,
.stat-card.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes float {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(6deg);
  }
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(10px, -15px, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

@media (max-width: 900px) {
  .nav-links {
    position: absolute;
    top: 70px;
    right: 1.5rem;
    background: rgba(5, 6, 10, 0.95);
    padding: 1.2rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    flex-direction: column;
    gap: 1rem;
    transform: scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .nav-links.open {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
  }

  .nav-toggle {
    display: flex;
  }

  .nav-cta {
    display: none;
  }

  .hero-stats {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .panel,
  .hero {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 640px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-meta {
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
  }

  .hero-meta .meta-item {
    text-align: center;
  }

  .cta-group {
    flex-direction: column;
    align-items: stretch;
  }

  .btn,
  .btn.ghost,
  .btn.primary {
    width: 100%;
  }

  .hero-visual {
    min-height: 300px;
    order: -1;
  }

  .floating-card {
    position: relative;
    display: block;
    margin: 1rem auto;
    inset: unset;
    width: 100%;
  }

  .panel,
  .hero {
    padding: 1.75rem 1.25rem;
  }

  .project-grid,
  .skills-grid,
  .awards-grid,
  .focus-grid,
  .research-grid,
  .coursework-grid,
  .writing-list,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .pill-grid span,
  .tech-badges span,
  .contact-links a {
    width: 100%;
    text-align: center;
  }

  .contact-grid {
    gap: 1.5rem;
  }

  .panel-heading h2 {
    font-size: 1.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  #constellation {
    display: none;
  }
}
