:root {
  --color-charcoal: #1a1a1a;
  --color-stone: #8b8589;
  --color-shadow: #0d0d0d;
  --color-amber: #c9a96e;
  --color-amber-soft: #e4c890;
  --color-parchment: #f5f0e6;
  --color-text: #efebe6;
  --color-muted: #b3aaae;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;

  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-deep: 0 20px 48px rgba(0, 0, 0, 0.55);

  --ease-smooth: cubic-bezier(0.23, 0.8, 0.28, 1);
  --duration-fast: 250ms;
  --duration-base: 360ms;

  --max-content-width: 1240px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--color-text);
  background:
    radial-gradient(circle at 15% 20%, rgba(201, 169, 110, 0.1), transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(139, 133, 137, 0.15), transparent 34%),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.015),
      rgba(255, 255, 255, 0.015) 2px,
      transparent 2px,
      transparent 7px
    ),
    linear-gradient(160deg, #131313 0%, #0d0d0d 52%, #171717 100%);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.02em;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -40px;
  z-index: 1000;
  background: #fff;
  color: #111;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: top var(--duration-fast) var(--ease-smooth);
}

.skip-link:focus {
  top: 1rem;
}

.site-shell {
  width: min(100%, var(--max-content-width));
  margin-inline: auto;
  padding: 1.2rem 1rem 2.2rem;
  min-height: 100dvh;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.eyebrow {
  margin: 0;
  color: var(--color-amber-soft);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.site-title {
  margin: 0.2rem 0 0;
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  line-height: 1;
}

.btn {
  border: 1px solid rgba(201, 169, 110, 0.55);
  background: linear-gradient(180deg, rgba(201, 169, 110, 0.18), rgba(201, 169, 110, 0.06));
  color: var(--color-text);
  padding: 0.65rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition:
    transform var(--duration-fast) var(--ease-smooth),
    box-shadow var(--duration-base) var(--ease-smooth),
    border-color var(--duration-fast) var(--ease-smooth);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  border-color: var(--color-amber);
  box-shadow: 0 8px 20px rgba(201, 169, 110, 0.24);
}

.btn:focus-visible,
.reader-nav:focus-visible,
.issue-card:focus-visible {
  outline: 2px solid var(--color-amber-soft);
  outline-offset: 2px;
}

.hub-view {
  animation: reveal-up var(--duration-base) var(--ease-smooth);
}

.hub-intro h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.hub-intro p {
  margin: 0.55rem 0 1.25rem;
  color: var(--color-muted);
  max-width: 52ch;
}

.issues-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 300px));
  justify-content: center;
  align-items: start;
  gap: 1.1rem;
}

.ad-slot--hub {
  width: min(100%, 980px);
  margin: 1.1rem auto 0;
  padding: 0.4rem 0;
}

.ad-slot--return {
  width: min(100%, 980px);
  margin: 1.2rem auto 0;
  padding: 0.4rem 0 0.2rem;
}

.issue-card {
  width: 100%;
  max-width: 300px;
  touch-action: manipulation;
  border: 1px solid rgba(139, 133, 137, 0.35);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    linear-gradient(180deg, rgba(26, 26, 26, 0.8), rgba(13, 13, 13, 0.86));
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  position: relative;
  transform: translateY(10px);
  opacity: 0;
  animation: card-rise 540ms var(--ease-smooth) forwards;
}

.issue-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(130deg, rgba(201, 169, 110, 0.1), transparent 48%);
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-smooth);
}

.issue-card:hover::after,
.issue-card:focus-visible::after,
.issue-card--active::after {
  opacity: 1;
}

.issue-card:hover {
  transform: translateY(-2px);
}

.issue-card--active {
  border-color: rgba(201, 169, 110, 0.68);
}

.issue-card--active .issue-meta__status {
  opacity: 1;
}

.issue-card__cover-wrap {
  width: 100%;
  aspect-ratio: 3 / 4;
  background:
    radial-gradient(circle at 40% 30%, rgba(201, 169, 110, 0.22), transparent 50%),
    linear-gradient(180deg, rgba(42, 42, 42, 0.9), rgba(20, 20, 20, 1));
  overflow: hidden;
}

.issue-card--no-cover .issue-card__cover-wrap {
  display: grid;
  place-items: center;
  min-height: 240px;
}

.issue-card--no-cover .issue-card__cover-wrap::before {
  content: "Cover art unavailable";
  color: rgba(239, 235, 230, 0.86);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.issue-card__cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform var(--duration-base) var(--ease-smooth);
}

