@font-face {
  font-family: "Hanken Grotesk";
  src: url("/assets/hanken-grotesk-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light only;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --ink: #191d2b;
  --ink-2: #343b50;
  --muted: #626b7e;
  --faint: #8a92a3;
  --line: #e4e7ef;
  --line-2: #eef0f5;
  --field: #d8dce6;
  --action: #5753ce;
  --action-hover: #4540b5;
  --action-soft: #f0effd;
  --action-line: #d9d7f7;
  --ok: #187655;
  --ok-soft: #e3f7ee;
  --amber: #8a5612;
  --amber-soft: #fbf2d9;
  --danger: #b52a36;
  --danger-soft: #fbe8e8;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(25, 29, 43, 0.05);
  --shadow: 0 1px 2px rgba(25, 29, 43, 0.04), 0 10px 30px -16px rgba(25, 29, 43, 0.16);
  --shadow-player: 0 2px 6px rgba(25, 29, 43, 0.06), 0 28px 60px -28px rgba(25, 29, 43, 0.45);
  --font: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --player-cap: 64svh;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--action); }
.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;
}
:focus-visible { outline: 3px solid rgba(87, 83, 206, 0.35); outline-offset: 2px; }

/* ---------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar__inner {
  max-width: 1120px; margin: 0 auto; height: 56px;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand__mark { width: 30px; height: 30px; display: block; }
.brand__name { font-weight: 650; font-size: 16px; letter-spacing: -0.01em; }
.topbar__inner > .tabs { margin-left: auto; }
.topbar__label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 11px 5px 9px;
}
.topbar__label svg { color: var(--faint); }

/* ---------- layout */
.main {
  flex: 1; width: 100%; max-width: 1120px; margin: 0 auto;
  padding: 18px max(var(--gutter), env(safe-area-inset-right)) 40px max(var(--gutter), env(safe-area-inset-left));
}
.footer {
  text-align: center; font-size: 12.5px; color: var(--faint);
  padding: 8px 16px calc(22px + env(safe-area-inset-bottom));
}

