/* ===================================================================
   PORTFOLIO UNIFIED CSS - Optimized & Mobile Responsive
   Maintains all original visual effects and styling
   ================================================================= */

/* ===================================================================
   BASE STYLES & RESET
   ================================================================= */

/* Universal Box-Sizing for consistency */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  background-color: #0a0a0a;
  color: #ffffff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ===================================================================
   NAVIGATION & BACK LINKS
   ================================================================= */

/* Back Link Style - Used across all pages */
.back-link, a.back-link {
  display: inline-flex;
  align-items: center;
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.75rem 1.5rem;
  margin-bottom: 3rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(10px);
}

.back-link:hover, a.back-link:hover {
  background: #dc2626;
  border-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.3);
}

/* Back button for mystory page */
.back-button {
  position: fixed;
  top: 2rem;
  left: 2rem;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 1rem;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  z-index: 100;
}

.back-button:hover {
  color: #fff;
}

.back-button svg {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  fill: currentColor;
}

/* ===================================================================
   CONTAINERS & LAYOUT
   ================================================================= */

/* Main containers */
.portfolio-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 2rem;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* Mystory specific container */
.container.mystory {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

/* ===================================================================
   TYPOGRAPHY
   ================================================================= */

/* Main headings */
h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  margin-bottom: 2rem;
  color: #ffffff;
  letter-spacing: -0.02em;
  text-align: center;
  background: linear-gradient(135deg, #ffffff 0%, #dc2626 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Portfolio header specific */
.portfolio-header {
  text-align: center;
  margin-bottom: 5rem;
  padding: 2rem 0;
}

.portfolio-header h1 {
  font-size: clamp(3rem, 5vw, 4rem);
  margin-bottom: 1.5rem;
}

.portfolio-header p {
  max-width: 700px;
  margin: 0 auto;
  color: #a1a1aa;
  font-size: 1.2rem;
  line-height: 1.7;
  font-weight: 400;
}

/* Section headings */
.section h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #ffffff;
  letter-spacing: -0.01em;
  text-align: center;
}

/* Mystory specific headings */
.mystory h1 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  position: relative;
  display: inline-block;
  text-align: left;
  background: none;
  -webkit-text-fill-color: #ffffff;
}

.mystory h1:after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 3px;
  background: #fff;
}

/* Paragraphs */
p {
  font-size: 1.1rem;
  color: #d1d5db;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.section p {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  text-align: justify;
}

.section p strong {
  color: #ffffff;
}

/* Mystory specific paragraphs */
.mystory p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.9);
}

.mystory .highlight {
  color: #fff;
  font-weight: 500;
}

/* Age badge */
.age {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.9rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* ===================================================================
   PROJECT GRIDS & CARDS
   ================================================================= */

/* Portfolio Grid */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
  gap: 2.5rem;
  margin-top: 4rem;
}

/* Project Items */
.project-item {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  aspect-ratio: 16/11;
  backdrop-filter: blur(20px);
}

.project-item:hover {
  border-color: rgba(220, 38, 38, 0.4);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-8px);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(220, 38, 38, 0.2);
}

/* Project Media */
.project-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.4s ease;
  filter: brightness(0.8) contrast(1.1);
}

.project-item:hover .project-media {
  filter: brightness(0.4) contrast(1.2);
  transform: scale(1.05);
}

/* Project Overlay */
.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(220, 38, 38, 0.1) 100%
  );
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2rem;
  backdrop-filter: blur(10px);
  z-index: 1;
  overflow-y: auto;
  /* Hide scrollbar but keep functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}

/* Hide scrollbar for WebKit browsers (Chrome, Safari, Edge) */
.project-overlay::-webkit-scrollbar {
  display: none;
}

.project-item:hover .project-overlay {
  opacity: 1;
}

