/* ============================================================
   CSS CUSTOM PROPERTIES — edit these to theme your site!
   TODO: Try asking Copilot to suggest a color palette for you.
   ============================================================ */
:root {
  --color-bg: #070b18;
  --color-bg-alt: #101932;
  --color-text: #f5f7ff;
  --color-text-muted: #c2c8e8;
  --color-accent: #9b7bff;
  --color-accent-hover: #6dd3ff;
  --color-border: rgba(157, 123, 255, 0.32);
  --color-card: rgba(11, 18, 38, 0.82);
  --color-card-strong: rgba(18, 27, 55, 0.92);
  --page-bg-start: #040712;
  --page-bg-middle: #070b18;
  --page-bg-end: #101b38;
  --page-glow-1: rgba(155, 123, 255, 0.38);
  --page-glow-2: rgba(109, 211, 255, 0.24);
  --page-glow-3: rgba(85, 52, 170, 0.24);
  --nav-bg: rgba(7, 11, 24, 0.82);
  --hero-overlay: rgba(4, 7, 18, 0.45);
  --hero-overlay-strong: rgba(4, 7, 18, 0.62);
  --hero-background: radial-gradient(circle at 50% 35%, rgba(155, 123, 255, 0.18), transparent 28%), url("https://wallpapercave.com/wp/wp7153972.jpg") center center / cover no-repeat;
  --hero-text: #e8ebff;
  --hero-highlight-start: #fffaff;
  --hero-highlight-mid: #f4f0ff;
  --hero-highlight-end: #9b7bff;
  --section-alt-bg: linear-gradient(180deg, rgba(19, 27, 55, 0.88) 0%, rgba(7, 11, 24, 0.6) 100%);
  --surface: rgba(11, 18, 38, 0.82);
  --surface-strong: rgba(18, 27, 55, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.04);
  --surface-soft-border: rgba(157, 123, 255, 0.14);
  --surface-soft-2: rgba(109, 211, 255, 0.16);
  --timeline-marker: "🌙";
  --star-color: rgba(255, 247, 199, 0.95);
  --star-opacity: 0.65;
  --starfield-opacity: 0.22;
  --starfield-glow-opacity: 0.22;
  --hero-bg-opacity: 0.45;
  --hero-after-opacity: 0.56;
  --theme-toggle-bg: rgba(11, 18, 38, 0.72);
  --theme-toggle-border: rgba(157, 123, 255, 0.32);
  --theme-toggle-color: #f5f7ff;
  --font-main: 'Segoe UI', system-ui, sans-serif;
  --radius: 10px;
  --shadow: 0 14px 34px rgba(2, 6, 23, 0.5);
  --transition: 0.2s ease;
}

html {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
  --color-bg: #eef4ff;
  --color-bg-alt: #e2ebf9;
  --color-text: #13213d;
  --color-text-muted: #52627f;
  --color-accent: #5b58e6;
  --color-accent-hover: #1477d3;
  --color-border: rgba(72, 97, 155, 0.18);
  --color-card: rgba(255, 255, 255, 0.92);
  --color-card-strong: rgba(247, 250, 255, 0.98);
  --page-bg-start: #f8fbff;
  --page-bg-middle: #eef4ff;
  --page-bg-end: #dfe8fb;
  --page-glow-1: rgba(91, 88, 230, 0.18);
  --page-glow-2: rgba(20, 119, 211, 0.12);
  --page-glow-3: rgba(255, 255, 255, 0.5);
  --nav-bg: rgba(255, 255, 255, 0.82);
  --hero-overlay: rgba(255, 255, 255, 0);
  --hero-overlay-strong: rgba(241, 246, 255, 0.04);
  --hero-background: url("https://images.pexels.com/photos/2598081/pexels-photo-2598081.jpeg?cs=srgb&dl=pexels-mo-eid-1268975-2598081.jpg&fm=jpg") center center / cover no-repeat;
  --hero-text: #f8fbff;
  --hero-highlight-start: #1a2450;
  --hero-highlight-mid: #4a4fd6;
  --hero-highlight-end: #5b58e6;
  --section-alt-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(236, 241, 252, 0.95) 100%);
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: rgba(247, 250, 255, 0.98);
  --surface-soft: rgba(19, 33, 61, 0.06);
  --surface-soft-border: rgba(72, 97, 155, 0.12);
  --surface-soft-2: rgba(91, 88, 230, 0.12);
  --timeline-marker: "⭐";
  --star-color: rgba(68, 87, 127, 0.55);
  --star-opacity: 0.28;
  --starfield-opacity: 0.24;
  --starfield-glow-opacity: 0.12;
  --hero-bg-opacity: 0.18;
  --hero-after-opacity: 0.32;
  --theme-toggle-bg: rgba(255, 255, 255, 0.9);
  --theme-toggle-border: rgba(72, 97, 155, 0.18);
  --theme-toggle-color: #21304f;
}