.issue-card:hover .issue-card__cover {
  transform: scale(1.05);
}

.issue-card__body {
  padding: 0.85rem 1rem 1rem;
}

.issue-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.issue-meta__number,
.issue-meta__pages,
.issue-meta__status {
  font-size: 0.78rem;
  color: var(--color-muted);
}

.issue-meta__status {
  color: var(--color-amber-soft);
  opacity: 0.7;
}

.issue-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.issue-progress {
  margin-top: 0.7rem;
  height: 0.32rem;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.issue-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, #8b8589, #c9a96e);
  width: 0;
  transition: width var(--duration-base) var(--ease-smooth);
}

.global-progress {
  margin-top: 1.4rem;
  height: 0.45rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.global-progress__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(139, 133, 137, 0.8), rgba(201, 169, 110, 0.95));
  transition: width var(--duration-base) var(--ease-smooth);
}

.reader-view {
  width: 100%;
  height: 100dvh;
  position: fixed;
  inset: 0;
  z-index: 12;
  background:
    radial-gradient(circle at center, rgba(30, 30, 30, 0.68), rgba(5, 5, 5, 0.96)),
    #090909;
  overflow: hidden;
  overscroll-behavior: none;
  animation: fade-in var(--duration-base) var(--ease-smooth);
}

.reader-stage {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(44px, 76px) 1fr minmax(44px, 76px);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  min-height: 0;
}

.page-frame {
  margin: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  position: relative;
  padding: 1rem;
  overflow: hidden;
}

.page-skeleton {
  position: absolute;
  width: min(88vw, 1120px);
  height: min(90dvh, 1600px);
  border-radius: var(--radius-md);
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.07) 8%, rgba(255, 255, 255, 0.16) 18%, rgba(255, 255, 255, 0.07) 33%),
    linear-gradient(180deg, #2a2a2a, #171717);
  background-size: 180% 100%, cover;
  animation: shimmer 1.3s linear infinite;
}

.page-skeleton[hidden] {
  display: none;
}

.page-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-deep);
  opacity: 0;
  transform: scale(0.995);
  transform-origin: 50% 50%;
  transition:
    opacity var(--duration-base) var(--ease-smooth),
    transform var(--duration-base) var(--ease-smooth),
    filter var(--duration-base) var(--ease-smooth);
  filter: blur(8px);
  cursor: zoom-in;
}

.page-image.is-loaded {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

.page-image.is-loaded.is-zoomed {
  transform: scale(2.2);
  cursor: zoom-out;
  touch-action: none;
  user-select: none;
  will-change: transform;
}

.page-image.is-loaded.is-zoomed.is-panning {
  cursor: grabbing;
}

.page-error {
  position: absolute;
  background: rgba(23, 23, 23, 0.9);
  border: 1px solid rgba(201, 169, 110, 0.5);
  color: var(--color-amber-soft);
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
}

.zoom-hint {
  position: absolute;
  left: 50%;
  bottom: 0.85rem;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(201, 169, 110, 0.32);
  color: var(--color-text);
  font-size: 0.76rem;
  line-height: 1.1;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  pointer-events: none;
  z-index: 4;
}

.reader-nav {
  align-self: stretch;
  position: relative;
  z-index: 3;
  border: none;
  background: transparent;
  color: rgba(239, 235, 230, 0.88);
  cursor: pointer;
  font-size: 2rem;
  transition: opacity var(--duration-base) var(--ease-smooth);
}

.reader-nav--next {
  transform: translateX(-18px);
}

.reader-nav[disabled] {
  opacity: 0.2;
  cursor: not-allowed;
}

.reader-nav span {
  display: inline-block;
  padding-inline: 0.5rem;
}

.reader-overlay {
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-smooth);
}

.reader-overlay .btn,
.reader-overlay p {
  pointer-events: auto;
}

.issue-label,
.page-counter {
  margin: 0;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.52);
  color: var(--color-text);
  font-size: 0.86rem;
}

.reader-stage.is-idle .reader-overlay,
.reader-stage.is-idle .reader-nav {
  opacity: 0.12;
}

.reader-stage.is-idle .reader-overlay {
  opacity: 1;
}

.reader-stage.is-idle .reader-overlay .issue-label,
.reader-stage.is-idle .reader-overlay .page-counter {
  opacity: 0.16;
}

.reader-stage.is-idle .reader-overlay .btn-back {
  opacity: 0.34;
}

