/* ── RESPONSIVE ─────────────────────────────────────────────────
   All breakpoint overrides live here so the original files stay
   untouched. Loaded after style.css and moodboard.css.
   ──────────────────────────────────────────────────────────────── */

/* ── Hamburger button — always in DOM, hidden on desktop via flex ── */
/* ── Hamburger button — always in DOM, hidden on desktop via flex ── */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 101;
  width: 32px;  /* Explicit width */
  height: 32px; /* Explicit height */
}

.nav-hamburger span {
  display: block;
  width: 24px;   /* Clean sizing */
  height: 2px;
  background: #2c1e0f; /* Match var(--text) directly to ensure visibility */
  border-radius: 2px;
  transition: background 0.2s;
}

/* Add a transition property to your general nav element for smooth scroll translation */
nav {
  transition: transform 0.3s ease, border-color 0.3s ease !important;
}

/* Class to translate the navbar out of view on scroll down */
nav.nav-hidden {
  transform: translateY(-100%);
}

/* ── Mobile drawer ── */
.nav-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(280px, 80vw);
  height: 100%;
  background: #ffffff;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 4rem 2rem 2rem;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.12);
}

.nav-drawer.open {
  right: 0;
}

.nav-drawer ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.nav-drawer ul a {
  font-family: var(--mono);
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
}

.nav-drawer .nav-cta {
  align-self: flex-start;
}

.nav-drawer-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

.nav-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(44, 30, 15, 0.4);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.nav-drawer-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Desktop safeguard — explicitly undo any pile/mobile rules on wide screens ── */
@media (min-width: 901px) {
  .mood-container {
    display: grid;
    position: static;
    height: fit-content;
  }

  .moodcard {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    left: auto !important;
    top: auto !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
  }

  .scotch {
    display: block !important;
  }

  .cloud-background {
    transform: scaleX(1.5) !important;
    left: -20% !important;
  }
}

/* ── TABLET — 900px ── */
@media (max-width: 900px) {
  /* Nav */
  .nav-links,
  nav > .nav-cta {
    display: none;
  }

 .nav-hamburger {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 4px !important;
    width: 40px !important;
    height: 40px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    z-index: 151 !important;
    
    /* Positioning fix */
    margin-left: auto; /* Dynamically anchors itself smoothly inside your flex padding layout */
  }

  nav {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.8rem 1.5rem !important;
    
    /* Strict viewport containment fixes */
    width: 100% !important;
    max-width: 100vw !important; /* Prevents stretching beyond screen margins */
    left: 0 !important;
    right: 0 !important;
    box-sizing: border-box !important; /* Keeps padding inside the defined width calculations */
    
    position: fixed !important;
    top: 0;
    z-index: 150;
    transition: transform 0.3s ease-in-out, border-color 0.3s ease !important;
  }
  nav.nav-hidden {
    transform: translateY(-100%) !important;
  }
  .nav-hamburger span {
    display: block !important;
    width: 24px !important;
    height: 3px !important;
    background-color: #2c1e0f !important; /* High contrast dark brown text token */
    border-radius: 2px !important;
    transition: background 0.2s ease;
  }

  /* Hero */
  #hero {
    grid-template-columns: 1fr;
    padding: 7rem 1.5rem 4rem;
    min-height: auto;
    text-align: center;
    justify-items: center;
  }

  .hero-content {
    margin-left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-tag {
    justify-content: center;
  }

  .hero-desc {
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }

  /* Make clouds layer stretch to fill the full auto-height hero */
  #clouds-layer {
    position: absolute;
    inset: 0;
    height: 100%;
    overflow: hidden;
  }

.hand {
display: none;
  }

.plane {
    position: absolute ;
    opacity: 1; /* Keeps your background watermark style subtle */
    scale: 0.4;
    /* Instead of left: 100% (off-screen), position it from the right side */
    right: 95% ;  
    top: 5% ;
    left: auto ; /* Clears any desktop left constraints */
    
    width: 40% ; /* Scale its physical container nicely down for mobile viewports */
    height: auto;
  }
  .cloud{
    scale: 0.5;
  }
  /* Sections */
  section {
    padding: 4rem 1.5rem;
  }

  /* About */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .logo-display {
    margin-top: 3rem;
    flex-wrap: wrap;
    gap: 1.2rem;
  }

  /* Skills */
  .skills-grid {
    grid-template-columns: 1fr;
  }

  /* Experience */
  .experience-inner {
    flex-direction: column;
  }
.swipe-responsive{
  display:contents;
}
  .carousel {
    width: 100%;
    position: static;
  }

