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

html,
body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
}

/*
  Section entry animations
  Each section starts slightly translated and transparent. When the `.visible`
  class is added (by JavaScript), they fade and slide into place. These
  transitions create a slick appearance as users navigate through the page.
*/
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Enhance interactions on buttons and scroll‑to‑top icon with subtle movement */
.btn,
button,
.scroll-top {
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.btn:hover,
button:hover,
.scroll-top:hover {
  transform: translateY(-3px);
}

.btn:active,
button:active,
.scroll-top:active {
  transform: translateY(0);
}

/*
  Primary call‑to‑action button used on the hero section. It stands out
  with a solid background and larger padding. Adjust colors via CSS variables.
*/
.primary-btn {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.75rem 1.75rem;
  background-color: var(--accent-color);
  color: #fff;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.primary-btn:hover {
  background-color: var(--accent-light);
}

/* Image Modal Styles 
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(3px);
}

.modal.active {
  display: flex;
}

.modal-content {
  max-width: 90%;
  max-height: 80%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content .project-image {
  width: 60vw;
  height: 40vh;
  border-radius: var(--border-radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  z-index: 2100;
  transition: transform 0.3s ease;
}

.modal-close:hover {
  transform: scale(1.1);
}

/* Make project images clickable 
.project-image {
  cursor: pointer;
}
  */

/* Theme variables */
:root {
  --bg-color: #0e1423;
  --header-bg: rgba(8, 13, 26, 0.9);
  --text-color: #d3d7e0;
  --heading-color: #ffffff;
  --accent-color: #007acc;
  --accent-light: #01bcd4;
  --card-bg: #16213a;
  --input-bg: #1d2a47;
  --btn-bg: transparent;
  --btn-hover-bg: #007acc;
  --btn-hover-text: #ffffff;
  --border-radius: 18px;
}

/* Particle canvas positioning */
/* Canvas used for connecting dots animation */
#network-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
}

/* Navigation Bar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--header-bg);
  backdrop-filter: blur(4px);
  z-index: 1000;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hide the navigation bar when on the home section */
.navbar.hidden {
  opacity: 0;
  transform: translateY(-60px);
  pointer-events: none;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-color);
  text-decoration: none;
}

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

.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.3s ease;
}

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

/* underline effect on hover */
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background-color: var(--accent-light);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

/* Hero Section */
.hero-section {
  height: 87vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1rem;
}

.hero-content h1 {
  font-size: 3.5rem;
  color: var(--heading-color);
  margin-bottom: 1rem;
}

.hero-content h1 .accent {
  color: var(--accent-light);
}

.subheading {
  font-size: 1.8rem;
  max-width: 700px;
  margin: 0 auto;
  color: var(--text-color);
}

/* Section Generic Styles */
section {
  padding: 5rem 1rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-size: 3rem;
  color: var(--heading-color);
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}

.section-title .underline {
  display: block;
  width: 50px;
  height: 4px;
  background-color: var(--accent-color);
  margin-top: 0.25rem;
}

/* About Section */
.about-section {
  /* Use a slightly transparent dark overlay so the animated background shows
     through while remaining subtle. This reduces the brightness of the
     connecting‑dots animation behind the section. */
  background-color: rgba(14, 20, 35, 0.83);
}

.about-wrapper {
  display: flex;
  flex-direction: column;
  /* align-items: center; */
  text-align: left;
  gap: 1.5rem;
  margin-bottom: 3rem;
}


.about-text {
  color: var(--text-color);
  font-size: 1.3rem;
  line-height: 1.7;
  max-width: 830px;
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.5rem;
}

.skill {
  background-color: var(--card-bg);
  border: 2px solid var(--accent-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
}


.skill span {
  display: block;
  font-weight: 600;
  color: var(--text-color);
}

.skill:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* Projects Section */
.projects-section {
  /* Dark overlay with transparency to fade the background animation */
  background-color: rgba(14, 20, 35, 0.83);
}

.project {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  /* Reduce default space between projects; will adjust further based on collapsed/expanded state */
  margin-bottom: 2rem;
}

/* Collapsed/expanded project state for category toggling */
/* When a project is collapsed, hide it with zero height and opacity, and remove extra spacing */
/* Use a selector including #projects for higher specificity so these properties
   override the base #projects .project rules defined above. */
#projects .project.collapsed {
  max-height: 0 !important;
  opacity: 0;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden;
  pointer-events: none;
}

/* When a project is expanded, restore height and opacity.  */
/* Expanded projects also need higher specificity */
#projects .project.expanded {
  /* Use a large max-height to allow project content to fully show; will smoothly animate from 0 */
  max-height: 2000px;
  opacity: 1;
  margin-bottom: 2rem;
  pointer-events: auto;
}


.project.reverse {
  flex-direction: row-reverse;
}

.project-image {
 /* flex: 1 1 45%; */
  height: 238px;
  width:425px;
  /*  background: linear-gradient(135deg, var(--accent-color), var(--accent-light)); */
  border-radius: var(--border-radius);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  margin-bottom: 1rem;
}

.project-info {
  flex: 1 1 55%;
  padding: 1rem 2rem;
  min-width: 280px;
}

