:root {
  color-scheme: dark;
  --bg: #000000;
  --bg-soft: rgba(15, 0, 0, 0.85);
  --panel: rgba(20, 0, 0, 0.85);
  --panel-border: rgba(255, 0, 0, 0.24);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.75);
  --line: rgba(255, 255, 255, 0.08);
  --red: #ff3e3e;
  --red-bright: #ff1a1a;
  --red-soft: #ff5e5e;
  --white: #ffffff;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.8);
  --glass: rgba(10, 0, 0, 0.8);
  --glass-border: rgba(255, 62, 62, 0.25);
  /* Mapping legacy variables to keep layout working with minimal changes */
  --cyan: var(--red);
  --green: var(--red-bright);
  --violet: var(--red-soft);
  --gold: var(--white);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 0, 0, 0.12), transparent 35%),
    radial-gradient(circle at 85% 10%, rgba(255, 0, 0, 0.08), transparent 30%),
    radial-gradient(circle at 50% 90%, rgba(255, 255, 255, 0.05), transparent 40%),
    linear-gradient(180deg, #000000 0%, #0a0000 42%, #000000 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(111, 248, 255, 0.9);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 10;
  padding: 12px 16px;
  border-radius: 999px;
  background: #08131f;
  color: var(--text);
  border: 1px solid rgba(111, 248, 255, 0.3);
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

canvas#starfield,
.noise,
.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

canvas#starfield {
  width: 100%;
  height: 100%;
  z-index: 0;
}

.noise {
  z-index: 1;
  opacity: 0.11;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mix-blend-mode: soft-light;
}

.glow {
  filter: blur(120px);
  opacity: 0.55;
}

.glow-a {
  background: radial-gradient(circle, rgba(255, 0, 0, 0.15), transparent 45%);
  top: -10%;
  left: -10%;
}

.glow-b {
  background: radial-gradient(circle, rgba(255, 62, 62, 0.12), transparent 45%);
  right: -12%;
  bottom: -12%;
}

.page-shell {
  position: relative;
  z-index: 2;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  padding: 12px 0 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 0, 0, 0.65);
  backdrop-filter: blur(22px);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--red), var(--red-bright));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) inset, 0 0 30px rgba(255, 62, 62, 0.4);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.brand:hover .brand-mark {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset, 0 0 45px rgba(255, 62, 62, 0.6);
}

.brand-text {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 0.98rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-links {
  display: flex;
  gap: 22px;
  color: var(--muted);
  align-items: center;
}

.nav-scrim {
  display: none;
}

.menu-toggle {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 62, 62, 0.2);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: none;
}

.menu-toggle:hover {
  border-color: rgba(255, 62, 62, 0.42);
  background: rgba(255, 62, 62, 0.1);
  box-shadow: 0 0 0 1px rgba(255, 62, 62, 0.18) inset;
}

.hamburger {
  position: relative;
  width: 20px;
  height: 2px;
  background: var(--white);
  transition: none;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--white);
  transition: none;
}

.hamburger::before { top: -6px; }
.hamburger::after { bottom: -6px; }

.menu-toggle[aria-expanded="true"] .hamburger {
  background: transparent;
}

.menu-toggle[aria-expanded="true"] .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .hamburger::after {
  bottom: 0;
  transform: rotate(-45deg);
}

.menu-toggle[aria-expanded="true"] {
  border-color: rgba(255, 62, 62, 0.55);
  background: rgba(255, 62, 62, 0.14);
}

.topbar-links a {
  transition: color 180ms ease, transform 180ms ease;
}

.topbar-links a:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.lang-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.flag-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.lang-switch {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 62, 62, 0.2);
  cursor: pointer;
  padding: 0;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.lang-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lang-switch[aria-checked="true"] {
  background: rgba(255, 62, 62, 0.3);
  border-color: var(--red);
}

.lang-switch[aria-checked="true"] .lang-switch-thumb {
  transform: translateX(20px);
}

.lang-switch:hover {
  border-color: rgba(255, 62, 62, 0.45);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: center;
  padding: 54px 0 20px;
}

.hero-copy h1,
.section-head h2,
.about h2,
.contact h2 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  line-height: 0.96;
  letter-spacing: -0.04em;
  margin: 0;
}

