/* ==========================================================================
   Play page (play.html) only. Loaded after site.css and home.css, so the
   homepage styles in home.css can change without touching Play.
   Sections: type and cards · project sheets · galleries · pop-up
   ========================================================================== */

/* Type: the same family as the main homepage (Helvetica throughout) ------ */
.play-page {
  --font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-serif: var(--font-sans);
}
.play-intro h1 { font-weight: 300; letter-spacing: -0.04em; }
.play-lede { font-weight: 300; }
.play-page .sheet-title, .play-page .story-title, .play-page .manual-title { font-weight: 400; letter-spacing: -0.02em; }
.play-page .sheet-copy > p:not([class]), .play-page .story-step > p, .play-page .story-text p, .play-page .story-list, .play-page .story-facts dd { font-weight: 300; }

/* Older Play rules in home.css that these replace */
.js-motion .tiles > li:nth-child(even) a.tile:hover { transform: translateY(-4px); }
.pong-focus .sheets { display: none; }

/* Play cards: a plain, even grid under the heading. Hover only lifts a
   card a little and deepens its shadow.                                   */
.play-intro { padding-bottom: clamp(32px, 4vw, 56px); }
.tiles--play { columns: auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: clamp(16px, 2.4vw, 32px); }
.tiles--play > li { margin: 0; }
.tiles--play .tile { height: 100%; transform: none; transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-color .3s; }
.tiles--play .tile-media { aspect-ratio: 4 / 3 !important; }
.tiles--play .tile-media img { width: 100%; height: 100%; object-fit: cover; }
.tile-media--paper { background: #FAFAFA; }
@media (hover: hover) {
  .js-motion .tiles--play > li a.tile:hover,
  .js-motion .tiles--play > li:nth-child(even) a.tile:hover { transform: translateY(-4px); }
}

/* Project sheets --------------------------------------------------------
   Without JS they stack under the wall. With JS (js/play.js) they open one
   at a time in a <dialog>, with previous / next and close.               */
.sheets { padding-bottom: clamp(72px, 10vw, 140px); }
.sheets .container { display: grid; gap: clamp(48px, 7vw, 96px); }
.js-sheets .sheets { display: none; }
.sheet {
  --sheet-bg: var(--cream); --sheet-ink: var(--ink); --sheet-ink-2: var(--ink-2); --sheet-line: rgba(42, 35, 29, .14);
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(24px, 3.6vw, 56px); align-items: start;
  color: var(--sheet-ink); scroll-margin-top: calc(var(--header-h) + 16px);
}
.sheet--dark { --sheet-bg: #1C1A17; --sheet-ink: #F3ECDD; --sheet-ink-2: #CFC5B2; --sheet-line: rgba(243, 236, 221, .18); }
.sheets .sheet--dark { background: var(--sheet-bg); border-radius: var(--radius-lg); padding: clamp(16px, 3vw, 40px); }
.sheet-gallery {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  padding-bottom: 12px; border-radius: 18px; scrollbar-width: thin; scrollbar-color: var(--sheet-line) transparent;
}
.sheet-gallery:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 4px; }
.sheet-gallery figure { flex: none; scroll-snap-align: start; margin: 0; position: relative; }
.sheet-gallery img, .sheet-gallery video { height: clamp(260px, 58vh, 560px); width: auto; max-width: none; border-radius: 14px; background: rgba(0, 0, 0, .06); }
.sheet-video video { aspect-ratio: 16 / 9; background: #000; }
.sheet-video figcaption {
  position: absolute; left: 12px; top: 12px; padding: 4px 10px; border-radius: 999px; font-size: 12px; letter-spacing: .04em;
  background: var(--accent); color: var(--accent-ink); pointer-events: none;
}
.sheet-copy { display: grid; gap: 16px; align-content: start; padding-top: 4px; color: var(--sheet-ink-2); }
.sheet-kicker { display: flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--sheet-ink-2); }
.sheet-kicker::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); flex: none; }
.sheet-title { font-family: var(--font-serif); font-weight: 400; font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); line-height: 1.02; letter-spacing: -0.02em; color: var(--sheet-ink); }
.sheet-hook { font-size: clamp(1.125rem, 1rem + .4vw, 1.375rem); font-weight: 400; line-height: 1.4; color: var(--sheet-ink); }
.sheet-copy > p:not([class]) { font-weight: 300; font-size: var(--fs-lead); line-height: 1.55; max-width: 44ch; }
.sheet-quiet { font-size: var(--fs-sm); }
.sheet-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin-top: 4px; }
.sheet-chips li { padding: 5px 12px; border: 1px solid var(--sheet-line); border-radius: 999px; font-size: 13px; color: var(--sheet-ink); }
.sheet-link { justify-self: start; color: var(--sheet-ink); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.sheet-link::after { content: " \2197"; }
.sheet-btn {
  justify-self: start; min-height: 44px; padding: 10px 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent-2, var(--accent)); color: var(--ink); font-size: 14px; font-weight: 500;
  transition: transform .3s cubic-bezier(.3, 1.6, .5, 1);
}
.sheet-btn:hover { transform: rotate(-2deg) scale(1.04); }
.sheet-btn:focus-visible, .chat-replay:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }

