:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #5b6472;
  --line: #d6dbe3;
  --accent: #1f4e79;
  --accent-strong: #173a5a;
  --shadow: 0 14px 38px rgba(17, 24, 39, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Source Sans 3", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.5;
}

.page-shell {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
  padding: 38px 0 54px;
}

.masthead {
  max-width: 1040px;
  margin: 0 auto 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 1040px;
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3.4vw, 3.2rem);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: 0;
}

.viewer {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.evaluation-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: #ffffff;
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.evaluation-link:hover,
.evaluation-link:focus-visible {
  background: #eef6fc;
  outline: 2px solid transparent;
}

.language-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef2f6;
}

.language-button {
  min-height: 34px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
}

.language-button:hover,
.language-button:focus-visible {
  color: var(--accent-strong);
  outline: 2px solid transparent;
}

.language-button.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(31, 78, 121, 0.22);
}

.video-frame {
  position: relative;
  background: #090d14;
  aspect-ratio: 16 / 9;
  width: 100%;
}

video {
  display: block;
  width: 100%;
  height: 100%;
  background: #090d14;
}

.loading-indicator {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.32);
  border-top-color: #ffffff;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85);
  transition: opacity 140ms ease, transform 140ms ease;
}

.video-frame.is-busy .loading-indicator {
  opacity: 1;
  transform: scale(1);
  animation: spin 900ms linear infinite;
}

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

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 18px, 1160px);
    padding: 24px 0 36px;
  }

  .masthead {
    margin-bottom: 18px;
    padding-bottom: 16px;
    text-align: left;
  }

  .viewer-header {
    display: grid;
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .language-switch {
    width: 100%;
  }
}
