*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

html, body {
  height: 100%;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

:root {
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  --container-max: 1200px;
  --container-pad: var(--space-4);

  --bg: #100e0c;
  --bg-elevated: #1a1712;
  --border: #2c2620;
  --text: #e9e4da;
  --text-dim: #96897a;
  --text-strong: #ffffff;
  --accent: #c59768;
  --accent-bright: #e0b483;
  --hover-overlay: rgba(255, 255, 255, 0.06);
  --hover-overlay-strong: rgba(255, 255, 255, 0.1);
  --overlay-scrim: rgba(0, 0, 0, 0.6);

  --font-display: "Cinzel", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --bar-height: 50px;

  --ui-zoom: 1;
}

:root[data-theme="light"] {
  --bg: #f7f5f1;
  --bg-elevated: #ffffff;
  --border: #e6e0d5;
  --text: #1a1712;
  --text-dim: #756b5c;
  --text-strong: #000000;
  --accent: #9c6a2e;
  --accent-bright: #7a5220;
  --hover-overlay: rgba(0, 0, 0, 0.045);
  --hover-overlay-strong: rgba(0, 0, 0, 0.08);
  --overlay-scrim: rgba(20, 17, 14, 0.4);
}

html.high-contrast {
  --text-dim: var(--text);
  --border: currentColor;
}

html.high-contrast :is(.bar, .drawer, .modal) {
  border-width: 2px;
}

html {
  zoom: var(--ui-zoom);
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  transition: background-color 0.15s ease, color 0.15s ease;
}

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

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.bar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--bar-height);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-inline: var(--space-2);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 15%, var(--accent) 85%, transparent);
  opacity: 0.5;
}

.bar__burger {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  border-radius: 6px;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.bar__burger:hover {
  background: var(--hover-overlay);
}

.bar__burger:active {
  background: var(--hover-overlay-strong);
  transform: scale(0.94);
}

.bar__burger-line {
  display: block;
  width: 15px;
  height: 1.5px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease, background-color 0.2s ease;
}

.bar__burger[aria-expanded="true"] .bar__burger-line {
  background: var(--accent-bright);
}

.bar__burger[aria-expanded="true"] .bar__burger-line:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}

.bar__burger[aria-expanded="true"] .bar__burger-line:nth-child(2) {
  opacity: 0;
}

.bar__burger[aria-expanded="true"] .bar__burger-line:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

.bar__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: auto;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

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

.bar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

.bar__icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-dim);
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}

.bar__icon svg {
  width: 15px;
  height: 15px;
}

.bar__icon:hover {
  color: var(--text);
  background: var(--hover-overlay);
}

.bar__icon:active {
  background: var(--hover-overlay-strong);
  transform: scale(0.92);
}

.bar__icon--play {
  color: var(--accent);
}

.bar__icon--play:hover {
  color: var(--accent-bright);
  background: rgba(197, 151, 104, 0.16);
}

.bar__icon--play:active {
  background: rgba(197, 151, 104, 0.26);
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(80vw, 300px);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  box-shadow: 12px 0 32px rgba(0, 0, 0, 0.45);
  transform: translateX(-100%);
  transition: transform 0.28s ease;
  z-index: 110;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer__head {
  height: var(--bar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.drawer__title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.drawer__close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-dim);
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}

.drawer__close svg {
  width: 15px;
  height: 15px;
}

.drawer__close:hover {
  color: var(--text);
  background: var(--hover-overlay);
}

.drawer__close:active {
  background: var(--hover-overlay-strong);
  transform: scale(0.92);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay-scrim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  z-index: 105;
}

.drawer-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay-scrim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 205;
}

.modal-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(90vw, 340px);
  max-height: min(80vh, 420px);
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  z-index: 210;
}

.modal.is-open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.modal__head {
  height: var(--bar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.modal__title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.modal__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.setting-row__label {
  font-size: 13px;
  color: var(--text);
}

.setting-row__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.setting-row__hint {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-dim);
}

.setting-divider {
  height: 1px;
  background: var(--border);
  margin-block: var(--space-1);
}

.setting-action {
  width: 100%;
  padding: 9px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.setting-action:hover {
  background: var(--hover-overlay);
  border-color: var(--text-dim);
}

.setting-action:active {
  background: var(--hover-overlay-strong);
}

.status-badge {
  flex-shrink: 0;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge--granted {
  color: #6fce8f;
  background: rgba(111, 206, 143, 0.14);
}

.status-badge--denied {
  color: #e17b7b;
  background: rgba(225, 123, 123, 0.14);
}

.seg-switch {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.seg-switch__item {
  padding: 5px 9px;
  background: none;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.15s ease, background-color 0.15s ease;
}

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

.seg-switch__item.is-active {
  color: #fff;
  background: var(--accent);
}

.switch {
  flex-shrink: 0;
  width: 38px;
  height: 22px;
  padding: 2px;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.switch__knob {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform 0.18s ease, background-color 0.15s ease;
}

.switch[aria-checked="true"] {
  background: var(--accent);
  border-color: var(--accent);
}

.switch[aria-checked="true"] .switch__knob {
  background: #fff;
  transform: translateX(16px);
}

.hero {
  position: relative;
  isolation: isolate;
  height: 70vh;
  min-height: 460px;
  max-height: 760px;
  overflow: hidden;
  background: var(--bg);
}

.hero__video {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(
      to bottom,
      rgba(16, 14, 12, 0.55) 0%,
      rgba(16, 14, 12, 0.28) 24%,
      rgba(16, 14, 12, 0.38) 60%,
      var(--bg) 100%
    );
}

:root[data-theme="light"] .hero__scrim {
  background:
    linear-gradient(
      to bottom,
      rgba(16, 14, 12, 0.55) 0%,
      rgba(16, 14, 12, 0.32) 24%,
      rgba(16, 14, 12, 0.42) 60%,
      var(--bg) 100%
    );
}

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