/* Base reset */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'IBM Plex Mono', system-ui, -apple-system, Segoe UI, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: #344E41;
  background: #CCD5AE;
}

.wallpaper {
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  background: #CCD5AE;
}

.polaroid-list {
  list-style: none;
  margin: 0;
  padding: 0 1.25rem;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 260px;
  gap: 2.25rem;
  align-items: start;
  justify-content: center;
  max-width: 1400px;
  margin-inline: auto;
  padding-top: 3rem;
}

.polaroid {
  position: relative;
  transform: translateY(var(--y)) rotate(var(--r, var(--x))) scale(var(--sc, var(--s))) translate(var(--tx, 0px), var(--ty, 0px));
  transition: transform 420ms cubic-bezier(.22,1,.36,1);
  transform-origin: 50% 0%;
}

.clip {
  display: none;
}

.card {
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  border: 0;
  background: transparent;
  position: relative;
  display: block;
  width: 260px;
  margin-inline: auto;
  cursor: pointer;
  outline-offset: 6px;
  perspective: 1200px; /* perspective belongs on the parent of the flipping element */
  -webkit-perspective: 1200px;
  transform-origin: 50% 0%;
}

.card-inner {
  display: grid;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 1200ms cubic-bezier(.19,1,.22,1);
  border-radius: 6px;
  border: 3px solid #344E41;
  transform-origin: center;
  will-change: transform;
  height: 320px;
}

.card-face {
  grid-area: 1 / 1;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: #fff;
  border-radius: 3px;
  overflow: hidden;
  height: 100%;
}

.card-front { transform: rotateY(0deg); }

.card-front img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
  background: #ddd;
}

.caption {
  display: block;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.1em;
  min-height: 60px;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 1rem;
  color: #344E41;
  text-transform: uppercase;
}

.card-back {
  transform: rotateY(180deg);
  padding: 1rem 1rem 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.card-back h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-weight: 500;
  color: #344E41;
  letter-spacing: 0.05em;
}
.card-back h3 {
  margin: 0 0 0.5rem;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-weight: 500;
  color: #344E41;
  letter-spacing: 0.03em;
}
.card-back p {
  margin: 0 0 0.5rem;
  font-family: 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif, Helvetica, Arial;
  font-weight: 400;
  color: #344E41;
}
.card-back .text-small {
  font-size: 0.6rem;
}
.card-back p, .card-back li {
  line-height: 1.25;
}

/* Doodle space for cards */
.card-doodle {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-doodle img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.card-doodle::before {
  font-size: 0.8rem;
  opacity: 0.3;
  position: absolute;
  top: 5px;
  right: 5px;
}

.card-doodle:hover::before {
  opacity: 0.6;
}

.card-back ul {
  margin: 0.25rem 0 0 1rem;
}

/* Contact actions */
.actions-row {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  margin-top: 0.6rem;
  margin-left: auto;
  margin-right: auto;
  align-items: center;
  justify-content: center;
  max-width: 200px;
}
.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0.5rem;
  border-radius: 50%;
  border: 2px solid #344E41;
  background: #fff;
  color: #344E41;
  text-decoration: none;
  font-weight: 600;
  width: 40px;
  height: 40px;
  min-width: 40px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.btn-link:hover { 
  background: #E9EDC9; 
  border-color: #588157;
  color: #588157;
}
.btn-link:active { 
  background: #f0f2e8; 
}
.btn-link svg { 
  width: 24; 
  height: 24px;
}
.btn-link span {
  display: none;
}

/* Banner footer for card backs */
.card-banner {
  margin-top: auto;
  width: 100%;
  height: 80px;
  background: #f8f8f8;
  border-top: 1px solid rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Active (flip + zoom) */
.polaroid.active { z-index: 1000; transform-origin: 50% 50%; }

.polaroid-spacer { visibility: hidden; }

/* Fixed centered state: identical position for all active cards */
.polaroid.active-fixed {
  position: fixed;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -52%);
}
.polaroid.active .card { transform: scale(1.2); }
.polaroid.active .card-inner {
  transform: rotateY(180deg) translateZ(0);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(52, 78, 65, 0.3);
  transition: opacity 250ms ease;
  z-index: 5;
}

.close-active {
  position: fixed;
  right: 1rem;
  top: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 2px solid #344E41;
  background: #fff;
  color: #344E41;
  font-size: 1.15rem;
  cursor: pointer;
  z-index: 1100;
}

.footer {
  text-align: center;
  padding: 4rem 1rem 1rem;
  color: #344E41;
}

.more-btn, .card-btn {
  background: rgba(255, 255, 255, 0.6);
  border: 2px solid #344E41;
  color: #344E41;
  font-family: 'Gill Sans MT', 'Courier New', monospace;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}


.more-btn:hover, .card-btn:hover {
  color: #588157;
  background: rgba(233, 237, 201, 0.8);
  border-color: #588157;
}

/* Subpage Styles */
.subpage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  background: #CCD5AE;
  z-index: 2000;
  overflow-y: auto;
  transform: translateY(-100%);
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.subpage.show {
  transform: translateY(0);
}

.subpage-layout {
  display: grid;
  grid-template-columns: 1fr 300px 1fr;
  gap: 1.5rem;
  min-height: 90vh;
  padding: 0.5rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
  align-content: start;
}

/* Timeline Section (Left) */
.timeline-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0.5rem;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease-out 0.3s forwards;
}

