/* Interdimensional Split comic reader — matches the v2 site, A-final branding */
:root {
  --bg: #07060d;
  --bg-2: #0e0a18;
  --ink: #f5f0ff;
  --muted: #b7a8c9;
  --violet: #c084fc;
  --cyan: #22d3ee;
  --line: rgba(192, 132, 252, 0.35);
  --header-h: 64px;
  --controls-h: 64px;
  --dock-h: 148px;
  --font: "Inter", system-ui, sans-serif;
  --display: "Sora", "Inter", system-ui, sans-serif;
  --wordmark: "Orbitron", "Sora", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body.reader-page {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.reader {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--violet); }

.skip-link {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--cyan); color: #041016; padding: 0.5rem 1rem;
  z-index: 100; border-radius: 6px;
}
.skip-link:focus { top: 0.75rem; }

.reader-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(7, 6, 13, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(192, 132, 252, 0.15);
}
.reader-header-inner {
  width: min(1120px, calc(100% - 1.5rem));
  margin-inline: auto;
  min-height: var(--header-h);
  display: flex; align-items: center; gap: 0.8rem;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); min-width: 0; }
.brand:hover, .brand:hover .brand-name { color: var(--ink); }
.brand-monogram { height: 36px; width: auto; flex: none; object-fit: contain; }
.brand-name {
  font-family: var(--wordmark);
  font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; font-size: 0.68rem;
  white-space: nowrap; color: var(--ink);
}
.brand-name i { font-style: normal; color: var(--cyan); }
.reader-kicker {
  margin: 0;
  font-family: var(--display);
  letter-spacing: 0.16em; text-transform: uppercase;
  font-size: 0.64rem; color: var(--muted);
  display: none;
  flex: 1;
  text-align: center;
}
.back-link {
  font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap; flex: none; margin-left: auto;
}
.back-short { display: none; }
@media (max-width: 700px) {
  .back-short { display: inline; }
  .back-long { display: none; }
  .brand-name { font-size: 0.58rem; letter-spacing: 0.05em; }
}
@media (min-width: 700px) {
  :root { --header-h: 72px; }
  .brand-monogram { height: 44px; }
  .brand-name { font-size: 0.8rem; letter-spacing: 0.1em; }
  .reader-kicker { display: block; }
}

.reader-note {
  width: min(1120px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 0.25rem 0 0.55rem;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fbbf24;
}
.reader-note[hidden] { display: none; }
.reader-note:not([hidden]) { display: block; }

.reader-stage {
  position: relative;
  min-height: calc(100svh - var(--header-h) - var(--dock-h));
}
.reader-pages { }

/* Scroll mode (phones): vertical stack */
.reader[data-mode="scroll"] .reader-pages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(900px, calc(100% - 1rem));
  margin: 0.75rem auto 5.5rem;
}
.reader[data-mode="scroll"] .reader-page-item {
  background: #000;
  border-radius: 4px;
  overflow: hidden;
}
.reader[data-mode="scroll"] .reader-page-item img {
  width: 100%;
  height: auto;
  margin: 0 auto;
  user-select: none;
  -webkit-user-drag: none;
}
.reader[data-mode="scroll"] .reader-stage {
  overflow-x: auto;
}

/* Paged mode (desktop) */
.reader[data-mode="paged"] .reader-stage {
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  touch-action: none;
  cursor: grab;
}
.reader[data-mode="paged"] .reader-stage.is-panning { cursor: grabbing; }
.reader[data-mode="paged"] .reader-pages {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: auto;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.reader[data-mode="paged"] .reader-page-item {
  display: none;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0.75rem;
}
.reader[data-mode="paged"] .reader-page-item.is-current {
  display: flex;
  align-items: center;
  justify-content: center;
}
.reader[data-mode="paged"] .reader-page-item picture {
  flex: 1;
  min-height: 0;
  height: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reader[data-mode="paged"] .reader-page-item img {
  width: auto;
  height: calc(100svh - var(--header-h) - var(--dock-h) - 1.5rem);
  max-height: calc(100svh - var(--header-h) - var(--dock-h) - 1.5rem);
  max-width: min(100%, 72vw);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  transform-origin: center center;
}

.reader-controls {
  position: relative;
  z-index: 40;
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.7rem;
  min-height: var(--controls-h);
  padding: 0.45rem 0.75rem;
  background: rgba(7, 6, 13, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(192, 132, 252, 0.15);
}
.reader-dock { flex: none; }
.reader[data-mode="scroll"] .reader-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
}
.reader[data-mode="scroll"] .reader-controls { position: static; }
.reader-btn {
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.reader-btn:hover { border-color: var(--cyan); color: #fff; }
.reader-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.reader-btn:disabled { opacity: 0.35; cursor: default; }
.reader-btn-text { text-transform: none; letter-spacing: 0.02em; }
.reader-counter {
  margin: 0;
  min-width: 5.5rem;
  text-align: center;
  font-family: var(--wordmark);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}
.reader-zoom { display: flex; align-items: center; gap: 0.3rem; }
.reader-zoom-label {
  min-width: 3.4rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.reader.is-loading .reader-pages { min-height: 40svh; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}


.reader-thumbs {
  flex: none;
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.4rem 0.75rem 0.35rem;
  background: rgba(7, 6, 13, 0.92);
  border-top: 1px solid rgba(192, 132, 252, 0.15);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.reader-thumbs[hidden] { display: none; }
.reader[data-mode="scroll"] .reader-thumbs { position: static; }
.reader[data-mode="scroll"] .reader-pages { margin-bottom: 10rem; }
.reader-thumb {
  appearance: none;
  flex: none;
  margin: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  background: #000;
  cursor: pointer;
  width: 40px;
  height: 60px;
  overflow: hidden;
}
.reader-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}
.reader-thumb.is-current {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan);
}
.reader-thumb:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
@media (min-width: 701px) {
  .reader-thumb { width: 48px; height: 72px; }
}