.prose-panel {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(18px);
  bottom: 1rem;
  width: min(94vw, 1040px);
  max-height: min(42dvh, 420px);
  background:
    linear-gradient(180deg, rgba(6, 6, 6, 0.78), rgba(10, 10, 10, 0.9)),
    linear-gradient(120deg, rgba(245, 240, 230, 0.06), transparent 42%);
  border: 1px solid rgba(245, 240, 230, 0.26);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.58);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--duration-base) var(--ease-smooth),
    transform var(--duration-base) var(--ease-smooth);
}

.reader-stage.prose-open .prose-panel {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.prose-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid rgba(245, 240, 230, 0.22);
}

.prose-panel__title {
  margin: 0;
  font-size: 1rem;
  color: var(--color-amber-soft);
}

.prose-content {
  padding: 0.95rem 1rem 1.15rem;
  max-height: calc(min(42dvh, 420px) - 56px);
  overflow-y: auto;
  color: var(--color-parchment);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.8;
  letter-spacing: 0.01em;
}

.prose-content p {
  margin: 0 0 0.95rem;
}

.prose-content p:last-child {
  margin-bottom: 0;
}

.prose-inline-ad {
  margin-top: 1rem;
}

.reader-stage.prose-open.prose-mode-split .page-frame {
  padding-right: clamp(320px, 34vw, 520px);
}

.reader-stage.prose-open.prose-mode-split .page-image {
  /* Use viewport-based bounds so tall pages always fit in split mode. */
  max-height: calc(100dvh - 2rem);
  max-width: calc(100vw - clamp(320px, 34vw, 520px) - 168px);
}

.reader-stage.prose-open.prose-mode-split .prose-panel {
  left: auto;
  transform: none;
  right: 0;
  top: 0;
  bottom: 0;
  width: clamp(300px, 34vw, 520px);
  max-height: none;
  border-radius: 0;
  border-left: 1px solid rgba(245, 240, 230, 0.24);
  border-right: none;
  border-top: none;
  border-bottom: none;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(245, 240, 230, 0.08),
      rgba(245, 240, 230, 0.08) 2px,
      rgba(209, 198, 176, 0.08) 2px,
      rgba(209, 198, 176, 0.08) 8px
    ),
    linear-gradient(180deg, rgba(31, 30, 28, 0.94), rgba(19, 19, 19, 0.95));
}

.reader-stage.prose-open.prose-mode-split .prose-content {
  max-height: calc(100dvh - 56px);
}

.reader-stage:hover .reader-overlay,
.reader-stage:hover .reader-nav,
.reader-stage:focus-within .reader-overlay,
.reader-stage:focus-within .reader-nav {
  opacity: 1;
}

.reader-stage.is-image-zoomed .reader-nav {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.reader-stage.is-image-zoomed .zoom-hint {
  opacity: 0;
  visibility: hidden;
}

.noscript-message {
  position: fixed;
  inset: auto 1rem 1rem;
  background: #111;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
}

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

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes card-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  from {
    background-position: 180% 0, 0 0;
  }
  to {
    background-position: -180% 0, 0 0;
  }
}

@media (max-width: 960px) {
  .reader-stage {
    grid-template-columns: 56px 1fr 56px;
  }

  .reader-overlay {
    flex-wrap: wrap;
    justify-content: center;
  }

  .prose-panel__header {
    flex-wrap: wrap;
  }
}

