/* ==========================================================================
   Page-Specific Styles: Portfolio Page
   ========================================================================== */

/* Navbar Header */
#site-header {
  width: 100%;
  padding: 1.5rem 0;
  display: flex;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
  will-change: transform;
}

#home {
  padding-top: 5.5rem;
}

.nav-wrapper {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
  pointer-events: auto;
}

nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

nav a {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

nav a.active {
  background-color: var(--text-main);
  color: var(--card-bg);
}

nav a:hover {
  background-color: var(--text-main);
  color: var(--card-bg);
  box-shadow: none;
  transform: none;
}

/* Palette Button */
.palette-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  color: var(--text-main);
}

.palette-btn:hover {
  background-color: var(--text-main);
  color: var(--card-bg);
  box-shadow: none;
  transform: none;
}

.palette-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: block;
}

/* Hero Section */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  margin: 1.5rem auto 3.5rem;
}

.hero h1 {
  font-size: clamp(1.85rem, 6.2vw, 3.8rem);
  font-weight: 800;
  letter-spacing: normal;
  line-height: 1.15;
  margin: 0 auto 1rem;
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(1px, 0.35vw, 3px);
  justify-content: center;
  align-items: baseline;
  text-align: center;
  width: 100%;
  max-width: 100%;
  user-select: none;
  cursor: default;
}

/* Individual character elastic / alive motion */
.hero h1 .char {
  display: inline-block;
  transform-origin: 50% 100%;
  will-change: transform;
  transform: translateY(0) scale(1, 1) rotate(0deg);
  transition: color 0.25s ease;
  cursor: pointer;
}