/* Project Title */
.project-title {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* Project Description */
.project-description {
  font-size: 1rem;
  color: #d1d5db;
  line-height: 1.6;
  margin-bottom: 2rem;
  font-weight: 400;
  display: block;
}

/* Project Tags */
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.project-tag {
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.3);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #fca5a5;
  font-weight: 500;
  backdrop-filter: blur(10px);
}

/* Project Meta */
.project-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    transparent,
    rgba(0, 0, 0, 0.8)
  );
  padding: 2rem 2rem 1.5rem;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.project-item:hover .project-meta {
  opacity: 0;
}

.project-meta h3 {
  margin: 0;
  font-size: 1.3rem;
  color: #ffffff;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.project-year {
  font-size: 0.9rem;
  color: #dc2626;
  margin-top: 0.5rem;
  font-weight: 500;
}

/* Project item visual effects */
.project-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent 0%,
    rgba(220, 38, 38, 0.05) 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 1;
}

.project-item:hover::before {
  opacity: 1;
}

/* ===================================================================
   PROJECT DETAIL PAGES
   ================================================================= */

/* Project Meta Grid */
.project-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: static;
}

.meta-item h3 {
  font-size: 0.9rem;
  color: #a1a1aa;
  margin-bottom: 0.4rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meta-item p {
  font-size: 1.1rem;
  color: #ffffff;
  font-weight: 500;
  margin: 0;
}

/* ===================================================================
   MEDIA & VIDEO
   ================================================================= */

/* Video Wrapper */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin-bottom: 3rem;
  border-radius: 8px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.4);
  background-color: #000;
}

.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
  object-fit: contain;
}

/* ===================================================================
   GALLERIES & GRIDS
   ================================================================= */

/* GIF Grid */
.gif-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  margin: 2.5rem auto;
  justify-content: center;
  max-width: 1000px;
}

.gif-grid img,
.gif-grid video {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gif-grid img:hover,
.gif-grid video:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

/* Image Grid */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  margin: 2.5rem auto;
  justify-content: center;
  max-width: 1000px;
}

.image-grid img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Concept Art */
.concept-art {
  text-align: center;
}

.concept-art p {
  font-size: 0.9rem;
  color: #a1a1aa;
  margin-top: 0.8rem;
  margin-bottom: 0;
  text-align: center;
}

/* Scrollable Gallery */
.gallery-container {
  position: relative;
  margin: 40px 0;
  width: 100%;
  margin-bottom: 3rem;
}

.gallery-scroll {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  gap: 15px;
  padding: 20px 0;
  width: 100%;
  height: 500px;
}

.gallery-scroll img {
  scroll-snap-align: start;
  height: 100%;
  width: auto;
  max-width: 90%;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
  background: #1a1a1a;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: all 0.3s ease;
}

.gallery-nav:hover {
  background: rgba(255,255,255,0.2);
}

.gallery-nav.prev {
  left: 10px;
}

.gallery-nav.next {
  right: 10px;
}

/* ===================================================================
   BUTTONS & LINKS
   ================================================================= */

/* Project Links */
.project-link {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #ffffff;
  padding: 0.8rem 1.8rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
  margin-top: auto;
  flex-shrink: 0;
}

.project-link:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(220, 38, 38, 0.4);
}

.project-button-container {
  text-align: center;
  margin-top: 3rem;
  margin-bottom: 3rem;
}

/* ===================================================================
   SPECIAL SECTIONS
   ================================================================= */

/* Sections */
.section {
  margin-bottom: 4rem;
}

/* Quote */
.quote {
  font-size: 1.3rem;
  font-style: italic;
  color: #dc2626;
  border-left: 4px solid #dc2626;
  padding-left: 1.5rem;
  margin: 2.5rem auto;
  max-width: 700px;
  line-height: 1.5;
  font-weight: 500;
}

/* Techniques Grid */
.techniques-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
}

