@font-face {
  font-family: "DegularVariable";
  src:
    url("../assets/DegularVariable.ttf") format("truetype-variations"),
    url("../assets/DegularVariable.ttf") format("truetype");
  font-weight: 1 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #070707;
  --surface: #0f0f0f;
  --surface-2: #171717;
  --surface-3: #222222;
  --surface-gloss: rgba(255, 255, 255, 0.08);
  --glass: rgba(18, 18, 18, 0.68);
  --glass-strong: rgba(22, 22, 22, 0.82);
  --text: #f7f7f7;
  --muted: #a7a7a7;
  --subtle: #777777;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --brand: #ff0033;
  --brand-strong: #ff2f55;
  --success: #32d296;
  --warning: #ffcf5a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 18px 46px rgba(0, 0, 0, 0.28);
  --radius: 8px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #edf0f4;
  --surface-3: #e1e6ec;
  --surface-gloss: rgba(255, 255, 255, 0.9);
  --glass: rgba(255, 255, 255, 0.74);
  --glass-strong: rgba(255, 255, 255, 0.88);
  --text: #101114;
  --muted: #59606b;
  --subtle: #747b86;
  --line: rgba(18, 23, 31, 0.12);
  --line-strong: rgba(18, 23, 31, 0.22);
  --brand: #d90429;
  --brand-strong: #b80322;
  --success: #15885f;
  --warning: #a06400;
  --shadow: 0 18px 46px rgba(34, 41, 52, 0.14);
  --shadow-soft: 0 14px 34px rgba(34, 41, 52, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 0, 51, 0.11), transparent 28rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 18rem),
    var(--bg);
  color: var(--text);
  font-family: "DegularVariable", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variation-settings: "wght" 520;
  transition: background-color 220ms ease, color 220ms ease;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
}

body::before {
  inset: -34px;
  z-index: -2;
  background: url("../assets/reference.jpg") center / cover no-repeat;
  filter: blur(24px) saturate(0.9) brightness(0.58);
  opacity: 0.34;
  transform: scale(1.06);
}

body::after {
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.7), transparent 42%, rgba(0, 0, 0, 0.58)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.82));
}

[data-theme="light"] body::before {
  filter: blur(24px) saturate(0.82) brightness(1.12);
  opacity: 0.22;
}

[data-theme="light"] body::after {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.75), transparent 45%, rgba(255, 255, 255, 0.7)),
    linear-gradient(180deg, rgba(246, 247, 249, 0.55), rgba(246, 247, 249, 0.92));
}

button,
input,
select {
  font: inherit;
}

button {
  letter-spacing: 0;
}

.watch-app {
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  height: 100vh;
  height: 100svh;
  overflow-x: hidden;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(168px, 0.55fr) minmax(240px, 620px) minmax(120px, 0.55fr);
  align-items: center;
  gap: 18px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent),
    var(--glass);
  backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), var(--shadow-soft);
}

.brand-mark {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark span {
  display: inline-grid;
  width: 36px;
  height: 26px;
  place-items: center;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 0, 51, 0.28);
}

.brand-mark i {
  font-size: 1.3rem;
  line-height: 1;
}

.brand-mark strong {
  font-size: 1.24rem;
  font-variation-settings: "wght" 820;
  letter-spacing: 0;
}

.search-shell {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background:
    linear-gradient(180deg, var(--surface-gloss), transparent),
    var(--glass-strong);
  color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 28px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(14px);
}

.search-shell span {
  overflow: hidden;
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.icon-button,
.profile-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  min-width: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background:
    linear-gradient(180deg, var(--surface-gloss), transparent),
    var(--glass);
  color: var(--text);
  backdrop-filter: blur(14px);
}

.icon-button:hover,
.profile-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
  color: var(--brand-strong);
}

.profile-button span {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--warning));
  color: #fff;
  font-size: 0.82rem;
  font-variation-settings: "wght" 820;
}

.watch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 31vw);
  gap: 18px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 18px 24px 24px;
}