.hero-copy h1 {
  font-size: clamp(3rem, 7vw, 6.5rem);
  max-width: 12ch;
  text-wrap: balance;
}

.hero-copy {
  transform: translate3d(calc(var(--pointer-x, 0px) * 0.2), calc(var(--pointer-y, 0px) * 0.2), 0);
}

.hero-visual {
  transform: translate3d(calc(var(--pointer-x, 0px) * -0.2), calc(var(--pointer-y, 0px) * -0.2), 0);
}

.hero-copy h1 span {
  background: linear-gradient(90deg, var(--red), var(--red-bright), var(--red-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow,
.section-label,
.project-kicker,
.timeline-item span,
.stack-list span {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.74rem;
  color: rgba(237, 245, 255, 0.62);
}

.lede,
.about p,
.contact p,
.project-card p,
.timeline-item p {
  color: var(--muted);
  line-height: 1.72;
  font-size: 1.03rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 28px 0 22px;
}

.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

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

.btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--red), var(--red-bright));
  box-shadow: 0 18px 50px rgba(255, 62, 62, 0.3);
}

.btn-secondary {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn-primary:hover::before {
  transform: translateX(100%);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill,
.project-tags span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(237, 245, 255, 0.84);
  padding: 10px 14px;
  font-size: 0.88rem;
}

.portrait-card {
  position: relative;
  min-height: 460px;
  border-radius: 34px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(10, 0, 0, 0.85);
  border: 1px solid rgba(255, 62, 62, 0.2);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  overflow: visible; /* Allow chips and glow to extend */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.portrait-card::before,
.portrait-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.portrait-card::before {
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 62, 62, 0.15), transparent 22%),
    linear-gradient(135deg, rgba(255, 0, 0, 0.08), transparent 50%, rgba(255, 255, 255, 0.05));
  mix-blend-mode: screen;
}

.portrait-card::after {
  background: linear-gradient(180deg, transparent 0%, var(--red) 50%, transparent 100%);
  height: 2px;
  width: 100%;
  top: 0;
  left: 0;
  opacity: 0.5;
  filter: blur(4px);
  animation: scan-vertical 4s linear infinite;
}

@keyframes scan-vertical {
  0% { transform: translateY(0); }
  100% { transform: translateY(460px); }
}

.portrait-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(50vw, 200px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 62, 62, 0.3);
  background: rgba(5, 0, 0, 0.6);
}

.portrait-photo-frame {
  box-shadow: 0 0 0 1px rgba(111, 248, 255, 0.08) inset;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  transform: scale(1.04);
  filter: saturate(1.1) contrast(1.1);
}

/* Glitch animations removed */

.data-chip {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  min-width: 170px;
  border-radius: 18px;
  background: rgba(6, 12, 22, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.data-chip span {
  color: rgba(237, 245, 255, 0.62);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.data-chip strong {
  font-size: 0.96rem;
  line-height: 1.3;
}

.data-chip-left {
  top: 40px;
  left: 20px;
  transform: translateX(-40%);
}

.data-chip-right {
  right: 20px;
  bottom: 40px;
  transform: translateX(0);
  max-width: min(300px, calc(100vw - 44px));
}

.orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 62, 62, 0.25);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05) inset, 0 0 30px rgba(255, 62, 62, 0.12);
}

.orbit-one {
  width: min(88%, 360px);
  height: min(88%, 360px);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  animation: spin 18s linear infinite;
}

.orbit-two {
  width: min(48%, 190px);
  height: min(48%, 190px);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-color: rgba(255, 255, 255, 0.15);
  animation: spin 26s linear reverse infinite;
}

.stats,
.content-grid,
.project-grid,
.timeline-grid,
.contact {
  display: grid;
  gap: 18px;
}

.stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 18px 0 28px;
}

.stats article,
.panel,
.project-card,
.timeline-item,
.contact {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--glass);
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.stats article {
  padding: 22px;
  display: flex;
  align-items: end;
  gap: 14px;
}

.stats strong {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--cyan);
}

.stats span {
  color: var(--muted);
  max-width: 18ch;
}

