* {
  box-sizing: border-box;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  touch-action: manipulation;
  color: var(--ink);
  background-color: var(--canvas);
  background-image: radial-gradient(var(--grain) 0.65px, transparent 0.65px);
  background-size: 7px 7px;
  font-family: var(--sans);
  font-size: var(--type-copy);
  -webkit-font-smoothing: antialiased;
}
.pull-refresh-indicator {
  position: fixed;
  z-index: 20;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 15px;
  border: 1px solid rgba(169, 124, 53, 0.3);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.97);
  box-shadow: 0 5px 18px rgba(34, 59, 85, 0.12), inset 0 1px 0 #fff;
  color: var(--deep-teal);
  font-size: 12px;
  font-weight: var(--weight-medium);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
  transition: opacity 0.16s ease, transform 0.18s ease;
}
body.is-pull-refreshing .pull-refresh-indicator {
  opacity: 1;
  transform: translate(-50%, calc(-100% + var(--pull-refresh-offset, 0px)));
}
body.is-pull-refresh-ready .pull-refresh-indicator {
  border-color: rgba(49, 88, 99, 0.42);
  background: linear-gradient(120deg, #fffefa, rgba(229, 244, 237, 0.98));
}
body.is-refreshing .pull-refresh-indicator {
  opacity: 1;
  transform: translate(-50%, 8px);
}
.pull-refresh-spinner {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid rgba(49, 88, 99, 0.2);
  border-top-color: var(--brass);
  border-radius: 50%;
  transform: rotate(var(--pull-refresh-progress, 0deg));
  transition: transform 0.12s ease, border-color 0.16s ease;
}
body.is-pull-refresh-ready .pull-refresh-spinner {
  border-top-color: var(--deep-teal);
}
body.is-refreshing .pull-refresh-spinner {
  animation: pull-refresh-spin 0.72s linear infinite;
}
@keyframes pull-refresh-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .pull-refresh-indicator,
  .pull-refresh-spinner {
    transition: none;
  }
  body.is-refreshing .pull-refresh-spinner {
    animation: none;
  }
}

button,
input,
select {
  font: inherit;
}
button {
  color: inherit;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(1540px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 clamp(24px, 3.3vw, 42px);
}
.topbar {
  height: 98px;
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(220px, 560px) auto auto;
  align-items: center;
  gap: clamp(16px, 1.9vw, 24px);
  border-bottom: 1px solid rgba(71, 72, 67, 0.13);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  width: fit-content;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  transform: rotate(-7deg);
}
.brand-mark i {
  border-radius: 1.5px;
  display: block;
  border: 1px solid rgba(169, 124, 53, 0.82);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.44),
    0 1px 0 rgba(169, 124, 53, 0.72);
}
.brand-mark i:nth-child(1) {
  background: var(--blue-strong);
  border-radius: 5px 1.5px 1.5px;
}
.brand-mark i:nth-child(2) {
  background: var(--lavender);
  border-radius: 1.5px 5px 1.5px 1.5px;
}
.brand-mark i:nth-child(3) {
  background: var(--pink);
  border-radius: 1.5px 1.5px 1.5px 5px;
}
.brand-mark i:nth-child(4) {
  background: var(--yellow);
  border-radius: 1.5px 1.5px 5px;
}
.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand-copy strong {
  color: #a4864d;
  background-image: linear-gradient(
    165deg,
    #d5c596 0%,
    #bca26a 17%,
    #856a3f 34%,
    #e1d2aa 49%,
    #a4864d 65%,
    #cebb8a 82%,
    #785e38 100%
  );
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 0.45px var(--navy-ink);
  paint-order: stroke fill;
  font-family: var(--serif);
  font-size: var(--type-brand);
  font-weight: var(--weight-medium);
  line-height: 1;
}
.brand-copy small {
  color: #777972;
  font-size: var(--type-micro);
  font-weight: var(--weight-bold);
  letter-spacing: 1.25px;
}
.glimmer-text {
  position: relative;
  display: inline-block;
  isolation: isolate;
}
.glimmer-text::after {
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: transparent;
  background-image: linear-gradient(
    108deg,
    transparent 40%,
    var(--glimmer-edge) 46%,
    var(--glimmer-shine) 50%,
    var(--glimmer-edge) 54%,
    transparent 60%
  );
  background-position: 135% 0;
  background-size: 240% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  content: attr(data-glimmer);
  opacity: 0;
  pointer-events: none;
}
.glimmer-gold {
  --glimmer-edge: #d29a28;
  --glimmer-shine: #fff1b8;
}
.glimmer-blue {
  --glimmer-edge: #4a91c6;
  --glimmer-shine: #c8efff;
}
.glimmer-pink {
  --glimmer-edge: #d56f9c;
  --glimmer-shine: #ffe0ed;
}
.glimmer-white {
  --glimmer-edge: #b7c5d0;
  --glimmer-shine: #fff;
}
.brand:hover .glimmer-text::after,
.brand:focus-visible .glimmer-text::after,
.topbar-note:hover .glimmer-text::after {
  animation: text-glimmer 0.95s ease-out both;
}
.chapter-heading .glimmer-text:hover::after {
  animation: text-glimmer 0.9s ease-out both;
}
.app-shell.is-glimmering .glimmer-text::after {
  animation: text-glimmer 0.95s ease-out both;
}
.brand-mark:hover,
.brand:focus-visible .brand-mark {
  animation: logo-spin-settle 1.05s both;
}
