/* aymandeyaf.com: dark and cinematic, phone first. Green and gold on near-black. */

:root {
  --bg: #0a0c0a;
  --ink: #ece6d6;
  --muted: #a7a08d;
  --gold: #d4af37;
  --gold-soft: #c9a54c;
  --gold-line: rgba(212, 175, 55, 0.28);
  --green: #2f7d3a;
  --green-bright: #3c9a49;
  --red: #a3302c;
  --display: "Cinzel", "Trajan Pro", "Times New Roman", Georgia, serif;
  --serif: "EB Garamond", Garamond, "Palatino Linotype", Georgia, serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --pad: clamp(1rem, 4vw, 2.5rem);
  --max: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--serif);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Film grain over everything, very faint. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

a {
  color: var(--gold);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* A soft green dawn behind the page; once the movie is there, its poster glows through. */
.ambient {
  position: absolute;
  inset: 0 0 auto;
  height: 110vh;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(60% 45% at 50% 0%, rgba(47, 125, 58, 0.22), transparent 70%),
    radial-gradient(40% 30% at 85% 10%, rgba(212, 175, 55, 0.07), transparent 70%);
  overflow: hidden;
}

.ambient::before {
  content: "";
  position: absolute;
  inset: -10%;
  background: var(--poster, none) center 30% / cover no-repeat;
  filter: blur(80px) saturate(1.1);
  opacity: 0.2;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 20%, transparent 78%);
}

/* Top bar */
.topbar {
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 1rem) var(--pad) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--gold-soft);
  text-decoration: none;
  font: 700 0.78rem/1 var(--display);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.brand .emblem {
  width: 28px;
  height: 28px;
}