.primary-column,
.side-column {
  min-width: 0;
  min-height: 0;
}

.primary-column {
  display: grid;
  grid-template-rows: minmax(320px, 1fr) auto;
  gap: 14px;
}

.player-shell {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #000;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.player-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.12), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.06));
  mix-blend-mode: screen;
}

.player-shell iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-copy {
  min-height: 0;
}

.video-kicker {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  margin-bottom: 8px;
  padding: 3px 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 48%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-variation-settings: "wght" 760;
}

.video-copy h1 {
  display: -webkit-box;
  max-height: 5.2rem;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 2rem;
  line-height: 1.08;
  font-variation-settings: "wght" 850;
  letter-spacing: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.video-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.channel-chip {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.channel-chip img {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 50%;
  object-fit: cover;
}

.channel-chip div {
  min-width: 0;
}

.channel-chip strong,
.channel-chip span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-chip strong {
  color: var(--text);
  font-size: 1rem;
  font-variation-settings: "wght" 780;
}

.channel-chip span {
  color: var(--muted);
  font-size: 0.82rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pill-button,
.inspect-jump {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background:
    linear-gradient(180deg, var(--surface-gloss), transparent),
    var(--glass);
  color: var(--text);
  font-size: 0.92rem;
  font-variation-settings: "wght" 690;
  text-decoration: none;
  backdrop-filter: blur(14px);
}

.pill-button:hover,
.inspect-jump:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
  color: var(--text);
}

.inspect-jump {
  border-color: color-mix(in srgb, var(--success) 60%, transparent);
  background: color-mix(in srgb, var(--success) 18%, var(--surface-2));
  color: color-mix(in srgb, var(--success) 86%, var(--text));
}

.description-box {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, var(--surface-gloss), transparent 54%),
    var(--glass);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px) saturate(1.15);
}

.description-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 0.9rem;
}

.description-stats span {
  color: var(--muted);
}

.description-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.side-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}

.inspection-card,
.playlist-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, var(--surface-gloss), transparent 46%),
    var(--glass);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px) saturate(1.18);
}

.inspection-card {
  padding: 16px;
}

.inspection-form .row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -0.25rem;
  margin-left: -0.25rem;
}

.inspection-form .row > * {
  width: 100%;
  padding-right: 0.25rem;
  padding-left: 0.25rem;
}

.inspection-form .g-2 {
  row-gap: 0.5rem;
}

.form-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.form-heading span {
  color: var(--muted);
  font-size: 0.82rem;
  font-variation-settings: "wght" 720;
  text-transform: uppercase;
}

.form-heading strong {
  max-width: 58%;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.1;
  text-align: right;
  font-variation-settings: "wght" 820;
}

.inspection-form .form-label {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-variation-settings: "wght" 720;
}