.technique {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.technique:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.technique h4 {
  font-size: 1.2rem;
  color: #ffffff;
  margin-bottom: 0.8rem;
  font-weight: 600;
}

.technique p {
  font-size: 0.95rem;
  color: #d1d5db;
  margin: 0;
  text-align: center;
}

/* Lists */
ul {
  list-style: none;
  padding: 0;
  margin: 2.5rem auto;
  max-width: 800px;
}

ul li {
  font-size: 1.1rem;
  color: #d1d5db;
  line-height: 1.7;
  margin-bottom: 0.8rem;
  position: relative;
  padding-left: 1.8rem;
}

ul li::before {
  content: '→';
  color: #dc2626;
  position: absolute;
  left: 0;
  font-weight: bold;
}

/* Skills for mystory */
.skills {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.skill-tag {
  background: rgba(255,255,255,0.1);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
}

/* Story content and image for mystory */
.story-content {
  padding-right: 2rem;
}

.story-image {
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.story-image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.story-image:hover img {
  transform: scale(1.02);
}

/* Captions */
.caption {
  font-size: 0.9rem;
  color: #a1a1aa;
  margin-top: 0.8rem;
  margin-bottom: 2rem;
  text-align: center;
  font-style: italic;
}

/* Award badge */
.award-badge {
  text-align: center;
  background: #dc2626;
  color: white;
  padding: 1rem;
  margin-bottom: 2rem;
  border-radius: 8px;
}

/* ===================================================================
   ENHANCED MYSTORY STYLES
   ================================================================= */

/* Enhanced Body for MyStory */
.mystory-enhanced {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Animated Background */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

#particleCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Floating Shapes */
.floating-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(45deg, rgba(220, 38, 38, 0.1), rgba(220, 38, 38, 0.05));
  animation: float 20s infinite linear;
}

.shape-1 {
  width: 80px;
  height: 80px;
  top: 20%;
  left: 10%;
  animation-duration: 25s;
}

.shape-2 {
  width: 120px;
  height: 120px;
  top: 60%;
  right: 15%;
  animation-duration: 30s;
  animation-direction: reverse;
}

.shape-3 {
  width: 60px;
  height: 60px;
  top: 80%;
  left: 70%;
  animation-duration: 20s;
}

.shape-4 {
  width: 100px;
  height: 100px;
  top: 40%;
  left: 80%;
  animation-duration: 35s;
  animation-direction: reverse;
}

.shape-5 {
  width: 40px;
  height: 40px;
  top: 10%;
  right: 30%;
  animation-duration: 15s;
}

@keyframes float {
  0% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.3;
  }
  50% {
    transform: translateY(-100px) rotate(180deg);
    opacity: 0.1;
  }
  100% {
    transform: translateY(0px) rotate(360deg);
    opacity: 0.3;
  }
}

/* Enhanced Back Button */
.back-button.enhanced {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-button.enhanced:hover {
  background: rgba(220, 38, 38, 0.9);
  border-color: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(220, 38, 38, 0.3);
}

/* MyStory Container */
.mystory-container {
  position: relative;
  z-index: 1;
}

/* Hero Section */
.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  max-width: 1200px;
  width: 100%;
  align-items: center;
}

.hero-text {
  z-index: 2;
}

.greeting {
  margin-bottom: 2rem;
}

.wave {
  font-size: 3rem;
  display: inline-block;
  animation: wave 2s infinite;
  margin-right: 1rem;
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(20deg); }
  75% { transform: rotate(-10deg); }
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
  background: none;
  -webkit-text-fill-color: #ffffff;
}

.hero-title .line {
  display: block;
  opacity: 0;
  animation: slideInUp 0.8s ease forwards;
}

.hero-title .line:nth-child(2) {
  animation-delay: 0.2s;
}

.highlight-text {
  position: relative;
  background: linear-gradient(135deg, #dc2626, #f87171);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.highlight-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  background: linear-gradient(135deg, #dc2626, #f87171);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: glitch 3s infinite;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes glitch {
  0%, 90%, 100% {
    transform: translate(0);
  }
  95% {
    transform: translate(2px, -2px);
  }
}

/* Age Badge */
.age-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  margin: 2rem 0;
  backdrop-filter: blur(10px);
}

.age-number {
  font-size: 2rem;
  font-weight: 700;
  color: #dc2626;
}

.age-text {
  color: #d1d5db;
  font-size: 0.9rem;
}

/* Typing Animation */
.typing-container {
  margin: 2rem 0;
  min-height: 60px;
  display: flex;
  align-items: center;
}

.typing-text {
  font-size: 1.2rem;
  color: #d1d5db;
  margin: 0;
  margin-right: 0.5rem;
}

.cursor {
  color: #dc2626;
  font-weight: bold;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Hero Stats */
.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 3rem;
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: #dc2626;
  line-height: 1;
}

.stat-label {
  font-size: 0.9rem;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Hero Visual */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.photo-container {
  position: relative;
}

.photo-frame {
  position: relative;
  width: 400px;
  height: 400px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 3px solid rgba(220, 38, 38, 0.3);
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.photo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(220, 38, 38, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.photo-frame:hover .photo-overlay {
  opacity: 1;
}

.photo-frame:hover .hero-photo {
  transform: scale(1.05);
}

/* Floating Icons */
.floating-icons {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.icon {
  position: absolute;
  font-size: 2rem;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: iconFloat 6s ease-in-out infinite;
}

.icon-1 {
  top: -10px;
  right: -10px;
  animation-delay: 0s;
}

.icon-2 {
  bottom: -10px;
  left: -10px;
  animation-delay: 1.5s;
}

.icon-3 {
  top: 50%;
  right: -30px;
  animation-delay: 3s;
}

.icon-4 {
  top: 50%;
  left: -30px;
  animation-delay: 4.5s;
}

@keyframes iconFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  cursor: pointer;
  animation: bounce 2s infinite;
}

.scroll-text {
  font-size: 0.9rem;
  color: #a1a1aa;
  margin-bottom: 0.5rem;
}

.scroll-arrow {
  font-size: 1.5rem;
  color: #dc2626;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff, #dc2626);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 1.2rem;
  color: #a1a1aa;
  max-width: 600px;
  margin: 0 auto;
}

/* Timeline Section */
.timeline-section {
  padding: 6rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #dc2626, rgba(220, 38, 38, 0.3));
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  margin-bottom: 4rem;
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.6s ease;
}

.timeline-item:nth-child(odd) {
  padding-right: 50%;
  text-align: right;
}

.timeline-item:nth-child(even) {
  padding-left: 50%;
  text-align: left;
}

.timeline-item.timeline-animate {
  opacity: 1;
  transform: translateY(0);
}

.timeline-marker {
  position: absolute;
  top: 0;
  left: 50%;
  width: 20px;
  height: 20px;
  background: #dc2626;
  border-radius: 50%;
  transform: translateX(-50%);
  border: 4px solid #0a0a0a;
  z-index: 2;
}

.timeline-marker.active {
  background: #ffffff;
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}

.timeline-content {
  background: rgba(255, 255, 255, 0.05);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.timeline-content h3 {
  font-size: 1.5rem;
  color: #ffffff;
  margin-bottom: 1rem;
  font-weight: 600;
}

.timeline-content p {
  color: #d1d5db;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.timeline-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.timeline-item:nth-child(odd) .timeline-tags {
  justify-content: flex-end;
}

.tag {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

/* Software Section */
.software-section {
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.software-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

.software-orbit {
  position: relative;
  width: 400px;
  height: 400px;
  margin: 2rem auto;
}

.orbit-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 10px 30px rgba(220, 38, 38, 0.3);
}

.center-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.center-text {
  font-size: 0.8rem;
  text-align: center;
  font-weight: 600;
  line-height: 1.2;
}

.center-text small {
  font-size: 0.6rem;
  opacity: 0.8;
  font-weight: 400;
}

.software-item {
  position: absolute;
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  animation: orbit 20s linear infinite;
}

.software-item:hover {
  transform: scale(1.2);
  background: rgba(220, 38, 38, 0.2);
  border-color: #dc2626;
  box-shadow: 0 10px 25px rgba(220, 38, 38, 0.3);
}

.software-icon {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
}

.software-tooltip {
  position: absolute;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  z-index: 20;
}

.software-item:hover .software-tooltip {
  opacity: 1;
}

.proficiency {
  display: block;
  font-size: 0.7rem;
  color: #dc2626;
  margin-top: 0.2rem;
}

@keyframes orbit {
  from {
    transform: rotate(0deg) translateX(150px) rotate(0deg);
  }
  to {
    transform: rotate(360deg) translateX(150px) rotate(-360deg);
  }
}

/* Adobe items */
.software-item.adobe {
  background: linear-gradient(135deg, rgba(255, 0, 0, 0.2), rgba(255, 0, 0, 0.1));
  border-color: rgba(255, 0, 0, 0.3);
}

.software-item.adobe:hover {
  background: linear-gradient(135deg, rgba(255, 0, 0, 0.4), rgba(255, 0, 0, 0.2));
  border-color: #ff0000;
}

/* 3D items */
.software-item.threeDee {
  background: linear-gradient(135deg, rgba(255, 165, 0, 0.2), rgba(255, 165, 0, 0.1));
  border-color: rgba(255, 165, 0, 0.3);
}

.software-item.threeDee:hover {
  background: linear-gradient(135deg, rgba(255, 165, 0, 0.4), rgba(255, 165, 0, 0.2));
  border-color: #ffa500;
}

/* Creative items */
.software-item.creative {
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.2), rgba(138, 43, 226, 0.1));
  border-color: rgba(138, 43, 226, 0.3);
}

.software-item.creative:hover {
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.4), rgba(138, 43, 226, 0.2));
  border-color: #8a2be2;
}

/* Video items */
.software-item.video {
  background: linear-gradient(135deg, rgba(0, 255, 127, 0.2), rgba(0, 255, 127, 0.1));
  border-color: rgba(0, 255, 127, 0.3);
}

.software-item.video:hover {
  background: linear-gradient(135deg, rgba(0, 255, 127, 0.4), rgba(0, 255, 127, 0.2));
  border-color: #00ff7f;
}

/* Design items */
.software-item.design {
  background: linear-gradient(135deg, rgba(255, 20, 147, 0.2), rgba(255, 20, 147, 0.1));
  border-color: rgba(255, 20, 147, 0.3);
}

.software-item.design:hover {
  background: linear-gradient(135deg, rgba(255, 20, 147, 0.4), rgba(255, 20, 147, 0.2));
  border-color: #ff1493;
}

/* Featured item (After Effects) */
.software-item.featured {
  background: linear-gradient(135deg, rgba(255, 0, 0, 0.4), rgba(255, 0, 0, 0.2));
  border-color: #ff0000;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.5), 0 0 40px rgba(255, 0, 0, 0.3);
  animation: glow 2s ease-in-out infinite alternate;
}

.software-item.featured:hover {
  background: linear-gradient(135deg, rgba(255, 0, 0, 0.6), rgba(255, 0, 0, 0.4));
  border-color: #ff0000;
  box-shadow: 0 0 30px rgba(255, 0, 0, 0.7), 0 0 60px rgba(255, 0, 0, 0.5);
}

@keyframes glow {
  from {
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5), 0 0 40px rgba(255, 0, 0, 0.3);
  }
  to {
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.8), 0 0 60px rgba(255, 0, 0, 0.6);
  }
}