/* Elastic cartoon ripple that runs every 4s: stays grounded at baseline, bounces above, wider on impact */
.hero h1 .char.is-wave {
  animation: elasticCartoonWave 1.1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes elasticCartoonWave {
  0% {
    transform: translateY(0) scale(1, 1) rotate(0deg);
  }
  24% {
    /* Anticipation squash: wider on impact, strictly grounded without dipping below */
    transform: translateY(0) scale(1.22, 0.84) rotate(-0.5deg);
  }
  50% {
    /* Elastic upward stretch: bounces clearly above static baseline */
    transform: translateY(-9px) scale(0.89, 1.16) rotate(0.6deg);
  }
  74% {
    /* Ground rebound squash: lands on baseline, spreads wider */
    transform: translateY(0) scale(1.14, 0.9) rotate(-0.3deg);
  }
  88% {
    /* Micro dampening bounce slightly above */
    transform: translateY(-0.8px) scale(0.98, 1.02) rotate(0.1deg);
  }
  100% {
    /* Returns completely to default position */
    transform: translateY(0) scale(1, 1) rotate(0deg);
  }
}

/* Interactive juicy elastic pop on hover/touch: grounded baseline, bounces above, wider on impact */
.hero h1 .char:hover,
.hero h1 .char.is-bouncing {
  animation: elasticJellyPop 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  color: var(--accent-color);
}

@keyframes elasticJellyPop {
  0% {
    transform: translateY(0) scale(1, 1) rotate(0deg);
  }
  18% {
    /* Anticipation squash: grounded on baseline, extra wide impact */
    transform: translateY(0) scale(1.32, 0.76) rotate(-0.8deg);
  }
  42% {
    /* Juicy spring stretch upward: bounces high above */
    transform: translateY(-14px) scale(0.82, 1.25) rotate(1deg);
  }
  65% {
    /* Ground rebound squash: lands on baseline, spreads wide */
    transform: translateY(0) scale(1.18, 0.88) rotate(-0.4deg);
  }
  82% {
    /* Settle bounce slightly above */
    transform: translateY(-2px) scale(0.96, 1.04) rotate(0.2deg);
  }
  93% {
    /* Soft final touch on baseline */
    transform: translateY(0) scale(1.04, 0.98) rotate(0deg);
  }
  100% {
    /* Returns completely to default position */
    transform: translateY(0) scale(1, 1) rotate(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero h1 .char {
    animation: none;
  }
}

.bio {
  font-size: 1.25rem;
  font-weight: 500;
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.7;
}

.highlight {
  color: var(--text-main);
  font-weight: 800;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
}

/* Facts Grid */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 4rem;
}

.fact-card {
  padding: 1.8rem;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.fact-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  display: block;
}

.fact-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

/* Featured Project Card */
.project-card {
  border-radius: 24px;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 320px;
}

.project-img {
  width: 48%;
  background: rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-weight: 700;
  border-right: 1px solid var(--border-color);
  flex-shrink: 0;
  font-size: 1.05rem;
  overflow: hidden;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-content {
  width: 52%;
  padding: 2.8rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.project-content h3 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.project-content p {
  color: var(--text-muted);
  margin-bottom: 1.8rem;
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Call to Action */
.all-projects-cta {
  text-align: center;
  margin: 2.25rem 0 1.5rem;
}

/* ==========================================================================
   Projects Feed Page Styles
   ========================================================================== */
:root {
  --header-padding-top: 1.5rem;
  --navbar-height: 55px;
  --navbar-effective-bottom: calc(var(--header-padding-top) + var(--navbar-height));
  --projects-stage-height: 258px;
  --title-baseline-top: 6.5rem;
  --projects-title-top: calc((var(--projects-stage-height) + var(--navbar-effective-bottom)) / 2 - 8px);
}

.projects-physics-section {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 100vw;
  height: var(--projects-stage-height);
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.physics-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-bottom: 2px solid var(--text-main);
  border-bottom-color: rgba(0, 0, 0, 0.14);
  cursor: default;
}

.projects-page-title {
  position: absolute;
  top: var(--projects-title-top);
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(2.3rem, 6.5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1;
  margin: 0;
  text-align: center;
  user-select: none;
  pointer-events: none;
  z-index: 2;
  white-space: nowrap;
  transition: none !important;
}

.title-segment {
  display: inline-block;
  vertical-align: baseline;
  line-height: 1;
  transition: none !important;
}

#physics-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
  cursor: default;
}

/* Container perfectly in line with content blocks (.projects-feed max-width: 760px) */
.physics-controls-bar {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 3rem);
  max-width: 760px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  pointer-events: none;
  z-index: 20;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .physics-controls-bar {
    width: calc(100% - 1.8rem);
  }
}

/* Circular Pause Button over the canvas */
.physics-circle-btn {
  position: relative;
  pointer-events: auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.physics-circle-btn:hover {
  background: var(--card-bg);
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.physics-circle-btn:active {
  transform: scale(0.95);
}

.physics-circle-btn:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.physics-circle-btn .circle-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1;
}

.physics-circle-btn .physics-btn-svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  display: block;
}

#projects-container {
  margin-top: calc(var(--projects-stage-height) + 4rem);
}

.physics-toggle-btn:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.physics-toggle-btn .toggle-icon {
  font-size: 0.75rem;
  display: inline-block;
  line-height: 1;
}

/* Single-column vertical feed prioritizing mobile responsiveness */
.projects-feed {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  width: 100%;
  max-width: 760px;
  margin: 0 auto 2rem;
}

/* Project Card with subtle, minimalistic hover animation (no shine) */
.project-feed-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.25s cubic-bezier(0.2, 0, 0, 1), border-color 0.25s ease;
}

.project-feed-card:hover {
  transform: scale(1.008);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.15);
}

/* 16:9 Aspect Ratio Media with Centered Content */
.project-feed-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
}

.project-feed-media img,
.project-feed-media svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Content Container */
.project-feed-body {
  padding: 2.2rem 2.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Title & Tools Row */
.project-feed-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.project-feed-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Tools icons with interactive tooltip on hover */
.project-tools-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tool-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  cursor: default;
  transition: background-color 0.2s ease, transform 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

.tool-badge svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
  display: block;
}

.tool-badge img,
.tool-badge-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}

.tool-badge:hover {
  /* background-color: var(--text-main); */
  color: var(--card-bg);
  border-color: var(--text-main);
  transform: translateY(-2px);
}

/* Floating Tooltip */
.tool-badge .tool-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #0F172A;
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 50;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.tool-badge .tool-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #0F172A;
}

.tool-badge:hover .tool-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Description */
.project-feed-desc {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.65;
  margin-top: 0.15rem;
}

