:root {
  color-scheme: light;
  --cream: #f4f1e9;
  --paper: #fffdf8;
  --ink: #0f2426;
  --ink-soft: #526163;
  --line: #d9d6cf;
  --teal: #18b2b6;
  --teal-dark: #0d7e82;
  --danger: #b33a3a;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="range"] {
  cursor: pointer;
}

.site-header,
.player-main,
.site-footer {
  width: min(100% - 40px, 1180px);
  margin-inline: auto;
}

.site-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
}

.brand img {
  display: block;
  width: 174px;
  height: auto;
}

.brand:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--teal) 55%, transparent);
  outline-offset: 3px;
}

.access-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.access-label span,
.video-meta i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgb(24 178 182 / 12%);
}

.text-button {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.text-button:hover {
  color: var(--ink);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-footer {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
}

.site-footer span:first-child {
  color: var(--ink);
  font-weight: 750;
}

/* Access */
.access-page {
  background: var(--cream);
}

.site-header--plain {
  width: min(100% - 40px, 1180px);
}

.access-main {
  width: min(100% - 32px, 440px);
  margin: auto;
  padding-block: 56px;
}

.access-panel {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 20px 50px -40px rgb(15 36 38 / 40%);
}

.access-panel h1 {
  margin: 0;
  font-size: clamp(32px, 8vw, 42px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.access-copy {
  margin: 17px 0 28px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.55;
}

.access-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.key-field {
  position: relative;
}

.key-field input {
  width: 100%;
  min-height: 50px;
  padding: 0 96px 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink);
  font-size: 16px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.key-field input:hover {
  border-color: color-mix(in srgb, var(--ink) 30%, var(--line));
}

.key-field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgb(24 178 182 / 12%);
  outline: 0;
}

.reveal-button {
  position: absolute;
  top: 5px;
  right: 5px;
  min-height: 40px;
  padding-inline: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.reveal-button:hover {
  background: rgb(15 36 38 / 5%);
  color: var(--ink);
}

.form-error {
  min-height: 20px;
  margin: 7px 2px 3px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.45;
}

.primary-button {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 7px;
  background: var(--ink);
  color: var(--cream);
  font-size: 15px;
  font-weight: 720;
  transition: background-color 150ms ease, transform 150ms ease;
}

.primary-button:hover:not(:disabled) {
  background: #193638;
}

.primary-button:active:not(:disabled) {
  transform: translateY(1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgb(244 241 233 / 35%);
  border-top-color: var(--cream);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.primary-button.is-pending .button-spinner {
  display: block;
}

/* Player */
.player-main {
  flex: 1;
  padding-block: clamp(34px, 5vw, 62px) 48px;
}

.player-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  align-items: end;
  gap: 40px;
  margin-bottom: 28px;
}

.player-intro h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.player-description {
  margin: 0 0 4px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.55;
}

.player-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid rgb(15 36 38 / 18%);
  border-radius: 16px;
  background: #071719;
  box-shadow: 0 26px 64px -42px rgb(15 36 38 / 65%);
  isolation: isolate;
}

.player-shell video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #071719;
}

.loading-state {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  overflow: hidden;
  background: #0c2022;
  color: rgb(244 241 233 / 78%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.loading-state::after {
  content: "";
  position: absolute;
  inset: -100% -50%;
  background: linear-gradient(105deg, transparent 40%, rgb(255 255 255 / 7%) 50%, transparent 60%);
  transform: translateX(-35%);
  animation: shimmer 1.7s ease-in-out infinite;
}

.is-loading .loading-state,
.has-error .loading-state {
  opacity: 1;
  visibility: visible;
}

.loading-state p {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.loading-mark {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 5px;
}

.loading-mark span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--teal);
  animation: loading-pulse 1.1s ease-in-out infinite;
}

.loading-mark span:nth-child(2) {
  animation-delay: 120ms;
}

.loading-mark span:nth-child(3) {
  animation-delay: 240ms;
}

.center-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgb(244 241 233 / 22%);
  border-radius: 50%;
  background: rgb(15 36 38 / 90%);
  color: var(--cream);
  transform: translate(-50%, -50%);
  transition: background-color 150ms ease, opacity 180ms ease, transform 150ms ease;
}

.center-play:hover {
  background: var(--teal-dark);
  transform: translate(-50%, -50%) scale(1.04);
}

.center-play svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
  margin-left: 3px;
}

.is-playing .center-play,
.is-loading .center-play,
.has-error .center-play {
  opacity: 0;
  pointer-events: none;
}

.player-controls {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  padding: 13px 16px 14px;
  background: rgb(6 20 22 / 92%);
  color: var(--cream);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 180ms ease, transform 180ms ease;
}

.player-shell[data-controls-visible="false"] .player-controls {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.timeline {
  position: relative;
  height: 15px;
  display: flex;
  align-items: center;
  margin-bottom: 7px;
}

.timeline progress,
.timeline input {
  position: absolute;
  inset-inline: 0;
  width: 100%;
  height: 4px;
  margin: 0;
  border: 0;
  border-radius: 999px;
}

.timeline progress {
  overflow: hidden;
  appearance: none;
  background: rgb(244 241 233 / 16%);
}

.timeline progress::-webkit-progress-bar {
  background: rgb(244 241 233 / 16%);
}

.timeline progress::-webkit-progress-value {
  background: rgb(244 241 233 / 34%);
}

.timeline progress::-moz-progress-bar {
  background: rgb(244 241 233 / 34%);
}

.timeline input {
  --played: 0%;
  z-index: 1;
  appearance: none;
  background: linear-gradient(to right, var(--teal) 0 var(--played), transparent var(--played) 100%);
}

.timeline input::-webkit-slider-thumb,
.volume-control input::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  appearance: none;
  border: 2px solid var(--cream);
  border-radius: 50%;
  background: var(--teal);
}

.timeline input::-moz-range-thumb,
.volume-control input::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid var(--cream);
  border-radius: 50%;
  background: var(--teal);
}

.control-row {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--cream);
}

