:root {
  --ux-reader-font-size: 19px;
  --ux-poem-font-size: 22px;
  --ux-poem-mobile-font-size: 17.5px;
  --ux-reader-line-height: 1.82;
  --ux-reader-width: 52rem;
}

:focus-visible {
  outline: 2px solid #ecd39e;
  outline-offset: 4px;
}

[id] {
  scroll-margin-top: 90px;
}

.ux-skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 13px 17px;
  border: 1px solid #d6b06a;
  color: #090909;
  background: #ecd39e;
  font: 600 12px/1.2 "Manrope", Arial, sans-serif;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.ux-skip-link:focus {
  transform: none;
}

html[data-ux-theme="warm"] {
  --hub-bg: #15110c;
  --hub-panel: #1b1711;
  --hub-panel-soft: #201a12;
  --hub-ink: #f0e8dc;
  --hub-muted: #a39a8c;
  --ink: #15110c;
  --paper: #f0e8dc;
}

html[data-ux-theme="warm"] body:not(.is-locked) {
  background:
    radial-gradient(circle at 82% 8%, rgba(166, 111, 46, 0.16), transparent 31rem),
    linear-gradient(180deg, #15110c 0%, #100d09 52%, #15110c 100%);
}

html[data-ux-theme="contrast"] {
  --hub-bg: #000;
  --hub-panel: #080808;
  --hub-panel-soft: #0b0b0b;
  --hub-ink: #fff;
  --hub-muted: #d2d2d2;
  --hub-line: rgba(255, 255, 255, 0.34);
  --hub-gold: #ffd477;
  --hub-gold-soft: #ffe2a4;
  --ink: #000;
  --paper: #fff;
  --muted: rgba(255, 255, 255, 0.8);
  --line: rgba(255, 255, 255, 0.32);
}

html[data-ux-theme="contrast"] body {
  color: #fff;
  background: #000;
}

html[data-ux-theme="contrast"] :is(.hub-kicker, .catalog-hero > p, .poem-lead, .poetry-card__copy p, .work-card-copy p, .hub-lead) {
  color: #e6e6e6;
}

html[data-ux-theme="warm"] .reader {
  --reader-bg: #e9e0d1;
  --reader-text: #29251f;
  --reader-muted: #665f55;
}

html[data-ux-theme="contrast"] .reader {
  --reader-bg: #000;
  --reader-text: #fff;
  --reader-muted: #d4d4d4;
}

.reader-content {
  max-width: var(--ux-reader-width);
  margin-inline: auto;
  font-size: var(--ux-reader-font-size) !important;
  line-height: var(--ux-reader-line-height) !important;
}

.reader-book {
  width: min(100%, calc(var(--ux-reader-width) + 10rem)) !important;
}

.static-reader-content {
  width: min(100%, var(--ux-reader-width)) !important;
  font-size: var(--ux-reader-font-size) !important;
  line-height: var(--ux-reader-line-height) !important;
}

.static-reader-content p {
  line-height: inherit !important;
}

.poem-text {
  max-width: min(100%, var(--ux-reader-width)) !important;
  font-size: var(--ux-poem-font-size) !important;
  line-height: var(--ux-reader-line-height) !important;
}

.poem-reader {
  width: min(100%, calc(var(--ux-reader-width) + 8rem));
}

.ux-settings-button {
  position: fixed;
  z-index: 260;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(214, 176, 106, 0.62);
  border-radius: 50%;
  color: #e9ddc4;
  background: rgba(13, 13, 12, 0.9);
  box-shadow: 0 15px 48px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
  cursor: pointer;
  font: 500 13px/1 "Prata", Georgia, serif;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.ux-settings-button:hover,
.ux-settings-button:focus-visible {
  color: #16110a;
  background: #ecd39e;
  transform: translateY(-2px);
}

body.is-locked .ux-settings-button,
body.is-poem-modal-open .ux-settings-button {
  display: none;
}

body.is-ux-settings-open {
  overflow: hidden;
}

.ux-settings {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  justify-items: end;
}

.ux-settings[hidden] {
  display: none;
}

.ux-settings__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(2, 2, 2, 0.72);
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.ux-settings__panel {
  position: relative;
  width: min(100%, 450px);
  height: 100%;
  overflow-y: auto;
  padding: 34px clamp(22px, 5vw, 38px);
  border-left: 1px solid rgba(214, 176, 106, 0.34);
  color: #ebe6dc;
  background:
    radial-gradient(circle at 85% 5%, rgba(214, 176, 106, 0.12), transparent 22rem),
    #0d0e0d;
  box-shadow: -28px 0 90px rgba(0, 0, 0, 0.55);
  font-family: "Manrope", Arial, sans-serif;
  animation: ux-panel-in 260ms cubic-bezier(.22, .75, .18, 1) both;
}

@keyframes ux-panel-in {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: none; }
}

.ux-settings__panel > header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(235, 230, 220, 0.14);
}