/* TODO: Add a [data-theme="dark"] block here for dark mode.
   Copilot can generate this for you — try:
   "Add a dark mode theme using CSS custom properties" */

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

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  min-height: 100vh;
  font-family: var(--font-main);
  background:
    radial-gradient(circle at top left, var(--page-glow-1), transparent 28%),
    radial-gradient(circle at top right, var(--page-glow-2), transparent 24%),
    radial-gradient(circle at 50% 25%, var(--page-glow-3), transparent 20%),
    linear-gradient(180deg, var(--page-bg-start) 0%, var(--page-bg-middle) 48%, var(--page-bg-end) 100%);
  color: var(--color-text);
  line-height: 1.7;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--starfield-opacity);
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.95) 50%, transparent 55%),
    radial-gradient(1px 1px at 24% 72%, rgba(173, 216, 255, 0.85) 50%, transparent 55%),
    radial-gradient(1px 1px at 41% 24%, rgba(255, 255, 255, 0.9) 50%, transparent 55%),
    radial-gradient(1.5px 1.5px at 58% 40%, rgba(255, 255, 255, 0.85) 50%, transparent 55%),
    radial-gradient(1px 1px at 76% 16%, rgba(194, 168, 255, 0.9) 50%, transparent 55%),
    radial-gradient(1px 1px at 82% 68%, rgba(255, 255, 255, 0.88) 50%, transparent 55%),
    radial-gradient(1px 1px at 90% 34%, rgba(109, 211, 255, 0.8) 50%, transparent 55%),
    radial-gradient(1.2px 1.2px at 66% 84%, rgba(255, 255, 255, 0.95) 50%, transparent 55%),
    radial-gradient(1px 1px at 8% 84%, rgba(255, 255, 255, 0.85) 50%, transparent 55%),
    radial-gradient(1px 1px at 50% 8%, rgba(255, 255, 255, 0.82) 50%, transparent 55%);
  background-size: 100% 100%;
  animation: twinkle 10s ease-in-out infinite alternate;
}

body::after {
  content: '';
  position: fixed;
  inset: -10%;
  pointer-events: none;
  z-index: 0;
  opacity: var(--starfield-glow-opacity);
  background-image:
    radial-gradient(circle at 15% 35%, rgba(155, 123, 255, 0.55), transparent 0 22%),
    radial-gradient(circle at 78% 24%, rgba(109, 211, 255, 0.4), transparent 0 20%),
    radial-gradient(circle at 48% 76%, rgba(155, 123, 255, 0.28), transparent 0 24%);
  filter: blur(20px);
  animation: drift 18s ease-in-out infinite alternate;
}

body > * {
  position: relative;
  z-index: 1;
}

.star-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-star {
  position: absolute;
  color: var(--star-color);
  text-shadow: 0 0 10px rgba(255, 241, 173, 0.9), 0 0 24px rgba(109, 211, 255, 0.28);
  animation-name: starFloat, starTwinkle;
  animation-timing-function: ease-in-out, ease-in-out;
  animation-iteration-count: infinite, infinite;
  will-change: transform, opacity;
  user-select: none;
}

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

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

/* ============================================================
   NAVIGATION
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 2rem;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid var(--theme-toggle-border);
  background: var(--theme-toggle-bg);
  color: var(--theme-toggle-color);
  font: inherit;
  font-size: 1.1rem;
  cursor: pointer;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--theme-toggle-border);
  background: var(--theme-toggle-bg);
  color: var(--theme-toggle-color);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), background-color var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.14);
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(2, 6, 23, 0.18);
}

.theme-toggle-icon {
  font-size: 1rem;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-accent);
  text-shadow: 0 0 18px rgba(155, 123, 255, 0.45);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--color-text);
  font-weight: 500;
}

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

/* TODO: The nav isn't responsive on mobile yet.
   Ask Copilot: "Make this navbar collapse into a hamburger menu on small screens" */

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(var(--hero-overlay), var(--hero-overlay-strong));
}

.hero::before {
  content: '';
  position: absolute;
  inset: -8%;
  background: var(--hero-background);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.08);
  filter: saturate(1.35) contrast(1.18) brightness(1.06);
  animation: spaceDrift 26s ease-in-out infinite alternate;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(var(--hero-overlay), var(--hero-overlay-strong));
  z-index: 0;
}

