/* Theria Reborn: one page in the trailer's palette (the game's dark wood #1c130c, the frame #684828, the level star's
   gold #ecba49, cream text #f0e4c8). Plain colours, no variables, and a plain value before every newer one (min, max,
   clamp, svh, aspect-ratio), so a browser that does not know the newer one still lays the page out. */

@font-face {
  font-family: "Cinzel Decorative";
  src: url("fonts/CinzelDecorative-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: #1c130c; color: #f0e4c8; font-family: Georgia, "Times New Roman", serif;
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
}
main {
  flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 16px 16px;
}

/* The two formats. The radios are visually hidden but stay in the keyboard and screen reader order; their labels
   are the switch. Nothing picked: the device decides (the media queries below). Picked: the pick wins. */
.fmt {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.player { width: 100%; display: flex; flex-direction: column; align-items: center; }
.frame { width: 100%; border: 4px solid #684828; background: #000; line-height: 0; }
.frame video { display: block; width: 100%; height: auto; }
.h video { aspect-ratio: 16 / 9; }
.v video { aspect-ratio: 9 / 16; }

/* Widescreen by default (desktops, laptops, phones on their side, any browser that does not know the queries) */
.h { max-width: 1120px; }
.v {
  display: none;
  max-width: 360px;
  max-width: calc((100vh - 270px) * 9 / 16);
  max-width: max(240px, calc((100vh - 270px) * 9 / 16));
  max-width: max(240px, calc((100svh - 270px) * 9 / 16));
}

.switch { margin-top: 4px; font-size: 16px; letter-spacing: 0.06em; }
.switch label {
  display: inline-block; padding: 12px 6px; cursor: pointer; color: #f0e4c8; opacity: 0.6;
  -webkit-tap-highlight-color: transparent;
}
.switch label span { padding-bottom: 3px; border-bottom: 2px solid transparent; }
@media (hover: hover) { .switch label:hover { opacity: 1; } }
.switch .sep { opacity: 0.4; padding: 0 6px; }
.switch .lh { color: #ecba49; opacity: 1; }
.switch .lh span { border-bottom-color: #ecba49; }

.soon {
  margin: 8px 0 0; text-align: center; font-family: "Cinzel Decorative", Georgia, serif; font-weight: 700;
  color: #ecba49; font-size: 64px; font-size: clamp(40px, 9vw, 96px); letter-spacing: 0.06em;
}
footer { padding: 16px; text-align: center; font-size: 13px; opacity: 0.6; }

/* Phones and tablets (a touch screen, no mouse): the video fits the screen's height with the switch and "Soon..." */
@media (hover: none) and (pointer: coarse) {
  main { padding-top: 16px; }
  .v {
    max-width: calc((100vh - 176px) * 9 / 16);
    max-width: max(200px, calc((100vh - 176px) * 9 / 16));
    max-width: max(200px, calc((100svh - 176px) * 9 / 16));
  }
  .h {
    max-width: calc((100vh - 96px) * 16 / 9);
    max-width: min(1120px, max(320px, calc((100vh - 96px) * 16 / 9)));
    max-width: min(1120px, max(320px, calc((100svh - 96px) * 16 / 9)));
  }
}
/* ... and held upright: vertical by default */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  .v { display: block; }
  .h { display: none; }
  .switch .lv { color: #ecba49; opacity: 1; }
  .switch .lv span { border-bottom-color: #ecba49; }
  .switch .lh { color: #f0e4c8; opacity: 0.6; }
  .switch .lh span { border-bottom-color: transparent; }
}
@media (max-height: 520px) {
  .soon { font-size: 40px; }
}

/* The visitor's pick (after the queries, and more specific, so it always wins) */
#fmt-v:checked ~ .player .v, #fmt-h:checked ~ .player .h { display: block; }
#fmt-v:checked ~ .player .h, #fmt-h:checked ~ .player .v { display: none; }
#fmt-v:checked ~ .player .lv, #fmt-h:checked ~ .player .lh { color: #ecba49; opacity: 1; }
#fmt-v:checked ~ .player .lv span, #fmt-h:checked ~ .player .lh span { border-bottom-color: #ecba49; }
#fmt-v:checked ~ .player .lh, #fmt-h:checked ~ .player .lv { color: #f0e4c8; opacity: 0.6; }
#fmt-v:checked ~ .player .lh span, #fmt-h:checked ~ .player .lv span { border-bottom-color: transparent; }

/* A visible focus ring for the keyboard (a browser without :focus-visible drops the second rule and keeps the ring) */
#fmt-v:focus ~ .player .lv, #fmt-h:focus ~ .player .lh { outline: 2px solid #ecba49; outline-offset: 2px; }
#fmt-v:focus:not(:focus-visible) ~ .player .lv, #fmt-h:focus:not(:focus-visible) ~ .player .lh { outline: none; }
