/* deck.orionaiapp.com. Orion's black and white: the gate is the light share-card look, the reader
   is a dark room so any slide design sits well in it. Focus and actions are ink, never a hue. */
:root {
  --paper: #ffffff;
  --ink: #111113;
  --muted: #5f5f66;
  --rule: #e4e4e7;
  --night: #111113;
  --night-2: #1c1c1f;
  --snow: #f5f6f8;
  --night-muted: #a6a6aa;
  --night-rule: rgba(245, 245, 247, 0.16);
  --failed: #b42318;
  --bar: 52px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
[hidden] { display: none !important; }

/* Gate */
#gate { min-height: 100%; display: grid; place-items: center; padding: 32px 20px; }
#gate .panel { width: min(100%, 400px); }
#gate .logo { display: block; margin-bottom: 22px; }
#gate h1 { font-size: 30px; line-height: 1.1; letter-spacing: -0.015em; margin: 0 0 6px; }
#gate .sub { color: var(--muted); font-size: 16px; margin: 0 0 28px; }
#gate label { display: block; font-size: 14px; color: var(--muted); margin: 0 0 6px; }
#gate input {
  display: block; width: 100%; font-size: 16px; color: var(--ink);
  padding: 12px 14px; margin: 0 0 16px;
  border: 1px solid var(--rule); border-radius: 10px; background: #fff;
}
#gate input:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: transparent; }
#gate button {
  width: 100%; min-height: 48px; font-size: 16px; font-weight: 600;
  border: 0; border-radius: 10px; cursor: pointer;
  background: var(--ink); color: var(--paper);
}
#gate button:hover { background: #2a2a2e; }
#gate button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
#gate button[disabled] { opacity: 0.6; cursor: progress; }
#gate .err { color: var(--failed); font-size: 14px; margin: -6px 0 14px; }
#gate .note { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 18px 0 0; }

/* Reader */
body.viewing { background: var(--night); color: var(--snow); overflow: hidden; }
#progress {
  position: fixed; top: 0; left: 0; z-index: 30; height: 2px; width: 0;
  background: var(--snow); transition: width 0.25s ease;
}
#bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: var(--bar);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 20px; font-size: 14px;
  background: rgba(17, 17, 19, 0.88); border-bottom: 1px solid rgba(245, 245, 247, 0.08);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
#bar .brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
#bar .tile {
  display: inline-grid; place-items: center; width: 26px; height: 26px;
  background: #fff; border-radius: 7px;
}
#bar .right { display: inline-flex; align-items: center; gap: 16px; color: var(--night-muted); }
#count { font-variant-numeric: tabular-nums; }
.quiet {
  background: none; border: 0; padding: 4px 0; color: var(--night-muted); cursor: pointer;
  font-size: 13px; text-decoration: underline; text-underline-offset: 3px;
}
.quiet:hover { color: var(--snow); }
.quiet:focus-visible { outline: 2px solid var(--snow); outline-offset: 2px; }

#pages {
  position: fixed; top: var(--bar); left: 0; right: 0; bottom: 0;
  overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y mandatory; outline: none;
}
@media (prefers-reduced-motion: no-preference) { #pages { scroll-behavior: smooth; } }
.page {
  height: calc(100dvh - var(--bar)); scroll-snap-align: start;
  display: grid; place-items: center; padding: 20px 24px 76px;
}
.sheet {
  position: relative; overflow: hidden; border-radius: 4px;
  background: var(--night-2); box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5);
}
.sheet canvas { display: block; width: 100%; height: 100%; background: #fff; }
.sheet .wait {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--night-muted); font-size: 13px;
}
.links { position: absolute; inset: 0; }
.links a { position: absolute; display: block; border-radius: 2px; }
.links a:hover { background: rgba(37, 99, 235, 0.12); }
.links a:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

#status {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 15;
  margin: 0; max-width: 32ch; text-align: center; color: var(--night-muted); font-size: 15px; line-height: 1.5;
}
#status:empty { display: none; }
#status a { color: var(--snow); }

#nav {
  position: fixed; right: 20px; bottom: 18px; z-index: 20; display: flex; gap: 8px;
}
#nav a, #nav button {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 44px; padding: 0 16px; border-radius: 22px;
  border: 1px solid var(--night-rule); background: rgba(28, 28, 31, 0.92);
  color: var(--snow); font-size: 14px; font-weight: 500; line-height: 1;
  text-decoration: none; cursor: pointer;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
#nav a:hover, #nav button:hover { border-color: var(--snow); }
#nav a:focus-visible, #nav button:focus-visible { outline: 2px solid var(--snow); outline-offset: 2px; }
#nav button[disabled] { opacity: 0.4; cursor: default; }
#nav .short { display: none; }

@media (max-width: 760px) {
  #bar { padding: 0 14px; }
  #pages { scroll-snap-type: y proximity; }
  .page { height: auto; padding: 12px 12px 0; }
  .page:last-child { padding-bottom: 88px; }
  .sheet { border-radius: 3px; }
  #nav { left: 12px; right: 12px; bottom: 14px; justify-content: flex-end; }
  #nav .long { display: none; }
  #nav .short { display: inline; }
}

.noscript { padding: 24px; font-size: 16px; }
