@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("./GolosText-latin.woff2") format("woff2");
}

:root {
  --bg: #f7f6f4;
  --text: #0b0b0a;
  --muted: #5c5c58;
  --line: #e6e4df;
  --switch-off: #d3d1cb;
  --card: #ffffff;
  --accent: #1f5fcf;
  --accent-text: #ffffff;
  --shadow: 0 24px 60px rgba(11, 11, 10, 0.12);
  --top: 56px;   /* header height */
  --chrome: 88px; /* header plus the space kept around the video on the first screen */
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214;
    --text: #f2f1ee;
    --muted: #a5a49e;
    --line: #2a2c30;
    --switch-off: #45474d;
    --card: #1b1c1f;
    --accent: #4f86ea;
    --accent-text: #ffffff;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.5 "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.top {
  height: var(--top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.brand b { color: var(--accent); font-weight: 700; }

.lang {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

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

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left));
}

/* The video box keeps the edition's shape and fits the first screen under the header. */
.stage {
  position: relative;
  margin: 8px auto 0;
  aspect-ratio: 16 / 9;
  width: min(100%, calc((100svh - var(--chrome)) * 16 / 9));
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}

.stage[data-mode="portrait"] {
  aspect-ratio: 9 / 16;
  width: min(100%, calc((100svh - var(--chrome)) * 9 / 16));
}

.stage video {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}

.noscript {
  position: absolute;
  inset: auto 0 0;
  margin: 0;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
}

.info {
  max-width: 640px;
  margin: 28px auto 0;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 4.2vw, 38px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.meta {
  margin: 10px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.lede {
  margin: 14px 0 0;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { border-color: var(--muted); }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

.btn--primary:hover { filter: brightness(1.08); border-color: var(--accent); }

.size { color: var(--muted); font-weight: 400; }

/* Player controls under the video: the subtitles switch and the format choice. */
.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 12px;
  margin-top: 16px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 6px 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.switch[hidden] { display: none; }

.switch__track {
  position: relative;
  width: 44px;
  height: 30px;
  border-radius: 999px;
  background: var(--switch-off);
  transition: background-color 0.15s;
}

.switch__thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(11, 11, 10, 0.3);
  transition: transform 0.15s;
}

.switch[aria-checked="true"] .switch__track { background: var(--accent); }
.switch[aria-checked="true"] .switch__thumb { transform: translateX(14px); }

@media (prefers-reduced-motion: reduce) {
  .switch__track, .switch__thumb { transition: none; }
}

.format {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
}

.format[hidden] { display: none; }

.format span { padding: 0 8px 0 10px; color: var(--muted); }

.format button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.format button[aria-pressed="true"] {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(11, 11, 10, 0.12);
}

.note {
  margin: 22px 0 0;
  font-size: 14px;
  color: var(--muted);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Phones held sideways: keep as much height as possible for the video. */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --top: 44px; --chrome: 56px; }
  .brand { font-size: 16px; }
  .brand img { width: 22px; height: 22px; }
  .stage { margin-top: 4px; border-radius: 12px; }
}

@media (max-width: 480px) {
  .stage { border-radius: 14px; }
  .info { margin-top: 22px; }
  .btn { font-size: 15px; padding: 0 16px; }
}