.ux-settings__panel header small,
.ux-settings__panel legend {
  color: #d6b06a;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.ux-settings__panel header h2 {
  margin: 8px 0 0;
  font-family: "Prata", Georgia, serif;
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -.04em;
}

.ux-settings__panel header > button {
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid rgba(235, 230, 220, 0.18);
  color: #ddd6ca;
  background: transparent;
  cursor: pointer;
  font-size: 27px;
}

.ux-setting {
  min-width: 0;
  margin: 0;
  padding: 25px 0;
  border: 0;
  border-bottom: 1px solid rgba(235, 230, 220, 0.12);
}

.ux-setting > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.ux-setting strong,
.ux-motion strong {
  font-size: 12px;
  font-weight: 500;
}

.ux-setting output {
  color: #d6b06a;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.ux-setting input[type="range"] {
  width: 100%;
  height: 44px;
  margin-top: 13px;
  accent-color: #d6b06a;
  cursor: pointer;
}

.ux-setting legend {
  width: 100%;
  margin-bottom: 15px;
}

.ux-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.ux-options button {
  min-height: 44px;
  padding: 8px 6px;
  border: 1px solid rgba(235, 230, 220, 0.16);
  color: #9d988f;
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.ux-options button.is-active {
  border-color: rgba(214, 176, 106, 0.68);
  color: #f0e7d7;
  background: rgba(214, 176, 106, 0.09);
}

.ux-motion {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 25px 0;
  border-bottom: 1px solid rgba(235, 230, 220, 0.12);
  cursor: pointer;
}

.ux-motion > span {
  display: grid;
  gap: 6px;
}

.ux-motion small {
  max-width: 250px;
  color: #858078;
  font-size: 9px;
  line-height: 1.55;
}

.ux-motion input {
  position: absolute;
  opacity: 0;
}

.ux-motion i {
  position: relative;
  width: 48px;
  height: 27px;
  flex: none;
  border: 1px solid rgba(235, 230, 220, 0.24);
  border-radius: 99px;
  background: #171817;
}

.ux-motion i::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #9b978f;
  transition: transform 180ms ease, background 180ms ease;
}

.ux-motion input:checked + i::after {
  background: #ecd39e;
  transform: translateX(21px);
}

.ux-motion input:focus-visible + i {
  outline: 2px solid #ecd39e;
  outline-offset: 4px;
}

.ux-install {
  padding: 25px 0;
  border-bottom: 1px solid rgba(235, 230, 220, 0.12);
}

.ux-install button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border: 1px solid rgba(214, 176, 106, 0.48);
  color: #eee5d6;
  background: rgba(214, 176, 106, 0.06);
  cursor: pointer;
  font-size: 10px;
}

.ux-install button[hidden] {
  display: none;
}

.ux-install p {
  margin: 10px 0 0;
  color: #858078;
  font-size: 9px;
  line-height: 1.55;
}

.ux-settings__panel > footer {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: space-between;
  padding-top: 25px;
}