.loading { display: flex; justify-content: center; padding: 22vh 0; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--line); border-top-color: var(--action);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- buttons, inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid transparent;
  font-size: 15.5px; font-weight: 600; letter-spacing: -0.005em;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
  -webkit-user-select: none; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn--primary { background: var(--action); color: #fff; box-shadow: 0 1px 2px rgba(40, 35, 120, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.btn--primary:hover:not(:disabled) { background: var(--action-hover); }
.btn--ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn--ghost:hover:not(:disabled) { border-color: var(--field); background: var(--surface-2); }
.btn--block { width: 100%; }
.btn--lg { min-height: 50px; font-size: 16px; }
.btn--sm { min-height: 36px; padding: 0 13px; font-size: 14px; border-radius: 10px; }

.link-btn {
  background: none; border: 0; padding: 6px 0; min-height: 32px;
  color: var(--action); font-weight: 600; font-size: 14px;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn--muted { color: var(--muted); font-weight: 500; }

.input {
  display: block; width: 100%;
  min-height: 48px; padding: 11px 14px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--field); border-radius: var(--radius-sm);
  font-size: 16px; line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: #9aa1b0; }
.input:focus { outline: none; border-color: var(--action); box-shadow: 0 0 0 3px rgba(87, 83, 206, 0.16); }
.input--area { resize: none; min-height: 92px; }
.input--code {
  text-align: center; letter-spacing: 0.22em; font-weight: 650; font-size: 18px; text-transform: uppercase;
}
.input--code::placeholder { letter-spacing: 0.02em; font-weight: 500; text-transform: none; }

/* ---------- gate */
.gate { display: flex; justify-content: center; align-items: center; min-height: calc(100svh - 190px); padding: 16px 0; }
.gate__card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); padding: 30px 22px 24px;
  display: flex; flex-direction: column; gap: 14px; text-align: center;
}
.gate__icon {
  width: 46px; height: 46px; margin: 0 auto 2px; border-radius: 14px;
  display: grid; place-items: center; color: var(--action);
  background: var(--action-soft); border: 1px solid var(--action-line);
}
.gate__title { font-size: 23px; font-weight: 650; letter-spacing: -0.02em; }
.gate__text { color: var(--muted); font-size: 15px; margin-top: -6px; }
.gate__error { color: var(--danger); font-size: 14px; font-weight: 500; }
.gate__card.is-shaking { animation: shake 0.35s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- tabs (in the top bar once unlocked) */
.tabs { display: flex; gap: 3px; padding: 3px; background: #eceef4; border-radius: 12px; }
.tabs__tab {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent;
  font-size: 14.5px; font-weight: 600; color: var(--muted); white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.tabs__tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(25, 29, 43, 0.1), 0 1px 1px rgba(25, 29, 43, 0.04); }
@media (max-width: 400px) {
  .is-unlocked .brand__name { display: none; }
}

/* ---------- video picker (only when there are several videos) */
.picker { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; margin: 0 -2px; scrollbar-width: none; }
.picker::-webkit-scrollbar { display: none; }
.picker__item {
  flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.picker__item[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- review layout */
.review { display: grid; gap: 18px; }
.review__stage {
  --ar: 0.5625;
  min-width: 0; width: min(100%, calc(var(--player-cap) * var(--ar)), 460px); margin: 0 auto;
}
@supports not (height: 1svh) { .review__stage { width: min(100%, calc(64vh * var(--ar)), 460px); } }
.review__side { min-width: 0; display: flex; flex-direction: column; gap: 18px; }

.vhead { margin-bottom: 10px; }
.vhead__row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.eyebrow {
  font-size: 12px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 0 2px 1px;
}
.vpick {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  background: none; border: 0; padding: 2px 2px 2px 1px; margin: 0; border-radius: 8px;
  font-size: 21px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; color: var(--ink);
}
.vpick svg { color: var(--faint); margin-top: 2px; }
.vpick:hover svg { color: var(--action); }
.vhead__meta { margin-left: auto; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 650; letter-spacing: 0.01em;
  background: var(--action-soft); color: var(--action); border: 1px solid var(--action-line);
}

.player {
  position: relative; width: 100%; aspect-ratio: var(--ar);
  background: #0c0e14; border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow-player);
}
.player video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #0c0e14; object-fit: contain; }
.player__error {
  position: absolute; left: 12px; right: 12px; bottom: 60px; padding: 10px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.95); color: var(--ink); font-size: 14px; text-align: center;
}

/* timeline of comments under the player */
.rail { position: relative; margin: 10px 0 0; height: 26px; }
.rail::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px;
  border-radius: 3px; background: #dde1ea;
}
.rail__dot {
  position: absolute; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; padding: 0;
  border: 0; background: transparent; display: grid; place-items: center;
}
.rail__dot::after {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  background: var(--action); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(25, 29, 43, 0.3);
  transition: transform 0.15s ease;
}
.rail__dot:hover::after, .rail__dot.is-active::after { transform: scale(1.3); }

/* ---------- comment button + composer */
.btn--comment { font-variant-numeric: tabular-nums; }
.composer {
  background: var(--surface); border: 1px solid var(--action-line); border-radius: var(--radius);
  box-shadow: 0 0 0 4px rgba(87, 83, 206, 0.07), var(--shadow);
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.composer__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.composer__actions { display: flex; justify-content: flex-end; gap: 10px; }
.composer__actions .btn { flex: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 8px;
  font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chip--time { background: var(--action-soft); color: var(--action); border: 1px solid var(--action-line); }
.chip--general { background: var(--line-2); color: var(--muted); border: 1px solid var(--line); }
button.chip { cursor: pointer; }
button.chip--time:hover { background: #e7e5fb; }

/* ---------- cards and sections */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 16px 18px;
}
.card__title { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; margin-bottom: 10px; }
.changes__note { color: var(--ink-2); font-size: 15px; margin-bottom: 10px; }
.changes__list { display: flex; flex-direction: column; gap: 8px; }
.changes__list li, .vitem__changes li { position: relative; padding-left: 20px; font-size: 15px; color: var(--ink-2); line-height: 1.45; }
.changes__list li::before, .vitem__changes li::before {
  content: ""; position: absolute; left: 3px; top: 0.58em; width: 7px; height: 7px; border-radius: 2px;
  background: var(--action); opacity: 0.8; transform: rotate(45deg);
}

.section__title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted);
  margin: 4px 2px 10px;
}
.count {
  display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: #e8ebf2; color: var(--ink-2); font-size: 12px; letter-spacing: 0; font-variant-numeric: tabular-nums;
}
.empty { color: var(--muted); font-size: 14.5px; padding: 2px 2px; }
.empty--card { background: var(--surface); border: 1px dashed var(--field); border-radius: var(--radius); padding: 28px 18px; text-align: center; }

/* comments */
.comments { display: flex; flex-direction: column; gap: 8px; }
.comment {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 4px; align-items: start;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.comment.is-flash { border-color: var(--action); box-shadow: 0 0 0 3px rgba(87, 83, 206, 0.14); }
.comment__body { font-size: 15px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; padding-top: 3px; }
.comment__meta { grid-column: 2; font-size: 12.5px; color: var(--faint); }

/* versions */
.versions { display: flex; flex-direction: column; gap: 10px; }
.vitem {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.vitem.is-current { border-color: var(--action-line); box-shadow: 0 0 0 3px rgba(87, 83, 206, 0.06); }
.vitem__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vitem__name { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 16px; letter-spacing: -0.01em; }
.vitem__meta { font-size: 13px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.vitem__title { font-size: 14.5px; color: var(--ink-2); margin-top: 8px; font-weight: 550; }
.vitem__changes { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.vitem__changes li { font-size: 14px; }
.vitem__more { margin-top: 6px; }
.vitem__playing { font-size: 13px; font-weight: 650; color: var(--action); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.vitem__playing::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--action); }

/* ---------- request form */
.request { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.request__title { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.request__lead { color: var(--muted); font-size: 15.5px; margin-top: 6px; }
.form { display: flex; flex-direction: column; gap: 18px; padding: 20px 18px; }
.field { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: 14.5px; font-weight: 650; color: var(--ink); padding: 0; }
.field__hint { font-size: 13px; color: var(--faint); }
.optional { font-weight: 500; color: var(--faint); font-size: 13px; margin-left: 4px; }
.form__error { color: var(--danger); font-size: 14px; font-weight: 500; background: var(--danger-soft); border-radius: 10px; padding: 10px 12px; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 62px; min-height: 42px; padding: 0 14px;
  border: 1px solid var(--field); border-radius: 10px; background: var(--surface);
  font-size: 15px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.choice input:checked + span { background: var(--action-soft); border-color: var(--action); color: var(--action); }
.choice input:focus-visible + span { box-shadow: 0 0 0 3px rgba(87, 83, 206, 0.2); }
.input--other { margin-top: 2px; }

.success { text-align: center; padding: 28px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.success__icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); margin-bottom: 4px; }
.success__title { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.success__text { color: var(--muted); font-size: 15px; margin-bottom: 8px; }

.requests { display: flex; flex-direction: column; gap: 8px; }
.ritem { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; }
.ritem__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ritem__title { font-weight: 650; font-size: 15px; overflow-wrap: anywhere; }
.ritem__meta { font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.ritem__text { font-size: 14px; color: var(--ink-2); margin-top: 6px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ritem__link { display: inline-block; margin-top: 6px; font-size: 13.5px; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.status { flex: none; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.status--received { background: var(--action-soft); color: var(--action); }
.status--in_progress { background: var(--amber-soft); color: var(--amber); }
.status--delivered { background: var(--ok-soft); color: var(--ok); }
.status--closed { background: var(--line-2); color: var(--muted); }

/* ---------- toast */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 50;
  transform: translateX(-50%); max-width: calc(100% - 32px);
  background: var(--ink); color: #fff; border-radius: 12px; padding: 11px 16px;
  font-size: 14.5px; font-weight: 550; box-shadow: 0 12px 30px -10px rgba(25, 29, 43, 0.5);
  animation: toast-in 0.2s ease;
}
.toast.is-error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- wider screens: player on the left, conversation on the right */
@media (min-width: 900px) {
  :root { --player-cap: 76vh; --gutter: 28px; }
  .main { padding-top: 26px; }
  .review { grid-template-columns: auto minmax(0, 1fr); gap: 40px; align-items: start; }
  .review__stage { position: sticky; top: 82px; margin: 0; width: min(calc(var(--player-cap) * var(--ar)), 460px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