.carousel-track-wrapper {
  width: 100%;
  height: 22rem;
  border-radius: 12px;
  touch-action: pan-x pan-y; /* Allow horizontal gestures to be computed by your script */
}

  .timeline {
    margin-left: -19%;
    height: auto;
    overflow-y: visible;
  }

  /* Education */
  .edu-grid {
    grid-template-columns: 1fr;
  }

  /* Portrait — tap to expand/collapse */
  #portrait {
    height: auto;
    padding: 4rem 1.5rem 6rem;
  }

  .clouds-portrait {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    height: fit-content;
  }

  .clouds {
    position: static !important;
    animation: none !important;
    width: 100%;
    max-width: 340px;
    /* Remove hover-based expansion so tap toggle can work */
    pointer-events: auto;
  }

  /* On mobile we drive expansion via .is-open class set by JS */
  .clouds .button-portrait {
    width: 100%;
    max-width: 320px;
    margin-top: -2rem;
    /* Override the CSS :hover rule from style.css */
    height: 8rem;
  }

  .clouds.is-open .button-portrait {
    height: fit-content;
  }

  /* Also suppress the hover-driven paragraph reveal from style.css */
  .clouds .btn-label p {
    opacity: 0;
    max-height: 0;
  }

  .clouds.is-open .btn-label p {
    padding-bottom: 5%;
    padding-right: 3%;
    opacity: 1;
    max-height: 40rem;
  }

  /* Suppress desktop :hover rules on mobile */
  .clouds:hover .button-portrait {
    height: 8rem;
  }

  .clouds.is-open:hover .button-portrait {
    height: fit-content;
  }

  .clouds:hover .btn-label p {
    opacity: 0;
    max-height: 0;
    padding-bottom: 0;
    padding-right: 0;
  }

  .clouds.is-open:hover .btn-label p {
    padding-bottom: 5%;
    padding-right: 3%;
    opacity: 1;
    max-height: 40rem;
  }

  .clouds img {
    width: 100%;
    max-width: 260px;
  }

  .background-portrait {
    display: none;
  }


 /* Moodboard — pile mode */
  #moodboard {
    height: fit-content;
   
  }

  /* Stack all cards in the center as a pile */
  .mood-container {
    display: block;
    position: relative;
    width: 100%;
    height: fit-content;
  }

  .moodcard {
    position: absolute !important;
    width: 18rem !important;
    height: 18rem !important;
    left: 50% !important;
    top: 50% !important;
    margin-left: -9rem !important;
    margin-top: -9rem !important;
    perspective: 1000px; /* Ensures 3D depth context is maintained while stacked */
  }
  
  /* Force the inner element to obey the 3D transitions even when stack elements update */
  .moodcard .moodcard-inner {
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  /* Hide scotch tape on small screens */
  .scotch {
    display: none !important;
  }

  /* Moodcard back — white background + readable text on mobile */
  .moodcard-back {
    background: #ffffff !important;
    color: #2c1e0f !important;
    flex-direction: column;
    gap: 0.4rem;
  }

  .moodcard-back-title {
    font-size: 13px;
    font-weight: 600;
    display: block;
    margin-bottom: 0.3rem;
  }

  .moodcard-back-text {
    font-size: 11px;
    line-height: 1.5;
    overflow-y: auto;
    max-height: 100%;
  }

  /* On mobile, disable the hover z-index lift from moodboard.css — pile manages its own stacking.
     We do NOT override transform here so cards keep their random tilts. */
  .moodcard:hover {
    z-index: unset !important;
  }

  /* While a card is being actively flipped, also freeze its transform */
  .moodcard.pile-active:hover {
    transform: rotate(0deg) translate(0px, 0px) !important;
  }

  /* Enlarged card sized to screen */
  .moodcard-enlarged {
    width: min(88vw, 22rem);
    height: min(88vw, 22rem);
  }

  /* Contact cloud — shrink dramatically */
  .cloud-background {
    transform: scaleX(0.4) scaleY(0.4) !important;
    transform-origin: bottom center;
    left: 0 !important;
  }

  /* Contact — make cards stretch full width */
  #contact {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .contact-inner {
    width: 100%;
    max-width: 100%;
  }

  .contact-cards {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-card {
    justify-content: center;
    width: 100%;
  }

  /* Modal form — fit inside viewport */
  #hire-modal {
    width: 95vw;
    max-height: 90svh;
    overflow-y: auto;
    top: 50%;
    left: 50%;
  }

  #hire-form {
    padding: 1.5rem;
    gap: 0.9rem;
  }

  #hire-form h2 {
    font-size: 1.6rem;
  }

  /* Footer */
  footer {
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    text-align: center;
  }
}

/* ── MOBILE — 600px ── */
@media (max-width: 600px) {
  h1.hero-name {
    font-size: clamp(3.5rem, 16vw, 5.5rem);
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn-primary {
    text-align: center;
  }

  .about-stats-reveal-1 {
    grid-template-columns: 1fr 1fr;
  }

  .stat {
    height: auto;
    padding: 1.25rem;
  }

  .tl-item {
    height: auto;
    padding-bottom: 2rem;
  }

  .edu-card {
    padding: 1.5rem 1.5rem 1.5rem 2.5rem;
  }

  .contact-cards {
    flex-direction: column;
    align-items: stretch;
  }

  #button-red,
  .contact-card {
    text-align: center;
    justify-content: center;
  }

  .moodcard-enlarged {
    width: 90vw;
    height: 90vw;
  }

  .carousel-btn {
    width: 34px;
    height: 34px;
  }

  .carousel-btn svg {
    width: 14px;
    height: 14px;
  }

  .clouds img {
    max-width: 200px;
  }

  .button-portrait {
    width: 90%;
  }

  /* Moodboard pile slightly smaller on very small phones */
  .moodcard {
    width: 14rem !important;
    height: 14rem !important;
    margin-left: -7rem !important;
    margin-top: -7rem !important;
  }

  .mood-container {
    height: 22rem;
  }
}