@media (max-width: 860px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-continue {
    align-self: flex-start;
  }

  .issues-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 640px) {
  .site-shell {
    padding-inline: 0.75rem;
    padding-bottom: 1.2rem;
  }

  .hub-intro p {
    max-width: none;
  }

  .issues-grid {
    grid-template-columns: 1fr;
  }

  .issue-card {
    max-width: none;
  }

  .reader-view {
    background: #070707;
  }

  .reader-stage {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  .reader-nav span {
    font-size: 1.45rem;
  }

  .page-frame {
    padding: 0.35rem;
  }

  .reader-overlay {
    left: 0.45rem;
    right: 0.45rem;
    top: 0.45rem;
    gap: 0.35rem;
  }

  .issue-label,
  .page-counter {
    font-size: 0.72rem;
    padding: 0.38rem 0.6rem;
  }

  .prose-panel {
    width: calc(100% - 0.6rem);
    max-height: min(46dvh, 360px);
    bottom: 0.3rem;
  }

  .prose-content {
    font-size: 0.95rem;
    line-height: 1.65;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .site-header,
  .hub-view,
  .reader-nav,
  .reader-overlay,
  .page-skeleton,
  .page-error {
    display: none !important;
  }

  .reader-view {
    position: static;
    background: #fff;
    display: block !important;
  }

  .page-frame {
    height: auto;
    padding: 0;
  }

  .page-image {
    opacity: 1 !important;
    filter: none !important;
    max-width: 100%;
    max-height: none;
    box-shadow: none;
  }

  .prose-panel {
    display: block !important;
    position: static;
    transform: none;
    width: 100%;
    max-height: none;
    border: 1px solid rgba(0, 0, 0, 0.25);
    margin-top: 0.7rem;
    opacity: 1;
    pointer-events: auto;
    background: #fff;
    color: #000;
  }

  .prose-panel__header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  }

  .prose-content {
    color: #000;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 768px) {
  .reader-view {
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  .reader-stage {
    height: auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    padding-bottom: 0.5rem;
  }

  .reader-overlay {
    position: sticky;
    top: calc(env(safe-area-inset-top, 0px) + 0.35rem);
    left: auto;
    right: auto;
    order: -1;
    width: min(calc(100% - 0.9rem), 42rem);
    margin: 0 auto 0.45rem;
    padding: 0.35rem;
    border-radius: var(--radius-md);
    background: rgba(10, 10, 10, 0.68);
    backdrop-filter: blur(6px);
    z-index: 7;
  }

  .reader-nav {
    flex: 1 1 0;
    min-width: 0;
    min-height: 3.25rem;
    display: flex;
    align-items: center;
    font-size: 1.65rem;
    color: rgba(239, 235, 230, 0.92);
    background: linear-gradient(180deg, rgba(11, 11, 11, 0.78), rgba(11, 11, 11, 0.38));
    border: 1px solid rgba(201, 169, 110, 0.2);
    margin-top: 0.12rem;
    margin-bottom: 0.12rem;
  }

  .reader-nav--prev {
    order: 2;
    justify-content: flex-start;
    padding-left: 0.55rem;
    border-top-left-radius: 999px;
    border-bottom-left-radius: 999px;
    margin-left: 0.45rem;
    margin-right: 0.2rem;
  }

  .reader-nav--next {
    order: 3;
    justify-content: flex-end;
    padding-right: 0.55rem;
    border-top-right-radius: 999px;
    border-bottom-right-radius: 999px;
    margin-right: 0.45rem;
    margin-left: 0.2rem;
    transform: none;
  }

  .reader-nav span {
    font-size: 1.65rem;
    line-height: 1;
  }

  .page-frame {
    order: 1;
    width: 100%;
    height: auto;
    min-height: 0;
    flex: 0 0 auto;
    padding: 0.45rem;
    overflow: visible;
  }

  .page-image {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
    margin: 0 auto;
  }

  .reader-stage.prose-open.prose-mode-split .page-frame {
    padding-right: 0;
  }

  .reader-stage.prose-open.prose-mode-split .page-image {
    width: 100%;
    max-width: 100%;
    max-height: none;
  }

  .prose-panel {
    order: 4;
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none;
    width: min(calc(100% - 0.9rem), 42rem);
    max-height: none;
    margin: 0.45rem auto 0;
    border-radius: var(--radius-md);
    opacity: 1;
    pointer-events: auto;
    display: none;
  }

  .prose-panel__header {
    width: min(100%, 65ch);
    margin: 0 auto;
  }

  .reader-stage.prose-open .prose-panel {
    display: block;
  }

  .reader-stage.prose-open .prose-panel,
  .reader-stage.prose-open.prose-mode-split .prose-panel {
    left: auto;
    right: auto;
    transform: none;
  }

  .prose-content {
    width: min(100%, 65ch);
    margin: 0 auto;
    max-height: none;
    overflow: visible;
    text-align: left;
  }
}

@media (max-width: 430px) {
  .reader-overlay {
    width: min(calc(100% - 0.6rem), 34rem);
    margin: 0 auto 0.3rem;
    padding: 0.22rem 0.28rem;
    gap: 0.28rem;
    border-radius: 10px;
  }

  .reader-overlay .btn {
    padding: 0.4rem 0.64rem;
    font-size: 0.78rem;
    line-height: 1.1;
  }

  .issue-label,
  .page-counter {
    padding: 0.3rem 0.46rem;
    font-size: 0.67rem;
    line-height: 1.1;
  }

  .reader-nav {
    min-height: 3rem;
    margin-top: 0.08rem;
    margin-bottom: 0.08rem;
  }

  .reader-nav span {
    font-size: 1.52rem;
  }

  .zoom-hint {
    display: inline-flex;
  }
}