/* ============================================
   ULTRA-WIDE SCREENS — beyond a normal desktop
   width, cap the whole page and centre it with a
   framed border, instead of letting content and
   line-lengths stretch indefinitely.
   ============================================ */
@media (min-width:1700px) {
  body {
    background: var(--ink);
  }

  .page {
    max-width: 1700px;
    margin: 0 auto;
    background: var(--paper);
    border-left: 3px solid var(--ink);
    border-right: 3px solid var(--ink);
  }
}

/* All mobile/small-screen overrides live here, in one place,
   so you don't have to hunt through every other file to adjust
   the mobile layout. */

/* Hamburger button: only exists visually below 900px. */
.menu-toggle {
  display: none;
}

@media (max-width:900px) {
  .page {
    grid-template-columns: 1fr;
  }

  /* Sidebar collapses to a slim sticky header bar (logo + hamburger).
     .sidebar-body (nav + status/theme + socials/contact) is pulled out
     of normal flow and becomes a dropdown panel that overlays the page
     content below it, instead of pushing that content down. */
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 250;
    height: auto;
    border-right: none;
    border-bottom: 3px solid var(--ink);
    padding: 16px 20px;
    background: var(--paper);
  }

  .side-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
  }

  .side-top .logo {
    margin-bottom: 0;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 2px solid var(--ink);
    background: var(--paper);
    cursor: pointer;
    padding: 0;
  }

  .menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--ink);
    transition: transform .25s ease, opacity .2s ease;
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* the overlay panel itself -- hidden state */
  .sidebar-body {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--paper);
    border-bottom: 3px solid var(--ink);
    box-shadow: 0 10px 0 -4px var(--ink);
    padding: 20px;

    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .35s cubic-bezier(.2, .8, .2, 1),
      opacity .3s ease,
      visibility 0s linear .35s;
  }

  /* open state -- smooth in, and the visibility delay above gives a
     smooth out too (fades/slides away before it's actually hidden) */
  .sidebar.is-open .sidebar-body {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform .35s cubic-bezier(.2, .8, .2, 1),
      opacity .3s ease,
      visibility 0s linear 0s;
  }

  .sidebar-body nav ul {
    gap: 10px;
  }

  .side-mid {
    border-top: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
    padding: 16px 0;
  }

  .side-bottom {
    padding-top: 0;
  }

  .intro {
    grid-template-columns: 1fr;
    padding: 40px 24px;
    text-align: left;
  }

  .avatar {
    width: 180px;
    height: 180px;
    margin: 0 auto;
  }

  section {
    padding: 40px 24px;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat:nth-child(2) {
    border-right: none;
  }

  .project-spotlight {
    padding: 20px;
  }

  .project-cols {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .project-head {
    flex-direction: column;
  }

  .contact-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .channel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width:480px) {
  .intro {
    padding: 32px 20px;
  }

  .avatar {
    width: 150px;
    height: 150px;
    margin: 0 auto;
  }

  section {
    padding: 32px 20px;
  }

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

  .stat {
    padding: 16px;
  }

  .big-link {
    word-break: break-word;
  }

  .meta-chip {
    flex: 1 1 100%;
  }

  .contact-meta {
    gap: 8px;
  }
}