/* ═══════════════════════════════════════════════
   RESPONSIVE — PEAKMEDIA
   Breakpoints: 1100 / 900 / 640 / 400
   ASCII art (#ascii-pre) + .manifesto-text: NEVER TOUCHED
═══════════════════════════════════════════════ */

/* ── 1100px ── */
@media (max-width: 1100px) {
  .nt-label                  { display: none; }
  .services-grid             { grid-template-columns: repeat(2,1fr); }
  .footer-inner              { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  .work-top-row              { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
}

/* ── 900px ── */
@media (max-width: 900px) {
  nav                        { padding: 1.2rem 1.5rem; }
  .nav-right .nav-link       { display: none; }
  .nav-teaser                { margin-right: .3rem; }
  #hero                      { min-height: 100svh; }
  .hero-letter               { font-size: clamp(3.5rem, 17vw, 10rem); }
  .hero-word                 { padding: 0 1rem; }
  #work, #services,
  #testimonials, #cta,
  footer                     { padding: 4rem 1.5rem; }
  #about                     { padding: 4rem 1.5rem; }
  .work-grid                 { grid-template-columns: 1fr; }
  .wcard:first-child         { grid-row: span 1; min-height: 300px; }
  .wcard:not(:first-child)   { min-height: 240px; }
  .about-grid                { grid-template-columns: 1fr; gap: 2.5rem; }
  .services-grid             { grid-template-columns: repeat(2,1fr); }
  .tquote-grid               { grid-template-columns: 1fr 1fr; }
  .about-stats               { gap: 1.5rem; }
}

/* ══════════════════════════════════════════════════
   640px — MOBILE PHONE
   Fixing issues visible in all 5 screenshots
══════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* ── OVERFLOW — contain everything ── */
  html, body                 { overflow-x: hidden; max-width: 100vw; }
  section, footer, nav,
  #ticker, #process-section,
  #process-wrapper           { max-width: 100vw; overflow-x: hidden; }
  #cursor                    { display: none !important; }
  body                       { cursor: auto !important; }
  a, button, [data-tilt],
  .wcard, .scard             { cursor: auto !important; }

  /* ── NAV ── */
  nav                        { padding: .9rem 1.1rem; }
  .nav-cta                   { display: none; }
  .nav-teaser                { display: none; }
  .nav-hamburger             { display: flex; }

  /* ─────────────────────────────────────────────
     HERO  (Image 1)
     Problems: text overflows right, too much top space, cursor dot showing
  ───────────────────────────────────────────── */
  #hero                      { height: 100svh; min-height: unset; overflow: hidden; }
  .hero-eyebrow,
  #hero-eyebrow              { font-size: .5rem; letter-spacing: .22em; margin-bottom: 1.4rem; padding: 0 1rem; }
  .hero-letter               { font-size: clamp(2rem, 9.8vw, 6rem); letter-spacing: -.02em; line-height: .9; }
  .hero-word                 { padding: 0 .8rem; width: 100%; overflow: hidden; }
  #hero-subtitle,
  .hero-subtitle             { font-size: .68rem; letter-spacing: .14em; margin-top: 2.4rem; padding: 0 1rem; }
  .hero-cta                  { margin-top: 1.4rem; padding: .6rem 1.6rem; font-size: .7rem; letter-spacing: .14em; }
  .scroll-hint               { bottom: 1.2rem; }
  .scroll-line               { height: 36px; }

  /* ─────────────────────────────────────────────
     TICKER
  ───────────────────────────────────────────── */
  #ticker                    { padding: 1rem 0; }
  .ticker-item               { font-size: .56rem; letter-spacing: .18em; }

  /* ─────────────────────────────────────────────
     WORK  (Image 1 bottom / Image 2 top)
     Problems: counter + title spacing, card height
  ───────────────────────────────────────────── */
  #work                      { padding: 2.8rem 1.1rem; }
  .work-inner                { width: 100%; }
  .work-top-row              { flex-direction: column; gap: .6rem; margin-bottom: 1.8rem; align-items: flex-start; }
  .sec-eyebrow               { font-size: .52rem; letter-spacing: .26em; margin-bottom: .8rem; }
  .sec-title                 { font-size: clamp(1.7rem, 7vw, 2.8rem); line-height: 1.08; margin-bottom: 0; }
  .work-counter              { gap: .6rem; }
  .wc-num                    { font-size: clamp(2.4rem, 9.5vw, 4rem); }
  .wc-label                  { font-size: .44rem; line-height: 1.4; }
  .work-grid                 { grid-template-columns: 1fr; gap: .8rem; }
  .wcard                     { min-height: 220px !important; grid-row: span 1 !important; }
  .wcard-title               { font-size: 1.1rem; }
  .wcard-info                { padding: 1.1rem; }
  .wcard-num                 { font-size: .54rem; margin-bottom: .35rem; }
  .wtag                      { font-size: .52rem; padding: .18rem .5rem; }
  .sec-cta-btn               { font-size: .52rem; padding: .72rem 1.3rem; gap: .55rem; }
  .sec-cta-row               { margin-top: 1.8rem; }

  /* ─────────────────────────────────────────────
     ABOUT — fit ASCII + text inside screen
     NOTE: ascii-pre font-size is set by ascii.js fitFont() using container width
  ───────────────────────────────────────────── */
  #about                     { padding: 2.8rem 1.1rem; overflow: hidden; }
  .about-grid                { grid-template-columns: 1fr; gap: 1.4rem; width: 100%; }
  #ascii-pre                 {
    width: 78%;
    max-width: 78%;
    overflow: hidden;
    display: block;
    box-sizing: border-box;
  }
  .manifesto-text            {
    font-size: .85rem;
    line-height: 1.65;
    overflow-wrap: break-word;
    word-break: break-word;
    width: 100%;
    max-width: 100%;
    display: block;
  }
  .about-stats               {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
    margin-top: 1.8rem;
    padding-top: 1.2rem;
    width: 100%;
    max-width: 100%;
    justify-content: space-between;
  }
  .about-stats > div         { flex: 1; min-width: 0; padding-right: .5rem; }
  .about-stats > div:last-child { padding-right: 0; }
  .stat-num                  { font-size: clamp(1.1rem, 5vw, 1.6rem); margin-bottom: .2rem; }
  .stat-label                { font-size: .4rem; letter-spacing: .14em; line-height: 1.4; }
  #about .sec-cta-row        { max-width: 100%; }
  #about .sec-cta-btn        { max-width: calc(100vw - 2.2rem); overflow: hidden; text-overflow: ellipsis; }

  /* ─────────────────────────────────────────────
     PROCESS  (Images 3 & 4)
     Vertical stack on mobile — contain overflow here only
  ───────────────────────────────────────────── */
  #process-section           { padding: 2.8rem 0 0; overflow: hidden; }
  .process-header            { padding: 0 1.1rem; margin-bottom: 1.6rem; }
  .pstep-num                 { font-size: 2rem; margin-bottom: .8rem; }
  .pstep-title               { font-size: 1.05rem; margin-bottom: .6rem; }
  .pstep-body                { font-size: .78rem; line-height: 1.68; }
  .pstep-tag                 { font-size: .54rem; margin-top: 1.1rem; }
  .pstep-arc                 { width: 38px; height: 38px; top: 1.1rem; right: 1.1rem; }

  /* SERVICES — padding fix */
  #services                  { padding: 2.8rem 1.5rem; }
  .services-inner            { width: 100%; }
  .services-grid             { grid-template-columns: 1fr !important; gap: .8rem; }
  .scard                     { padding: 1.5rem 1.1rem 1.3rem; }
  .scard-num                 { font-size: .52rem; margin-bottom: 1rem; }
  .scard-icon                { font-size: 1.1rem; margin-bottom: .6rem; }
  .scard-name                { font-size: .98rem; margin-bottom: .45rem; }
  .scard-desc                { font-size: .78rem; line-height: 1.62; }
  .scard-arrow               { bottom: 1.2rem; right: 1.2rem; }

  /* ─────────────────────────────────────────────
     TESTIMONIALS  (Image 4 bottom / Image 5 top)
     Problems: cards need tighter padding, text readable
  ───────────────────────────────────────────── */
  #testimonials              { padding: 2.8rem 1.1rem; }
  .testi-inner               { width: 100%; }
  .tquote-grid               {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 2rem;
    border-radius: 6px;
    overflow: hidden;
  }
  .tquote-card               { padding: 1.4rem 1.1rem; gap: .9rem; }
  .tquote-stars              { font-size: .68rem; letter-spacing: .1em; }
  .tquote-text               { font-size: .8rem; line-height: 1.68; }
  .tquote-meta               { padding-top: .9rem; }
  .tquote-name               { font-size: .5rem; letter-spacing: .2em; }
  .tquote-co                 { font-size: .66rem; }

  /* ─────────────────────────────────────────────
     CTA  (Image 5 middle)
     Problems: button needs full width feel, ghost text overflow
  ───────────────────────────────────────────── */
  #cta                       { padding: 3.5rem 1.1rem; }
  .cta-ghost                 { font-size: 18vw; letter-spacing: -.04em; opacity: .6; }
  .cta-inner                 { width: 100%; }
  .cta-eyebrow               { font-size: .54rem; letter-spacing: .3em; margin-bottom: .9rem; }
  .cta-heading               { font-size: clamp(2rem, 8.5vw, 3.5rem); line-height: 1.0; margin-bottom: .55rem; }
  .cta-sub                   { font-size: .8rem; line-height: 1.6; margin-bottom: 2rem; }
  .blob-wrap                 { display: block; width: 100%; text-align: center; }
  .blob-bg                   { width: 180px; height: 60px; }
  .cta-btn                   { font-size: .78rem; padding: .9rem 2rem; display: inline-block; }
  .cta-email                 { font-size: .7rem; margin-top: 1.1rem; letter-spacing: .12em; }

  /* ─────────────────────────────────────────────
     FOOTER  (Image 5 bottom)
     Problems: columns too cramped, needs single col with good spacing
  ───────────────────────────────────────────── */
  footer                     { padding: 2.8rem 1.1rem 1.6rem; }
  .footer-inner              { grid-template-columns: 1fr; gap: 2rem; }
  .footer-brand              { font-size: 1.6rem; margin-bottom: .6rem; }
  .footer-brand-sub          { font-size: .8rem; letter-spacing: .2em; }
  .footer-tagline            { font-size: .76rem; line-height: 1.6; max-width: 100%; margin-top: .5rem; }
  .footer-social             { gap: .5rem; margin-top: 1.1rem; flex-wrap: wrap; }
  .fsoc                      { font-size: .58rem; padding: .26rem .65rem; }
  .footer-col-head           { font-size: .54rem; letter-spacing: .24em; margin-bottom: .8rem; }
  .footer-links a            { font-size: .78rem; }
  .footer-links li           { margin-bottom: .45rem; }
  .footer-bottom             {
    flex-direction: column;
    gap: .45rem;
    text-align: center;
    margin-top: 1.8rem;
    padding-top: 1.2rem;
  }
  .footer-copy,
  .footer-credit             { font-size: .6rem; }
}

/* ── 400px — small phone ── */
@media (max-width: 400px) {
  .hero-letter               { font-size: clamp(1.8rem, 9.2vw, 4.5rem); }
  #work, #about, #services,
  #testimonials, #cta,
  footer                     { padding: 2.2rem .9rem; }
  .about-stats               { gap: 0; }
  .stat-num                  { font-size: clamp(1.2rem, 5vw, 1.6rem); }
  .services-grid             { grid-template-columns: 1fr !important; }
  .tquote-grid               { grid-template-columns: 1fr; }
  .cta-heading               { font-size: clamp(1.8rem, 9.5vw, 2.8rem); }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after     { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .hero-letter               { color: var(--cream) !important; -webkit-text-stroke: 0 !important; transform: none !important; opacity: 1 !important; }
  .mword.lit                 { opacity: 1 !important; transform: none !important; }
  [data-reveal]              { opacity: 1 !important; transform: none !important; }
}