.inspection-form .form-control,
.inspection-form .form-select {
  min-height: 42px;
  border-color: var(--line);
  border-radius: 7px;
  background-color: color-mix(in srgb, var(--surface-2) 82%, transparent);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.inspection-form .form-control::placeholder {
  color: color-mix(in srgb, var(--muted) 70%, transparent);
}

.inspection-form .form-control:focus,
.inspection-form .form-select:focus {
  border-color: var(--brand-strong);
  box-shadow: 0 0 0 0.18rem color-mix(in srgb, var(--brand) 24%, transparent);
}

.submit-button {
  display: inline-flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  border: 0;
  border-radius: 7px;
  background:
    linear-gradient(135deg, color-mix(in srgb, #ffffff 14%, transparent), transparent),
    linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  font-variation-settings: "wght" 820;
  box-shadow: 0 16px 30px color-mix(in srgb, var(--brand) 24%, transparent);
}

.submit-button:hover,
.submit-button:focus-visible {
  color: #fff;
  filter: brightness(1.05);
}

.submit-button:disabled {
  cursor: wait;
  filter: grayscale(0.35);
  opacity: 0.78;
}

.form-status {
  min-height: 20px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.form-status.success {
  color: var(--success);
}

.form-status.warning {
  color: var(--warning);
}

.form-status.error {
  color: var(--brand-strong);
}

.playlist-panel {
  min-height: 0;
  overflow: hidden;
}

.playlist-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
}

.playlist-heading strong {
  font-size: 1rem;
  font-variation-settings: "wght" 820;
}

.playlist-heading span {
  color: var(--muted);
  font-size: 0.82rem;
}

.video-list {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  max-height: 100%;
  overflow: auto;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--brand) 44%, transparent) transparent;
}

.video-card {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  text-align: left;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.video-card:hover,
.video-card.active {
  border-color: var(--line);
  background:
    linear-gradient(180deg, var(--surface-gloss), transparent),
    color-mix(in srgb, var(--surface-2) 82%, transparent);
}

.video-card.active {
  box-shadow: inset 3px 0 0 var(--brand), 0 14px 32px rgba(0, 0, 0, 0.18);
}

.thumb-wrap {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 7px;
  background: #000;
  aspect-ratio: 16 / 9;
}

.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease, filter 180ms ease;
}

.video-card:hover .thumb-wrap img,
.video-card.active .thumb-wrap img {
  filter: saturate(1.08) contrast(1.05);
  transform: scale(1.035);
}

.duration {
  position: absolute;
  right: 5px;
  bottom: 5px;
  min-width: 38px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.86);
  color: #fff;
  font-size: 0.72rem;
  font-variation-settings: "wght" 720;
  text-align: center;
}

.video-card-copy {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 5px;
}

.video-card-copy strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.18;
  font-variation-settings: "wght" 760;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.video-card-copy span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (max-width: 1199.98px) {
  .watch-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
  }

  .video-card {
    grid-template-columns: 118px minmax(0, 1fr);
  }
}

@media (min-width: 576px) {
  .inspection-form .col-sm-6 {
    width: 50%;
  }
}

@media (min-width: 992px) {
  .inspection-form .col-lg-12 {
    width: 100%;
  }
}

@media (min-width: 1200px) {
  .inspection-form .col-xl-6 {
    width: 50%;
  }
}

@media (max-width: 991.98px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .watch-app {
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    grid-template-columns: minmax(140px, 1fr) auto;
    padding: 10px 14px;
  }

  .search-shell {
    display: none;
  }

  .watch-grid {
    grid-template-columns: 1fr;
    overflow: visible;
    padding: 12px;
  }

  .primary-column {
    grid-template-rows: auto auto;
  }

  .player-shell {
    aspect-ratio: 16 / 9;
    min-height: auto;
  }

  .side-column {
    grid-template-rows: auto auto;
  }

  .playlist-panel {
    overflow: visible;
  }

  .video-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 78vw);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
  }

  .video-card {
    grid-template-columns: 120px minmax(0, 1fr);
    scroll-snap-align: start;
  }
}

@media (max-width: 575.98px) {
  .watch-app {
    grid-template-rows: 58px minmax(0, 1fr);
  }

  .brand-mark strong {
    font-size: 1.08rem;
  }

  .topbar-actions {
    gap: 7px;
  }

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

  .watch-grid {
    gap: 12px;
    padding: 8px;
  }

  .player-shell,
  .inspection-card,
  .playlist-panel,
  .description-box {
    border-radius: 7px;
  }

  .video-copy h1 {
    font-size: 1.42rem;
    line-height: 1.12;
  }

  .video-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .action-row {
    justify-content: flex-start;
  }

  .pill-button,
  .inspect-jump {
    min-height: 36px;
    font-size: 0.86rem;
  }

  .description-box p {
    font-size: 0.92rem;
  }

  .form-heading {
    display: block;
  }

  .form-heading strong {
    display: block;
    max-width: none;
    margin-top: 4px;
    text-align: left;
  }

  .video-list {
    grid-auto-columns: minmax(236px, 86vw);
  }

  .video-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }
}
