/* Daitan Motion home, additions on top of style.css: real footage in the photo
   album, the file index, the hero shortcut to the films, contact repairs.
   style.css stays the shared look for the home page and the World Cup archive. */

/* ── reveals: text is visible by default; it only starts hidden once
   cursor.js has its observer running (html.reveal-on) ── */
[data-reveal], [data-reveal-x] { opacity: 1; transform: none; }
.reveal-on [data-reveal]:not(.in-view) { opacity: 0; transform: translateY(36px); }
.reveal-on [data-reveal-x]:not(.in-view) { opacity: 0; transform: translateX(-72px); }

/* ── nav: Work stays reachable on phones ── */
@media (max-width: 760px) {
  .nav nav { gap: 14px; }
  .nav nav a.nav-work { display: inline-flex; padding: 12px 4px; }
}

/* ── album tools: FILE SELECT index tab + reel link ── */
.album-tools {
  max-width: 1080px;
  margin: 0 auto 36px;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px;
}
.album-tab {
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.1em;
  line-height: 1;
  color: #0c0a1f;
  background: var(--cream-warm);
  border: 2px solid #0c0a1f;
  outline: 2px solid var(--cream-warm);
  padding: 12px 14px;
  min-height: 44px;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
  cursor: var(--donut-cursor), pointer;
  transition: transform .15s steps(2), box-shadow .15s steps(2), background .15s steps(2);
}
.album-tab:hover { background: var(--accent); outline-color: var(--accent); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.6); }
.album-tab:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6); }
.album-tab[aria-expanded="true"] { background: var(--accent); outline-color: var(--accent); }
.album-tab--reel { background: rgba(12, 10, 31, 0.7); color: var(--ink); border-color: var(--accent); outline: 0; text-shadow: 2px 2px 0 rgba(0,0,0,0.6); }
.album-tab--reel:hover { color: #0c0a1f; text-shadow: none; }
.file-index {
  flex-basis: 100%;
  list-style: none;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin-top: 4px; padding: 14px;
  background: rgba(12, 10, 31, 0.78);
  border: 2px dashed var(--accent);
}
.file-index[hidden] { display: none; }
.file-index a {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 12px;
  font-family: var(--display); font-size: 9px; letter-spacing: 0.08em; line-height: 1.3;
  color: var(--ink); background: rgba(242, 237, 227, 0.06);
  border: 2px solid var(--ink-line);
}
.file-index a em { font-style: normal; color: var(--accent); }
.file-index a:hover, .file-index a[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: #0c0a1f; }
.file-index a:hover em, .file-index a[aria-current="true"] em { color: #0c0a1f; }

/* ── cover: a real still taped under the cameraman ── */
.album-cover-illu { position: relative; margin-bottom: 26px; }
.cover-still {
  position: absolute; right: -22%; bottom: -14%;
  width: 62%;
  padding: 4px 4px 5px;
  background: #fbf7ec;
  border: 1px solid rgba(60, 40, 20, 0.45);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
  transform: rotate(5deg);
}
.cover-still::before {
  content: ''; position: absolute; left: 50%; top: -8px; width: 44px; height: 14px; margin-left: -22px;
  background: rgba(248, 168, 192, 0.82); border: 1px solid rgba(12, 10, 31, 0.25);
  transform: rotate(-4deg);
}
.cover-still img { width: 100%; height: auto; aspect-ratio: 1600 / 680; object-fit: cover; image-rendering: auto; }
.cover-stamp {
  position: absolute; left: -20%; bottom: -11%;
  font-family: var(--display); font-size: 8px; letter-spacing: 0.1em; line-height: 1.5; white-space: nowrap;
  color: var(--accent-deep); background: #16101f;
  border: 2px solid var(--accent-deep); padding: 5px 7px 4px;
  transform: rotate(-8deg);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}
.album-cover-cta { font-size: 9px; }
@media (max-width: 760px) {
  .cover-still { right: -18%; }
  .cover-stamp { left: -16%; }
}

/* ── grain and scanlines, scoped ──
   style.css lays both over the whole viewport, which also puts them over the
   films. Here each decorative surface carries its own copy (nav, hero, the
   sections, footer, album cover, album paper) and the footage sits above the
   paper's copy, so posters and playing video stay clean. */
.grain { display: none; }
body::after { display: none; }
footer { position: relative; }
.nav::before, .hero::before, .pixel-section::before, footer::before, .fx-grain,
.nav::after, .hero::after, .pixel-section::after, footer::after, .fx-lines, .album-spread.is-active::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 30;
}
.nav::before, .hero::before, .pixel-section::before, footer::before, .fx-grain {
  opacity: 0.08; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
}
.nav::after, .hero::after, .pixel-section::after, footer::after, .fx-lines, .album-spread.is-active::after, .page-photo {
  background-image: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 3px, rgba(0,0,0,0.06) 3px, rgba(0,0,0,0.06) 4px);
}
/* the book rises above its section's layers and carries its own, with the photo above those */
.album-stage { z-index: 31; }
.album-spread.is-active { position: relative; }
.album-spread .fx-grain, .album-spread.is-active::after { z-index: 5; }
.album-spread .page-photo { z-index: 6; }

/* ── film pages: a taped photo with real footage ── */
.spread-page--right { overflow-y: auto; }
.page-media {
  position: relative;
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.album-spread:not(.has-film) .page-media .page-illu { align-self: stretch; }
.page-photo {
  position: relative;
  flex: none;
  width: 100%;
  padding: 8px 8px 9px;
  background-color: #fbf7ec;
  border: 1px solid rgba(60, 40, 20, 0.4);
  box-shadow: 4px 5px 0 rgba(60, 40, 20, 0.38);
  transform: rotate(-1.1deg);
  margin-top: 8px;
}
.album-spread:nth-of-type(even) .page-photo { transform: rotate(0.9deg); }
/* tape corners */
.page-photo::before, .page-photo::after {
  content: ''; position: absolute; top: -9px; width: 58px; height: 18px; z-index: 3;
  background: rgba(248, 168, 192, 0.8);
  border: 1px solid rgba(60, 40, 20, 0.18);
  box-shadow: 1px 1px 0 rgba(60, 40, 20, 0.18);
  pointer-events: none;
}
.page-photo::before { left: -18px; transform: rotate(-36deg); }
.page-photo::after { right: -18px; transform: rotate(36deg); }
.photo-frame {
  position: relative;
  aspect-ratio: var(--ar, 16 / 9);
  background: #14102a;
  overflow: hidden;
}
.photo-frame img, .photo-frame video {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  object-fit: contain;
  image-rendering: auto;
}
.photo-frame img { object-fit: cover; }
.photo-frame video { display: none; background: #14102a; }
.photo-frame.is-video video { display: block; }
.js .photo-frame:not(.is-video), .js .photo-frame.is-auto { cursor: var(--donut-cursor), pointer; }
.photo-play {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  width: 56px; height: 48px; margin: -24px 0 0 -28px;
  display: none; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 16px; line-height: 1; padding: 0 0 0 4px;
  color: #0c0a1f; background: var(--accent);
  border: 3px solid #0c0a1f; outline: 2px solid var(--paper);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.65);
  cursor: var(--donut-cursor), pointer;
  transition: transform .15s steps(2), background .15s steps(2);
}
.js .photo-play { display: inline-flex; }
.photo-play:hover { background: var(--cream-warm); transform: translate(-2px, -2px); }
.photo-frame.is-playing .photo-play, .photo-frame.has-controls .photo-play { display: none; }
.photo-status {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  margin: 0; padding: 10px 12px;
  font-family: var(--display); font-size: 8px; letter-spacing: 0.08em; line-height: 1.7;
  color: var(--ink); background: rgba(12, 10, 31, 0.92);
}
.photo-status a { color: var(--accent); text-decoration: underline; }

/* the drawing moves into the margin on film pages */
.has-film .page-illu { flex: 1 1 0; min-height: 0; width: 100%; }
.has-film .page-illu svg { width: auto; height: 100%; max-height: 200px; max-width: 100%; }
/* portrait footage stands upright with the drawing beside it */
.is-portrait .page-media { flex-direction: row; align-items: center; justify-content: center; gap: 12px; }
.is-portrait .page-photo { width: auto; height: 100%; max-height: 400px; margin-top: 0; }
.is-portrait .photo-frame { height: 100%; width: auto; aspect-ratio: 9 / 16; }
.is-portrait .page-illu { flex: 1 1 0; min-width: 0; height: 100%; }
.is-portrait .page-illu svg { width: 100%; height: auto; max-height: 100%; }

/* actions under the text */
.page-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 12px 12px; align-items: flex-start; padding: 0 6px 6px 0; }
.page-actions .page-button { align-self: auto; min-height: 44px; display: inline-flex; align-items: center; cursor: var(--donut-cursor), pointer; }
.page-button--alt { background: transparent; color: var(--ink-pen); text-shadow: none; }
.page-button.is-on { background: var(--accent-deep); color: var(--ink-pen); text-shadow: none; }
.page-h:focus { outline: none; }
.page-h:focus-visible { outline: 2px dashed var(--accent-deep); outline-offset: 4px; }
.has-film .page-text { margin-bottom: 14px; }

/* keyboard focus, in the site's own colours */
.album-cover:focus-visible, .album-btn:focus-visible, .album-close:focus-visible, .album-tab:focus-visible,
.file-index a:focus-visible, .page-button:focus-visible, .photo-play:focus-visible, .wc-btn:focus-visible,
.contact-mail:focus-visible, .nav nav a:focus-visible, .foot-reel:focus-visible {
  outline: 3px solid var(--cream-warm); outline-offset: 3px;
}

/* ── stacked paper (phones and narrow windows): one auto-height sheet per file ── */
@media (max-width: 900px) {
  .album {
    --book-w: min(92vw, 560px);
    --book-h: calc(var(--book-w) * 1.25);
    --cover-w: var(--book-w);
  }
  .album.is-closed .album-stage { transform: none; }
  .album-cover { left: 0; width: 100%; }
  .album-cover::before { display: none; }
  .album-flip-fx { display: none; }
  .album.is-open .album-stage, .album.is-opening .album-stage { height: auto; min-height: 0; }
  .album.is-open .album-spreads, .album.is-opening .album-spreads {
    position: relative; inset: auto; display: block;
    background: linear-gradient(135deg, var(--paper) 0%, var(--paper-deep) 100%);
  }
  .album.is-opening .album-cover { height: var(--book-h); }
  .album-spreads::before { display: none; }          /* no vertical binding on a single sheet */
  .album-spread.is-active {
    display: flex; flex-direction: column;
    position: relative;
    height: auto;
    padding: 26px 20px 22px;
  }
  .album-spread.is-active .spread-page,
  .album-spread.is-active .page-media { display: contents; }
  .album-spread.is-active .spread-page--left > .paper { display: none; }
  .album-spread.is-active .spread-page--right > .paper { position: absolute; inset: 0; }
  .spread-page::after { display: none; }
  .page-corner { top: 12px; right: 16px; }
  .page-tag { order: 1; margin-top: 14px; }
  .page-h { order: 2; font-size: clamp(22px, 6.4vw, 34px); }
  .page-meta { order: 3; line-height: 1.6; }
  /* the ways to play come right after the credits, before the photo */
  .page-actions { order: 4; margin: 2px 0 20px; gap: 10px; }
  .page-actions .page-button { font-size: 9px; padding: 10px 10px; }
  .page-photo { order: 5; margin: 6px 0 24px; }
  .page-text { order: 6; flex: none; font-size: 18px; margin-bottom: 22px; }
  /* horizontal fold, then the drawing */
  .page-illu {
    order: 7; flex: none; position: relative;
    margin: 0 -20px; padding: 26px 20px 4px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.32) 0, rgba(0,0,0,0.12) 2px, rgba(60,40,20,0.08) 6px, transparent 16px);
    border-top: 1px solid rgba(60, 40, 20, 0.3);
  }
  .has-film .page-illu { flex: none; width: auto; }
  .has-film .page-illu svg, .is-portrait .page-illu svg { width: auto; height: 130px; max-height: none; }
  .album-spread:not(.has-film) .page-illu svg { width: min(70%, 240px); height: auto; }
  .page-caption { order: 8; }
  .page-num { order: 9; position: relative; bottom: auto; right: auto; align-self: center; margin-top: 16px; }
  /* pitches have no footage: drawing first, then the link and the words */
  .album-spread:not(.has-film) .page-illu { order: 4; margin-top: 4px; background: none; border-top: 0; padding-top: 6px; }
  .album-spread:not(.has-film) .page-caption { order: 4; margin-bottom: 22px; }
  .is-portrait .page-photo { width: min(100%, 256px); height: auto; max-height: none; align-self: center; }
  .is-portrait .photo-frame { width: 100%; height: auto; }
  .album-controls { margin-top: 22px; }
  .album-btn, .album-close { min-height: 44px; }
}
@media (max-width: 760px) {
  .photo-frame { aspect-ratio: var(--ar-m, var(--ar, 16 / 9)); }
  .photo-frame.is-full { aspect-ratio: var(--ar, 16 / 9); }     /* the full film keeps its own shape */
  .album-tools { margin-bottom: 28px; }
  .album-tab { font-size: 9px; padding: 12px 10px; }
  .file-index { justify-content: flex-start; padding: 10px; }
}

/* ── contact: PRESS START really toggles, mail fallback always in reach ── */
.contact-form[hidden] { display: none; }
.contact-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.contact-form fieldset[disabled] { opacity: 0.6; }
.cf-legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cf-direct { margin: 36px auto 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 16px; }
.cf-direct .cf-alt { margin: 0; border: 0; background: none; padding: 6px 0; }
.cf-copy { display: none; }
.js .cf-copy { display: inline-flex; }
.cf-copy-status { flex-basis: 100%; margin: 0; border: 0; background: none; padding: 0; min-height: 1.4em; }
.cf-copy-status:empty { display: block; }

/* ── footer ── */
.foot-reel { text-decoration: none; }
.foot-reel:hover { background: var(--accent); color: #0c0a1f; }

@media (prefers-reduced-motion: reduce) {
  .album-tab, .photo-play, .page-button { transition: none; }
  .album-cover-cta { animation: none; }
}

/* ── services on phones: long pixel titles wrap inside their card instead of
   pushing the page wider than the screen ── */
.service > div { min-width: 0; }
@media (max-width: 760px) {
  .service .px-title-sm { font-size: min(4.2vw, 18px); overflow-wrap: break-word; }
}
