/* ===== BID LLC Company Profile — viewer styles ===== */
:root {
  --accent: #c8a24b;
  --bg: #0d0e10;
  --surface: #16181c;
  --surface-2: #1d2024;
  --text: #e8e9ec;
  --muted: #9aa0a8;
  --border: #262a30;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --bar-h: 60px;
  --maxw: 1200px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef0f3;
  --surface: #ffffff;
  --surface-2: #f4f5f7;
  --text: #16181c;
  --muted: #5a616b;
  --border: #e2e5ea;
  --shadow: 0 10px 40px rgba(20, 24, 31, .14);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { height: 30px; width: auto; display: block; }
.brand .wordmark {
  font-weight: 800; letter-spacing: .2px; font-size: 18px;
  display: inline-block;
}
.brand .wordmark b { color: var(--accent); }
.brand .doc-title {
  color: var(--muted); font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 1px solid var(--border); padding-left: 12px;
}
.spacer { flex: 1 1 auto; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 9px 13px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #141414; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-icon { padding: 9px; }
.btn .sub { color: inherit; opacity: .7; font-weight: 500; }
.btn-mini { display: none; font-weight: 700; }

/* ---------- viewer ---------- */
.viewer {
  max-width: var(--maxw);
  margin: 24px auto 120px;
  padding: 0 16px;
  display: flex; flex-direction: column; gap: 22px;
}
.page {
  position: relative; margin: 0;
  width: 100%;
  border-radius: 12px; overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  cursor: zoom-in;
  scroll-margin-top: calc(var(--bar-h) + 12px);
}
.page .ph {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: blur(14px); transform: scale(1.06);
}
.page picture, .page .full { display: block; width: 100%; height: auto; }
.page .full { position: relative; opacity: 0; transition: opacity .4s ease; }
.page .full.loaded { opacity: 1; }
.page .num {
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  font-size: 12px; font-weight: 600; color: #fff;
  background: rgba(0,0,0,.55); padding: 3px 9px; border-radius: 999px;
  opacity: 0; transition: opacity .2s;
}
.page:hover .num { opacity: 1; }

/* ---------- flipbook mode ---------- */
.viewer.flip {
  max-width: none; margin: 0; padding: 0;
  height: calc(100vh - var(--bar-h));
  display: block; position: relative; overflow: hidden;
}
.viewer.flip .page {
  position: absolute; inset: 0; margin: auto;
  width: auto; height: auto;
  max-width: min(100%, calc((100vh - var(--bar-h) - 48px) * 1.7778));
  max-height: calc(100vh - var(--bar-h) - 48px);
  border-radius: 10px;
  display: none;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
}
.viewer.flip .page.active { display: block; }
.viewer.flip .page .full { height: auto; }

/* ---------- controls (floating) ---------- */
.hud {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  z-index: 40; display: flex; align-items: center; gap: 6px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 8px; box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.hud .counter { font-size: 13px; font-weight: 700; padding: 0 8px; font-variant-numeric: tabular-nums; }
.hud button {
  width: 34px; height: 34px; border-radius: 999px; border: none;
  background: transparent; color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.hud button:hover { background: var(--surface-2); }
.hud button:disabled { opacity: .3; cursor: default; }
.hud .nav { display: none; }
.viewer.flip ~ .hud .nav { display: inline-flex; }

/* ---------- lightbox (desktop click-to-zoom) ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(8,9,11,.92); backdrop-filter: blur(4px);
  overflow: hidden; touch-action: pinch-zoom;
}
.lightbox.open { display: block; }
.lightbox img {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  max-width: 100vw; max-height: 100vh;
  transition: transform .18s ease; cursor: zoom-in; will-change: transform;
}
.lightbox.zoomed img { cursor: grab; transition: none; }
.lightbox .lb-close {
  position: fixed; top: 14px; right: 16px; z-index: 2;
  width: 42px; height: 42px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.lightbox .lb-hint {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  font-size: 12px; color: var(--muted); background: var(--surface);
  border: 1px solid var(--border); padding: 5px 12px; border-radius: 999px;
}

/* ---------- misc ---------- */
.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;
}
footer {
  max-width: var(--maxw); margin: 0 auto; padding: 28px 16px 60px;
  color: var(--muted); font-size: 13px; text-align: center;
}
footer a { color: var(--accent); text-decoration: none; }

@media (max-width: 720px) {
  body { overflow-x: hidden; }
  .topbar { gap: 8px; padding: 0 12px; }
  .brand .doc-title { display: none; }
  .btn .label-long { display: none; }
  /* secondary download → icon only; primary → icon + "HD" */
  .btn .btn-txt { display: none; }
  .btn-primary .btn-mini { display: inline; }
  /* when it's the only download button, keep its full label */
  .btn-solo .btn-txt { display: inline; }
  .btn { padding: 9px 11px; }
  .viewer { gap: 14px; margin-top: 14px; }
  :root { --bar-h: 54px; }
}
@media (max-width: 380px) {
  .brand .wordmark { font-size: 16px; }
  .topbar { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .page .full, .lightbox img { transition: none; }
}