.timeline-section h2 {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  color: #344E41;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.timeline-section h2::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #344E41, #588157);
  transition: width 0.3s ease;
}

.timeline-section:hover h2::after {
  width: 100%;
}

.timeline {
  position: relative;
  width: 100%;
  max-width: 250px;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  padding-bottom: 1rem;
}

.timeline::-webkit-scrollbar {
  width: 4px;
}

.timeline::-webkit-scrollbar-track {
  background: rgba(52, 78, 65, 0.1);
  border-radius: 2px;
}

.timeline::-webkit-scrollbar-thumb {
  background: rgba(52, 78, 65, 0.3);
  border-radius: 2px;
}

.timeline::-webkit-scrollbar-thumb:hover {
  background: rgba(52, 78, 65, 0.5);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.2rem;
  padding-left: 2.5rem;
  opacity: 0;
  transform: translateX(-20px);
  animation: slideInLeft 0.5s ease-out forwards;
}

.timeline-item:nth-child(1) { animation-delay: 1.2s; }
.timeline-item:nth-child(2) { animation-delay: 1.4s; }
.timeline-item:nth-child(3) { animation-delay: 1.6s; }
.timeline-item:nth-child(4) { animation-delay: 1.8s; }
.timeline-item:nth-child(5) { animation-delay: 2.0s; }

.timeline-dot {
  position: absolute;
  left: 11px;
  top: 8px;
  width: 18px;
  height: 18px;
  background: #344E41;
  border-radius: 50%;
  border: 3px solid #CCD5AE;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.timeline-dot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border: 2px solid transparent;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  pointer-events: none;
}

