﻿/* ==========================================================================
   RESPONSIVE - TABLET (≤ 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  :root {
    --gutter: 28px;
  }

  .about__inner {
    gap: 64px;
    grid-template-columns: 1.15fr 1fr;
  }

  .about {
    padding: 120px var(--gutter) 100px;
  }

  .work__panel {
    width: min(78vw, 640px);
  }

  .process__pin {
    grid-template-columns: 1fr 200px;
    gap: 0 32px;
  }

  .skills__groups {
    grid-template-columns: repeat(2, 1fr);
    gap: 48px 40px;
  }

  .certificates {
    padding: 120px var(--gutter) 100px;
  }

  .certificates__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .experiments__grid {
    grid-template-columns: repeat(3, minmax(0, 110px));
    gap: 10px;
  }
}

/* ==========================================================================
   RESPONSIVE - MOBILE (≤ 720px)
   ========================================================================== */
@media (max-width: 720px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  :root {
    --gutter: 20px;
    --nav-height: 52px;
  }

  .navbar__nav {
    display: none;
  }

  /* No logo on mobile at all (neither wordmark nor pixel mark) - just
     the menu toggle, pinned to the right below via margin-left: auto. */
  .navbar__logo {
    display: none;
  }

  /* Hairline under the docked header (the floating pill keeps its own border). */
  .navbar:not(.navbar--scrolled) {
    border-bottom-color: rgba(245, 245, 245, 0.1);
  }

  .navbar__toggle {
    display: flex;
    width: 44px;
    height: 44px;
    /* With the logo gone, this is the only flex child - pin it to
       the right (where it always sat) instead of letting it fall
       back to flex-start. */
    margin-left: auto;
    /* Pull the icon's visible edge back onto the page gutter. */
    margin-right: -11px;
  }

  .navbar--scrolled {
    top: 10px;
    left: 10px;
    right: auto;
    width: calc(100% - 20px);
    max-width: calc(100vw - 20px);
    height: 44px;
    border-radius: 999px;
    animation: navbar-mobile-float-in 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  }

  /* Menu open: the header snaps back to a flat, dark bar on top of the
     overlay (logo left, X right) even if the page was scrolled. */
  .navbar.navbar--menu-open {
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: var(--nav-height);
    translate: 0 0;
    pointer-events: auto;
    border-radius: 0;
    border-color: transparent;
    border-bottom-color: rgba(245, 245, 245, 0.1);
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    color: #f5f5f5;
  }

  .navbar--menu-open a:focus-visible,
  .navbar--menu-open button:focus-visible {
    outline-color: #ffd866;
  }

  @keyframes navbar-mobile-float-in {
    from {
      opacity: 0.65;
      translate: 0 -14px;
    }

    to {
      opacity: 1;
      translate: 0 0;
    }
  }

  .hero {
    min-height: 580px;
  }

  .hero__frame {
    padding: calc(var(--nav-height) + 16px) var(--gutter) 20px;
  }

  .hero__title-name {
    font-size: 15px;
  }

  .hero__character-img {
    height: clamp(200px, 46vw, 280px);
  }

  /* Fix character positioning on mobile */
  .hero__character {
    height: clamp(200px, 46vw, 280px);
    width: clamp(200px, 46vw, 280px);
  }

  .hero__scene {
    padding-bottom: 12px;
    justify-content: center;
    gap: 8px;
  }

  .hero__platform {
    width: min(240px, 58vw);
    margin-top: -8px;
  }

  .hero__character-shadow {
    bottom: -4px;
    width: 40%;
    height: 10px;
  }

  .hero__dialog-box {
    min-width: 0;
    max-width: 88vw;
    padding: 12px 14px;
  }

  .hero__dialog-text {
    font-size: 19px;
  }

  .mobile-menu {
    padding-right: max(var(--gutter), env(safe-area-inset-right));
    padding-bottom: max(32px, env(safe-area-inset-bottom));
    padding-left: max(var(--gutter), env(safe-area-inset-left));
  }

  .about {
    padding: 88px var(--gutter) 72px;
  }

  .about__inner {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .about__media {
    order: -1;
    max-width: 220px;
    margin: 0 auto;
  }

  .about__heading-row {
    margin-bottom: 28px;
  }

  .about__paragraph {
    font-size: 15px;
  }

  .about__meta {
    margin-top: 36px;
    padding-top: 24px;
    gap: 24px 40px;
  }

  /* Work: drop the pinned horizontal track for a simple vertical list */
  .work__intro {
    padding: 88px var(--gutter) 40px;
  }

  .work__hint {
    display: none;
  }

  .work__viewport {
    height: auto;
    padding-top: 0;
    overflow: visible;
  }

  .work__track {
    display: flex;
    flex-direction: column;
    height: auto;
    transform: none !important;
  }

  .work__panel {
    width: auto;
    height: auto;
    display: block;
    padding: 0 var(--gutter);
    margin: 0 0 56px;
  }

  .work__panel:first-child {
    margin-left: 0;
  }

  .work__shot {
    height: clamp(200px, 58vw, 280px);
    margin-bottom: 20px;
  }

  .work__panel:hover .work__shot,
  .work__panel:hover .work__panel-info {
    transform: none;
  }

  .work__panel-desc {
    max-width: 100%;
  }

  .work__panel-actions {
    gap: 12px 20px;
  }

  .work__panel-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
  }

  /* Process: no pin, every step shown as a plain stacked list */
  .process {
    height: auto;
  }

  .process__pin {
    height: auto;
    padding: 88px var(--gutter) 72px;
    display: block;
  }

  .process__head {
    margin-bottom: 40px;
  }

  .process__stages {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 40px;
  }

  .process__stage {
    position: static;
    transform: none;
  }

  .process__stage-number {
    font-size: 40px;
  }

  .process__stage-name {
    font-size: 26px;
  }

  .process__nav-wrap {
    display: none;
  }

  .certificates {
    padding: 88px var(--gutter) 72px;
  }

  .certificates__intro {
    margin-bottom: 40px;
  }

  .certificates__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .certificates__card {
    padding: 24px;
  }

  .skills {
    padding: 88px var(--gutter) 72px;
  }

  .skills__head {
    margin-bottom: 40px;
  }

  .skills__groups {
    grid-template-columns: 1fr;
    gap: 36px;
    min-width: 0;
  }

  .skills__inner,
  .skills__group,
  .skills__list,
  .skills__item,
  .skills__name {
    min-width: 0;
    max-width: 100%;
  }

  .skills__name {
    overflow-wrap: anywhere;
  }

  /* Experiments: the sticky-grid-scroll script skips mobile entirely
     (see js/experiments-grid.js), so this collapses to a plain static
     grid - same "simplify on mobile" rule as Process and Exploring. */
  .experiments {
    height: auto;
    padding: 88px var(--gutter) 72px;
  }

  .experiments__wrapper {
    position: static;
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    gap: 28px;
  }

  .experiments__head {
    position: static;
  }

  .experiments__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
  }

  .experiments__item--live:active {
    scale: 0.97;
    background: var(--color-bg);
    border-color: var(--color-ink);
  }

  .experiments__content {
    position: static;
    height: auto;
    max-width: 100%;
    text-align: left;
    padding: 0;
    pointer-events: auto;
  }

  .exploring__intro {
    max-width: 78vw;
    font-size: 14px;
  }

  /* The winding path doesn't translate to a narrow screen, so it
     collapses to a plain stacked list - same "simplify on mobile"
     rule the rest of the site's experimental sections follow. */
  .exploring__hint {
    display: none;
  }

  .exploring__main {
    height: auto;
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .exploring__waypoint {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 14px;
  }

  .exploring__waypoint--initial {
    display: none;
  }

  .exploring__marker {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-accent);
  }

  /* Texture/glow pseudo-elements are sized for the larger floating
     planets on desktop; at 10px in a plain list they'd just read as
     a smudge, so drop them here. */
  .exploring__marker::before,
  .exploring__marker::after {
    display: none;
  }

  /* Nebula/stardust/meteors are part of the desktop "winding path
     through space" scene - on the simplified mobile list they'd just
     be clutter, so the section keeps only its base starfield. */
  .exploring__space-fx {
    display: none;
  }

  .exploring__label {
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
    opacity: 1;
    transform: none;
    text-align: left;
  }

  .exploring__final {
    height: 0;
  }

  .contact {
    padding: 100px var(--gutter) 90px;
  }

  .contact__sub {
    margin-bottom: 40px;
  }

  .footer__note {
    order: 3;
  }
}
