/* Phone layout for theshansstudio.com
 *
 * Claude Design exports each page as a fixed 1440px canvas that is scaled
 * down to fit the window. On phones that makes everything tiny, so below
 * 760px this file stops the scaling and reflows each page into one column.
 * Desktop and tablet are untouched.
 *
 * Inline styles from the export are overridden with !important on purpose.
 * Added to every page by tools/update_site.py, so it survives re-exports.
 */

@media (max-width: 760px) {

  /* ---------- every page: stop the shrink-to-fit ---------- */
  html { scroll-snap-type: none !important; -webkit-text-size-adjust: 100%; }
  .pf-stage { height: auto !important; }
  .pf-fit { width: 100% !important; height: auto !important; transform: none !important; margin-left: 0 !important; }
  img { max-width: 100%; }

  /* ================= HOME ================= */
  .m-home .pf-fit > div { min-height: 100svh !important; }
  .m-home .pf-navbar { justify-content: center !important; gap: 4px !important; padding: 18px 12px 0 !important; }
  .m-home .pf-nav { padding: 12px 18px !important; }
  .m-home .pf-nav img { height: 24px !important; }
  .m-home .pf-main { gap: 26px !important; padding: 24px 14px 48px !important; justify-content: center !important; }
  .m-home .pf-art { max-width: 100% !important; }
  .m-home .pf-greet { font-size: 26px !important; letter-spacing: 0.12em !important; text-indent: 0.12em !important; line-height: 1.25 !important; padding: 0 8px; }

  /* ================= ABOUT ================= */
  /* The export already stacks the cards it calls .pf-notes; finish the job. */
  .m-about .pf-page { display: flex !important; flex-direction: column !important; height: auto !important; min-height: 0 !important; padding-bottom: 0 !important; }
  .m-about .pf-bg, .m-about .pf-tint, .m-about .pf-strings { display: none !important; }
  .m-about .pf-navbar { justify-content: center !important; gap: 4px !important; padding: 18px 12px 6px !important; order: 0; }
  .m-about .pf-nav { padding: 12px 18px !important; }
  .m-about .pf-notes { display: contents !important; }
  .m-about .pf-note { position: static !important; width: auto !important; height: auto !important; transform: none !important; margin: 0 18px 26px !important; }
  .m-about .pf-note .pf-in { width: auto !important; }
  .m-about .pf-note .pf-rock { transform: rotate(-0.8deg) !important; }
  .m-about .pf-note:nth-child(even) .pf-rock { transform: rotate(0.8deg) !important; }
  /* "In practice": the export scatters the items at angles; list them neatly */
  .m-about .pf-note .pf-in > div:has(> span + span + span) { position: static !important; display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px 14px; width: auto !important; height: auto !important; padding: 0 26px 26px !important; }
  .m-about .pf-note .pf-in > div:has(> span + span + span) > span { position: static !important; width: auto !important; height: auto !important; transform: none !important; font-size: 15px !important; line-height: 1.3 !important; }
  .m-about .pf-note .pf-in > h2 { transform: none !important; }
  .m-about .pf-note p, .m-about .pf-note .pf-in > div { width: auto !important; }
  .m-about .pf-tape { display: none !important; }
  .m-about .pf-chip { white-space: nowrap; }
  .m-about div:has(> .pf-chip) { flex-wrap: wrap !important; width: auto !important; }
  /* bottom links: back to studio / project index */
  .m-about .pf-page > a { position: static !important; order: 20; display: block; text-align: center; padding: 14px 18px !important; font-size: 12px !important; }
  .m-about .pf-page > a:first-of-type { order: 19; padding-top: 10px !important; }

  /* ================= PROJECTS INDEX ================= */
  .m-projects .pf-fit > div { min-height: 100svh !important; }
  .m-projects header { padding: 18px 18px 0 !important; }
  .m-projects main { padding: 0 18px 48px !important; box-sizing: border-box; }
  .m-projects main > p { margin: 44px 0 34px !important; height: auto !important; font-size: 16px !important; line-height: 1.35 !important; }
  .m-projects .pf-row { padding-top: 34px; border-bottom: 0; }
  .m-projects .pf-folder { left: 0 !important; right: auto !important; top: 10px !important; width: auto !important; height: 26px !important; padding: 0 16px; font-size: 11px !important; }
  .m-projects .pf-tab { height: auto !important; padding: 10px 2px 14px !important; transform: none !important; }
  .m-projects .pf-tab h2 { font-size: 34px !important; line-height: 0.95 !important; letter-spacing: -0.05em !important; white-space: normal !important; overflow: visible !important; }
  .m-projects .pf-tab:active { background-color: #C62B23 !important; color: #FEF9ED; }

  /* ================= PROJECT PAGES ================= */
  .m-project .pf-fit > div { min-height: 0 !important; }
  .m-project .pf-fit > div > header { padding: 16px 18px 12px !important; gap: 12px; flex-wrap: wrap; }
  .m-project .pf-fit > div > header nav { gap: 18px !important; }
  .m-project .pf-fit > div > header nav a[href^="Library"] { display: none !important; }

  .m-project section:has(.pf-introgrid), .m-project section:has(.pf-occgrid) { height: auto !important; min-height: 0 !important; }

  /* hero: rolling title, project facts, hero render, question */
  .m-project .pf-marquee h1, .m-project .pf-marquee span { font-size: 54px !important; padding-right: 34px !important; }
  .m-project .pf-introgrid { display: flex !important; flex-direction: column !important; height: auto !important; min-height: 0 !important; gap: 0 !important; padding: 18px 18px 30px !important; }
  .m-project .pf-introgrid > aside { position: static !important; order: 2; width: auto !important; height: auto !important; display: flex; flex-wrap: wrap; gap: 6px 16px; padding-top: 16px; }
  .m-project .pf-introgrid > aside > * { position: static !important; width: auto !important; margin: 0 !important; }
  .m-project .pf-introgrid > aside > span { flex-basis: 100%; }
  .m-project .pf-introgrid > div { order: 1; width: 100% !important; max-width: 100% !important; height: auto !important; }
  .m-project .pf-hero { width: 100% !important; height: auto !important; }
  .m-project .pf-hero > div:first-child { height: auto !important; aspect-ratio: 1076 / 549; padding: 5px !important; }
  /* tap toggles day/night; phones keep :hover stuck after a tap, so neutralise it */
  html:not(.m-night) .pf-hero:hover .pf-day { opacity: 1 !important; }
  html:not(.m-night) .pf-hero:hover .pf-night { opacity: 0 !important; }
  html.m-night .pf-hero .pf-day { opacity: 0 !important; }
  html.m-night .pf-hero .pf-night { opacity: 1 !important; }
  .m-project .pf-introgrid > div > p { font-size: 17px !important; margin-top: 18px !important; }
  /* the avatar + "hover over" bubbles point at hover, which phones don't have */
  .m-project section > div[style*="z-index: 12"],
  .m-project .pf-occgrid > div[style*="position: absolute"],
  .m-project section.pf-snap > div[style*="position: absolute"] { display: none !important; }

  /* threshold image */
  .m-project section.pf-drop { padding-left: 18px !important; padding-right: 18px !important; }
  .m-project .pf-thrbox { height: auto !important; aspect-ratio: 1280 / 707; }
  .m-project div:has(> .pf-thrbox) { height: auto !important; }
  .m-project section:has(.pf-thrbox) { padding-bottom: 34px !important; }

  /* the story */
  .m-project .pf-occgrid { display: block !important; padding: 40px 0 44px !important; }
  .m-project .pf-occgrid > div:nth-child(2) { font-size: 16px !important; line-height: 1.45 !important; margin-top: 18px; }
  /* the closing line of the story (48-58px on desktop) */
  .m-project .pf-occgrid > div:nth-child(2) > [style*="font-size"],
  .m-project .pf-occgrid > div:nth-child(2) > [style*="font-size"] * { font-size: 28px !important; line-height: 1.12 !important; width: auto !important; }
  .m-project .pf-occgrid > div:nth-child(2) > [style*="font-size"] { margin: 30px 0 0 !important; }

  /* checkpoints: swipeable strip */
  .m-project .pf-cpsheet { padding: 22px 0 18px !important; }
  .m-project .pf-cpsheet header { margin: 0 18px !important; padding-bottom: 14px !important; }
  .m-project .pf-cpsheet h2, .m-project .pf-cpsheet h3 { font-size: 26px !important; }
  .m-project .pf-cpview { height: auto !important; margin-top: 16px !important; scroll-snap-type: x mandatory; }
  .m-project .pf-cptrack { padding: 0 18px !important; }
  .m-project .pf-cpslide { margin-right: 12px !important; }
  .m-project .pf-cpslide img { height: 250px !important; }
  .m-project .pf-cpsheet > div:nth-child(2) > div:last-child { margin: 14px 18px 0 !important; }

  /* a day in the life */
  .m-project .pf-timewrap { width: 100% !important; height: auto !important; aspect-ratio: 1150 / 642; }
  .m-project .pf-timewrap ~ div { flex-direction: column !important; gap: 14px !important; }
  .m-project .pf-timewrap ~ div > div[role="tablist"] { justify-content: flex-start !important; place-content: start !important; }
  .m-project .pf-timewrap ~ div h2, .m-project .pf-timewrap ~ div h3,
  .m-project .pf-timewrap ~ div > div:first-child > :first-child { font-size: 28px !important; line-height: 1.1 !important; }
  .m-project .pf-tbar { right: 40px !important; transform: translateY(-50%) scale(0.78) !important; transform-origin: right center; }
  .m-project .pf-timelabel { bottom: 8px !important; font-size: 9px !important; padding: 6px 12px !important; }

  /* drawings sheet */
  .m-project .pf-sheet { padding: 26px 16px 22px 16px !important; }
  .m-project .pf-stripL { display: none !important; }
  .m-project .pf-sheetbody > header { padding-bottom: 14px !important; }
  .m-project .pf-sheetbody h2 { font-size: 30px !important; }
  .m-project .pf-bigword { display: none !important; }
  .m-project .pf-dwblock { margin-top: 26px !important; }
  .m-project .pf-dwgrid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 14px !important; margin-top: 40px !important; }
  .m-project .pf-dwimg { height: auto !important; aspect-ratio: 4 / 3; }
  .m-project .pf-dwcap { font-size: 9px !important; letter-spacing: 0.1em !important; }
  .m-project .pf-quote { width: auto !important; margin-top: 30px !important; }
  .m-project .pf-quotetext { font-size: 21px !important; }
  .m-project .pf-tblock { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; margin-top: 30px !important; }
  .m-project .pf-tblock b { font-size: 10px !important; }

  /* the dreaming figure + previous / next */
  .m-project .pf-dream { min-height: 0 !important; padding: 24px 0 64px !important; }
  .m-project .pf-dreambox { transform: none !important; zoom: 0.62; }
  .m-project div:has(> .sc-host > .pf-dream) { height: auto !important; min-height: 0 !important; }
  .m-project .pf-fnav { top: auto !important; bottom: 18px !important; transform: none !important; font-size: 17px !important; }
  .m-project .pf-fnav[style*="right"] { right: 18px !important; }
  .m-project .pf-fnav[style*="left"] { left: 18px !important; }
  .m-project .pf-fcontacts { grid-template-columns: 1fr !important; justify-items: center; text-align: center; gap: 10px !important; padding: 20px 18px 26px !important; }
}