.timeline-content {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0.5rem;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.timeline-content:hover {
  background: rgba(233, 237, 201, 0.4);
}

.timeline-item:hover .timeline-dot::before {
  opacity: 1;
  border: 5px solid #E9EDC9;
  width: 20px;
  height: 20px;
}

.timeline-content h3 {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  margin: 0 0 0.5rem;
  color: #344E41;
  transition: color 0.3s ease;
}

.timeline-content:hover h3 {
  color: #588157;
}

.timeline-content p {
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif, Helvetica, Arial;
  font-size: 0.9rem;
  font-weight: 400;
  color: #344E41;
  margin: 0;
  transition: all 0.3s ease;
}

.timeline-content:hover p {
  color: #2d4a3e;
  font-weight: 500;
}

/* Center Card Section */
.center-card-section {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0.5rem 0.5rem;
  padding-top: 2rem;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

.center-card {
  width: 265px;
  height: 350px;
  perspective: 1200px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.center-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.center-card:hover .center-card-inner {
  transform: rotateY(-180deg) scale(1.02);
}

.center-card-front, .center-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  border: 3px solid #344E41;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: all 0.3s ease;
}

.center-card-front {
  background: #fff;
}

.center-card-back {
  transform: rotateY(180deg);
  background: #fff;
}

.center-card-front img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
  border: 3px solid transparent;
}

.center-card-front h3 {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #344E41;
  transition: all 0.3s ease;
  position: relative;
}


.center-card-back h3 {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: #344E41;
  margin: 0 0 0.5rem;
  transition: color 0.3s ease;
}


.center-card-back p {
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif, Helvetica, Arial;
  font-size: 0.9rem;
  font-weight: 400;
  color: #344E41;
  line-height: 1.4;
  margin: 0 0 1rem;
  transition: all 0.3s ease;
  text-align: left;
}

.center-card-back .center {
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif, Helvetica, Arial;
  font-size: 0.9rem;
  font-weight: 400;
  color: #344E41;
  line-height: 1.4;
  margin: 0 0 1rem;
  transition: all 0.3s ease;
  text-align: center;
}

.center-card:hover .center-card-back p {
  color: #2d4a3e;
  font-weight: 500;
}

.center-card-banner {
  width: 100%;
  height: 60px;
  background: linear-gradient(135deg, #f8f8f8 0%, #e9e9e9 100%);
  border-radius: 8px;
  overflow: hidden;
  margin-top: auto;
  transition: all 0.3s ease;
  border: 1px solid rgba(52, 78, 65, 0.1);
}


.center-card-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* Right Section (Hobbies & Courses) */
.right-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.2rem 0.5rem 0 0.5rem;
  align-items: center;
  opacity: 0;
  /*transform: translateY(30px);*/
  animation: fadeInUp 0.8s ease-out 0.6s forwards;
  overflow: visible;
  margin-left: 1rem;
}

.hobbies-section, .courses-section {
  width: 100%;
  max-width: 200px;
  opacity: 0;
  margin: 0 0 2rem;
  transform: translateX(20px);
  animation: slideInRight 0.6s ease-out forwards;
  overflow: visible;
}

.hobbies-section {
  animation-delay: 1s;
}

.courses-section {
  animation-delay: 1.2s;
}

.hobbies-section h2, .courses-section h2 {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  margin: 0 0 1rem;
  color: #333;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.hobbies-section h2::after, .courses-section h2::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #344E41, #588157);
  transition: width 0.3s ease;
}

.hobbies-section:hover h2::after, .courses-section:hover h2::after {
  width: 80%;
}

.hobby-item, .course-item {
  background: #fff;
  padding: 0.5rem 0.75rem;
  margin: 0.4rem 0;
  border-radius: 12px;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif, Helvetica, Arial;
  font-size: 0.75rem;
  font-weight: 500;
  color: #344E41;
  text-align: center;
  transform: rotate(0deg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid rgba(52, 78, 65, 0.1);
}

.hobby-item {
  overflow: visible;
}

.course-item {
  overflow: hidden;
}

.course-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s ease;
  z-index: 1;
}

.course-item:hover::before {
  left: 100%;
}

.hobby-item:nth-child(1n), .course-item:nth-child(1n) {
  transform: rotate(0deg);
  background: #f0f2e8;
  /*background: linear-gradient(135deg, #E9EDC9 0%, #f0f2e8 100%);*/
  color: #344E41;
}


.course-item:hover, .hobby-item:hover {
  transform: /*translateY(-3px)*/ scale(1.05);
  z-index: 10;
  color: #588157;
  background: linear-gradient(135deg, #E9EDC9 0%, #f0f2e8 100%);
  border-color: #588157;
}

/* Tooltip styles for hobby items */
.hobby-item {
  position: relative;
}

/* Hide tooltips on mobile, show only on desktop */
@media (min-width: 769px) {
  .hobby-item::after, .course-item::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 105%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 10px;
    background: #344E41;
    color: #CCD5AE;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif, Helvetica, Arial;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10000;
    pointer-events: none;
    width: 150px;
    white-space: normal;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid #588157;
  }

  .hobby-item:hover::after {
    opacity: 1;
    visibility: visible;
  }
}

/* Hide tooltips on mobile */
@media (max-width: 768px) {
  .hobby-item::after, .course-item::after {
    display: none;
  }
}

.subpage-footer {
  text-align: center;
  padding: 0 1rem 0;
  color: #344E41;
  position: relative;
  bottom: 2.5rem;
  z-index: 100;
  display: block;
}

/* Inline subpage footer */
.subpage-footer-inline {
  text-align: center;
  padding: 1rem;
  margin-top: 1rem;
}

/* Mobile: Hide original subpage footer, show inline */
@media (max-width: 768px) {
  .subpage-footer {
    display: none;
  }
  
  .subpage-footer-mobile {
    display: none;
  }
  
  .subpage {
    padding-top: 1rem;
    padding-bottom: 2rem;
  }
}

/* Desktop: Show original subpage footer, hide inline */
@media (min-width: 769px) {
  .subpage-footer {
    display: block;
    z-index: 10;
  }
  
  .subpage-footer-inline {
    display: none !important;
  }
  
  .subpage-footer-mobile {
    display: none;
  }
}


/* Hover affordance - only for devices that support hover */
@media (hover: hover) and (pointer: fine) {
  .polaroid:not(.active):hover {
    transform: translateY(var(--y)) rotate(var(--r, var(--x))) scale(calc(var(--s) + 0.03)) translate(var(--tx, 0px), var(--ty, 0px));
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .card {
    cursor: default;
  }
  .polaroid:not(.active):active {
    transform: translateY(var(--y)) rotate(var(--r, var(--x))) scale(calc(var(--s) + 0.02)) translate(var(--tx, 0px), var(--ty, 0px));
  }
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
  .polaroid-list { 
    gap: 1.5rem; 
    grid-auto-columns: 220px; 
    padding: 0 1rem;
  }
  .card { width: 220px; }
  .card-inner { height: 280px; }
  .card-front img { height: 220px; }
}

/* Responsive - Mobile Landscape / Small Tablets */
@media (max-width: 768px) {
  .polaroid-list {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 3rem 1rem 6rem 1rem;
    justify-items: center;
  }
  
  .footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 1rem;
    background: #CCD5AE;
  }
  
  .subpage {
    padding-bottom: 6rem;
  }
  
  .polaroid {
    transform: translateY(var(--y)) rotate(var(--r, var(--x))) scale(var(--sc, var(--s))) translate(var(--tx, 0px), var(--ty, 0px));
  }
  .card { width: 200px; }
  .card-inner { height: 260px; }
  .card-front img { height: 200px; }
  .actions-row {
    flex-direction: column;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    max-width: 150px;
  }
}

/* Responsive - Medium Mobile */
@media (max-width: 600px) {
  .polaroid-list {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .card { width: 240px; }
  .card-inner { height: 290px; }
  .card-front img { height: 240px; }
  .actions-row {
    flex-direction: column;
    gap: 0.5rem;
    margin-left: auto;
    margin-right: auto;
    max-width: 180px;
  }
}

/* Responsive - Mobile Portrait */
@media (max-width: 480px) {
  .string { top: 60px; height: 120px; }
  
  .polaroid-list {
    padding-bottom: 6rem !important;
  }
  
  .footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 1rem;
    background: #CCD5AE;
  }
  
  .subpage {
    padding-bottom: 6rem !important;
  }
  
  .polaroid-list {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 0 0.75rem;
    padding-top: 1rem;
    justify-items: center;
  }
  .polaroid {
    transform: translateY(0) rotate(0) scale(1) translate(0, 0);
    --x: 0deg;
    --y: 0rem;
    --s: 1;
  }
  .card { 
    width: 280px; 
    max-width: calc(100vw - 2rem);
  }
  .card-inner { height: 320px; }
  .card-front img { height: 260px; }
  .clip { top: -0.5rem; }
  .actions-row {
    flex-direction: column;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    gap: 0.75rem;
    max-width: 200px;
  }
  .btn-link {
    padding: 0.5rem 0.5rem;
    font-size: 0.9rem;
  }
  .footer {
    padding: 2rem 1rem 1rem;
    font-size: 0.9rem;
  }
  .card-back {
    padding: 0.75rem 0.75rem 0;
  }
  .card-back h2, .card-back h3 {
    font-size: 1.1rem;
  }
  .card-back p {
    font-size: 0.9rem;
  }
  .card-back .text-small {
    font-size: 0.6rem;
  }
}

/* Subpage Responsive */
@media (max-width: 1024px) {
  .subpage-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    height: auto;
    min-height: 100vh;
    gap: 1rem;
    padding: 0.5rem;
  }
  
  .center-card-section {
    order: 1;
    padding: 0.5rem;
    padding-top: 1rem;
  }
  
  .timeline-section {
    order: 2;
    padding: 0.5rem;
  }
  
  .right-section {
    order: 3;
    padding: 1rem;
    flex-direction: row;
    gap: 1rem;
  }
  
  .hobbies-section, .courses-section {
    flex: 1;
    padding: 1rem;
  }
}