/* Link Section */
.project-feed-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.6rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.project-feed-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  text-decoration: none;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border-color);
  min-height: 40px;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.project-feed-link .link-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.project-feed-link .link-label {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.project-feed-link .link-arrow-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  line-height: 1;
}

.project-feed-link .link-arrow-svg {
  width: 16px;
  height: 16px;
  display: block;
  stroke: currentColor;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.project-feed-link:hover {
  background: var(--text-main);
  color: var(--card-bg);
  border-color: var(--text-main);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.project-feed-link:hover .link-icon,
.project-feed-link:hover .link-arrow-svg {
  color: var(--card-bg);
}

.project-feed-link:hover .link-arrow-svg {
  transform: translateX(3px);
}

.btn-arrow-svg {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  margin-left: 0.4rem;
  transition: transform 0.2s ease;
}

.btn:hover .btn-arrow-svg {
  transform: translateX(3px);
}

.project-feed-link:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Footer */
footer {
  width: 100%;
  max-width: 960px;
  margin-top: 2.25rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.copyright {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.social-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.social-icon {
  width: 22px;
  height: 22px;
  fill: var(--text-main);
  transition: fill 0.2s ease, transform 0.2s ease;
}

.social-icon:hover {
  fill: var(--accent-color);
  transform: translateY(-2px);
}

/* ==========================================================================
   Links Page Styles (Minimalistic Vertically Stacked Blocks like Posts)
   ========================================================================== */
#links-page {
  padding-top: 5.5rem;
  max-width: 680px;
  margin: 0 auto 0;
  width: 100%;
}

#links-page .links-section:last-child,
#links-page .links-section:last-of-type {
  margin-bottom: 0;
}

.links-hero {
  margin: 1.5rem auto 3.5rem;
  text-align: center;
  width: 100%;
}

.links-title {
  font-size: clamp(1.85rem, 6.2vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: normal;
  color: var(--text-main);
  margin: 0 auto 1rem;
  text-align: center;
}

.links-subheading {
  font-size: 1.25rem;
  font-weight: 500;
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.7;
  color: inherit;
}

.links-section {
  margin-bottom: 2.25rem;
}

.links-section .section-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.links-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
}

.link-block {
  position: relative;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.35rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 1.25rem;
  text-decoration: none;
  color: var(--text-main);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.25s cubic-bezier(0.2, 0, 0, 1), border-color 0.25s ease, background-color 0.25s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.link-block:hover,
.link-block:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.07);
  border-color: rgba(0, 0, 0, 0.16);
}

.link-block-title {
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.015em;
  line-height: 1.35;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
  text-decoration: none;
  transition: text-decoration-color 0.2s ease;
}

.link-block:hover .link-block-title,
.link-block:focus-visible .link-block-title {
  color: var(--text-main);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.link-block-right {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 0.45rem;
  margin-left: auto;
  text-align: right;
  justify-content: flex-end;
  flex-shrink: 0;
  white-space: nowrap;
}

.link-block-url {
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--text-muted);
  opacity: 0.85;
  margin: 0;
  white-space: nowrap;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.link-icon {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  opacity: 0.85;
  flex-shrink: 0;
  display: block;
}

/* Don't move the icon near the link. Don't highlight it. */
.link-block:hover .link-icon {
  transform: none;
  color: var(--text-muted);
  opacity: 0.85;
}

.link-block:hover .link-block-url {
  opacity: 1;
}

/* Copyable Container & Active Feedback */
.link-block[role="button"],
.link-block.copyable {
  cursor: pointer;
}

@keyframes copyCardPop {
  0% {
    transform: scale(1) translateY(0);
  }
  32% {
    transform: scale(1.01) translateY(-2px);
  }
  68% {
    transform: scale(0.998) translateY(-0.5px);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

.link-block.copied {
  animation: copyCardPop 0.36s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-color: var(--accent-color) !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.07), 0 0 0 1.5px var(--accent-color) !important;
}

.link-block.copied .link-block-title {
  color: var(--accent-color);
}

.link-block.copied .link-block-url {
  color: var(--text-main);
  opacity: 1;
}

/* Email & Link Copy Button (Clean pill badge with accent pop) */
.email-copy-btn,
.link-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: transparent;
  border: 1px solid transparent;
  padding: 0.22rem 0.45rem;
  border-radius: 9999px;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0.85;
  flex-shrink: 0;
  outline: none;
  line-height: 1;
  transition: color 0.2s ease, opacity 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, padding 0.2s ease;
}

.email-copy-btn:hover,
.link-copy-btn:hover {
  opacity: 1;
  color: var(--accent-color);
  background: rgba(0, 0, 0, 0.04);
}

.email-copy-icon,
.link-copy-icon {
  width: 15px;
  height: 15px;
  display: block;
  stroke: currentColor;
  flex-shrink: 0;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.copy-badge-label {
  display: none;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}

.email-copy-btn.copied,
.link-copy-btn.copied,
.link-block.copied .email-copy-btn,
.link-block.copied .link-copy-btn {
  color: var(--accent-color) !important;
  opacity: 1 !important;
  background: var(--card-bg) !important;
  border-color: var(--accent-color) !important;
  padding: 0.22rem 0.6rem !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.email-copy-btn.copied .copy-badge-label,
.link-copy-btn.copied .copy-badge-label,
.link-block.copied .copy-badge-label {
  display: inline-block;
  animation: copyLabelFadeIn 0.2s ease forwards;
}

@keyframes copyLabelFadeIn {
  from {
    opacity: 0;
    transform: translateX(3px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive Styles */
@media (max-width: 768px) {
  .hero h1 {
    font-size: clamp(1.7rem, 6.8vw, 2.6rem);
  }
  
  .bio {
    font-size: 1.1rem;
  }
  
  .fact-title {
    font-size: 1.8rem;
  }
  
  .project-card {
    flex-direction: column;
  }
  
  .project-img {
    width: 100%;
    height: 220px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .project-content {
    width: 100%;
    padding: 1.8rem;
  }

  footer {
    flex-direction: column-reverse;
    text-align: center;
  }

  .projects-feed {
    gap: 2.2rem;
  }

  :root {
    --projects-stage-height: 232px;
    --projects-title-top: 50%;
  }

  .projects-physics-section {
    height: var(--projects-stage-height);
  }

  .projects-page-title {
    top: 50%;
    transform: translate(-50%, -50%);
  }

  #projects-container {
    margin-top: calc(232px + 2.8rem);
  }
}

@media (max-width: 640px) {
  :root {
    --title-baseline-top: 5.05rem;
    --header-padding-top: 0.75rem;
    --navbar-height: 44px;
    --projects-stage-height: 216px;
    --projects-title-top: 50%;
  }

  #home {
    padding-top: 3.8rem;
  }

  #links-page {
    padding-top: 3.8rem;
    margin-bottom: 0;
  }

  .links-hero {
    margin: 1.25rem auto 2.5rem;
  }

  .links-title {
    font-size: clamp(1.85rem, 9.5vw, 2.65rem);
    margin-bottom: 0.75rem;
  }

  .links-subheading {
    font-size: 1.05rem;
    line-height: 1.65;
    margin: 0 auto;
  }

  .links-section {
    margin-bottom: 1.85rem;
  }

  .links-section .section-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
  }

  .link-block {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.15rem 1.25rem;
    border-radius: 18px;
    gap: 0.35rem;
  }

  .link-block-title {
    font-size: 1.12rem;
  }

  .link-block-right {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    gap: 0.45rem;
    flex-wrap: wrap;
  }

  .link-block-url {
    font-size: 0.86rem;
    text-align: left;
    white-space: normal;
    word-break: break-all;
  }

  /* Phone Navbar: compact, centered, slides up when scrolling down, slides down when scrolling up */
  #site-header {
    padding: 0.75rem 0;
  }

  #site-header.nav-hidden {
    transform: translateY(-125%);
    opacity: 0;
    pointer-events: none;
  }

  .nav-wrapper {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    align-items: stretch;
    gap: 0.45rem;
  }

  nav {
    padding: 0.32rem 0.45rem;
    gap: 0.2rem;
    display: flex;
    align-items: center;
    box-sizing: border-box;
  }

  nav a {
    font-size: 0.84rem;
    padding: 0.45rem 0.65rem;
    white-space: nowrap;
  }

  /* Make palette button match the exact height and size of the navbar */
  .palette-btn {
    padding: 0;
    align-self: stretch;
    aspect-ratio: 1 / 1;
    width: auto;
    height: auto;
    min-width: unset;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }

  .palette-btn svg {
    width: 19px;
    height: 19px;
  }

  /* Homepage Hero on phones: bigger, bolder, cleanly centered */
  .hero {
    margin: 1.25rem auto 2.5rem;
  }

  .hero h1 {
    font-size: clamp(1.85rem, 9.5vw, 2.65rem);
    gap: 1.5px;
  }

  .bio {
    font-size: 1.05rem;
    line-height: 1.65;
  }

  :root {
    --header-padding-top: 0.75rem;
    --navbar-height: 44px;
    --projects-stage-height: 216px;
  }

  .projects-physics-section {
    height: var(--projects-stage-height);
  }

  .projects-page-title {
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(1.85rem, 9.5vw, 2.65rem);
  }

  .physics-controls-bar {
    width: calc(100% - 1.8rem);
    bottom: 10px;
  }

  .physics-circle-btn {
    width: 34px;
    height: 34px;
  }

  .physics-circle-btn .physics-btn-svg {
    width: 13px;
    height: 13px;
  }

  #projects-container {
    margin-top: calc(216px + 1.8rem);
  }

  .project-feed-body {
    padding: 1.5rem 1.3rem;
  }

  .project-feed-title {
    font-size: 1.45rem;
  }

  .project-feed-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  /* Full-width link buttons on phones */
  .project-feed-links {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.65rem;
  }

  .project-feed-link {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.15rem;
    font-size: 0.92rem;
    min-height: 44px;
    box-sizing: border-box;
  }

  .project-feed-link .link-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: block;
  }

  .project-feed-link .link-label {
    flex: 1;
    text-align: left;
    margin: 0 0.75rem;
    display: flex;
    align-items: center;
  }

  .project-feed-link .link-arrow-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }

  .project-feed-link .link-arrow-svg {
    width: 16px;
    height: 16px;
    display: block;
  }

  /* Homepage action link buttons full width on phones */
  .project-content .btn,
  .all-projects-cta .btn {
    width: 100%;
    display: block;
    text-align: center;
    box-sizing: border-box;
  }
}

