/* =================================================================
   RESPONSIVE — Mobile adaptations for Drake Murphy site
   Load AFTER main.css:  <link rel="stylesheet" href="css/responsive.css">
   ================================================================= */

/* ===== HAMBURGER BUTTON (hidden on desktop) ===== */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 110;
  position: relative;
}

.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--glacier);
  margin: 5px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  border-radius: 1px;
}

.hamburger-btn.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger-btn.open span:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== MOBILE NAV OVERLAY ===== */
.mobile-nav-overlay {
  display: none;
}

/* ===== VISUALIZER SIDEBAR TOGGLE (hidden on desktop) ===== */
.sidebar-toggle-btn {
  display: none;
  width: 100%;
  padding: 12px 20px;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--golden-hour);
  background: var(--anthracite-mid);
  border: none;
  border-top: 1px solid rgba(123, 135, 148, 0.19);
  cursor: pointer;
  transition: background 0.2s ease;
}

.sidebar-toggle-btn:active {
  background: var(--sierra-granite);
}


/* =================================================================
   BREAKPOINT: TABLET AND BELOW (768px)
   ================================================================= */
@media (max-width: 768px) {

  /* --- Hamburger visible, desktop nav hidden --- */
  .hamburger-btn {
    display: block;
    margin-left: auto;
  }

  nav .nav-links {
    display: none;
  }

  nav {
    padding: 0.9rem 1.25rem;
    justify-content: flex-end;
  }

  .page-sub nav .nav-links {
    display: none;
  }

  /* --- Mobile nav overlay --- */
  .mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 105;
    background: rgba(22, 25, 32, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
  }

  .mobile-nav-overlay.open {
    display: flex;
  }

  .mobile-nav-overlay .mobile-nav-link {
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--glacier);
    cursor: pointer;
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    text-align: center;
  }

  .mobile-nav-overlay .mobile-nav-link:active {
    color: var(--poppy);
  }

  /* --- Hero: full viewport, 9:16 mobile video fills it --- */
  .hero {
    height: 100vh;
    height: 100dvh; /* dynamic viewport height — accounts for Safari toolbar */
  }

  .hero-video-container {
    position: absolute;
    inset: 0;
  }

  .hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: none;
    object-fit: cover;
    object-position: center top;
  }

  .hero-name-bar {
    padding-top: 35vh;
  }

  .hero-name {
    font-size: clamp(1.6rem, 7.5vw, 2.8rem);
    letter-spacing: 0.18em;
    text-align: center;
  }

  .hero-scroll {
    bottom: 1.5rem;
  }

  /* --- Visualizer triptych spacing --- */
  .viz-triptych {
    padding: 3rem 1.25rem 3rem;
  }

  .viz-triptych-label {
    padding: 1rem 1.25rem;
  }

  /* --- Visualizer full pages: stack canvas on top, sidebar below --- */
  .surface-app,
  .envelope-app {
    flex-direction: column !important;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
  }

  .surface-sidebar,
  .envelope-sidebar {
    width: 100% !important;
    min-width: 100% !important;
    max-height: none !important;
    height: auto !important;
    border-right: none !important;
    border-top: 1px solid rgba(123, 135, 148, 0.19);
    order: 2;
  }

  .surface-sidebar.collapsed > *:not(.sidebar-toggle-btn),
  .envelope-sidebar.collapsed > *:not(.sidebar-toggle-btn) {
    display: none !important;
  }

  .sidebar-toggle-btn {
    display: block;
    order: -1;
  }

  .surface-app > div:last-child,
  .envelope-app > div:last-child {
    flex: none !important;
    width: 100%;
    height: 55vh;
    min-height: 300px;
    order: 1;
    position: relative;
  }

  /* --- Thought Lattice mobile --- */
  .lattice-app {
    padding-top: 56px !important;
  }

  .lattice-app > div:first-child {
    padding: 14px 16px 0 !important;
  }

  .lattice-app > div:first-child h1 {
    font-size: 1.3rem !important;
  }

  .lattice-app > div:first-child p {
    font-size: 0.9rem !important;
  }

  #lattice-chain-buttons {
    gap: 4px !important;
  }

  #lattice-chain-buttons button {
    font-size: 10px !important;
    padding: 3px 7px !important;
  }

  #lattice-info-panel {
    bottom: 50px !important;
    left: 10px !important;
    right: 10px !important;
    padding: 10px 12px !important;
  }

  /* --- Music dashboard: inline on mobile --- */
  #music-dashboard-mount {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* --- Story reader spacing --- */
  .story-reader-section {
    padding: 4rem 1.25rem 3rem;
  }

  .story-reader-header h2 {
    font-size: 1.6rem;
  }

  .story-body p {
    font-size: 1.05rem;
  }

  /* --- Connect section --- */
  .connect {
    padding: 3.5rem 1.25rem;
  }

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

  /* --- Marble Canyon overlay --- */
  .marble-canyon-inner {
    padding: 3rem 1.25rem 4rem;
  }

  /* --- Section scroll cue --- */
  .section-scroll-cue {
    padding: 3rem 0;
  }

  /* --- Strata --- */
  .strata {
    height: 40px;
  }

  /* --- Lightbox --- */
  .lightbox-content {
    max-width: 98vw;
  }

  .lightbox-overlay img {
    max-width: 98vw;
    max-height: 75vh;
  }

  .lightbox-close {
    top: 0.75rem;
    right: 0.75rem;
  }

  /* --- Photo grids --- */
  .photo-grid-5x2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }

  /* --- Footnote tips --- */
  .fn-tip {
    width: calc(100vw - 2.5rem);
    left: 0;
    transform: translateX(-1rem);
  }

  /* --- Visualizer sidebar text --- */
  .surface-sidebar p,
  .envelope-sidebar p {
    font-size: 12px !important;
  }

  .surface-sidebar [style*="display:flex"][style*="gap:6px"],
  .envelope-sidebar [style*="display:flex"][style*="gap:6px"] {
    flex-wrap: wrap;
  }
}


/* =================================================================
   BREAKPOINT: SMALL PHONES (400px and below)
   ================================================================= */
@media (max-width: 400px) {

  .hero-name {
    font-size: 1.4rem;
    letter-spacing: 0.12em;
  }

  .hero-name-bar {
    padding-top: 30vh;
  }

  .viz-triptych {
    padding: 2.5rem 1rem 2.5rem;
  }

  .story-reader-section {
    padding: 3rem 1rem 2.5rem;
  }

  .connect {
    padding: 3rem 1rem;
  }

  .marble-canyon-inner {
    padding: 2.5rem 1rem 3rem;
  }

  nav {
    padding: 0.75rem 1rem;
  }

  footer {
    padding: 1.25rem 1rem;
  }

  .story-body p {
    font-size: 1rem;
  }

  .mobile-nav-overlay .mobile-nav-link {
    font-size: 1.2rem;
  }
}