.project-info h3 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
  color: var(--heading-color);
}

.project-info p {
  font-size: 1rem;
 /* margin-bottom: 1.5rem; */
  color: var(--text-color);
  line-height: 1.6;
}

.project-links .btn {
  display: inline-block;
  padding: 0.5rem 1rem;
      margin-top: 8px;
  margin-right: 1rem;
  border-radius: var(--border-radius);
  color: #fff;
  border: 2px solid var(--accent-color);
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.project-links .btn:hover {
  background-color: #007acc;
  color: #fff;
}

.subsection-title {
  font-size: 2.4rem;
  color: var(--heading-color);
  /* Reduce top and bottom margins to tighten spacing between categories */
  /* Tighten spacing above and below category titles */
  margin: 1rem 0 0.5rem;
  font-weight: 600;
  /* Allow category headings to toggle visibility of project lists */
  cursor: pointer;
  /* Use flex layout on a block-level element so titles span the grid width */
  display: flex;
  align-items: center;
  /* Spread title text and icon to opposite edges so the icon aligns to the far right */
  justify-content: space-between;
  /* Remove the gap since space-between handles spacing */
  gap: 0;
}

/* Toggle icon appended to category titles in the projects section */
/* Inline plus/minus indicator used for expanding/collapsing project categories. */
.toggle-icon {
  /* Create a square icon with a border to house the plus/minus symbol */
  position: relative;
  margin-left: 0.5rem;
  /* Increase size slightly for improved visibility */
  width: 2.4rem;
  height: 2.4rem;
  border: 2px solid var(--accent-light);
  border-radius: 0.3rem;
  /* The text is hidden since we'll draw the symbol with pseudo-elements */
  font-size: 0;
  color: var(--accent-light);
  user-select: none;
  flex: 0 0 2.4rem;
}

/* Horizontal and vertical bars for the plus/minus symbol */
.toggle-icon::before,
.toggle-icon::after {
  content: '';
  position: absolute;
  background-color: var(--accent-light);
}

/* Horizontal bar spans most of the width */
.toggle-icon::before {
  top: 50%;
  left: 0.25rem;
  right: 0.25rem;
  height: 2px;
  transform: translateY(-50%);
}

/* Vertical bar spans most of the height, forming a plus sign */
.toggle-icon::after {
  left: 50%;
  top: 0.25rem;
  bottom: 0.25rem;
  width: 2px;
  transform: translateX(-50%);
}

/* When the category is expanded, hide the vertical bar to show a minus sign */
.subsection-title.expanded .toggle-icon::after {
  display: none;
}

/* Enable smooth fade and slide transitions for project items */
#projects .project {
  /* Hide overflowing content during animation */
  overflow: hidden;
  /* Ensure project cards are visible by default */
  opacity: 1;
  max-height: none;
  /* Animate changes to max-height and opacity */
  /* Increase the transition duration slightly for a smoother fade/slide effect */
  transition: max-height 0.6s ease, opacity 0.6s ease;
}


/* Contact Section */
.contact-section {
  /* Semi‑transparent dark overlay to subtly fade the background animation */
  background-color: rgba(14, 20, 35, 0.83);
  position: relative;
}

.contact-text {
  font-size: 1rem;
  margin-bottom: 2rem;
  color: var(--text-color);
  max-width: 600px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 600px;
}

.contact-form input,
.contact-form textarea {
  background-color: var(--input-bg);
  color: var(--text-color);
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  resize: vertical;
}

/* Style for select dropdown in contact form */
.contact-form select {
  background-color: var(--input-bg);
  /* Use the standard text colour for the dropdown */
  color: var(--text-color);
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
}

.contact-form select option {
  background-color: var(--input-bg);
  color: var(--text-color);
}

/* Highlight disabled (placeholder) option in the service dropdown using the accent colour */
.contact-form select option[disabled] {
  color: var(--text-color);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #8592b2;
}

.submit-btn {
  align-self: flex-start;
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.submit-btn:hover {
  background-color: var(--accent-light);
}

/* Social links */
/* Contact links displayed in the contact section */
.contact-links {
  margin-top: 1.5rem;
  display: flex;
  gap: 2rem;
}

.contact-links a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

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

/* Message displayed after form submission */
.form-message {
  margin-top: 1rem;
  font-size: 1rem;
  color: var(--accent-light);
}

/* Scroll to top button */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 45px;
  height: 45px;
  border: none;
  border-radius: 50%;
  background-color: var(--accent-color);
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
}

.scroll-top.show {
  opacity: 1;
  visibility: visible;
}

footer {
  margin-top: 3rem;
  text-align: center;
  color: #6e7da8;
  font-size: 0.9rem;
}

/*
  Section Divider
  A slim animated line used to separate sections after the About section. It spans
  the full width of the page and cycles through the accent colors to create
  a subtle motion effect. The animation continuously shifts the gradient,
  producing a slick shimmer that draws the eye without being distracting.
*/
.section-divider {
  /* Limit the width of the divider to less than half the page for a sleek look */
  width: 40%;
  height: 4px;
  border-radius: 4px;
  margin: 3rem auto;
  /* Gradient colours cycle along the bar to create a shimmer effect */
  background: linear-gradient(90deg, var(--accent-color), var(--accent-light), var(--accent-color));
  background-size: 200% 100%;
  /* Combine two animations: one moves the gradient across the bar and the other slides the bar left and right */
  animation: dividerShimmer 5s linear infinite, dividerSlide 8s ease-in-out infinite alternate;
}

