/* Gated manual app — built for a phone propped against a plate stack. */

.manual-body { min-height: 100vh; }

/* ---------------------------------------------------------------------- gate */

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  background:
    radial-gradient(620px 380px at 50% 0%, rgba(242, 178, 62, 0.12), transparent 70%),
    var(--ink);
}

.gate[hidden] { display: none; }

.gate-card {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
}

.gate-card h1 { font-size: clamp(26px, 6vw, 34px); font-weight: 800; margin: 10px 0 0; }

#code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 19px;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

/* -------------------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 62px;
  padding: 0 16px;
  background: rgba(11, 11, 11, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-title { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.topbar-title strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }

.search { width: 260px; padding: 10px 13px; font-size: 14px; border-radius: 9px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--bone);
  cursor: pointer;
}

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

#menu-btn { display: none; }

/* -------------------------------------------------------------------- layout */

.layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  align-items: start;
  max-width: 1280px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 62px;
  height: calc(100vh - 62px);
  overflow-y: auto;
  border-right: 1px solid var(--line);
  padding: 22px 14px 60px;
}

.side-group + .side-group { margin-top: 22px; }

.side-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  padding: 0 10px 8px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14.5px;
  border-left: 2px solid transparent;
}

.side-link:hover { background: var(--surface); color: var(--bone); }

.side-link.active {
  background: rgba(242, 178, 62, 0.1);
  color: var(--amber);
  border-left-color: var(--amber);
  font-weight: 700;
}

.side-link .vdot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); flex: 0 0 auto; }
.side-link .vdot.has-video { background: var(--good); }

.content { padding: 34px 30px 90px; min-width: 0; }

/* ------------------------------------------------------------------- section */

.section-head { max-width: 720px; }

.crumb {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
}

.section-h1 { font-size: clamp(28px, 5.4vw, 44px); font-weight: 800; margin: 10px 0 0; }

.section-def { color: var(--muted); font-size: clamp(15px, 2.2vw, 17px); margin: 14px 0 0; max-width: 62ch; }

.video-shell {
  margin: 26px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #000;
  max-width: 860px;
}

.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-frame iframe,
.video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

.video-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  background: repeating-linear-gradient(45deg, #121212, #121212 12px, #171717 12px, #171717 24px);
  color: var(--muted-dim);
  text-align: center;
  padding: 20px;
}

.video-empty strong { font-family: var(--font-display); color: var(--muted); font-size: 14px; }
.video-empty span { font-size: 12.5px; }

.video-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.cols {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 28px;
  margin-top: 34px;
  max-width: 1000px;
}

.col-head {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.col-head.good { color: var(--amber); }
.col-head.bad { color: var(--bad); }

.item { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.item:last-child { border-bottom: none; }

.item-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  color: var(--amber);
  flex: 0 0 auto;
  width: 16px;
  padding-top: 2px;
}

.item-num.bad { color: var(--bad); }

.item h4 { font-size: 16px; margin: 0 0 6px; }
.item p { color: var(--muted); font-size: 14.5px; margin: 0; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; max-width: 1000px; flex-wrap: wrap; }
.pager a { flex: 0 1 300px; text-decoration: none; }
.pager a:only-child { margin-left: auto; }

.pager-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 18px;
}

.pager-card:hover { border-color: var(--amber); }
.pager-card span { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-dim); font-weight: 700; }
.pager-card strong { display: block; font-family: var(--font-display); font-size: 16px; margin-top: 4px; }

/* ------------------------------------------------------------------ overview */

.overview-hero { max-width: 760px; }
.overview-hero h1 { font-size: clamp(30px, 6vw, 48px); font-weight: 800; margin: 10px 0 0; }

.points { display: grid; gap: 14px; margin-top: 28px; max-width: 760px; }

.point {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 20px;
}

.point h3 { font-size: 16px; margin: 0 0 7px; }
.point p { color: var(--muted); font-size: 14.5px; margin: 0; }

.jump-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.jump-card {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
}

.jump-card:hover { border-color: var(--amber); }
.jump-card h3 { color: var(--amber); font-size: 18px; text-transform: uppercase; letter-spacing: 0.04em; }
.jump-card p { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.jump-card .count { color: var(--muted-dim); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 12px; display: block; }

/* --------------------------------------------------------------- faultfinder */

.table-wrap { overflow-x: auto; margin-top: 24px; border: 1px solid var(--line); border-radius: var(--r-md); }

table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 460px; }

th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-dim);
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
tr:last-child td { border-bottom: none; }
td.pos { color: var(--bone); font-weight: 700; }
td a { color: var(--amber); text-decoration: none; font-weight: 700; }
td a:hover { text-decoration: underline; }

/* -------------------------------------------------------------------- search */

.results { display: grid; gap: 10px; margin-top: 22px; max-width: 820px; }

.result {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
}

.result:hover { border-color: var(--amber); }
.result .where { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); font-weight: 700; }
.result h3 { font-size: 16px; margin: 6px 0 4px; }
.result p { color: var(--muted); font-size: 14px; margin: 0; }
.result mark { background: rgba(242, 178, 62, 0.25); color: var(--bone); border-radius: 3px; padding: 0 2px; }

/* ---------------------------------------------------------------- responsive */

.scrim {
  position: fixed;
  inset: 62px 0 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 45;
}

@media (max-width: 940px) {
  #menu-btn { display: inline-flex; }
  .search { width: 150px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    top: 62px;
    left: 0;
    z-index: 46;
    width: 282px;
    max-width: 84vw;
    background: var(--ink);
    transform: translateX(-102%);
    transition: transform 0.22s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 26px 18px 80px; }
  .cols { grid-template-columns: minmax(0, 1fr); gap: 26px; }
}

@media (max-width: 560px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .topbar-title { display: none; }
  .search { width: 100%; }
  .topbar-actions { flex: 1 1 auto; }
}

/* ---- Original manual figure panels ---- */
.figure-shell {
  margin: 18px 0 0;
  max-width: 860px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #0f1012;
}

.figure-frame {
  display: block;
  padding: 14px 16px;
  background: #0f1012;
}

.figure-frame img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 340px;
  width: auto;
  height: auto;
}

.figure-cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Poster-first video cover: shows the Bunny thumbnail, loads the player on click */
.video-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #000;
  cursor: pointer;
  display: block;
}

.video-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 68px;
  height: 68px;
  margin: -34px 0 0 -34px;
  border-radius: 50%;
  background: rgba(12, 12, 12, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.9);
  transition: transform 160ms ease, background 160ms ease;
}

.video-play::after {
  content: '';
  position: absolute;
  left: 26px;
  top: 21px;
  border-style: solid;
  border-width: 12px 0 12px 19px;
  border-color: transparent transparent transparent #fff;
}

.video-cover:hover .video-play,
.video-cover:focus-visible .video-play {
  transform: scale(1.08);
  background: var(--amber, #f5b301);
}

.video-cover:hover .video-play::after,
.video-cover:focus-visible .video-play::after {
  border-left-color: #0c0c0c;
}

.video-fallback {
  margin: 0;
  padding: 0 16px 12px;
  background: var(--surface);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.video-fallback a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.video-fallback a:hover { color: var(--amber, #f5b301); }
