:root {
  --bg: #ffffff;
  --ink: #111111;
  --ink-soft: #4a4a4a;
  --orange: #d9591c;
  --orange-bg: #fff5ee;
  --rule: #e4e4e4;
  --content-width: 860px;
  --sidebar-width: 360px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- home logo --- */
.home-logo {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  text-decoration: none;
  outline: none;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.home-logo:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.home-logo:focus-visible {
  background-color: rgba(0, 0, 0, 0.04);
  box-shadow: 0 0 0 3px rgba(217, 89, 28, 0.45);
}

.home-logo svg {
  width: 40px;
  height: 40px;
  display: block;
  pointer-events: none;
}

.page {
  width: 100%;
  display: flex;
  justify-content: center;
  transition: transform 0.45s cubic-bezier(.65, 0, .35, 1), padding 0.45s cubic-bezier(.65, 0, .35, 1);
}

.page.shifted {
  transform: translateX(calc(-1 * var(--sidebar-width) / 2));
}

main {
  width: 100%;
  max-width: var(--content-width);
  padding: 96px 24px 160px;
}

h1 {
  text-align: center;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.08em;
  text-transform: none;
  margin: 0 0 6px;
}

.byline {
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 64px;
}

.divider {
  text-align: center;
  margin: 0 auto 64px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
}

p {
  font-size: 17px;
  line-height: 1.9;
  color: var(--ink);
  margin: 0 0 32px;
  text-align: left;
}

p:last-of-type {
  margin-bottom: 0;
}

.end-mark {
  display: block;
  text-align: center;
  margin-top: 64px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
}

/* --- annotation spans --- */
.annot {
  cursor: default;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  border-radius: 2px;
}

body.annot-mode .annot {
  cursor: pointer;
  box-shadow: inset 0 -2px 0 0 rgba(217, 89, 28, 0.55);
}

body.annot-mode .annot:hover {
  background-color: var(--orange-bg);
}

.annot.active {
  background-color: var(--orange-bg);
  box-shadow: inset 0 -2px 0 0 var(--orange);
}

/* --- toggle button --- */
.toggle-wrap {
  text-align: center;
  margin-top: 48px;
  margin-bottom: 96px;
}

#toggleBtn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 11px 18px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

#toggleBtn:hover {
  background: var(--ink);
  color: var(--bg);
}

#toggleBtn .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-soft);
  transition: background 0.2s ease;
}

body.annot-mode #toggleBtn .dot {
  background: var(--orange);
}

body.annot-mode #toggleBtn {
  border-color: var(--orange);
  color: var(--orange);
}

body.annot-mode #toggleBtn:hover {
  background: var(--orange);
  color: #fff;
}

/* --- sidebar --- */
#sidebar {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: var(--sidebar-width);
  max-width: 88vw;
  background: var(--orange);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(.65, 0, .35, 1);
  z-index: 30;
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.08);
}

#sidebar.open {
  transform: translateX(0);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 28px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.sidebar-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.85;
}

#closeSidebar {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#closeSidebar:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar-body {
  padding: 24px 28px 40px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-body::-webkit-scrollbar {
  display: none;
}

.sidebar-quote {
  font-size: 13px;
  line-height: 1.7;
  opacity: 0.85;
  font-style: italic;
  padding-left: 12px;
  border-left: 2px solid rgba(255, 255, 255, 0.6);
  margin: 0 0 24px;
}

.sidebar-text {
  font-size: 14px;
  line-height: 1.85;
  white-space: pre-wrap;
}

@media (max-width: 720px) {
  :root {
    --sidebar-width: 100vw;
  }

  .page.shifted {
    transform: translateX(0);
    opacity: 0.15;
    pointer-events: none;
  }

  .home-logo {
    top: 16px;
    left: 16px;
    width: 44px;
    height: 44px;
  }

  .home-logo svg {
    width: 32px;
    height: 32px;
  }
}