@keyframes dividerShimmer {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 100% 50%;
  }
}

@keyframes dividerSlide {
  0% {
    transform: translateX(-60%);
  }
  100% {
    transform: translateX(60%);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2.5rem;margin-right: 60px !important;
  }
  .subheading {
    font-size: 1.4rem;
  }
  .project {
    flex-direction: column;
  }
  .project.reverse {
    flex-direction: column;
  }
  .project-image,
  .project-info {
    flex: 1 1 100%;
  }
  .project-image {
    height: 180px;
    width:300px; 
  }
  .nav-links {
    gap: 1rem;
  }
}

/* Hide hero text until typing begins, but keep layout space */
/* Caret only while typing */
}

/* Smooth scrolling for in-page anchors (#projects) */
html { scroll-behavior: smooth; }


/* Flashy click animation for "View my work" button */
.view-work-btn {
  position: relative;
  overflow: hidden; /* contain ripple */
  will-change: transform, box-shadow;
}
.view-work-btn.flash {
  animation: btn-glow 600ms ease-out;
}
.view-work-btn::after {
  content: "";
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, currentColor 0 30%, transparent 30% 100%);
  opacity: 0;
  pointer-events: none;
}
.view-work-btn.flash::after {
  animation: btn-ripple 600ms ease-out forwards;
}

@keyframes btn-glow {
  0%   { box-shadow: 0 0 0px currentColor, 0 0 0px rgba(255,255,255,0.5); transform: scale(1); }
  60%  { box-shadow: 0 0 32px currentColor, 0 0 64px rgba(255,255,255,0.6); transform: scale(1.03); }
  100% { box-shadow: 0 0 0px currentColor, 0 0 0px rgba(255,255,255,0); transform: scale(1); }
}
@keyframes btn-ripple {
  0%   { opacity: 0.9; width: 0; height: 0; }
  100% { opacity: 0;  width: 300px; height: 300px; }
}


/* Slicker click burst for "View my work" */
.view-work-btn {
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
  will-change: transform, box-shadow;
}

/* moving light sweep */
.view-work-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,.18) 20%, rgba(255,255,255,.35) 50%, rgba(255,255,255,.18) 80%, transparent 100%);
  transform: translateX(-120%);
  pointer-events: none;
  opacity: 0;
}

.view-work-btn.blast::before {
  animation: btn-sweep 650ms ease-out forwards;
}

/* expanding ring from click point */
.view-work-btn::after {
  content: "";
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  transform: translate(-50%, -50%) scale(0.2);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px currentColor inset, 0 0 24px currentColor;
  opacity: 0;
  pointer-events: none;
}

.view-work-btn.blast::after {
  animation: btn-ring 800ms ease-out forwards;
}

