@font-face {
  font-family: 'Neue Haas';
  src: url('./assets/NeueHaasDisplayRoman.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Neue Haas';
  src: url('./assets/NeueHaasDisplayBold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --page-navigation-size: 48px;
  color-scheme: dark;
  font-family: 'Neue Haas', Arial, sans-serif;
  color: #fff;
  background: #2c20a0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.introduction {
  width: min(100%, 375px);
  height: 100vh;
  height: 100dvh;
  margin-inline: auto;
  padding: max(32px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) var(--page-navigation-size);
  gap: 40px;
}

h1 {
  margin: 0;
  color: #ffeb33;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.reading-frame {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  overflow-wrap: break-word;
  scrollbar-width: thin;
  scrollbar-color: #ffffff70 transparent;
}

p { margin: 0; }
.paragraph-space { margin-bottom: 1.4em; }

.page-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-arrow {
  position: relative;
  display: block;
  width: var(--page-navigation-size);
  height: var(--page-navigation-size);
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

.page-arrow::after { content: ''; position: absolute; inset: -6px; }
.page-arrow img { display: block; width: var(--page-navigation-size); height: var(--page-navigation-size); }
.page-arrow:disabled { opacity: .35; }
.page-arrow:active { opacity: .75; }
.page-arrow:focus-visible, .reading-frame:focus-visible { outline: 2px solid #ffeb33; outline-offset: 5px; }

/* Unlike mobile native scrollbars, this remains visible while reading. */
.reading-frame.has-guide-scrollbar, .caption-scroll.has-guide-scrollbar { scrollbar-width: none; }
.has-guide-scrollbar::-webkit-scrollbar { display: none; }
.guide-scrollbar {
  position: fixed;
  z-index: 10;
  right: max(3px, env(safe-area-inset-right));
  width: 12px;
  touch-action: none;
  cursor: pointer;
}
.guide-scrollbar[hidden] { display: none; }
.guide-scrollbar::before {
  content: '';
  position: absolute;
  inset: 0 4px;
  background: #ffffff40;
  border-radius: 4px;
}
.guide-scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 4px;
  width: 4px;
  border-radius: 4px;
  background: #ffeb33;
}
.guide-scrollbar:focus-visible { outline: 1px solid #ffeb33; outline-offset: 1px; }

/* Keep OS-detected dates and year ranges visually identical to the copy. */
a[x-apple-data-detectors], a[data-detector], a[href^="x-apple-data-detectors:"] {
  color: inherit !important;
  text-decoration: none !important;
  border-bottom: 0 !important;
  font: inherit !important;
}

@media (max-height: 480px) {
  .introduction { padding-block: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-bottom)); gap: 20px; }
}