.icon-button:hover {
  background: rgb(244 241 233 / 10%);
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pause-icon,
.muted-icon,
.is-playing .play-icon,
.is-muted .volume-icon {
  display: none;
}

.is-playing .pause-icon,
.is-muted .muted-icon {
  display: block;
}

.time-display {
  min-width: 104px;
  color: rgb(244 241 233 / 82%);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 3px;
}

.volume-control input {
  --volume: 100%;
  width: 82px;
  height: 4px;
  appearance: none;
  border-radius: 999px;
  background: linear-gradient(to right, var(--cream) 0 var(--volume), rgb(244 241 233 / 22%) var(--volume) 100%);
}

.control-spacer {
  flex: 1;
}

.speed-control {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgb(244 241 233 / 62%);
  font-size: 11px;
}

.speed-control select {
  min-width: 68px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid rgb(244 241 233 / 20%);
  border-radius: 7px;
  background: #10282a;
  color: var(--cream);
  font-size: 12px;
}

.video-meta {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--ink-soft);
  font-size: 12px;
}

.video-meta span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.video-meta i {
  display: block;
  width: 7px;
  height: 7px;
  box-shadow: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { transform: translateX(-40%); }
  100% { transform: translateX(40%); }
}

@keyframes loading-pulse {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 760px) {
  .site-header,
  .player-main,
  .site-footer,
  .site-header--plain {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    min-height: 66px;
  }

  .brand img {
    width: 144px;
  }

  .access-label {
    font-size: 9px;
    letter-spacing: 0.07em;
  }

  .player-main {
    padding-block: 30px 36px;
  }

  .player-intro {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 22px;
  }

  .player-intro h1 {
    font-size: clamp(34px, 10vw, 46px);
  }

  .player-description {
    font-size: 15px;
  }

  .player-shell {
    border-radius: 10px;
  }

  .center-play {
    width: 58px;
    height: 58px;
  }

  .center-play svg {
    width: 25px;
    height: 25px;
  }

  .player-controls {
    padding: 9px 9px 10px;
  }

  .time-display {
    min-width: 84px;
    font-size: 10px;
  }

  .volume-control input,
  .speed-control > span {
    display: none;
  }

  .speed-control select {
    min-width: 61px;
    padding-inline: 5px;
  }

  .video-meta {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding-block: 12px;
  }

  .site-footer {
    min-height: 84px;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 460px) {
  .access-main {
    width: min(100% - 24px, 440px);
    padding-block: 30px;
  }

  .access-panel {
    padding: 24px 20px;
    border-radius: 12px;
  }

  .player-shell {
    aspect-ratio: 16 / 10;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .control-row {
    gap: 2px;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