/* burst particles */
.view-work-btn .particle {
  position: absolute;
  left: var(--px, 50%);
  top: var(--py, 50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  filter: drop-shadow(0 0 6px currentColor);
  opacity: 0;
  pointer-events: none;
}

.view-work-btn .particle.fly {
  animation: btn-particle 700ms ease-out forwards;
}

@keyframes btn-sweep {
  0%   { transform: translateX(-120%); opacity: 0; }
  20%  { opacity: .9; }
  100% { transform: translateX(120%); opacity: 0; }
}
@keyframes btn-ring {
  0%   { opacity: .9; transform: translate(-50%, -50%) scale(0.2); box-shadow: 0 0 0 2px currentColor inset, 0 0 24px currentColor; }
  100% { opacity: 0;  transform: translate(-50%, -50%) scale(6);   box-shadow: 0 0 0 0 transparent, 0 0 0 transparent; }
}
@keyframes btn-particle {
  0%   { opacity: .95; transform: translate(0, 0) scale(.8); }
  100% { opacity: 0;   transform: translate(var(--tx, 0), var(--ty, 0)) scale(0); }
}

/* Brand "dance" */
.brand {
  display: inline-block;
  transform-origin: 50% 60%;
  will-change: transform;
}
.brand:hover {
  animation: brand-dance 600ms ease-out 1;
}
.brand.dance {
  animation: brand-dance 700ms ease-out 1;
}
@keyframes brand-dance {
  0%   { transform: translateY(0) rotate(0); }
  20%  { transform: translateY(-1px) rotate(-4deg); }
  40%  { transform: translateY(-2px) rotate(4deg); }
  60%  { transform: translateY(-1px) rotate(-3deg) scale(1.01); }
  80%  { transform: translateY(0) rotate(3deg); }
  100% { transform: translateY(0) rotate(0); }
}


/* Smooth height stabilization for hero during/after typing */
.hero-content { transition: min-height .3s ease; }


/* Global link/button transition overlay */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: radial-gradient(75% 75% at var(--cx,50%) var(--cy,50%), rgba(255,255,255,.04), rgba(0,0,0,.12) 60%, rgba(0,0,0,.35) 100%);
  transform: scaleX(0);
  transform-origin: var(--ox, 0%) 50%;
  opacity: 0;
}
.page-transition.active {
  animation: page-wipe 620ms cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes page-wipe {
  0%   { opacity: 0; transform: scaleX(0); }
  10%  { opacity: 1; }
  100% { opacity: 1; transform: scaleX(1); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .page-transition,
  .view-work-btn.blast::before,
  .view-work-btn.blast::after,
  .view-work-btn .particle.fly {
    animation: none !important;
    transition: none !important;
  }
}


/* === Tuned page transition options === */
:root {
  --page-transition-duration: 900ms;
  --page-transition-ease: cubic-bezier(.2,.7,.2,1);
  --page-transition-strength: 0.45;
}
.page-transition { 
  /* keeps base overlay from earlier */
}
/* Neutralize default animation; effects below will control it */
.page-transition.active { animation: none !important; }

/* 1) Sweep (radial, from click point) */
.page-transition.effect-sweep {
  background: radial-gradient(75% 75% at var(--cx,50%) var(--cy,50%), rgba(255,255,255,.04), rgba(0,0,0, calc(var(--page-transition-strength) * .6)) 60%, rgba(0,0,0, var(--page-transition-strength)) 100%);
  transform: scaleX(0);
  transform-origin: var(--ox, 0%) 50%;
  opacity: 0;
}
.page-transition.effect-sweep.active {
  animation: page-wipe-sweep var(--page-transition-duration) var(--page-transition-ease) forwards;
}
@keyframes page-wipe-sweep {
  0%   { opacity: 0; transform: scaleX(0); }
  10%  { opacity: 1; }
  100% { opacity: 1; transform: scaleX(1); }
}

/* 2) Vertical Curtain (default) */
.page-transition.effect-curtain {
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0, calc(var(--page-transition-strength) * .6)) 30%, rgba(0,0,0, var(--page-transition-strength)) 100%);
  transform: scaleY(0);
  transform-origin: var(--oy, 50% 0%);
  opacity: 0;
}
.page-transition.effect-curtain.active {
  animation: page-curtain var(--page-transition-duration) var(--page-transition-ease) forwards;
}
@keyframes page-curtain {
  0%   { opacity: 0; transform: scaleY(0); }
  10%  { opacity: 1; }
  100% { opacity: 1; transform: scaleY(1); }
}

/* 3) Blur Dissolve */
.page-transition.effect-blur {
  background: rgba(0,0,0, var(--page-transition-strength));
  opacity: 0;
  /* If supported, add a subtle blur */
  -webkit-backdrop-filter: blur(0px);
  backdrop-filter: blur(0px);
}
.page-transition.effect-blur.active {
  animation: page-blur var(--page-transition-duration) var(--page-transition-ease) forwards;
}
@keyframes page-blur {
  0%   { opacity: 0; -webkit-backdrop-filter: blur(0px); backdrop-filter: blur(0px); }
  100% { opacity: 1; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
}
@supports not ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
  .page-transition.effect-blur { /* graceful fallback without blur */ }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .page-transition { animation: none !important; transition: none !important; }
  .page-transition.active { animation: none !important; }
}


/* Magnetic tilt hover for View button */
.view-work-btn {
  transform-style: preserve-3d;
  transition: transform .18s ease, box-shadow .18s ease;
  will-change: transform;
  perspective: 800px; /* establishes a 3D context for children if needed */
}
.view-work-btn.magnet-rest {
  transform: rotateX(0deg) rotateY(0deg) translateZ(0);
}
@media (hover:hover) and (pointer:fine) {
  .view-work-btn:hover {
    /* shadow deepens slightly on hover */
    box-shadow: 0 10px 22px rgba(0,0,0,.18);
  }
}
@media (prefers-reduced-motion: reduce) {
  .view-work-btn { transition: none !important; }
}


20%  { transform: translateY(-1px) rotate(-6deg) scale(1.02); }
  40%  { transform: translateY(-2px) rotate(6deg) scale(1.03); }
  60%  { transform: translateY(-1px) rotate(-4deg) scale(1.02); }
  80%  { transform: translateY(0px) rotate(3deg) scale(1.01); }
  100% { transform: translateY(0) rotate(0deg) scale(1); }
}


10%  { transform: translate(2px,-4px) rotate(-10deg) scale(1.06) skewX(-4deg); }
  25%  { transform: translate(12px,-10px) rotate(14deg)  scale(1.12) skewY(3deg); }
  40%  { transform: translate(-10px,-6px) rotate(-12deg) scale(1.10) skewX(-6deg); }
  55%  { transform: translate(14px,2px)  rotate(10deg)  scale(1.08) skewY(4deg); }
  70%  { transform: translate(-8px,-4px) rotate(-14deg) scale(1.10); }
  85%  { transform: translate(6px,0px)   rotate(8deg)   scale(1.05); }
  100% { transform: translate(0,0)       rotate(0deg)   scale(1) skewX(0deg) skewY(0deg); }
}


