.skip-link { position:absolute; left:16px; top:-100px; z-index:100; background:var(--ink); color:var(--paper); padding:12px; }
.skip-link:focus { top:8px; }
button,a,input { outline-offset:4px; }
button:focus-visible,a:focus-visible,input:focus-visible { outline:3px solid var(--accent); }
button:disabled { cursor:not-allowed; }
.site-footer { max-width:1320px; min-height:64px; margin:0 auto; padding:14px 32px; display:flex; align-items:center; justify-content:space-between; gap:16px; font-size:12px; }
body:not([data-view=home]) { --page-gutter:clamp(20px,3vw,32px); }
body:not([data-view=home]) .site-shell { min-height:100svh; display:flex; flex-direction:column; overflow:visible; }
body:not([data-view=home]) .site-header { width:100%; max-width:1208px; height:clamp(56px,8svh,80px); padding-inline:var(--page-gutter); flex-shrink:0; }
body:not([data-view=home]) .site-shell>main { min-width:0; flex:1; display:flex; flex-direction:column; }
body:not([data-view=home]) .site-footer { width:100%; max-width:1208px; padding:10px var(--page-gutter); flex-shrink:0; }
#error-scene a { color:var(--accent); font-weight:700; text-decoration-thickness:2px; text-underline-offset:4px; }
.not-found a { color:var(--button-ink); font-weight:700; text-decoration-thickness:2px; text-underline-offset:4px; }
.nav-button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:9px 15px; border:2px solid var(--ink); border-radius:4px; background:var(--secondary); color:var(--accent); font-size:13px; font-weight:700; text-decoration:none; }
.nav-button:hover { background:var(--paper); }
.nav-button svg { width:18px; height:18px; }
.character,.character img { background:transparent; }
.character img { max-width:100%; height:auto; }
.hero-copy,.search-area { min-width:0; }
body:not([data-view=home]) .marquee { display:none; }
body[data-view=results] .hero { width:100%; display:block; min-height:0; padding:16px var(--page-gutter) 12px; max-width:1208px; }
body[data-view=results] .hero-copy,body[data-view=results] .mascot-scene,body[data-view=results] .scene-stamp,body[data-view=results] .background-word { display:none; }
body[data-view=results] .search-area { position:static; width:100%; max-width:760px; margin:0 auto; }
body[data-view=results] .search-help { margin-top:12px; }
body[data-view=film] .hero { display:none; }
.response-section { width:100%; scroll-margin-top:20px; min-height:0; margin:0 auto; padding:0 var(--page-gutter,32px) 20px; flex:1; display:grid; grid-template-columns:minmax(0,1fr); align-content:start; }
.response-section:has(>.empty-scene:not([hidden])),.response-section:has(>.loading-scene:not([hidden])) { align-content:center; }
.results-heading { padding:16px 0; }
.results-heading p { margin:0; }
#movie-results { grid-template-columns:repeat(4,minmax(0,1fr)); grid-auto-rows:1px; column-gap:16px; row-gap:0; align-items:start; }
.movie-item { display:block; width:100%; min-width:0; height:max-content; padding:0; text-decoration:none; }
.movie-item>div { padding:12px 13px; }
.movie-item h3 { margin:0 0 8px; font-size:22px; line-height:1.4; overflow-wrap:anywhere; }
.movie-item img { display:block; width:100%; height:auto; aspect-ratio:auto 2/3; object-fit:contain; max-width:100%; border-bottom:2px solid var(--ink); }
.movie-item .cover-missing { object-fit:contain; }
#search-notice { padding:12px 16px; border:2px solid var(--ink); background:var(--secondary); line-height:1.6; }
.results-feed { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:12px; padding:16px 0 4px; }
#results-status { margin:0; color:var(--muted); font-size:12px; line-height:1.7; text-align:center; }
#results-sentinel { height:1px; }
.back-to-top { position:fixed; z-index:30; right:max(16px,env(safe-area-inset-right)); bottom:max(18px,env(safe-area-inset-bottom)); display:flex; flex-direction:column; align-items:center; justify-content:center; width:56px; height:56px; padding:5px; border:2px solid var(--ink); border-radius:50%; background:var(--paper); color:var(--ink); box-shadow:3px 4px 0 var(--ink); font-size:10px; font-weight:900; }
.back-to-top svg { width:22px; height:22px; transform:rotate(-90deg); }
.back-to-top:hover { background:var(--secondary); }
.film-heading { display:flex; align-items:center; gap:20px; padding-top:8px; }
.film-heading .nav-button { flex-shrink:0; }
#film-title { min-width:0; margin:0; font-size:clamp(22px,2.3vw,30px); overflow-wrap:anywhere; }
#film-description { max-width:72ch; margin:0; white-space:pre-line; line-height:1.8; overflow-wrap:anywhere; }
/* The video keeps its ratio; a height-aware width leaves room for navigation and feedback. */
.watch-layout { display:grid; grid-template-columns:minmax(0,1fr) 300px; align-items:stretch; gap:20px; width:min(100%,calc(max(220px,100svh - 352px) * 16 / 9 + 326px)); margin:16px auto 0; }
.watch-layout>* { min-width:0; }
.player-stage,.watch-sidebar { border:3px solid var(--ink); background:var(--paper); box-shadow:8px 8px 0 var(--ink); }
.player-stage { overflow:hidden; }
.watch-sidebar { min-height:0; contain:size; display:grid; grid-template-rows:minmax(144px,1fr) minmax(96px,.7fr); }
.watch-intro { min-width:0; min-height:0; padding:14px 16px; border-top:3px solid var(--ink); overflow:auto; overscroll-behavior:contain; scrollbar-color:var(--ink) var(--paper); }
.watch-intro:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.player-masthead { min-height:54px; padding:9px 15px; display:flex; align-items:center; justify-content:space-between; gap:12px; border-bottom:3px solid var(--ink); background:var(--paper); }
.player-masthead>span { display:flex; align-items:center; gap:10px; font-size:14px; font-weight:900; white-space:nowrap; }
.player-masthead small { padding:3px 7px; color:var(--paper); background:var(--ink); font-size:9px; letter-spacing:.08em; transform:rotate(-3deg); }
.player-masthead strong { font-size:13px; text-align:right; }
.artplayer-host { position:relative; container-type:inline-size; width:100%; aspect-ratio:16/9; min-height:220px; overflow:hidden; background:#11120f; }
.artplayer-host .art-video-player { width:100%; height:100%; --art-theme:var(--paper); --art-border-radius:0; --art-padding:16px; --art-control-height:46px; --art-control-icon-size:32px; --art-control-opacity:.94; --art-settings-max-height:calc(100% - var(--art-control-height) - 8px); }
/* Comic site SVG rules must not add outlines to ArtPlayer's filled icons. */
.artplayer-host svg { fill:currentColor; stroke:none; stroke-width:0; }
.artplayer-host .art-icon svg { width:100%; height:100%; }
.artplayer-host .art-state .art-icon { width:100%; height:100%; }
.artplayer-host .art-controls,.artplayer-host .art-settings { font-weight:400; }
@container (max-width:400px) {
  .artplayer-host .art-video-player,.artplayer-host .art-video-player.art-mobile { --art-padding:8px; --art-control-height:44px; --art-control-icon-size:30px; }
  .artplayer-host .art-controls .art-controls-left { min-width:0; flex:1; }
  .artplayer-host .art-controls .art-control-time { min-width:0; flex-shrink:1; white-space:normal; text-align:center; font-size:11px; line-height:1.3; padding-inline:4px!important; }
}
.player-feedback { min-height:46px; padding:8px 14px; display:flex; align-items:center; justify-content:space-between; gap:12px; border-top:2px solid var(--ink); background:var(--secondary); }
#player-status { margin:0; min-height:1.6em; line-height:1.6; }
#retry-player { flex-shrink:0; min-height:44px; padding:7px 13px; border:2px solid var(--ink); background:var(--paper); font-weight:800; }
.episode-reel { min-height:0; display:flex; flex-direction:column; padding:14px 12px 10px; background:var(--paper); }
.episode-reel-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:8px; }
.episode-reel-head h3 { margin:0 0 2px; font-size:25px; }
.episode-reel-head p { margin:0; color:var(--muted); font-size:12px; }
#next-episode { flex-shrink:0; display:flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:7px 13px; border:2px solid var(--ink); background:var(--ink); color:var(--paper); font-weight:800; }
#next-episode svg { width:18px; height:18px; }
#next-episode:disabled { opacity:.48; }
.episode-grid { min-height:0; display:grid; grid-template-columns:repeat(auto-fill,minmax(64px,1fr)); align-content:start; gap:9px; overflow:auto; overscroll-behavior:contain; padding:8px 5px 13px; scrollbar-color:var(--ink) var(--paper); }
.episode-grid button { min-width:44px; min-height:46px; border:2px solid var(--ink); background:var(--secondary); box-shadow:3px 3px 0 var(--ink); font-weight:900; line-height:1.35; overflow-wrap:anywhere; transform:skew(-4deg); transition:transform .16s ease,background-color .16s ease,color .16s ease; }
.episode-grid button:nth-child(even) { transform:skew(-4deg) translateY(3px); }
.episode-grid button:hover { transform:skew(-4deg) translateY(-2px); }
.episode-grid button[aria-pressed=true] { background:var(--accent); color:var(--button-ink); border-color:var(--ink); box-shadow:3px 3px 0 var(--ink), inset 0 0 0 2px var(--paper); }
.empty-scene { gap:32px; padding:12px 0; }
.empty-scene>div { min-width:0; max-width:560px; }
.empty-scene p { margin:12px 0 16px; line-height:1.8; overflow-wrap:anywhere; }
.empty-scene>img { max-width:32%; max-height:clamp(112px,24svh,220px); width:auto; height:auto; }
.scene-actions { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
#error-scene a { display:inline-flex; align-items:center; min-height:44px; margin:0; padding:10px 8px; color:var(--accent); text-underline-offset:4px; }
.loading-scene { padding:12px 0; }
.run-lane { height:clamp(96px,24svh,210px); }
.run-lane img { width:auto; height:calc(100% - 16px); left:50%; bottom:8px; transform:translateX(-50%); }
.loading-scene p { margin:12px 0 0; }
.static-loader { display:none; }
.animated-loader { display:block; }
body[data-motion=paused] .animated-loader { display:none; }
body[data-motion=paused] .static-loader { display:block; }
.character img { animation:bean-sway 2.4s ease-in-out infinite; transform-origin:50% 86%; }
body[data-motion=paused] .character img { animation:none; }
@keyframes bean-sway { 0%,100% { transform:rotate(-2deg); } 50% { transform:rotate(2deg); } }
.bean-burst { position:absolute; top:38%; left:64%; font-family:var(--title); font-size:48px; color:var(--ink); pointer-events:none; }
.not-found { min-height:100svh; max-width:1000px; margin:auto; padding:clamp(16px,4svh,48px) 24px; display:grid; grid-template-columns:minmax(120px,.8fr) minmax(0,1.2fr); align-content:center; align-items:center; justify-items:start; column-gap:32px; row-gap:16px; }
.not-found img { grid-column:1; grid-row:1/4; width:100%; max-width:260px; max-height:66svh; object-fit:contain; justify-self:center; }
.not-found h1 { font-size:clamp(44px,9vw,80px); }
.not-found p { margin:0; }
@media (max-width:959px) {
  #movie-results { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .watch-layout { width:100%; grid-template-columns:minmax(0,1fr); gap:16px; }
  .watch-sidebar { contain:none; grid-template-rows:auto; grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  .watch-intro { border-top:0; border-left:3px solid var(--ink); max-height:240px; }
  .episode-grid { max-height:176px; }
}
@media (max-width:760px) {
  .site-footer { min-height:58px; padding:10px 22px; font-size:11px; }
  .site-header { padding:0 23px; }
  body:not([data-view=home]) .site-footer { padding-block:8px; }
  .response-section { margin-top:0; }
  .film-heading { gap:12px; flex-wrap:wrap; }
  #film-title { flex:1; }
  .player-stage,.watch-sidebar { box-shadow:4px 4px 0 var(--ink); }
  .player-masthead { flex-wrap:wrap; gap:5px 12px; padding:9px 11px; }
  .player-masthead strong { text-align:left; }
  .artplayer-host { min-height:200px; }
  .episode-reel { padding:13px 11px 10px; }
  .episode-grid { gap:8px; }
  .episode-grid button { min-height:44px; }
  .episode-reel-head h3 { font-size:22px; }
  .results-heading { display:flex; align-items:baseline; gap:8px 16px; flex-wrap:wrap; }
  .search-form input { width:0; flex:1; min-width:0; }
  .empty-scene { flex-direction:column; gap:12px; padding:8px 0; }
  .empty-scene>img { max-width:100%; max-height:clamp(96px,20svh,180px); }
  .empty-scene p { margin:8px 0 12px; }
  .scene-actions { justify-content:center; }
  .search-help { flex-wrap:wrap; gap:8px; }
}
@media (max-width:599px) {
  #movie-results { grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:12px; }
  .movie-item>div { padding:10px; }
  .movie-item h3 { font-size:18px; }
  .watch-sidebar { grid-template-columns:minmax(0,1fr); }
  .watch-intro { border-left:0; border-top:3px solid var(--ink); max-height:none; overflow:visible; overscroll-behavior:auto; }
  .not-found { display:flex; flex-direction:column; justify-content:center; text-align:center; }
  .not-found img { width:auto; max-width:70vw; max-height:36svh; }
}
@media (min-width:600px) and (max-height:600px) {
  body:not([data-view=home]) .site-header { height:52px; }
  body:not([data-view=home]) .site-footer { min-height:52px; padding-block:4px; }
  body[data-view=results] .hero { padding-block:8px; }
  body[data-view=results] .search-area { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:24px; }
  body[data-view=results] .search-help { flex-direction:column; margin:0; gap:8px; }
  .empty-scene { flex-direction:row; gap:24px; padding:0; text-align:left; }
  .empty-scene p { margin:8px 0 12px; }
  .empty-scene>img { max-width:28%; max-height:40svh; }
  .scene-actions { justify-content:flex-start; }
  .loading-scene { display:grid; grid-template-columns:minmax(96px,180px) minmax(0,1fr); align-items:center; text-align:left; gap:12px 24px; padding-block:8px; }
  .loading-scene .run-lane { grid-row:1/3; height:40svh; }
  .loading-scene p { margin:0; }
}
/* Fit the home composition to the viewport, rather than clipping a tall hero. */
body[data-view=home] .site-shell { height:100svh; display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:clamp(64px,10svh,90px) minmax(0,1fr) 70px; }
body[data-view=home] .site-header { width:100%; height:100%; }
body[data-view=home] main { min-width:0; min-height:0; display:flex; flex-direction:column; padding-bottom:12px; }
body[data-view=home] .hero { flex:1; width:100%; min-height:0; padding:clamp(12px,3svh,36px) clamp(35px,6.5vw,86px); grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; }
body[data-view=home] .hero-copy { align-self:center; }
body[data-view=home] .hero h1 { font-size:clamp(60px,min(10.5svh,7vw),96px); }
body[data-view=home] .intro { margin-top:clamp(12px,2svh,24px); }
body[data-view=home] .mascot-scene { height:100%; min-height:0; max-height:530px; }
body[data-view=home] .character { width:min(335px,38svh); max-width:83%; }
body[data-view=home] .search-area { margin-top:20px; }
body[data-view=home] .search-help { margin-top:16px; }
body[data-view=home] .marquee { flex-shrink:0; }
body[data-view=home] .site-footer { width:100%; min-height:0; }
@media (max-width:760px) {
  body[data-view=home] .site-shell { grid-template-rows:clamp(54px,8svh,72px) minmax(0,1fr) 66px; }
  body[data-view=home] .hero { padding:12px 23px 24px; }
  body[data-view=home] .hero h1 { font-size:clamp(48px,9svh,76px); }
  body[data-view=home] .subtitle { margin-top:16px; }
  body[data-view=home] .intro { margin-top:16px; }
  body[data-view=home] .mascot-scene { top:clamp(116px,22svh,200px); height:clamp(153px,27svh,270px); width:56%; }
  body[data-view=home] .character { width:min(205px,27svh); }
  body[data-view=home] .search-area { bottom:40px; margin:0; }
  body[data-view=home] .search-help { margin-top:14px; }
  body[data-view=home] .scene-stamp { bottom:160px; }
  body[data-view=home] .background-word { top:45%; }
  body[data-view=home] .site-footer { padding:9px 18px; gap:10px; }
  body[data-view=home] .site-footer .nav-button { flex-shrink:0; padding:9px 11px; font-size:12px; }
}
@media (max-width:760px) and (max-height:720px) {
  body[data-view=home] .scene-stamp { display:none; }
}
@media (max-height:600px) and (min-width:761px) {
  body[data-view=home] .site-shell { grid-template-rows:50px minmax(0,1fr) 56px; }
  body[data-view=home] .hero { padding:8px 45px 12px; }
  body[data-view=home] .hero h1 { font-size:46px; }
  body[data-view=home] .title-two { margin-top:3px; }
  body[data-view=home] .subtitle { margin-top:10px; padding:4px 12px; font-size:12px; }
  body[data-view=home] .intro { display:none; }
  body[data-view=home] .search-area { margin-top:12px; width:510px; }
  body[data-view=home] .search-form { height:54px; }
  body[data-view=home] .search-help { margin-top:12px; font-size:10px; }
  body[data-view=home] .character { width:150px; left:30%; }
  body[data-view=home] .speech { font-size:11px; padding:8px 12px; }
  body[data-view=home] .orbit { width:210px; height:180px; top:20px; left:20%; }
  body[data-view=home] .orbit-two { height:140px; }
  body[data-view=home] .marquee { height:30px; }
  body[data-view=home] .scene-stamp { display:none; }
}
@media (prefers-reduced-motion:reduce) {
  .character img { animation:none; }
  .run-lane .animated-loader { display:none; }
  .run-lane .static-loader { display:block; }
  html { scroll-behavior:auto; }
  *,*:before,*:after { transition:none!important; }
}