@media (max-width: 768px) {
  .subpage-layout {
    padding: 0.5rem;
    gap: 0.75rem;
  }
  
  .timeline-section h2 {
    font-size: 1.3rem;
  }
  
  .center-card {
    width: 320px;
    height: 380px;
  }
  
  .center-card-front img {
    width: 160px;
    height: 160px;
  }
  
  .right-section {
    flex-direction: column;
  }
  
  .hobby-item, .course-item {
    font-size: 0.7rem;
    padding: 0.4rem 0.6rem;
    min-height: 25px;
  }
}

@media (max-width: 480px) {
  .subpage-layout {
    padding: 0.25rem;
  }
  
  .timeline-section, .center-card-section, .right-section {
    padding: 0.25rem;
  }
  
  .center-card {
    width: 260px;
    height: 340px;
  }
  
  .center-card-front img {
    width: 140px;
    height: 140px;
  }
  
  .timeline-content h3 {
    font-size: 1rem;
  }
  
  .timeline-content p {
    font-size: 0.8rem;
  }
}

/* Keyframe Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes drawLine {
  from {
    opacity: 0;
    height: 0;
  }
  to {
    opacity: 1;
    height: 100%;
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Scroll-triggered animations */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

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

/* Enhanced subpage entrance */
.subpage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: #CCD5AE;
  z-index: 2000;
  overflow-y: auto;
  transform: translateY(-100%);
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.subpage.show {
  transform: translateY(0);
}