@media (max-width: 380px) {
  /* Extra-compact navigation for small phone screens */
  #site-header {
    padding: 0.6rem 0;
  }

  .nav-wrapper {
    gap: 0.3rem;
    align-items: stretch;
  }

  nav {
    padding: 0.25rem 0.3rem;
    gap: 0.12rem;
  }

  nav a {
    font-size: 0.76rem;
    padding: 0.38rem 0.45rem;
  }

  .palette-btn {
    align-self: stretch;
    aspect-ratio: 1 / 1;
    width: auto;
    height: auto;
    min-width: unset;
    border-radius: 50%;
    padding: 0;
  }

  .palette-btn svg {
    width: 17px;
    height: 17px;
  }

  :root {
    --header-padding-top: 0.6rem;
    --navbar-height: 38px;
    --projects-stage-height: 202px;
    --title-baseline-top: 4.4rem;
    --projects-title-top: 50%;
  }

  #home {
    padding-top: 3.4rem;
  }

  #links-page {
    padding-top: 3.4rem;
  }

  .links-hero {
    margin: 1rem auto 2rem;
  }

  .links-title {
    font-size: clamp(1.6rem, 8.8vw, 1.95rem);
  }

  .hero {
    margin: 1rem auto 2rem;
  }

  .hero h1 {
    font-size: clamp(1.6rem, 8.8vw, 1.95rem);
    gap: 1px;
  }

  .projects-physics-section {
    height: var(--projects-stage-height);
  }

  .projects-page-title {
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(1.6rem, 8.8vw, 1.95rem);
  }

  .physics-controls-bar {
    width: calc(100% - 1.2rem);
    bottom: 8px;
  }

  #projects-container {
    margin-top: calc(202px + 1.4rem);
  }
}