.hero-content {
  max-width: 700px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
  text-shadow: 0 0 24px rgba(109, 211, 255, 0.18);
}

.highlight {
  color: var(--hero-highlight-mid);
  background: linear-gradient(90deg, var(--hero-highlight-start) 0%, var(--hero-highlight-mid) 28%, #d9ccff 58%, var(--hero-highlight-end) 100%);
  background-size: 220% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 10px rgba(244, 240, 255, 0.35), 0 0 22px rgba(155, 123, 255, 0.4), 0 0 38px rgba(109, 211, 255, 0.18);
  animation: nameShimmer 2.8s ease-in-out infinite alternate;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--hero-text);
  margin-bottom: 2rem;
}

/* ============================================================
   THEME TRANSITION
   ============================================================ */
.theme-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
}

.theme-transition-stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.theme-transition-star {
  position: absolute;
  color: #fff7c7;
  font-size: var(--star-size, 18px);
  text-shadow: 0 0 10px rgba(255, 241, 173, 0.95), 0 0 22px rgba(109, 211, 255, 0.3);
  animation: themeStarBurst var(--star-duration, 900ms) ease-out forwards;
  transform: translate3d(0, 0, 0) rotate(0deg);
  will-change: transform, opacity;
}

.theme-transition-star::before {
  content: '✦';
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
  color: #fff !important;
  border-radius: var(--radius);
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
  box-shadow: 0 0 24px rgba(155, 123, 255, 0.28);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(109, 211, 255, 0.35);
  filter: brightness(1.05);
}

.btn-outline {
  background: transparent;
  color: var(--color-accent) !important;
  border: 2px solid var(--color-accent);
}

.btn-outline:hover {
  background: var(--surface-soft-2);
  color: #fff !important;
}

.spaceship {
  position: fixed;
  left: 0;
  bottom: 1rem;
  z-index: 2;
  font-size: clamp(2rem, 3.2vw, 3rem);
  filter: drop-shadow(0 0 10px rgba(109, 211, 255, 0.45));
  pointer-events: auto;
  cursor: pointer;
  will-change: transform, opacity;
  opacity: 0;
}

.spaceship::after {
  content: '';
  position: absolute;
  left: -1.4rem;
  top: 50%;
  width: 1.2rem;
  height: 0.35rem;
  transform: translateY(-50%);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(109, 211, 255, 0), rgba(109, 211, 255, 0.9), rgba(155, 123, 255, 0.2));
  filter: blur(1px);
  opacity: 0.9;
}

.ship-explosion {
  position: fixed;
  z-index: 3;
  pointer-events: none;
  width: 0;
  height: 0;
}

.ship-flash {
  position: absolute;
  left: 0;
  top: 0;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, rgba(255, 214, 102, 0.95) 30%, rgba(255, 96, 96, 0) 70%);
  box-shadow: 0 0 20px rgba(255, 226, 127, 0.95), 0 0 46px rgba(255, 120, 120, 0.7);
  transform: translate(-50%, -50%) scale(0.5);
  animation: shipFlash 0.65s ease-out forwards;
}

.ship-particle {
  position: absolute;
  left: 0;
  top: 0;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--particle-color, #fff);
  box-shadow: 0 0 12px var(--particle-color, #fff);
  transform: translate(-50%, -50%);
  animation: shipBurst 1.25s ease-out forwards;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding: 5rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.section-alt {
  background: var(--section-alt-bg);
  max-width: 100%;
  padding: 5rem 2rem;
}

.section-alt > * {
  max-width: 1000px;
  margin: 0 auto;
}

h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}

/* Accent underline on section headings */
h2::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 40px;
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-hover));
  border-radius: 2px;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: start;
}

.about-text p + p {
  margin-top: 1rem;
}

.about-image {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.avatar-placeholder,
.avatar-image {
  width: clamp(180px, 22vw, 240px);
  height: clamp(180px, 22vw, 240px);
  border-radius: 50%;
  border: 3px solid var(--color-border);
  background: radial-gradient(circle at 30% 30%, rgba(109, 211, 255, 0.32), rgba(155, 123, 255, 0.32)), var(--color-card);
  box-shadow: 0 0 28px rgba(155, 123, 255, 0.18);
}

.avatar-image {
  display: block;
  object-fit: cover;
  object-position: center;
}

/* ============================================================
   EXPERIENCE & EDUCATION
   ============================================================ */
.chart-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3.5rem;
  align-items: center;
}