/* Accent "Zach" dance — wilder with shimmer + 3D tilt */
.accent {
  display: inline-block;
  transform-origin: 50% 80%;
  will-change: transform, text-shadow, filter;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Hover: run both dance + shimmer */
.accent:hover {
  animation:
    accent-dance 1200ms cubic-bezier(.18,.76,.2,1) 1,
    accent-shimmer 1200ms ease-out 1;
}

/* Programmatic trigger after typing */
.accent.dance {
  animation:
    accent-dance 1300ms cubic-bezier(.18,.76,.2,1) 1,
    accent-shimmer 1300ms ease-out 1;
}

/* Bigger, playful motion with 3D tilts (no full flip for readability) */
@keyframes accent-dance {
  0%   { transform: perspective(700px) translate(0,0) rotate(0deg) rotateY(0deg) scale(1); }
  12%  { transform: perspective(700px) translate(4px,-8px) rotate(-10deg) rotateY(18deg) scale(1.08); }
  28%  { transform: perspective(700px) translate(18px,-14px) rotate(14deg)  rotateY(-16deg) scale(1.14); }
  44%  { transform: perspective(700px) translate(-16px,-8px) rotate(-12deg) rotateY(12deg)  scale(1.12); }
  60%  { transform: perspective(700px) translate(20px,2px)   rotate(10deg)  rotateY(-14deg) scale(1.10); }
  76%  { transform: perspective(700px) translate(-12px,-6px) rotate(-14deg) rotateY(10deg)  scale(1.10); }
  88%  { transform: perspective(700px) translate(8px,0px)    rotate(8deg)   rotateY(-6deg)  scale(1.05); }
  100% { transform: perspective(700px) translate(0,0)        rotate(0deg)   rotateY(0deg)   scale(1); }
}

/* Shimmer trail using text-shadow pulses */
@keyframes accent-shimmer {
  0%   { text-shadow: 0 0 0 rgba(255,255,255,0), 0 0 0 rgba(255,255,255,0); filter: drop-shadow(0 0 0 currentColor); }
  15%  { text-shadow: 0 0 10px rgba(255,255,255,.35), 6px -6px 14px rgba(255,255,255,.18); filter: drop-shadow(0 0 6px currentColor); }
  35%  { text-shadow: -6px -6px 16px rgba(255,255,255,.35), 8px -10px 18px rgba(255,255,255,.22); filter: drop-shadow(0 0 10px currentColor); }
  60%  { text-shadow: 6px 0 14px rgba(255,255,255,.30), -8px -6px 16px rgba(255,255,255,.18); filter: drop-shadow(0 0 8px currentColor); }
  85%  { text-shadow: 0 0 8px rgba(255,255,255,.18), 0 0 0 rgba(255,255,255,0); filter: drop-shadow(0 0 3px currentColor); }
  100% { text-shadow: 0 0 0 rgba(255,255,255,0); filter: drop-shadow(0 0 0 currentColor); }
}

/* Reduced motion: keep visual calm */
@media (prefers-reduced-motion: reduce) {
  .accent,
  .accent:hover,
  .accent.dance {
    animation: none !important;
    transform: none !important;
    text-shadow: none !important;
    filter: none !important;
  }
}


/* ===== Global smoothing ===== */
:root{
  --ease-smooth: cubic-bezier(.2,.7,.2,1);
  --dur-fast: 160ms;
  --dur-med: 240ms;
  --dur-slow: 360ms;
}

/* Subtle, consistent transitions */
a, button, .btn, .primary-btn, .card, .nav a, .project-card, .hero-content {
  transition:
    color var(--dur-med) var(--ease-smooth),
    background-color var(--dur-med) var(--ease-smooth),
    border-color var(--dur-med) var(--ease-smooth),
    box-shadow var(--dur-med) var(--ease-smooth),
    transform var(--dur-med) var(--ease-smooth),
    opacity var(--dur-med) var(--ease-smooth);
}

/* Buttons: gentle lift + shadow */
.btn, .primary-btn, a.btn, a.primary-btn {
  will-change: transform, box-shadow;
}
@media (hover:hover) and (pointer:fine){
  .btn:hover, .primary-btn:hover, a.btn:hover, a.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(0,0,0,.14);
  }
  .btn:active, .primary-btn:active, a.btn:active, a.primary-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(0,0,0,.12);
  }
}

/* Cards/images (if present) */
.project-card, .card, .gallery img {
  will-change: transform, box-shadow;
}
@media (hover:hover) and (pointer:fine){
  .project-card:hover, .card:hover, .gallery img:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(0,0,0,.14);
  }
}