/* Hero */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.hero {
  text-align: center;
  padding: clamp(2rem, 6vw, 3.5rem) 0 clamp(1.5rem, 3.5vw, 2.25rem);
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--gold-soft);
  font: 500 clamp(0.72rem, 2.2vw, 0.9rem)/1.2 var(--display);
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.title {
  margin: 0;
  font: 800 clamp(2.35rem, 10.4vw, 5.75rem)/0.98 var(--display);
  letter-spacing: 0.035em;
  text-transform: uppercase;
  color: var(--gold);
  background: linear-gradient(180deg, #fbf0c4 0%, #e3c45e 38%, #c39a2f 62%, #8d6c1f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 24px rgba(212, 175, 55, 0.16));
  text-wrap: balance;
}

.tagline {
  margin: 1rem 0 0;
  font: italic 400 clamp(1.2rem, 4vw, 1.7rem)/1.3 var(--serif);
  color: rgba(236, 230, 214, 0.88);
}

.tagline::after {
  content: "";
  display: block;
  width: 72px;
  height: 1px;
  margin: 1.4rem auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* Player */
.player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 0 0 1px var(--gold-line),
    0 30px 80px -24px rgba(0, 0, 0, 0.9),
    0 0 140px -40px rgba(47, 125, 58, 0.55);
  -webkit-tap-highlight-color: transparent;
}

.player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.player:fullscreen,
.player:-webkit-full-screen {
  border-radius: 0;
  box-shadow: none;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

/* A vignette behind the big play button so it stands out on any poster. */
.player::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.1) 30%, rgba(0, 0, 0, 0.55) 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.player[data-state="ready"]::after,
.player[data-state="ended"]::after {
  opacity: 1;
}

.bigplay,
.spinner,
.soon,
.message,
.controls {
  position: absolute;
  z-index: 2;
}

.bigplay {
  inset: 0;
  margin: auto;
  width: max-content;
  height: max-content;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}

.bigplay svg {
  width: clamp(64px, 14vw, 96px);
  height: clamp(64px, 14vw, 96px);
  padding: clamp(16px, 3.4vw, 24px);
  border-radius: 50%;
  fill: #fff8e6;
  background: radial-gradient(circle at 35% 30%, var(--green-bright), var(--green) 55%, #1d5225);
  box-shadow:
    0 0 0 2px var(--gold),
    0 0 0 7px rgba(212, 175, 55, 0.18),
    0 12px 40px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(47, 125, 58, 0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bigplay .i-play {
  transform: translateX(1px);
}

.bigplay .i-replay,
.player[data-state="ended"] .bigplay .i-play {
  display: none;
}

.player[data-state="ended"] .bigplay .i-replay {
  display: inline;
}

.bigplay:hover svg,
.bigplay:focus-visible svg {
  transform: scale(1.06);
  box-shadow:
    0 0 0 2px var(--gold),
    0 0 0 9px rgba(212, 175, 55, 0.24),
    0 12px 40px rgba(0, 0, 0, 0.6),
    0 0 80px rgba(60, 154, 73, 0.7);
}

.bigplay:focus-visible {
  outline: none;
}

.bigplay-label {
  font: 700 clamp(0.68rem, 2vw, 0.82rem)/1 var(--display);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.player[data-state="ready"] .bigplay,
.player[data-state="paused"] .bigplay,
.player[data-state="ended"] .bigplay {
  display: flex;
}

.player[data-state="paused"] .bigplay-label {
  display: none;
}

/* Loading spinner (while the movie buffers) */
.spinner {
  inset: 0;
  margin: auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid rgba(212, 175, 55, 0.2);
  border-top-color: var(--gold);
  animation: spin 0.9s linear infinite;
  display: none;
  pointer-events: none;
}

.player.is-waiting .spinner {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Premiering soon (no movie yet) */
.soon {
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  background:
    radial-gradient(55% 60% at 50% 45%, rgba(47, 125, 58, 0.28), transparent 75%),
    linear-gradient(180deg, #0d120d, #050605);
}

.player[data-state="soon"] .soon {
  display: flex;
}

.player[data-state="soon"] video,
.player[data-state="error"] video {
  visibility: hidden;
}

.soon-emblem {
  width: clamp(52px, 12vw, 84px);
  height: clamp(52px, 12vw, 84px);
  margin-bottom: clamp(0.6rem, 2.5vw, 1.2rem);
  filter: drop-shadow(0 0 24px rgba(47, 125, 58, 0.6));
  animation: sway 6s ease-in-out infinite;
  transform-origin: 23% 85%;
}

@keyframes sway {
  50% {
    transform: rotate(-3deg);
  }
}

.soon-title {
  margin: 0;
  color: var(--gold);
  font: 700 clamp(1.05rem, 4.2vw, 1.9rem)/1.1 var(--display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.soon-text {
  max-width: 30ch;
  margin: clamp(0.4rem, 1.6vw, 0.8rem) 0 0;
  color: var(--muted);
  font: italic 400 clamp(0.95rem, 2.8vw, 1.2rem)/1.4 var(--serif);
  text-wrap: balance;
}

/* Error message */
.message {
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  text-align: center;
  background: #070807;
}

.player[data-state="error"] .message {
  display: flex;
}

.message p {
  margin: 0;
  max-width: 34ch;
}

.retry {
  padding: 0.6rem 1.3rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: transparent;
  color: var(--gold);
  font: 700 0.75rem/1 var(--display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}

.noscript {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  margin: 0;
  background: #070807;
}

/* Control bar */
.controls {
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  align-items: center;
  gap: clamp(0.15rem, 1vw, 0.5rem);
  padding: 2.2rem clamp(0.4rem, 1.6vw, 0.9rem) clamp(0.3rem, 1.2vw, 0.6rem);
  padding-bottom: max(clamp(0.3rem, 1.2vw, 0.6rem), env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.78));
  color: var(--ink);
  font: 500 0.8rem/1 var(--ui);
  transition: opacity 0.25s;
}

.player[data-state="playing"] .controls,
.player[data-state="paused"] .controls {
  display: flex;
}

.player.idle .controls {
  opacity: 0;
  pointer-events: none;
}

.player.idle {
  cursor: none;
}

.ctl {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.35rem;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  cursor: pointer;
}

.ctl svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

#btn-fullscreen svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ctl:hover {
  color: var(--gold);
}

.ctl .i-pause,
.player[data-state="playing"] .ctl .i-play,
.ctl .i-muted,
.player.is-muted .ctl .i-sound,
.ctl .i-exit,
.player.is-fullscreen .ctl .i-enter {
  display: none;
}

.player[data-state="playing"] .ctl .i-pause,
.player.is-muted .ctl .i-muted,
.player.is-fullscreen .ctl .i-exit {
  display: inline;
}

.time {
  flex: none;
  min-width: 2.6em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}

/* Sliders: gold for what's played, lighter for what's loaded. */
.player input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 28px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.seek {
  flex: 1 1 auto;
  min-width: 40px;
}

.volume {
  flex: none;
  width: 72px;
}

.player input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right,
      var(--gold) 0 var(--p, 0%),
      rgba(255, 255, 255, 0.42) var(--p, 0%) var(--b, 0%),
      rgba(255, 255, 255, 0.18) var(--b, 0%) 100%);
}

.player input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right,
      var(--gold) 0 var(--p, 0%),
      rgba(255, 255, 255, 0.42) var(--p, 0%) var(--b, 0%),
      rgba(255, 255, 255, 0.18) var(--b, 0%) 100%);
}

.player input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.22);
}

.player input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.22);
}

/* Quality menu (shown where hls.js plays the movie; Safari picks quality itself) */
.quality {
  position: relative;
  flex: none;
}

.quality[hidden] {
  display: none;
}

.quality-btn {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font: 700 0.72rem/1 var(--ui);
  letter-spacing: 0.04em;
  border: 1px solid rgba(236, 230, 214, 0.35);
  height: 26px;
  padding: 0 0.5rem;
}

.quality-mode:not(:empty)::after {
  content: "\00a0\00b7\00a0";
}