.chart-circle {
  flex: 0 1 420px;
  width: min(420px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.06), transparent 28%),
    radial-gradient(circle at center, var(--surface-soft-2), var(--surface-strong) 62%);
  border: 1px solid var(--color-border);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.45), inset 0 0 24px rgba(109, 211, 255, 0.08);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.chart-circle h3 {
  margin-bottom: 0.9rem;
  font-size: 1.2rem;
  color: var(--color-text);
}

.timeline-list {
  list-style: none;
  display: grid;
  gap: 0.65rem;
}

.timeline-list li {
  position: relative;
  padding: 0.7rem 0.95rem 0.7rem 2rem;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--surface-soft-border);
  text-align: left;
}

.timeline-list li::before {
  content: var(--timeline-marker);
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  line-height: 1;
}

.timeline-label {
  display: block;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}

.timeline-value {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .chart-grid {
    gap: 1.5rem;
  }

  .chart-circle {
    flex-basis: min(320px, 100%);
    width: min(320px, 100%);
  }
}

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

.project-filter {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--surface-soft);
  color: var(--color-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), background-color var(--transition), color var(--transition), border-color var(--transition);
}

.project-filter:hover,
.project-filter.is-active {
  transform: translateY(-1px);
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.project-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 0 1px rgba(155, 123, 255, 0.18), 0 16px 34px rgba(4, 8, 24, 0.28), 0 0 36px rgba(109, 211, 255, 0.1);
}

.project-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.project-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  background: var(--surface-soft-2);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text);
}

.project-links {
  display: flex;
  gap: 0.75rem;
}

.project-links a {
  font-size: 0.875rem;
  font-weight: 600;
}

/* ============================================================
   SKILLS
   ============================================================ */
.skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.skill-badge {
  padding: 0.5rem 1rem;
  background: var(--surface-soft-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  /* TODO: Ask Copilot to add an emoji or icon prefix to each badge */
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-intro {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.contact-form {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
  max-width: 720px;
}

.contact-form label {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--color-text);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  color: var(--color-text);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--color-text-muted);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid rgba(109, 211, 255, 0.45);
  outline-offset: 2px;
}

.contact-message-field {
  min-height: 0;
}

.contact-submit {
  justify-self: start;
}

.contact-form-note {
  min-height: 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--color-border);
}

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 120;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--theme-toggle-bg);
  color: var(--theme-toggle-color);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition), background-color var(--transition);
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top-sentinel {
  position: absolute;
  top: 420px;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

@keyframes twinkle {
  0% {
    opacity: 0.45;
    transform: scale(1);
  }
  100% {
    opacity: 0.78;
    transform: scale(1.01);
  }
}

@keyframes drift {
  0% {
    transform: translate3d(-1%, -1%, 0) scale(1);
  }
  100% {
    transform: translate3d(1.5%, 1%, 0) scale(1.03);
  }
}

@keyframes starFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(calc(var(--drift-distance, 10px) * -1)) rotate(14deg);
  }
}

@keyframes starTwinkle {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

@keyframes spaceDrift {
  0% {
    transform: scale(1.08) translate3d(-1.5%, -1%, 0);
    background-position: 48% 42%, center center;
  }
  50% {
    transform: scale(1.12) translate3d(1%, 1.5%, 0);
    background-position: 52% 58%, center center;
  }
  100% {
    transform: scale(1.1) translate3d(-0.5%, 0.5%, 0);
    background-position: 50% 48%, center center;
  }
}

@keyframes nameShimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

@keyframes themeStarBurst {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.2) rotate(0deg);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--dx, 0px), var(--dy, 0px), 0) scale(1.35) rotate(var(--rotation, 90deg));
  }
}

@keyframes shipFlash {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.6);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(3.2);
  }
}

@keyframes shipBurst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) scale(0.1);
  }
}

/* ============================================================
   RESPONSIVE
   TODO: This is a start, but there's more to do on mobile.
   Ask Copilot: "Improve the responsive styles for screens under 600px"
   ============================================================ */
@media (max-width: 768px) {
  .navbar {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: inline-flex;
    order: 2;
  }

  .theme-toggle {
    order: 3;
  }

  .nav-links {
    display: none;
    width: 100%;
    order: 4;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem 0 0;
  }

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

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 0.65rem 0;
  }

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

  .avatar-placeholder {
    width: 100px;
    height: 100px;
  }

  .contact-submit {
    width: 100%;
  }
}