/* Focus-visible for accessibility */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after {
    transition: none !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@keyframes hero-caret-blink { 50% { border-color: transparent; } }


/* Caret only when H1 is typing */
.hero-content h1.is-typing-h1 {
  display: inline-block;
  border-right: 2px solid currentColor;
  white-space: pre-wrap;
  animation: hero-caret-blink .8s steps(1) infinite;
}


/* === Mobile Hamburger Nav === */
.hamburger {
  position: relative;
  z-index: 1001;
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.hamburger-box { display: inline-block; width: 24px; height: 2px; position: relative; }
.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  position: absolute;
  left: 0;
  transition: transform 250ms ease, opacity 200ms ease, top 250ms ease;
}
.hamburger-inner { top: 50%; transform: translateY(-50%); }
.hamburger-inner::before { top: -8px; }
.hamburger-inner::after  { top:  8px; }

/* Active (X) state */
.hamburger.is-active .hamburger-inner { transform: translateY(-50%) rotate(45deg); }
.hamburger.is-active .hamburger-inner::before { top: 0; transform: rotate(90deg); }
.hamburger.is-active .hamburger-inner::after { top: 0; opacity: 0; }

/* Mobile menu panel */
@media (max-width: 860px) {
  .hamburger { display: inline-flex; }

  /* Assume the main header uses .navbar; ensure it lays out brand + button nicely */
  .navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  /* Hide the nav links by default on mobile */
  .nav-links {
    position: fixed;
    inset: 0 0 auto 0;
    top: 64px;              /* space for header */
    height: calc(100dvh - 64px);
    background: rgba(0,0,0,0.9);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    padding: 24px;
    display: none;
    flex-direction: column;
    gap: 16px;
  }

  .nav-links a, .nav-links li { color: #fff; font-size: 1.125rem; }

  /* When menu is open */
  .nav-open .nav-links { display: flex; }

  /* Prevent body scroll when menu is open */
  body.nav-open { overflow: hidden; }
}


/* === Hamburger/Sticky Fixes (override) === */
.navbar { color: var(--heading-color); }

/* Keep header fixed at all sizes */
@media (max-width: 860px) {
  .navbar { position: fixed; top: 0; left: 0; right: 0; }
  .nav-container { display: flex; align-items: center; justify-content: space-between; }
  .brand { margin-left: .25rem; }
  .hamburger { margin-left: .5rem; }
}


@media (max-width: 860px) {
  .nav-links {
    top: var(--nav-offset, 64px);
    height: calc(100dvh - var(--nav-offset, 64px));
  }
}


/* === Hamburger visibility & alignment tweaks === */
.hamburger {
  color: var(--accent-color); /* Blue from theme */
}

@media (max-width: 860px) {
  .nav-container {
    display: flex;
    align-items: center;
    gap: .5rem;
  }
  /* Make sure nav takes available space so the hamburger sits on the right */
  .nav-container nav { flex: 1 1 auto; }
  .brand { flex: 0 0 auto; }
  .hamburger { flex: 0 0 auto; margin-left: .25rem; }

  /* Thicker bars & slightly larger box for visibility */
  .hamburger-box { width: 28px; }
  .hamburger-inner,
  .hamburger-inner::before,
  .hamburger-inner::after { height: 3px; }
  .hamburger-inner::before { top: -9px; }
  .hamburger-inner::after  { top:  9px; }
}

/* Stronger contrast in dark headers if needed */
.navbar { color: var(--accent-color); }


/* === Sticky header styles applied after hero === */
.navbar { position: relative; }
.navbar.is-sticky {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--header-bg);
  backdrop-filter: blur(6px);
  z-index: 1000;
  box-shadow: 0 4px 10px rgba(0,0,0,.25);
}

/* Avoid content jump when sticky engages */
body.has-sticky { padding-top: var(--nav-offset, 64px); }

/* Ensure mobile menu overlay still anchors under sticky header */
@media (max-width: 860px) {
  .nav-links {
    top: var(--nav-offset, 64px);
    height: calc(100dvh - var(--nav-offset, 64px));
  }
}


/* === Cross‑device mobile nav hardening === */

/* Make header always sit above app layers */
.navbar { z-index: 1200; }

/* Treat touch devices as 'mobile' too, even if wide (some big phones/tablets) */
@media (max-width: 860px), (hover: none) and (pointer: coarse) {
  .hamburger { display: inline-flex !important; }
  /* Convert link list to an overlay panel */
  .nav-links {
    position: fixed;
    left: 0; right: 0;
    top: calc(var(--nav-offset, 64px) + env(safe-area-inset-top, 0px));
    height: calc(100svh - var(--nav-offset, 64px) - env(safe-area-inset-top, 0px));
    background: rgba(0,0,0,0.92);
    -webkit-backdrop-filter: saturate(120%) blur(8px);
    backdrop-filter: saturate(120%) blur(8px);
    display: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px clamp(16px, 4vw, 28px);
    gap: 16px;
    z-index: 1199;
  }
  .nav-open .nav-links { display: flex; }
  body.nav-open { overflow: hidden; }
  /* Ensure brand and burger align on one row */
  .nav-container { display: flex; align-items: center; justify-content: space-between; }
}

/* Larger tap targets */
@media (hover: none) and (pointer: coarse) {
  .nav-links a { padding: 12px 4px; }
  .hamburger { width: 48px; height: 48px; }
  .hamburger-box { width: 30px; }
  .hamburger-inner, .hamburger-inner::before, .hamburger-inner::after { height: 3.25px; }
}

/* Respect notches / safe areas on iOS */
@supports (padding: max(0px)) {
  .navbar { padding-top: max(0px, env(safe-area-inset-top)); }
}

/* Fallback height units for older browsers */
@supports not (height: 100svh) {
  @media (max-width: 860px), (hover: none) and (pointer: coarse) {
    .nav-links {
      height: calc(100dvh - var(--nav-offset, 64px) - env(safe-area-inset-top, 0px));
    }
  }
}


/* === No-flash header: hidden until sticky engages === */
.navbar {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.navbar.is-sticky {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Ensure hamburger becomes visible when applicable */
.hamburger { display: none; }
@media (max-width: 860px), (hover: none) and (pointer: coarse) {
  .hamburger { display: inline-flex !important; }
}


/* === iPhone Chrome hardening === */
.hamburger {
  z-index: 1300;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Force overlay to show when nav-open regardless of other rules */
.nav-open .nav-links { display: flex !important; }

/* If menu is open, ensure header is visible and interactive even before sticky */
body.nav-open .navbar {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}




.hi-text {
  display: inline-block;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 6s ease, transform 6s ease;
  animation: hi-disappear 5s ease forwards; /* triggers auto */
}

@keyframes hi-disappear {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  70% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* --- iOS/Safari hardening for project cards --- */
.projects-section .project img.project-image {

        width: 50%;
        height: auto;
        margin: 0 auto;
}

/* Ensure the card stack doesn't get collapsed in Safari flexbox */
.projects-section .project{
  display:flex;
  flex-direction:column;
  gap:1rem;
  margin:0;
  padding:1.25rem;
  background:rgba(255,255,255,0.07);
  border:1px solid rgba(255,255,255,0.06);
  border-radius:14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  height:auto;
}

/* Mobile sizing you already intend, made explicit for the <img> too */
@media (max-width: 768px) {
  .projects-section .project img.project-image {
   /* width: 300px; */
           display: block;
        margin: auto;
        width: 83%;
  }
}

/* (Optional) If an overlay ever covers content, be explicit: */
.projects-section { position: relative; z-index: 0; }


/* ========= Projects Section: 3‑col grid with clean card alignment ========= */
.projects-section .container{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  /* Reduce the gap between grid rows and columns to tighten spacing */
  gap:1.5rem;
  align-items:start;
}

/* Make section/subsection titles span all columns so they don't occupy a single grid cell */
.projects-section .section-title,
.projects-section .subsection-title{ 
  margin-top:0.5rem;
  margin-bottom:0.5rem;
}



#projects .subsection-title.expanded {
   /* margin-top: .75rem; */
    margin-bottom: .35rem;
}

#projects .subsection-title.collapsed {
    margin-top: .75rem;
margin-bottom: -0.5rem;
}






/* Each project is a card that fills its grid cell neatly */
.projects-section .project{
  display:flex;
  flex-direction:column;
  flex-wrap:nowrap;
  align-items:stretch;
  min-width:0;
  gap:1rem;
  margin:0;                 /* remove giant bottom gaps */
  padding:1.25rem;
  background:rgba(255,255,255,0.07);
  border:1px solid rgba(255,255,255,0.06);
  border-radius:14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  height:100%;
}

/* Size the thumbnail wrapper to the card's inner width. */
.projects-section .project > div:first-child {
  width: 100%;
  min-width: 0;
  flex: 0 0 auto;
}

.projects-section .project > div:first-child > a {
  display: block;
}

/* Image on top, full width */
.projects-section .project img.project-image{
  width:100% !important;
  height:auto;
  display:block;
  border-radius:10px;
  margin:0 auto;
}

/*
  Special centering rule for the LSI.com archived project image. By reducing the
  maximum width and using auto margins, the image remains horizontally centered
  within its card while still respecting responsive behavior. This class is
  attached only to the LSI.com image in the archived section.
*/
.projects-section .project img.lsi-center {
  max-width: 85%;
  margin-left: auto;
  margin-right: auto;
  display: block;
}

/* Stack text content nicely and push CTA to bottom for equal-height cards */
.projects-section .project .project-info{
  display:flex;
  flex-direction:column;
  gap:0.5rem;
  min-width:0;
  overflow-wrap:anywhere;
  flex:1 1 auto;
}
.projects-section .project .project-links{ 
  margin-top:auto;
  text-align: center;
}

/* Spacing before each subsection block */
.projects-section .subsection-title{ 
  margin-top:2rem;
}

/* Responsive columns */
@media (max-width: 1100px){
  .projects-section .container{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px){
  .projects-section .container{ grid-template-columns:1fr; }


  /* Reduce overall section spacing */
  .projects-section {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  /* Tighten the grid */
  .projects-section .container {
    gap: 0.75rem;
  }

  /* Category headings */
  .projects-section .subsection-title {
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 1.75rem;
  }

  /* Cards */
  .projects-section .project {
    padding: 1rem;
  }

  /* Slightly reduce spacing between image and text */
  .projects-section .project-info {
    padding: 0.75rem 0;
  }
}

/* ========= End Projects Grid overrides ========= */


/* ========= Double-tap fix for mobile buttons =========
   Hover transforms (translateY(-3px)) cause a "first tap = hover, second tap = click"
   problem on touch devices. Scoping :hover to true pointer devices fixes this
   without affecting button styles or breaking target="_blank" links. */
@media (hover: hover) and (pointer: fine) {
  .btn:hover,
  button:hover,
  .scroll-top:hover {
    transform: translateY(-3px);
  }
}

/* On touch devices, suppress the hover lift entirely */
@media (hover: none) {
  .btn:hover,
  button:hover,
  .scroll-top:hover {
    transform: none;
  }
}

.btn,
button,
.scroll-top {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
/* ========= End double-tap fix ========= */

/* ---- Projects filter styles ---- */
.projects-filter {
  position: sticky;
  top: calc(var(--nav-offset, 64px) + 1rem);
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0rem;
  background: rgba(14, 20, 35, 0.85);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  backdrop-filter: blur(4px);
}

#projects .projects-filter {
  grid-column: 1 / -1;
  width: 100%;
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.filter-btn {
  padding: 0.4rem 0.9rem;
  border-radius: var(--border-radius);
  background-color: transparent;
  border: 1px solid var(--accent-color);
  color: var(--text-color);
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.filter-btn:hover {
  background-color: var(--accent-color);
  color: #fff;
  transform: translateY(-2px);
}

.filter-btn.active {
  background-color: var(--accent-color);
  color: #fff;
}

.project.hidden,
.projects-section .subsection-title.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .projects-filter {
    overflow-x: auto;
    white-space: nowrap;
    padding: 0.5rem;
    gap: 0.5rem;
    top: calc(var(--nav-offset, 64px) + 0.5rem);
  }
  .filter-btn {
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  #projects .projects-filter {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

/* ---- Brand shine animation ---- */
.brand.logo {
  position: relative;
  overflow: hidden;
}

.brand.logo .word-zach,
.brand.logo .word-tech {
  position: relative;
  display: inline-block;
  overflow: hidden;
}

.brand.logo .word-zach,
.brand.logo .word-tech {
    background: none !important;
}

.brand.logo .word-zach::after,
.brand.logo .word-tech::after {
    content: '';
    position: absolute;
    inset: 0;
    background: none;
    box-shadow: 0 0 12px rgba(255,255,255,.5);
    opacity: 0;
    animation: logo-shine 4s linear infinite;
}
.brand.logo .word-tech::after {
  animation-delay: 2s;
}

@keyframes logo-shine {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Optionally adjust colours for each part of the brand */
.brand.logo .word-tech {
  color: var(--accent-light);
}

/* ---- Anchor link click animation ---- */
.nav-links a.scroll-animate {
  animation: nav-link-bounce 0.6s ease;
}

@keyframes nav-link-bounce {
  0% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-3px);
  }
  60% {
    transform: translateY(3px);
  }
  100% {
    transform: translateY(0);
  }
}

.brand.logo .dot {
    position: relative;
    top: -9px;
    display: inline-block;
}

/* ============================= */
/* Services Section Styling      */
/* ============================= */

/* Dark overlay background matching other sections */
.services-section {
  background-color: rgba(14, 20, 35, 0.83);
}

/* Layout for services cards */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

/* Style for each service offering */
.service {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Service icons within service cards
   Each service card displays an icon above the heading. The icons are
   centered, sized consistently, and inverted to stand out on the dark
   background. Feel free to adjust width/height or remove the filter
   depending on the colour of your source icons. */
.service .service-icon {
  /* Reduce icon size for a more subtle appearance */
  width: 40px;
  height: 40px;
  display: block;
  margin: 0 auto 0.75rem;
  /* Invert and zero brightness to convert dark icons to light on a dark background */
  filter: brightness(0) invert(1);
}

/* Headline for service cards */
.service h4 {
  font-size: 1.3rem;
  color: var(--heading-color);
  margin-bottom: 0.5rem;
  text-align: center;
}

/* Price tag accent */
.service .price {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-color);
  margin-left: 0.4rem;
}

/* Service description paragraphs */
.service p {
  color: var(--text-color);
  line-height: 1.6;
}

/* Bullet list within services */
.service-list {
  margin-left: 1.25rem;
  color: var(--text-color);
}

.service-list li {
  margin-bottom: 0.5rem;
}

/* About section inline links */
.about-text a,
.about-text a:visited {
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.25s ease;
}

.about-text a:hover,
.about-text a:focus {
  color: var(--accent-color);
  text-decoration: none;
}




/* Responsive single-column layout for narrow screens */
@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

/* Force category titles to sit on their own full-width row */
#projects .subsection-title {
  grid-column: 1 / -1 !important;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Keep project cards in the grid below the title */
#projects .project {
  grid-column: auto;
}

/* Prevent sticky hover highlighting on touch/mobile devices.
   Only the filter with the .active class should remain highlighted. */
@media (hover: none), (pointer: coarse) {
  .filter-btn:not(.active):hover,
  .filter-btn:not(.active):focus,
  .filter-btn:not(.active):focus-visible {
    background-color: transparent;
    color: var(--text-color);
    transform: none;
  }

  .filter-btn.active,
  .filter-btn.active:hover,
  .filter-btn.active:focus,
  .filter-btn.active:focus-visible {
    background-color: var(--accent-color);
    color: #fff;
    transform: none;
  }
}

.projects-section .project img.project-image {
  aspect-ratio: 2 / 1;
  object-fit: cover;
  object-position: center top;
}