.quality-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  min-width: 10.5rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border: 1px solid var(--gold-line);
  border-radius: 10px;
  background: rgba(8, 10, 8, 0.96);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.quality-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink);
  font: 500 0.85rem/1 var(--ui);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.quality-menu button:hover,
.quality-menu button:focus-visible {
  background: rgba(212, 175, 55, 0.12);
  outline: none;
}

.quality-menu button[aria-checked="true"] {
  color: var(--gold);
}

.quality-menu button[aria-checked="true"]::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.quality-menu small {
  color: var(--muted);
  font-size: 0.75rem;
}

/* Touch screens: no volume slider (phones use their buttons) and tap targets stay big. */
@media (hover: none) {
  .volume {
    display: none;
  }
}

/* Facts under the player */
.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 0;
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font: 500 clamp(0.64rem, 1.9vw, 0.74rem)/1.4 var(--display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.facts li + li::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 0.9em 0.18em;
  transform: rotate(45deg);
  background: var(--gold);
  opacity: 0.75;
}

/* The story */
.story {
  max-width: 44rem;
  margin: clamp(3rem, 9vw, 5.5rem) auto 0;
}

.story h2 {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.4rem;
  color: var(--gold);
  font: 700 clamp(0.8rem, 2.4vw, 0.95rem)/1 var(--display);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.story h2::before,
.story h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line));
}

.story h2::after {
  background: linear-gradient(90deg, var(--gold-line), transparent);
}

.story p {
  margin: 0 0 1rem;
  font-size: clamp(1.08rem, 3.2vw, 1.25rem);
  line-height: 1.65;
  color: rgba(236, 230, 214, 0.9);
}

.story > p:first-of-type::first-letter {
  float: left;
  margin: 0.08em 0.12em 0 0;
  color: var(--gold);
  font: 700 3.3em/0.8 var(--display);
}

.story-last {
  font-style: italic;
  color: var(--gold-soft) !important;
}

.sides {
  display: grid;
  gap: 1rem;
  margin-top: 2.4rem;
}

@media (min-width: 640px) {
  .sides {
    grid-template-columns: 1fr 1fr;
  }
}

.side {
  padding: 1.2rem 1.3rem 1.1rem;
  border: 1px solid rgba(236, 230, 214, 0.08);
  border-top: 3px solid var(--green);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(47, 125, 58, 0.1), rgba(255, 255, 255, 0.015) 60%);
}

.side-red {
  border-top-color: var(--red);
  background: linear-gradient(180deg, rgba(163, 48, 44, 0.1), rgba(255, 255, 255, 0.015) 60%);
}

.side h3 {
  margin: 0 0 0.8rem;
  font: 700 0.85rem/1 var(--display);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #8fd19a;
}

.side-red h3 {
  color: #e08a83;
}

.side dl {
  margin: 0;
}

.side dt {
  font: 600 0.95rem/1.3 var(--display);
  letter-spacing: 0.04em;
}

.side dd {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.35;
}

.side dd:last-child {
  margin-bottom: 0;
}

/* Footer */
.footer {
  max-width: var(--max);
  margin: clamp(3.5rem, 9vw, 6rem) auto 0;
  padding: 1.6rem var(--pad) calc(env(safe-area-inset-bottom) + 2rem);
  border-top: 1px solid rgba(212, 175, 55, 0.14);
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer p {
  margin: 0;
}

.footer-title {
  color: var(--gold-soft);
  font: 700 0.8rem/1 var(--display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* 404 page */
.lost {
  min-height: 70vh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 3rem 0;
}

.lost .emblem {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.2rem;
  transform: rotate(-12deg);
  opacity: 0.85;
}

.lost h1 {
  margin: 0;
  color: var(--gold);
  font: 800 clamp(1.6rem, 7vw, 3rem)/1.1 var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lost p {
  margin: 0.8rem 0 1.8rem;
  color: var(--muted);
  font-style: italic;
  font-size: 1.2rem;
}

.lost .home {
  justify-self: center;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  text-decoration: none;
  font: 700 0.78rem/1 var(--display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.lost .home:hover {
  background: rgba(212, 175, 55, 0.1);
}

/* Phones: the player runs edge to edge. */
@media (max-width: 600px) {
  .player {
    width: auto;
    margin: 0 calc(-1 * var(--pad));
    border-radius: 0;
    box-shadow:
      0 -1px 0 var(--gold-line),
      0 1px 0 var(--gold-line),
      0 0 120px -40px rgba(47, 125, 58, 0.55);
  }

  .ctl {
    min-width: 36px;
  }

  .time {
    font-size: 0.75rem;
  }

  .facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem 0.5rem;
    text-align: center;
  }

  .facts li + li::before {
    display: none;
  }
}

/* Small phones: room for the seek bar first. */
@media (max-width: 480px) {
  #time-total,
  .quality-mode {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .spinner {
    animation: spin 1.6s linear infinite !important;
  }
}