/* Stacked sheet (Cymatics): film edge to edge, then the words, then photos */
.sheet--stack { grid-template-columns: 1fr; }
.sheet--stack .sheet-copy { max-width: none; }
.sheet--stack .sheet-copy > p:not([class]) { max-width: 80ch; }
.sheet-film video { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 14px; background: #000; }

/* Click-through photo gallery: one photo at a time, centred, uncropped */
.gal { display: grid; gap: 12px; }
.gal-stage { position: relative; }
.gal-track {
  display: flex; list-style: none; margin: 0; padding: 0; overflow: hidden; scroll-behavior: smooth; touch-action: pan-y;
}
.gal-track::-webkit-scrollbar { display: none; }
.gal-track:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }
.gal { --gal-h: clamp(260px, 54vh, 560px); }
.gal-slide { flex: 0 0 100%; display: grid; place-items: center; height: var(--gal-h); padding: 0 64px; overflow: hidden; }
@media (max-width: 599.98px) { .gal { --gal-h: clamp(220px, 46vh, 420px); } .gal-slide { padding: 0 8px; } .gal-btn { top: auto; bottom: -56px; translate: none; } .gal-count { margin-top: 8px; } }
.gal-slide img { max-width: 100%; max-height: var(--gal-h); width: auto; height: auto; object-fit: contain; border-radius: 6px; }
.gal-btn {
  position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(253, 252, 247, .92); color: var(--ink); font-size: 18px; line-height: 1; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .5);
  transition: background-color .2s;
}
.gal-btn:hover { background: #fff; }
.gal-btn:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.gal-btn[disabled] { opacity: .35; cursor: default; }
.gal-prev { left: 12px; } .gal-next { right: 12px; }
html:not(.js-sheets) .gal-btn { display: none; }
html:not(.js-sheets) .gal-track { overflow-x: auto; }
.gal-count { justify-self: center; font-size: 12px; letter-spacing: .14em; color: var(--sheet-ink-2); }

/* Story sheet (Saheli): one centred column, each step of the process in turn */
.sheet--story { max-width: 1040px; margin-inline: auto; gap: clamp(32px, 5vw, 64px); }
.sheet--story .sheet-copy > p:not([class]) { max-width: 70ch; }
.story-facts { display: grid; grid-template-columns: 2.2fr 1.3fr .9fr 2.8fr; gap: 24px 32px; margin: 0; padding-block: 24px; border-block: 1px solid var(--sheet-line); }
.story-facts dt { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.story-facts dd { margin: 0; font-weight: 300; line-height: 1.55; color: var(--sheet-ink); }
.story-step { display: grid; gap: 20px; }
.story-title { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: 1.1; color: var(--sheet-ink); }
.story-step > p, .story-text p { font-weight: 300; font-size: var(--fs-lead); line-height: 1.6; max-width: 70ch; }
.story-step figure { margin: 0; display: grid; gap: 8px; }
.story-step figure img { width: 100%; height: auto; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(42, 35, 29, .08), 0 16px 36px -24px rgba(42, 35, 29, .35); }
.story-step figcaption { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.story-grid { display: grid; gap: clamp(16px, 2.4vw, 28px); align-items: start; }
.story-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.story-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: clamp(20px, 3.4vw, 48px); align-items: start; }
.story-text { display: grid; gap: 14px; }
.story-list { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; font-weight: 300; line-height: 1.55; }
.story-list b { font-weight: 500; color: var(--sheet-ink); }
.story-wide { width: 100%; }
@media (max-width: 759.98px) {
  .story-facts, .story-grid--2, .story-split { grid-template-columns: 1fr; }
}

/* Process shots (Cymatics): work-in-progress photos in an even grid */
.sheet--stack .story-step { padding-top: clamp(8px, 2vw, 24px); border-top: 1px solid var(--sheet-line); }
.sheet--stack .story-step > h3 { padding-top: clamp(16px, 2vw, 24px); }
.process-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 2vw, 20px); }
.process-grid img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; }
@media (max-width: 699.98px) { .process-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sheet--story .story-step { padding-top: 0; border-top: 0; }
.sheet--story .story-step > h3 { padding-top: 0; }

/* Saheli intro: words on the left, a tappable phone prototype on the right */
.story-intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.proto { margin: 0; display: grid; justify-items: center; gap: 14px; }
.proto-phone {
  position: relative; width: clamp(220px, 24vw, 280px); padding: 12px; border-radius: 44px; background: #1D1C1A;
  box-shadow: inset 0 0 0 2px #3A3835, 0 30px 60px -28px rgba(42, 35, 29, .55);
}
.proto-speaker { position: absolute; top: 17px; left: 50%; width: 60px; height: 6px; margin-left: -30px; border-radius: 6px; background: #3A3835; z-index: 2; }
.proto-screen {
  position: relative; display: block; width: 100%; aspect-ratio: 540 / 962; padding: 0; border: 0; border-radius: 32px; overflow: hidden;
  background: #fff; cursor: pointer;
}
.proto-screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.proto-screen:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 4px; }
.proto-hot {
  position: absolute; left: var(--x, 50%); top: var(--y, 50%); width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%;
  background: rgba(21, 163, 186, .35); box-shadow: 0 0 0 2px rgba(21, 163, 186, .8); pointer-events: none;
}
.js-motion .proto-hot { animation: hotpulse 1.6s ease-out infinite; }
@keyframes hotpulse { 0% { transform: scale(.7); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
.js-motion .proto-screen img.is-new { animation: screenin .35s var(--ease); }
@keyframes screenin { from { opacity: 0; transform: translateX(14px); } }
.proto-bar { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-2); }
.proto-label { min-width: 15ch; text-align: center; }
.proto-nav {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--sheet-line); background: transparent; color: var(--ink); cursor: pointer; font-size: 16px; line-height: 1;
}
.proto-nav:hover { background: rgba(127, 127, 127, .12); }
.proto-nav:focus-visible, .proto-lang button:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.proto-lang { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--sheet-line); }
.proto-lang button { min-height: 32px; padding: 4px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.proto-lang button[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
@media (max-width: 759.98px) { .story-intro { grid-template-columns: 1fr; } }

/* The full manual (Anti-User Manual): every page in one scrolling column */
.manual { grid-column: 1 / -1; display: grid; gap: 16px; padding-top: clamp(8px, 2vw, 24px); border-top: 1px solid var(--sheet-line); }
.manual-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding-top: clamp(16px, 2vw, 24px); }
.manual-title { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: 1.1; color: var(--sheet-ink); }
.manual-pages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); align-items: start; padding: clamp(16px, 3vw, 32px); border-radius: 18px; background: #E9E2D2; }
@media (max-width: 699.98px) { .manual-pages { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.manual-pages:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }
.manual-pages img { width: 100%; height: auto; background: #fff; box-shadow: 0 1px 2px rgba(42, 35, 29, .1), 0 16px 36px -22px rgba(42, 35, 29, .35); }

/* The pop-up ------------------------------------------------------------- */
.sheet-dialog {
  width: min(1240px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); height: auto;
  padding: 0; border: 0; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--sheet-bg, var(--cream)); color: var(--ink); box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .5);
}
.sheet-dialog.is-dark { --sheet-bg: #1C1A17; }
.sheet-dialog::backdrop { background: rgba(28, 24, 18, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.js-motion .sheet-dialog[open] { animation: sheetin .5s var(--ease); }
.js-motion .sheet-dialog[open]::backdrop { animation: fadein .4s ease; }
@keyframes sheetin { from { opacity: 0; transform: translateY(24px) scale(.97); } }
@keyframes fadein { from { opacity: 0; } }
.sheet-frame { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.sheet-bar {
  display: flex; align-items: center; gap: 8px; padding: 14px clamp(16px, 2.6vw, 32px);
  border-bottom: 1px solid var(--sheet-line, rgba(42, 35, 29, .12)); color: var(--sheet-ink, var(--ink));
}
.sheet-count { margin-right: auto; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.sheet-nav {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--sheet-line, rgba(42, 35, 29, .14)); background: transparent; color: inherit; font-size: 18px; line-height: 1;
  transition: background-color .2s, transform .3s var(--ease);
}
.sheet-nav:hover { background: rgba(127, 127, 127, .14); }
.sheet-nav:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.sheet-close:hover { transform: rotate(90deg); }
.sheet-scroll { overflow-y: auto; overscroll-behavior: contain; padding: clamp(18px, 3vw, 40px) clamp(16px, 2.6vw, 32px) clamp(24px, 3.4vw, 44px); }
.sheet-dialog .sheet { --sheet-bg: transparent; }
.sheet-dialog.is-dark .sheet-bar { --sheet-line: rgba(243, 236, 221, .18); --sheet-ink: #F3ECDD; }
.js-motion .sheet-scroll.is-switching .sheet { animation: switchin .4s var(--ease); }
@keyframes switchin { from { opacity: 0; transform: translateX(var(--from, 16px)); } }
/* The site's dot cursor and the pong paddle sit under the pop-up, so bring
   the normal cursor back while it is open */
html.sheet-open, html.sheet-open * { cursor: auto !important; }
html.sheet-open a, html.sheet-open button, html.sheet-open .sheet-btn { cursor: pointer !important; }
html.sheet-open .cursor-dot { opacity: 0 !important; }
html.sheet-open body { overflow: hidden; }

@media (max-width: 859.98px) {
  .sheet { grid-template-columns: 1fr; }
  .sheet-gallery img, .sheet-gallery video { height: clamp(220px, 46vh, 420px); }
  .sheet-gallery { margin-inline: calc(-1 * clamp(16px, 2.6vw, 32px)); padding-inline: clamp(16px, 2.6vw, 32px); scroll-padding-inline: clamp(16px, 2.6vw, 32px); }
  .sheet-dialog { width: 100vw; max-height: 100dvh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; margin: auto auto 0; }
  .sheet-frame { max-height: 94dvh; }
}

/* Cards: like the homepage cards. Very slightly rounded corners (6px), the
   photo flush with the top edge, text on white below. Hover lifts the
   card a little and darkens the background a touch. */
.tiles--play .tile {
  padding: 0; border: 1px solid rgba(42, 35, 29, .08); border-radius: 6px; overflow: hidden; background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(42, 35, 29, .04);
}
.tiles--play .tile-media { border-radius: 0; }
.tiles--play .tile-body { padding: 16px 18px 18px; }
.tiles--play .tile-title { font-size: clamp(1.125rem, 1rem + .5vw, 1.375rem); line-height: 1.2; }
@media (hover: hover) {
  .tiles--play a.tile:hover { background: #FFFFFF; box-shadow: 0 14px 30px -18px rgba(42, 35, 29, .3); }
}
.tiles--play a.tile:focus-visible { border-radius: 6px; outline-offset: 3px; }

/* Anti-User Manual: the photo gallery sits beside the words, on a light panel */
.gal--manual { --gal-h: clamp(300px, 56vh, 560px); min-width: 0; }
.gal { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.gal--manual .gal-track { border-radius: 6px; background: #ECE6DA; }
.gal--manual .gal-slide { padding: 16px 60px; }
.sheet-note { padding: 14px 16px; border-left: 2px solid var(--accent); background: rgba(42, 35, 29, .04); font-size: var(--fs-sm); line-height: 1.55; color: var(--sheet-ink); }
.sheet-note .sheet-link { white-space: nowrap; }
.sheet-note .sheet-link::after { content: " \2192"; }

/* Less space above "Play": the ping pong bar already clears the header */
.play-intro { padding-top: clamp(20px, 3vw, 40px); }

/* Ping pong switch and hint sit under the intro line instead of above "Play" */
.play-intro { padding-top: calc(var(--header-h) + clamp(20px, 3vw, 40px)); }
.play-intro .pong-bar { padding: 6px 0 0; }
.play-intro .pong-hint { max-width: 40ch; text-align: left; }
/* Focus mode keeps the switch (and score) but hides the heading and intro line */
.pong-focus .play-intro { display: block; }
.pong-focus .play-intro h1, .pong-focus .play-lede, .pong-focus .play-sun { display: none; }

/* The sun glow behind "Play" fades out on its own instead of being cut off
   in a hard line where the cards begin; the cards sit above it */
.play-intro { overflow: visible; }
.play-wall { position: relative; z-index: 1; }
