/* ==========================================================================
   AMINO — RESPONSIVE
   Desktop-first, as briefed. Mobile is *recomposed*, not stacked: the rails
   become swipe carousels, the coverflow becomes a peek-scroller, the hero
   re-orders so the wordmark still crops the section edge, and the offset
   card grid keeps its rhythm at two columns instead of collapsing to one.
   ========================================================================== */

/* ==========================================================================
   ≤ 1200px — laptop
   ========================================================================== */
@media (max-width: 1200px) {

  .hero__intro { grid-column: 1 / span 5; }
  .hero__card  { grid-column: 7 / span 6; }

  .split__aside { grid-column: 1 / span 4; }
  .split__main  { grid-column: 5 / -1; }

  .prob__body { grid-column: 2 / span 7; }
  .prob__art  { grid-column: 10 / span 3; }

  .founder__art  { grid-column: 1 / span 5; }
  .founder__body { grid-column: 7 / span 6; }

  .audit__left { grid-column: 1 / span 5; }
  .audit__form { grid-column: 7 / span 6; }

  /* six across gets cramped — go two rows of three */
  .svc__rail {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .svc { aspect-ratio: 1.15; }
}

/* ==========================================================================
   ≤ 1024px — tablet landscape
   ========================================================================== */
@media (max-width: 1024px) {

  :root { --section-y: clamp(4.5rem, 10vw, 7rem); --section-y-lg: clamp(5.5rem, 12vw, 9rem); }

  .stmt__head { max-width: 24ch; }

  .why__rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .why:nth-child(4) { margin-block-start: clamp(1rem, 2vw, 2rem); }
  .why:nth-child(5) { margin-block-start: clamp(2rem, 4vw, 4rem); }

  .lab__grid    { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .voices__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .voice:nth-child(2) { margin-block-start: 0; }
  .voice:nth-child(3) { grid-column: 1 / -1; }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3), .stat:nth-child(4) { border-top: var(--hair) solid var(--line); }
  .stat:nth-child(odd) { border-left: 0; padding-left: 0; }

  .founder__art  { grid-column: 1 / span 12; max-width: 26rem; aspect-ratio: 1.1; }
  .founder__body { grid-column: 1 / span 12; }
}

/* ==========================================================================
   ≤ 900px — tablet portrait. The rails become swipe-scrollers here.
   ========================================================================== */
@media (max-width: 900px) {

  .nav__menu { display: none; }
  .nav__burger { display: grid; }
  .nav__actions .btn--nav { display: none; }

  .hero { min-height: auto; padding-block-start: 7.5rem; }
  .hero__body { grid-template-columns: 1fr; gap: var(--s-8); }
  .hero__intro { grid-column: 1 / -1; }
  .hero__card  { grid-column: 1 / -1; }
  .hero__meta  { display: none; }
  .hero__mark  { margin-block-start: clamp(2.5rem, 8vw, 5rem); }

  .stmt__wings { grid-template-columns: 1fr; gap: var(--s-5); }
  .stmt__wing:last-child { justify-self: start; }
  .stmt__head { max-width: none; text-align: left; margin-inline: 0; }

  /* problem cards stop stacking — sticky stacking on a short viewport traps
     the user, so they become a plain vertical sequence with the reveal only */
  .prob {
    position: relative;
    top: auto;
    grid-template-columns: 1fr;
    min-height: 0;
    gap: var(--s-5);
  }
  .prob__idx  { grid-column: 1; }
  .prob__body { grid-column: 1; }
  .prob__art  { grid-column: 1; min-height: 8rem; }

  /* SERVICES → swipe rail with peek */
  .svc__rail {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: 68vw;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    padding-inline: var(--gutter);
    margin-inline: calc(var(--gutter) * -1);
    scrollbar-width: none;
    align-items: stretch;
  }
  .svc__rail::-webkit-scrollbar { display: none; }
  .svc { scroll-snap-align: start; aspect-ratio: 0.95; }
  /* no lift on touch — it would clip inside the scroller */
  .svc.is-active { transform: none; }

  .why__rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .why:nth-child(n) { margin-block-start: 0; }
  .why:nth-child(even) { margin-block-start: clamp(1.5rem, 5vw, 3rem); }

  .lab__grid    { grid-template-columns: 1fr; }
  .voices__grid { grid-template-columns: 1fr; }
  .voice:nth-child(3) { grid-column: auto; }

  .audit { grid-template-columns: 1fr; gap: var(--s-9); }
  .audit__left, .audit__form { grid-column: 1 / -1; }

  .foot__top { grid-template-columns: 1fr; gap: var(--s-9); }
  .foot__lead, .foot__cols { grid-column: 1 / -1; }

  .split__aside { grid-column: 1 / -1; position: static; }
  .split__main  { grid-column: 1 / -1; }
}

/* ==========================================================================
   ≤ 640px — phone
   ========================================================================== */
@media (max-width: 640px) {

  :root {
    --section-y: clamp(3.5rem, 14vw, 5rem);
    --section-y-lg: clamp(4.5rem, 17vw, 6.5rem);
    --r-frame: 1.125rem;
    --r-card: 1rem;
  }

  .page { padding: 0.375rem; }

  /* the wordmark stays cropped — that's the whole point of it */
  .hero__mark { font-size: 25vw; margin-block-end: -0.5rem; }
  .hero__title { font-size: clamp(1.875rem, 8.6vw, 2.5rem); max-width: none; }
  .hero__cue { display: none; }

  .stats { grid-template-columns: 1fr; }
  .stat { border-left: 0 !important; padding-left: 0 !important; }
  .stat + .stat { border-top: var(--hair) solid var(--line); }

  .step { width: 78vw; min-height: 22rem; }

  .case { width: 76vw; }

  .why__rail { grid-template-columns: 1fr; }
  .why:nth-child(n) { margin-block-start: 0; min-height: 0; }

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

  .acc__btn { grid-template-columns: 1fr auto; gap: var(--s-4); }
  .acc__idx { display: none; }
  .acc__body { padding-inline-start: 0; }

  .foot__cols { grid-template-columns: 1fr; gap: var(--s-7); }
  .foot__mark { font-size: 24vw; }
  .foot__bar { flex-direction: column; align-items: flex-start; gap: var(--s-3); }

  .cta__actions .btn { width: 100%; justify-content: center; }

  .railnav__btn { width: 3rem; }
}

/* ==========================================================================
   TOUCH — no hover states that strand content behind a hover
   ========================================================================== */
@media (hover: none) {
  .svc__cta        { grid-template-rows: 1fr; }
  .svc__cta-in     { opacity: 1; transform: none; }
  .case__plate     { transform: none; }
  .btn:hover::before { transform: scaleY(0); }
}

/* ==========================================================================
   SHORT VIEWPORTS — never pin taller than the screen
   ========================================================================== */
@media (max-height: 700px) and (min-width: 901px) {
  .prob { top: 4rem; min-height: 18rem; }
  .hero { min-height: 46rem; }
}

/* ==========================================================================
   PRINT
   ========================================================================== */
@media print {
  .nav, .cursor, .grain, .loader, .curtain, .hero__stage, .band__art { display: none !important; }
  * { background: #FFF !important; color: #000 !important; box-shadow: none !important; }
  .r-mask, .r-fade, .r-up { clip-path: none !important; opacity: 1 !important; transform: none !important; }
}
