/* ==========================================================================
   Responsive — mobile-first overrides & breakpoints
   ========================================================================== */

@media (max-width: 1100px) {
  .hero__meta {
    display: none;
  }

  .project__trigger {
    grid-template-columns: 60px 1fr 1.1fr;
  }
}

@media (max-width: 900px) {
  .nav__links {
    display: none;
  }

  .nav__menu-btn {
    display: block;
  }

  .scroll-progress {
    display: none;
  }

  .hero {
    justify-content: flex-end;
    padding-top: calc(var(--nav-h) + 1rem);
    padding-bottom: 3.5rem;
  }

  .hero__canvas {
    opacity: 0.72;
  }

  .hero__glow {
    top: 0;
    right: -20%;
    width: min(90vw, 480px);
    height: min(90vw, 480px);
    opacity: 0.85;
  }

  .hero__shell {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .hero__rail {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    min-height: 0;
    padding: 0 0 0.85rem;
    border-right: none;
    border-bottom: 1px solid var(--bg-line);
    gap: 0.85rem 1.25rem;
  }

  .hero__circuit,
  .hero__rail-meta {
    display: none;
  }

  .hero__chips {
    grid-auto-flow: column;
    gap: 0.75rem;
  }

  .hero__content {
    max-width: 100%;
  }

  .hero__title {
    font-size: clamp(2.3rem, 8.5vw, 3.6rem);
    margin-bottom: 1rem;
  }

  .about__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about__meta {
    border-left: none;
    border-top: 1px solid var(--bg-line);
    padding-left: 0;
    padding-top: 1.5rem;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.5rem;
  }

  .about__tags,
  .about__edu {
    grid-column: 1 / -1;
  }

  /* Experience: stack all roles on tablet/mobile (no pin scrub) */
  .experience__pin {
    min-height: 0;
    display: block;
    background: transparent;
  }

  .experience__inner {
    padding: 4.25rem 0;
  }

  .experience__hint,
  .experience__timeline {
    display: none;
  }

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

  .experience__panels {
    height: auto !important;
    min-height: 0;
    display: grid;
    gap: 2.25rem;
  }

  .exp-panel {
    position: relative;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--bg-line);
  }

  .exp-panel:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .exp-panel__tech span {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .project__trigger {
    grid-template-columns: 1fr;
    gap: 0.9rem;
    padding: 1.35rem 0;
  }

  .project__index {
    order: -1;
    padding-top: 0;
  }

  .project__visual {
    aspect-ratio: 16 / 10;
  }

  .arch__svg {
    min-height: 240px;
  }

  .section {
    padding: 4.25rem 0;
  }

  .section__header {
    margin-bottom: 2.25rem;
  }

  .statement {
    min-height: auto;
    padding: 4.5rem 1.5rem;
  }
}

@media (max-width: 720px) {
  :root {
    --container: min(100% - 1.5rem, 1120px);
    --container-wide: min(100% - 1.5rem, 1280px);
    --space-8: 4.5rem;
  }

  body {
    cursor: auto;
  }

  .nav {
    padding: 0.75rem 0.85rem;
  }

  .nav.is-compact {
    padding: 0.55rem 0.85rem;
  }

  .nav__logo-name {
    display: none;
  }

  .hero {
    align-items: stretch;
    justify-content: flex-end;
    padding-top: calc(var(--nav-h) + 0.75rem);
    padding-bottom: 3.25rem;
  }

  .hero__grid {
    opacity: 0.08;
    mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
  }

  .hero__rail {
    padding-bottom: 0.7rem;
    gap: 0.65rem 1rem;
  }

  .hero__chips li:last-child {
    display: none;
  }

  .hero__title {
    font-size: clamp(2rem, 9.5vw, 2.85rem);
    margin-bottom: 0.85rem;
  }

  .hero__eyebrow {
    margin-bottom: 0.7rem;
    font-size: 0.64rem;
  }

  .hero__statement {
    font-size: 0.92rem;
    margin-bottom: 1.15rem;
    max-width: 100%;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .hero__actions .btn {
    justify-content: center;
    width: 100%;
    padding: 0.9rem 1.1rem;
  }

  .hero__scroll {
    left: 0.85rem;
    bottom: 1.25rem;
  }

  .hero__meta {
    display: none;
  }

  .statement__line {
    font-size: clamp(1.15rem, 3.8vw, 1.5rem);
  }

  .statement__line--lg {
    font-size: clamp(2.1rem, 12vw, 3.5rem);
  }

  .about__lead {
    font-size: 1.08rem;
  }

  .about__body {
    margin-bottom: 1.75rem;
  }

  .about__meta {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .stat__num,
  .stat__suffix {
    font-size: clamp(2.8rem, 14vw, 3.8rem);
  }

  .section {
    padding: 3.75rem 0;
  }

  .section__title {
    font-size: clamp(1.85rem, 7vw, 2.6rem);
  }

  .exp-panel__role {
    font-size: clamp(1.45rem, 6vw, 1.9rem);
  }

  .exp-panel__list {
    gap: 0.55rem;
    margin-bottom: 1.25rem;
  }

  .exp-panel__list li {
    font-size: 0.92rem;
  }

  .work__list {
    gap: 0;
  }

  .project__name {
    font-size: clamp(1.35rem, 5.5vw, 1.75rem);
    margin-bottom: 0.55rem;
  }

  .project__summary {
    font-size: 0.92rem;
    margin-bottom: 0.9rem;
  }

  .stack__marquee {
    margin-bottom: 2rem;
    padding: 0.75rem 0;
  }

  .stack__ecosystem {
    gap: 1.35rem;
  }

  .stack__detail {
    padding: 1rem;
    min-height: 72px;
  }

  .contact {
    padding-top: 3.75rem;
    padding-bottom: 3.25rem;
  }

  .contact__title {
    font-size: clamp(2.2rem, 11vw, 3.4rem);
    margin-bottom: 1.1rem;
  }

  .contact__text {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }

  .contact__links {
    margin-top: 2.25rem;
  }

  .contact__links a {
    grid-template-columns: 1fr;
    gap: 0.25rem;
    padding: 0.95rem 0;
  }

  .footer {
    padding: 1.75rem 0 1.5rem;
  }

  .footer__top {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.1rem;
    margin-bottom: 1.35rem;
  }

  .footer__bottom {
    flex-direction: column;
    gap: 0.4rem;
  }

  .terminal__body {
    min-height: 160px;
    max-height: 240px;
    padding: 1rem;
    font-size: 0.74rem;
  }

  .terminal-section.section {
    padding-bottom: 3rem;
  }

  .arch {
    overflow: hidden;
    padding: 0.75rem;
  }

  .arch__svg {
    min-width: 0;
    width: 100%;
    height: auto;
    min-height: 0;
  }

  .arch__legend {
    gap: 0.5rem 1rem;
    font-size: 0.6rem;
  }
}

@media (max-width: 480px) {
  :root {
    --container: min(100% - 1.25rem, 1120px);
    --container-wide: min(100% - 1.25rem, 1280px);
  }

  .hero {
    padding-bottom: 2.75rem;
  }

  .hero__title {
    font-size: clamp(1.85rem, 10vw, 2.4rem);
  }

  .hero__eyebrow {
    font-size: 0.6rem;
  }

  .btn {
    padding: 0.85rem 1rem;
  }

  .stack-node {
    padding: 0.55rem 0.7rem;
    font-size: 0.66rem;
  }

  .project-overlay {
    padding: 0.75rem;
    align-items: flex-start;
    padding-top: 0.75rem;
  }

  .project-overlay__panel {
    width: 100%;
    max-height: calc(100vh - 1.5rem);
    max-height: calc(100svh - 1.5rem);
    padding: 1.1rem;
  }

  .mobile-menu__nav a {
    font-size: clamp(1.75rem, 9vw, 2.5rem);
  }

  .statement {
    padding: 3.5rem 1.25rem;
  }
}

/* Large / 4K refinements */
@media (min-width: 1600px) {
  :root {
    --container: min(1200px, calc(100% - 4rem));
    --container-wide: min(1400px, calc(100% - 4rem));
  }

  .hero__title {
    font-size: clamp(3.5rem, 5.5vw, 5.8rem);
  }
}

/* Touch targets */
@media (hover: none) and (pointer: coarse) {
  .nav__links a,
  .btn,
  .stack-node,
  .terminal__hints button,
  .contact__links a,
  .footer__links a,
  .project__trigger {
    min-height: 44px;
  }

  .cursor {
    display: none !important;
  }
}