.ux-settings__panel > footer button {
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid rgba(235, 230, 220, 0.24);
  color: #938e85;
  background: transparent;
  cursor: pointer;
  font-size: 9px;
}

[data-ux-network] {
  color: #7f9473;
  font-size: 8px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

[data-ux-network].is-offline {
  color: #d6b06a;
}

.ux-personal[hidden] {
  display: none;
}

.ux-personal {
  padding-top: clamp(75px, 9vw, 125px);
  padding-bottom: clamp(75px, 9vw, 125px);
}

.ux-personal__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 35px;
  margin-bottom: 34px;
}

.ux-personal__head h2 {
  font-size: clamp(42px, 5vw, 72px);
}

.ux-personal__head > span {
  color: #78746d;
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.ux-personal__card {
  display: grid;
  grid-template-columns: minmax(180px, .38fr) 1fr;
  min-height: 390px;
  border: 1px solid rgba(235, 230, 220, 0.15);
  background: rgba(255, 255, 255, 0.012);
}

.ux-personal__cover {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  background: #111;
}

.ux-personal__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(5, 5, 4, .78));
}

.ux-personal__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.72) brightness(.78);
}

.ux-personal__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(30px, 6vw, 75px);
}

.ux-personal__copy h3 {
  margin: 0;
  font-family: "Prata", Georgia, serif;
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 400;
  letter-spacing: -.045em;
}

.ux-personal__copy > p {
  max-width: 600px;
  margin: 22px 0 0;
  color: #99948b;
  font-size: 13px;
  line-height: 1.8;
}

.ux-personal__progress {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  margin: 35px 0 28px;
}

.ux-personal__track {
  height: 2px;
  overflow: hidden;
  background: rgba(235, 230, 220, .13);
}

.ux-personal__track i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #d6b06a, #ecd39e);
  transition: width 600ms cubic-bezier(.22, .75, .18, 1);
}

.ux-personal__progress span {
  color: #d6b06a;
  font: 400 16px/1 "Prata", Georgia, serif;
  font-variant-numeric: tabular-nums;
}

[data-work-status].is-reading {
  color: #ecd39e !important;
}

[data-work-status].is-completed {
  color: #a8bf91 !important;
}

[data-work-status].is-upcoming {
  color: #d6b06a !important;
}

.ux-calendar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  align-items: center;
  margin: -8px 0 30px;
}

.ux-calendar button {
  min-height: 44px;
}

.ux-calendar p {
  flex-basis: 100%;
  min-height: 1.4em;
  margin: -4px 0 0;
  color: #79746c;
  font-size: 9px;
  line-height: 1.5;
}

.hub-menu,
.reader-controls button,
.reader-toc-head button,
.gallery-navigation button,
.poem-share-dialog header > button {
  min-width: 44px;
  min-height: 44px;
}

.hub-nav a,
.hub-link,
.text-link,
.utility-back {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

html[data-ux-motion="reduce"] {
  scroll-behavior: auto !important;
}

html[data-ux-motion="reduce"] *,
html[data-ux-motion="reduce"] *::before,
html[data-ux-motion="reduce"] *::after {
  scroll-behavior: auto !important;
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
}

@media (max-width: 720px) {
  .poem-text {
    font-size: var(--ux-poem-mobile-font-size) !important;
  }

  .ux-settings-button {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  .ux-settings__panel {
    width: 100%;
    border-left: 0;
  }

  .ux-personal__head {
    display: block;
  }

  .ux-personal__head > span {
    display: block;
    margin-top: 13px;
  }

  .ux-personal__card {
    grid-template-columns: 1fr;
  }

  .ux-personal__cover {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .ux-personal__copy {
    padding: 30px 22px 35px;
  }

  .ux-personal__copy h3 {
    font-size: clamp(37px, 12vw, 55px);
  }
}

@media (forced-colors: active) {
  :focus-visible {
    outline: 3px solid Highlight;
  }

  .ux-settings-button,
  .ux-options button,
  .ux-personal__card {
    border: 1px solid CanvasText;
  }
}
