/* max3d.xyz, round 2 (2026-11-12): a film stage and a few lines under it */
:root {
  --linen: #f3ede2;
  --paper: #fbf8f2;
  --ink: #2a2420;
  --ink-soft: #5d544c;
  --red: #b81d29;
  --mat: #184a40;
  --mat-deep: #0f352e;
  --gold: #8a5d00;
  --line: #d9cfbf;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --round: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--mat-deep); color: var(--ink); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--linen); color: var(--ink); font-family: var(--serif); font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #0b57d0; outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: var(--space-2); top: -4rem; z-index: 10; background: var(--paper); color: var(--ink); padding: 0.6rem 1rem; border-radius: 0.5rem; font-family: var(--round); }
.skip:focus { top: var(--space-2); }

/* ---- the stage */
.stage { position: relative; height: 100vh; height: 100svh; min-height: 22rem; background: var(--mat-deep); overflow: hidden; }
.poster, .poster img { position: absolute; inset: 0; width: 100%; height: 100%; }
.poster img { object-fit: cover; }
#film { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 0.4s ease-out; cursor: pointer; touch-action: pan-y; }
.stage.live #film { opacity: 1; }
.stage.nofilm #film { display: none; }

.controls { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: var(--space-1);
  padding: var(--space-2) max(var(--space-2), env(safe-area-inset-right)) calc(var(--space-2) + env(safe-area-inset-bottom)) max(var(--space-2), env(safe-area-inset-left)); pointer-events: none; }
.controls[hidden] { display: none; }
.btn { pointer-events: auto; display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-width: 2.75rem; height: 2.75rem; padding: 0 0.8rem;
  border: 0; border-radius: 1.4rem; background: rgb(18 30 27 / 0.62); color: #fff; font: 600 0.9375rem/1 var(--round); cursor: pointer; transition: background-color 0.15s ease-out; }
.btn:hover { background: rgb(18 30 27 / 0.86); }
.btn svg { width: 1.1rem; height: 1.1rem; flex: none; }
#play .i-play { display: none; }
#play.paused .i-play { display: block; }
#play.paused .i-pause { display: none; }
#sound .i-on { display: none; }
#sound[aria-pressed="true"] .i-on { display: block; }
#sound[aria-pressed="true"] .i-off { display: none; }
.scrub { pointer-events: auto; flex: 1; min-width: 4rem; height: 2.75rem; margin: 0 var(--space-1); background: transparent; -webkit-appearance: none; appearance: none; opacity: 0; transition: opacity 0.2s ease-out; cursor: pointer; }
.stage:hover .scrub, .controls:focus-within .scrub { opacity: 1; }
@media (hover: none) { .scrub { opacity: 0.85; } }
.scrub::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: rgb(255 255 255 / 0.75); box-shadow: 0 0 0 1px rgb(18 30 27 / 0.35); }
.scrub::-moz-range-track { height: 3px; border-radius: 2px; background: rgb(255 255 255 / 0.75); box-shadow: 0 0 0 1px rgb(18 30 27 / 0.35); }
.scrub::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-top: -6.5px; border-radius: 50%; background: #fff; border: 2px solid var(--red); }
.scrub::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--red); }
.more { pointer-events: auto; display: inline-flex; align-items: center; height: 2.75rem; padding: 0 1rem; border-radius: 1.4rem; background: rgb(18 30 27 / 0.62); color: #fff; font: 600 0.9375rem/1 var(--round); text-decoration: none; white-space: nowrap; }
.more:hover { background: rgb(18 30 27 / 0.86); }

/* ---- the story */
/* the text is a panel of its own, one screen high: at the end of the page the film is out of view and sleeps */
.story { max-width: 46rem; margin: 0 auto; min-height: 100vh; min-height: 100svh; display: grid; align-content: center; padding: var(--space-5) max(1.25rem, env(safe-area-inset-right)) var(--space-5) max(1.25rem, env(safe-area-inset-left)); }
h1 { font-family: var(--round); line-height: 1.15; letter-spacing: -0.01em; margin: 0; text-wrap: balance; font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem); font-weight: 800; }
h1 em { font-style: normal; color: var(--red); }
p { margin: var(--space-2) 0 0; max-width: 40rem; }
.intro { font-size: 1.15em; }
.try { padding: 0; margin: var(--space-3) 0 0; list-style: none; display: grid; gap: 0.6rem; max-width: 40rem; }
.try li { padding-left: 1.6rem; position: relative; }
.try li::before { content: ""; position: absolute; left: 0.1rem; top: 0.55em; width: 0.8rem; height: 0.72rem; background: var(--red);
  clip-path: polygon(50% 100%, 3% 42%, 3% 20%, 18% 4%, 36% 4%, 50% 20%, 64% 4%, 82% 4%, 97% 20%, 97% 42%); }
kbd { font: 600 0.85em/1 var(--round); background: var(--paper); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 0.35rem; padding: 0.15em 0.45em; }

footer { background: var(--mat); color: #e9f1ee; font-family: var(--round); font-size: 0.9375rem; }
footer .in { max-width: 70rem; margin: 0 auto; padding: var(--space-4) max(1.25rem, env(safe-area-inset-right)) calc(var(--space-4) + env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left)); display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); justify-content: space-between; }
footer p { margin: 0; max-width: none; }
footer a { color: #fff; }

.lost { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; text-align: center; padding: var(--space-4) 1.25rem; }
.lost p { margin-left: auto; margin-right: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .stage { height: auto; min-height: 0; background: none; }
  .poster, .poster img { position: static; }
  #film, .controls, .skip { display: none !important; }
  body { background: #fff; }
}