/* Software Categories */
.software-categories {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.category-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #d1d5db;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 500;
}

.category-btn:hover,
.category-btn.active {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(220, 38, 38, 0.3);
}

/* Personality Section */
.personality-section {
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.personality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.personality-card {
  position: relative;
  height: 200px;
  perspective: 1000px;
  cursor: pointer;
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  transition: transform 0.6s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.card-front {
  background: rgba(255, 255, 255, 0.05);
}

.card-back {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
  transform: rotateY(180deg);
}

.personality-card.flipped .card-front {
  transform: rotateY(-180deg);
}

.personality-card.flipped .card-back {
  transform: rotateY(0deg);
}

.trait-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.card-front h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.card-back p {
  color: #d1d5db;
  text-align: center;
  line-height: 1.6;
  margin: 0;
}

/* About Content Section */
.about-content-section {
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-top: 3rem;
}

.content-block {
  background: rgba(255, 255, 255, 0.03);
  padding: 3rem;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.content-block h3 {
  font-size: 1.8rem;
  color: #dc2626;
  margin-bottom: 2rem;
  font-weight: 600;
}

.content-block p {
  color: #d1d5db;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* CTA Section */
.cta-section {
  padding: 6rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-content {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.cta-content h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff, #dc2626);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cta-content p {
  font-size: 1.2rem;
  color: #a1a1aa;
  margin-bottom: 3rem;
}

.cta-buttons {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-btn {
  padding: 1rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cta-btn.primary {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #ffffff;
  border: 2px solid transparent;
}

.cta-btn.primary:hover {
  background: linear-gradient(135deg, #b91c1c, #991b1b);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(220, 38, 38, 0.4);
}

.cta-btn.secondary {
  background: transparent;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.cta-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
  transform: translateY(-2px);
}

/* Floating Elements */
.floating-elements {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}

.float-element {
  position: absolute;
  font-size: 2rem;
  opacity: 0.3;
  animation: floatAround 15s infinite linear;
}

.float-element:nth-child(1) {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.float-element:nth-child(2) {
  top: 60%;
  right: 15%;
  animation-delay: 3s;
}

.float-element:nth-child(3) {
  bottom: 30%;
  left: 20%;
  animation-delay: 6s;
}

.float-element:nth-child(4) {
  top: 40%;
  right: 30%;
  animation-delay: 9s;
}

.float-element:nth-child(5) {
  bottom: 20%;
  right: 10%;
  animation-delay: 12s;
}

@keyframes floatAround {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-20px) rotate(90deg);
  }
  50% {
    transform: translateY(0px) rotate(180deg);
  }
  75% {
    transform: translateY(20px) rotate(270deg);
  }
  100% {
    transform: translateY(0px) rotate(360deg);
  }
}

/* Mouse Follower */
.mouse-follower {
  position: fixed;
  width: 20px;
  height: 20px;
  background: rgba(220, 38, 38, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.1s ease;
  mix-blend-mode: difference;
}

.mouse-follower.follower-active {
  transform: scale(2);
  background: rgba(220, 38, 38, 0.8);
}

/* Animation Classes */
.animate-in {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.software-show {
  opacity: 1;
  transform: scale(1);
}

.card-animate {
  animation: cardPop 0.6s ease forwards;
}

@keyframes cardPop {
  0% {
    transform: scale(0.8) rotateY(-10deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotateY(0deg);
    opacity: 1;
  }
}

/* Enhanced Responsive Design for MyStory */
@media (max-width: 768px) {
  .mystory-enhanced {
    font-size: 14px;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .hero-stats {
    justify-content: center;
    gap: 1rem;
  }

  .photo-frame {
    width: 300px;
    height: 300px;
  }

  .timeline::before {
    left: 20px;
  }

  .timeline-item {
    padding-left: 60px;
    text-align: left;
  }

  .timeline-item:nth-child(odd) {
    padding-right: 0;
    text-align: left;
  }

  .timeline-item:nth-child(even) {
    padding-left: 60px;
  }

  .timeline-marker {
    left: 20px;
  }

  .software-orbit {
    width: 300px;
    height: 300px;
  }

  .software-item {
    width: 50px;
    height: 50px;
  }

  .software-icon {
    font-size: 1.2rem;
  }

  .personality-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .content-block {
    padding: 2rem;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .floating-icons .icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .age-number {
    font-size: 1.5rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .photo-frame {
    width: 250px;
    height: 250px;
  }

  .software-orbit {
    width: 250px;
    height: 250px;
  }

  .orbit-center {
    width: 80px;
    height: 80px;
  }

  .center-icon {
    font-size: 1.5rem;
  }

  .center-text {
    font-size: 0.7rem;
  }

  .software-item {
    width: 40px;
    height: 40px;
  }

  .software-icon {
    font-size: 1rem;
  }

  .personality-card {
    height: 180px;
  }

  .trait-icon {
    font-size: 2rem;
  }

  .card-front h3 {
    font-size: 1.2rem;
  }

  .content-block {
    padding: 1.5rem;
  }

  .section-title {
    font-size: 1.8rem;
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .software-item {
    animation: none;
  }

  .floating-shapes .shape {
    animation: none;
  }

  .cursor {
    animation: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .hero-title,
  .section-title {
    -webkit-text-fill-color: #ffffff;
    background: none;
  }

  .software-item,
  .personality-card,
  .content-block {
    border-width: 2px;
  }
}


/* ===================================================================
   RESPONSIVE DESIGN
   ================================================================= */

@media (max-width: 1200px) {
  .portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
  }
}

/* Universal touch/click overlay functionality - works at all screen sizes */
/* Show overlay when project item is tapped/clicked */
.project-item:active .project-overlay,
.project-item.show-overlay .project-overlay {
  opacity: 1;
}

/* Darken media when overlay is shown */
.project-item:active .project-media,
.project-item.show-overlay .project-media {
  filter: brightness(0.4) contrast(1.2);
}

/* Hide bottom meta when overlay is shown */
.project-item:active .project-meta,
.project-item.show-overlay .project-meta {
  opacity: 0;
}

/* Mobile-first approach for responsive design */
@media (max-width: 768px) {
  /* Containers */
  .portfolio-container {
    padding: 1.5rem;
  }

  .container {
    padding: 2rem 1rem;
  }

  .container.mystory {
    grid-template-columns: 1fr;
    padding: 2rem 1.5rem;
  }

  /* Typography */
  .portfolio-header {
    margin-bottom: 3rem;
  }

  .portfolio-header h1 {
    font-size: 2.5rem;
  }

  .portfolio-header p {
    font-size: 1.1rem;
  }

  .mystory h1 {
    font-size: 2rem;
  }

  /* Navigation */
  .back-button {
    top: 1rem;
    left: 1rem;
  }

  /* Grids */
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* MOBILE PROJECT CARDS - Touch-based overlay activation */
  .project-item {
    aspect-ratio: 16/12; /* Slightly taller for mobile */
    min-height: 400px; /* Ensure minimum height for content */
  }

  /* Mobile overlay styling */
  .project-overlay {
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.95) 0%,
      rgba(0, 0, 0, 0.7) 40%,
      rgba(0, 0, 0, 0.3) 70%,
      transparent 100%
    );
    justify-content: flex-end;
    padding: 1.5rem;
    backdrop-filter: blur(5px);
  }

  /* Mobile-optimized overlay content */
  .project-title {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    line-height: 1.3;
  }

  .project-description {
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    line-height: 1.5;
    /* Limit description length on mobile for better UX */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .project-tags {
    gap: 0.5rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
  }

  .project-tag {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.4);
  }

  /* Enhanced mobile button styling */
  .project-link {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    min-height: 44px; /* Ensure proper touch target size */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  /* Remove hover effects on mobile for project items */
  .project-item:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }

  .project-item:hover .project-media {
    transform: none;
  }

  .project-item:hover .project-overlay {
    opacity: 0; /* Ensure hover doesn't interfere with touch */
  }

  /* Other responsive elements */
  .project-meta {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }

  .gif-grid,
  .image-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
  }

  .gif-grid img,
  .gif-grid video,
  .image-grid img {
    height: 200px;
  }

  .techniques-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Gallery */
  .gallery-scroll {
    height: 300px;
  }

  /* Mystory specific */
  .story-content {
    padding-right: 0;
    margin-bottom: 3rem;
  }
}

/* Medium screens - tablets and small laptops */
@media (min-width: 769px) and (max-width: 1200px) {
  /* Ensure touch functionality works on tablets */
  .project-overlay {
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.95) 0%,
      rgba(0, 0, 0, 0.7) 40%,
      rgba(0, 0, 0, 0.3) 70%,
      transparent 100%
    );
    justify-content: flex-end;
    padding: 2rem;
    backdrop-filter: blur(5px);
  }

  .project-link {
    min-height: 44px; /* Ensure proper touch target size */
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  /* Containers */
  .container {
    padding: 1.5rem 0.8rem;
  }

  .portfolio-container {
    padding: 1rem;
  }

  /* Typography */
  h1 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
  }

  .section h2 {
    font-size: 1.5rem;
  }

  .section p, ul li {
    font-size: 0.95rem;
  }

  .quote {
    font-size: 1rem;
  }

  /* Navigation */
  .back-link {
    margin-bottom: 2rem;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  /* SMALL MOBILE PROJECT CARDS */
  .project-item {
    min-height: 350px;
    aspect-ratio: 16/13;
  }

  .project-overlay {
    padding: 1.2rem;
  }

  .project-title {
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
  }

  .project-description {
    font-size: 0.85rem;
    margin-bottom: 1rem;
    -webkit-line-clamp: 2; /* Reduce to 2 lines on very small screens */
  }

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

  .project-tag {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }

  .project-link {
    padding: 0.7rem 1.2rem;
    font-size: 0.85rem;
    min-height: 42px;
  }

  /* Grids */
  .gif-grid,
  .image-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .gif-grid img,
  .gif-grid video,
  .image-grid img {
    height: 120px;
  }

  /* Gallery */
  .gallery-scroll {
    height: 250px;
  }

  /* Sections */
  .section {
    margin-bottom: 3rem;
  }

  /* Techniques */
  .technique h4 {
    font-size: 1.1rem;
  }

  .technique p {
    font-size: 0.9rem;
  }
}

/* Ensure desktop hover effects are preserved for non-touch devices */
@media (hover: hover) and (pointer: fine) {
  /* Desktop/laptop hover effects - keep original behavior */
  .project-overlay {
    opacity: 0;
    background: linear-gradient(
      135deg,
      rgba(0, 0, 0, 0.9) 0%,
      rgba(220, 38, 38, 0.1) 100%
    );
    justify-content: center;
    align-items: flex-start;
    padding: 3rem;
  }

  .project-item:hover .project-overlay {
    opacity: 1;
  }

  .project-item .project-media {
    filter: brightness(0.8) contrast(1.1);
  }

  .project-item:hover .project-media {
    filter: brightness(0.4) contrast(1.2);
    transform: scale(1.05);
  }

  .project-meta {
    opacity: 1;
  }

  .project-item:hover .project-meta {
    opacity: 0;
  }

  .project-item:hover {
    border-color: rgba(220, 38, 38, 0.4);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-8px);
    box-shadow:
      0 20px 40px rgba(0, 0, 0, 0.3),
      0 0 0 1px rgba(220, 38, 38, 0.2);
  }

  /* Desktop overlay content styling */
  .project-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
  }

  .project-description {
    font-size: 1rem;
    margin-bottom: 2rem;
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
  }

  .project-tags {
    gap: 0.75rem;
    margin-bottom: 2rem;
  }

  .project-tag {
    font-size: 0.85rem;
    padding: 0.4rem 0.9rem;
  }

  .project-link {
    padding: 0.8rem 1.8rem;
    font-size: 0.95rem;
  }
}