.content-grid {
  grid-template-columns: 1.1fr 0.9fr;
  margin-bottom: 28px;
}

.panel {
  padding: 28px;
}

.about h2,
.section-head h2,
.contact h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  max-width: 13ch;
  margin: 8px 0 14px;
}

.stack-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.stack-list div {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stack-list strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
}

.projects,
.timeline {
  margin-bottom: 28px;
}

.section-head {
  margin-bottom: 16px;
}

.project-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.project-card {
  position: relative;
  overflow: visible;
  padding: 32px;
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project-card h3 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: clamp(1.55rem, 2.2vw, 2.35rem);
  line-height: 1.05;
  margin: 16px 0 14px;
  max-width: 12ch;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(111, 248, 255, 0.24);
  background: rgba(111, 248, 255, 0.08);
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.project-link::after {
  content: "↗";
  margin-left: 8px;
  color: var(--red);
}

.project-link:hover {
  transform: translateY(-2px);
  border-color: rgba(111, 248, 255, 0.4);
  background: rgba(111, 248, 255, 0.14);
}

.project-glow {
  position: absolute;
  inset: auto;
  filter: blur(18px);
  opacity: 0.7;
}

.project-glow-a {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  right: -60px;
  top: -70px;
  background: radial-gradient(circle, rgba(255, 62, 62, 0.28), transparent 62%);
}

.project-glow-b {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  right: -60px;
  top: -70px;
  background: radial-gradient(circle, rgba(255, 0, 0, 0.26), transparent 62%);
}

.timeline-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.timeline-item {
  padding: 24px;
}

.timeline-item strong {
  display: block;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 1.38rem;
  margin: 12px 0 10px;
}

.contact {
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  padding: 30px;
}

.socials {
  display: grid;
  gap: 12px;
}

.socials a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
  min-height: 60px;
}

.socials-cta {
  border-color: rgba(113, 255, 176, 0.28) !important;
  background: linear-gradient(135deg, rgba(111, 248, 255, 0.14), rgba(113, 255, 176, 0.12)) !important;
}

.socials a::after {
  content: "↗";
  color: var(--red);
}

.socials-cta::after {
  content: "●";
  color: var(--red-bright);
}

.socials a:hover {
  transform: translateY(-2px);
  border-color: rgba(111, 248, 255, 0.3);
  background: rgba(111, 248, 255, 0.06);
}

.footer {
  margin-top: 80px;
  padding: 60px 0 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 32px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 400px;
}

.footer-brand p {
  font-size: 0.95rem;
  color: var(--muted);
}

.footer-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
}

.footer-meta p {
  margin: 4px 0;
}