/* Parallax effect for background */
.subpage::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

/* Mobile Popup Styles */
.mobile-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(52, 78, 65, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 1rem;
  box-sizing: border-box;
}

.mobile-popup.show {
  opacity: 1;
  visibility: visible;
}

.mobile-popup-content {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  max-width: 90%;
  max-height: 80vh;
  width: 100%;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transform: scale(0.8);
  transition: transform 0.3s ease;
  overflow-y: auto;
  box-sizing: border-box;
}

.mobile-popup.show .mobile-popup-content {
  transform: scale(1);
}

.mobile-popup-image {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #E9EDC9 0%, #f0f2e8 100%);
}

.mobile-popup-image img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

.mobile-popup-content p {
  margin: 0;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif, Helvetica, Arial;
  font-weight: 400;
  color: #344E41;
  line-height: 1.5;
  font-size: 1rem;
}

.mobile-popup-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #344E41;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.mobile-popup-close:hover {
  background: #E9EDC9;
  color: #588157;
}

/* Cursor Credit */
.cursor-credit {
  position: fixed;
  bottom: 10px;
  left: 10px;
  z-index: 1000;
  cursor: pointer;
}

/* Hide cursor credit on mobile */
@media (max-width: 768px) {
  .cursor-credit {
    display: none;
  }
}

.cursor-logo {
  width: 100px;
  height: 100px;
  border-radius: 6px;
  transition: all 0.3s ease;
  filter: grayscale(0.3);
}

.cursor-tooltip {
  position: absolute;
  bottom: 100%;
  left: 40px;
  margin-bottom: 8px;
  background: #344E41;
  color: #CCD5AE;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.cursor-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 24px;
  border: 4px solid transparent;
  border-top-color: #344E41;
}

.cursor-credit:hover .cursor-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .card-inner, .polaroid, .scroll-animate { 
    transition: none; 
    animation: none;
  }
  
  .timeline-section, .center-card-section, .right-section {
    opacity: 1;
    transform: none;
    animation: none;
  }
  
  .timeline-item {
    opacity: 1;
    transform: none;
    animation: none;
  }
  
  .cursor-logo, .cursor-tooltip {
    transition: none;
  }
}