@media (max-width: 768px) {
  .footer-grid {
    gap: 24px;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
}

.reveal.is-visible {
  animation: rise 900ms ease both, floaty 9s ease-in-out infinite;
  backface-visibility: hidden;
  perspective: 1000px;
  will-change: transform, opacity;
}

.hero-copy.reveal {
  animation-delay: 80ms;
}

.hero-visual.reveal {
  animation-delay: 160ms;
}

.stats.reveal {
  animation-delay: 220ms;
}

.content-grid .reveal:nth-child(1) {
  animation-delay: 260ms;
}

.content-grid .reveal:nth-child(2) {
  animation-delay: 320ms;
}

.projects .reveal:nth-child(2) {
  animation-delay: 80ms;
}

.projects .reveal:nth-child(3) {
  animation-delay: 140ms;
}

.timeline .reveal {
  animation-delay: 80ms;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}


@keyframes floaty {
  0%,
  100% {
    transform: translateY(0) translateZ(0);
  }
  50% {
    transform: translateY(-6px) translateZ(0);
  }
}

@media (max-width: 980px) {
  .hero-grid,
  .content-grid,
  .project-grid,
  .timeline-grid,
  .contact,
  .stats {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 12px 16px;
  }

  .menu-toggle {
    display: flex;
    z-index: 1101;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 260ms ease, visibility 260ms ease;
    z-index: 1090;
  }

  body.nav-open .nav-scrim {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .topbar-links {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(84vw, 340px);
    background: linear-gradient(180deg, rgba(16, 0, 0, 0.98), rgba(6, 0, 0, 0.96));
    backdrop-filter: blur(14px);
    flex-direction: column;
    padding: 92px 24px 28px;
    align-items: flex-start;
    gap: 14px;
    border-left: 1px solid rgba(255, 62, 62, 0.28);
    box-shadow: -24px 0 60px rgba(0, 0, 0, 0.6);
    transform: none;
    transition: none;
    z-index: 1100;
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: visible;
  }

  .topbar-links.is-active {
    display: flex;
  }

  .topbar-links a {
    display: block;
    width: 100%;
    padding: 14px 12px;
    border-radius: 14px;
    font-size: clamp(1.05rem, 2.8vw, 1.2rem);
    font-weight: 700;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    transition: none;
    opacity: 1;
    transform: none;
  }

  .topbar-links a:hover {
    border-color: rgba(255, 62, 62, 0.45);
    background: rgba(255, 62, 62, 0.09);
  }

  .hero-grid {
    padding-top: 26px;
  }

  .hero-copy h1 {
    max-width: 10ch;
    font-size: clamp(2.6rem, 10vw, 5rem);
  }

  .lede,
  .about p,
  .contact p,
  .project-card p,
  .timeline-item p {
    font-size: 1rem;
  }

  .portrait-card {
    min-height: 420px;
  }

  .portrait-frame img {
    object-position: center 14%;
  }

  .portrait-frame {
    width: min(66vw, 270px);
  }

  .orbit-one {
    width: min(82%, 300px);
    height: min(82%, 300px);
  }

  .orbit-two {
    width: min(42%, 150px);
    height: min(42%, 150px);
  }

  .stats article {
    padding: 20px;
  }

  .panel,
  .project-card,
  .timeline-item,
  .contact {
    padding: 24px;
    backdrop-filter: blur(6px);
  }

  .topbar {
    flex-direction: row;
    align-items: center;
    backdrop-filter: blur(6px);
  }

  .reveal.is-visible {
    animation: rise 520ms ease both;
  }

  .portrait-card::after,
  .orbit-one,
  .orbit-two {
    animation: none;
  }

  canvas#starfield,
  .noise,
  .glow {
    display: none;
  }

  .data-chip-left,
  .data-chip-right {
    transform: none;
  }

  .contact {
    align-items: start;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 12px;
  }

  .topbar,
  .panel,
  .project-card,
  .timeline-item,
  .contact,
  .stats article {
    border-radius: 22px;
  }

  .hero-copy h1 {
    max-width: 10ch;
    font-size: clamp(2.35rem, 14vw, 3.4rem);
  }

  .hero-copy h1,
  .about h2,
  .section-head h2,
  .contact h2 {
    line-height: 0.98;
  }

  .portrait-card {
    min-height: 360px;
    padding: 12px;
  }

  .portrait-frame {
    width: min(70vw, 220px);
  }

  .data-chip {
    min-width: 0;
    max-width: 62%;
    padding: 12px 14px;
  }

  .data-chip-left {
    top: 22px;
  }

  .data-chip-right {
    bottom: 22px;
  }

  .orbit-one {
    width: min(84%, 220px);
    height: min(84%, 220px);
  }

  .orbit-two {
    width: min(48%, 120px);
    height: min(48%, 120px);
  }

  .project-link {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .topbar-links {
    gap: 10px;
  }

  .topbar-links a,
  .flag-icon {
    font-size: 0.8rem;
  }

  .socials a {
    padding: 16px;
    min-height: 0;
    flex-wrap: wrap;
  }

  .socials a::after {
    margin-left: auto;
  }

  .contact {
    gap: 14px;
  }

  .hero-actions {
    gap: 10px;
  }

  .btn {
    min-height: 48px;
    padding: 0 16px;
    font-size: 0.95rem;
  }

  .pill,
  .project-tags span {
    padding: 9px 12px;
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal,
  .reveal.is-visible {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .menu-toggle,
  .hamburger,
  .hamburger::before,
  .hamburger::after {
    transition: none !important;
  }

  .menu-toggle[aria-expanded="true"] {
    animation: none !important;
    transform: none;
  }

  .topbar-links a,
  .topbar-links.is-active a {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}