:root {
  --paper: #faf7ef;
  --paper-deep: #efe6d8;
  --ink: #202226;
  --soft-ink: #5d646b;
  --line: #d9d0bf;
  --panel: #fffdf8;
  --teal: #176b72;
  --red: #9a3f36;
  --blue: #315f8d;
  --green: #55752d;
  --gold: #a67822;
  --violet: #695591;
  --brown: #7a5541;
  --shadow: 0 20px 48px rgba(44, 38, 28, 0.14);
  --reader-font-size: 20px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(250, 247, 239, 0.96), rgba(239, 230, 216, 0.78)),
    repeating-linear-gradient(0deg, rgba(122, 85, 65, 0.038) 0 1px, transparent 1px 31px),
    repeating-linear-gradient(90deg, rgba(23, 107, 114, 0.035) 0 1px, transparent 1px 92px);
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.masthead {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(18px, 4vw, 48px);
  align-items: center;
  padding: clamp(24px, 5vw, 56px) clamp(18px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
}

body[data-view="home"] .masthead {
  min-height: 100svh;
  align-content: center;
  border-bottom: 0;
}

.brand-home {
  display: inline-block;
  color: inherit;
  text-decoration: none;
}

body[data-view="home"] .brand-block {
  grid-column: 1 / -1;
  justify-self: center;
  max-width: min(980px, 100%);
  text-align: center;
}

body[data-view="home"] .dek {
  margin-inline: auto;
}

.app-nav {
  position: fixed;
  z-index: 60;
  top: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(340px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(250, 247, 239, 0.94)),
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(49, 95, 141, 0.06) 30px 31px);
  box-shadow: 0 24px 70px rgba(44, 38, 28, 0.24);
  padding: 74px 16px 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(18px);
  transition: opacity 180ms ease, transform 180ms ease;
}

body[data-menu="open"] .app-nav {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.app-nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
  padding: 0 14px;
  color: var(--soft-ink);
  font-size: 0.96rem;
  font-weight: 830;
  text-decoration: none;
}

.app-nav a.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fffaf0;
}

.nav-mobile-label {
  display: inline;
}

.nav-desktop-label {
  display: none;
}

.menu-credit {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--soft-ink);
  font-size: 0.82rem;
  font-weight: 760;
}

.menu-button {
  position: fixed;
  z-index: 70;
  top: 22px;
  right: 22px;
  display: inline-grid;
  place-content: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: 0 12px 34px rgba(44, 38, 28, 0.14);
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 99px;
  background: var(--ink);
  transition: transform 180ms ease, opacity 180ms ease;
}

body[data-menu="open"] .menu-button span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

body[data-menu="open"] .menu-button span:nth-child(2) {
  opacity: 0;
}

body[data-menu="open"] .menu-button span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.brand-block h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4rem, 12vw, 11rem);
  font-weight: 500;
  line-height: 0.82;
}

.typewriter {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.12em;
  vertical-align: bottom;
  line-height: 1;
  white-space: nowrap;
}

body[data-view="home"] .typewriter {
  width: 0;
  border-right: 0.045em solid var(--ink);
  animation: typeDear 1.45s steps(9, end) 220ms forwards, blinkCaret 740ms steps(1) 220ms 4;
}

body[data-view="home"] .dek {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 1.8s cubic-bezier(0.22, 1, 0.36, 1) 2.05s forwards;
}

body[data-view="doors"] .masthead,
body[data-view="isms"] .masthead,
body[data-view="archive"] .masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: nowrap;
  gap: 10px 18px;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(14px, 3vw, 28px);
  background: rgba(250, 247, 239, 0.96);
}

body[data-view="doors"] .brand-block h1,
body[data-view="isms"] .brand-block h1,
body[data-view="archive"] .brand-block h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 0.88;
}

body[data-view="doors"] .brand-block .eyebrow,
body[data-view="isms"] .brand-block .eyebrow,
body[data-view="archive"] .brand-block .eyebrow,
body[data-view="doors"] .dek,
body[data-view="isms"] .dek,
body[data-view="archive"] .dek,
body[data-view="doors"] .occasion-block,
body[data-view="isms"] .occasion-block,
body[data-view="archive"] .occasion-block {
  display: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 0.86rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dek {
  max-width: 820px;
  margin: 18px 0 0;
  color: var(--soft-ink);
  font-size: clamp(1.25rem, 2.35vw, 1.72rem);
  line-height: 1.45;
}

.opening-note {
  max-width: 680px;
  margin: 18px auto 0;
  color: var(--soft-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  font-style: italic;
  line-height: 1.5;
}

body[data-view="home"] .opening-note {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 1.5s cubic-bezier(0.22, 1, 0.36, 1) 3.85s forwards;
}

body:not([data-view="home"]) .opening-note {
  display: none;
}

.occasion-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.occasion-stat,
.occasion-note {
  min-height: 92px;
  padding: 16px;
  background: rgba(255, 253, 248, 0.86);
}

.occasion-stat strong {
  display: block;
  margin-bottom: 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.25rem;
  line-height: 1;
}

.occasion-stat span,
.occasion-note span {
  color: var(--soft-ink);
  font-size: 0.9rem;
  line-height: 1.35;
}

.occasion-note {
  grid-column: 1 / -1;
  min-height: 0;
  background: var(--ink);
  color: #fffaf0;
}

.occasion-note span {
  color: #fffaf0;
  font-weight: 720;
}

.app-shell {
  display: grid;
  gap: 26px;
  padding: 22px clamp(14px, 3vw, 36px) 34px;
}

body[data-view="home"] .app-shell {
  gap: 0;
  padding-top: 0;
}

.letter-intro {
  position: relative;
  display: grid;
  align-content: center;
  max-width: 940px;
  min-height: 100svh;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 2px;
  background:
    linear-gradient(90deg, rgba(154, 63, 54, 0.16) 0 2px, transparent 2px 68px),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(49, 95, 141, 0.11) 31px 32px),
    #fffdf7;
  padding: clamp(24px, 5vw, 54px) clamp(22px, 6vw, 82px);
  box-shadow: 0 24px 60px rgba(44, 38, 28, 0.15);
}

.letter-intro::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(217, 208, 191, 0.62);
  pointer-events: none;
}

.letter-intro.reveal-ready {
  opacity: 0;
  transform: translateY(84px) scale(0.985);
  transition: opacity 1.25s ease, transform 1.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.letter-intro.reveal-ready.is-revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.letter-intro::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: -18px;
  left: 7%;
  width: 86%;
  height: 22px;
  border: 1px solid #48443d;
  border-radius: 12px 12px 3px 3px;
  background: linear-gradient(#757069 0 22%, #302e2a 24% 68%, #6a655e 70% 100%);
  box-shadow: 0 9px 18px rgba(44, 38, 28, 0.24);
}

.letter-date {
  margin-bottom: 18px;
  color: var(--soft-ink);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.9rem;
  text-align: right;
}

.salutation {
  margin-bottom: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1;
}

.letter-intro p:not(.salutation) {
  max-width: 800px;
  margin-bottom: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2.2vw, 1.58rem);
  line-height: 1.62;
}

.letter-intro .letter-signoff {
  align-self: end;
  justify-self: end;
  margin-top: clamp(28px, 8vw, 82px);
  margin-bottom: 0;
  color: var(--soft-ink);
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(1.05rem, 1.8vw, 1.22rem);
}

.explore-panel {
  display: grid;
  gap: 28px;
  align-content: center;
  min-height: 100svh;
  border-top: 1px solid var(--line);
  padding: clamp(22px, 5vw, 64px);
}

.explore-panel h2 {
  max-width: 980px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 7vw, 6.4rem);
  font-weight: 540;
  line-height: 0.94;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 22px;
}

.explore-button,
.grandpa-button,
.door-button,
.studio-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 0 18px;
  font-weight: 860;
  text-decoration: none;
}

.explore-panel .intro-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.explore-panel .explore-button,
.explore-panel .grandpa-button,
.explore-panel .door-button {
  display: grid;
  gap: 14px;
  justify-content: start;
  align-content: center;
  min-height: 170px;
  border-radius: 8px;
  padding: 20px;
  text-align: left;
}

.explore-panel .intro-actions strong {
  max-width: 280px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2.5vw, 2.1rem);
  font-weight: 560;
  line-height: 1.04;
}

.explore-panel .studio-link {
  grid-column: 1 / -1;
  width: fit-content;
}

.explore-button {
  background: var(--ink);
  color: #fffaf0;
}

.grandpa-button {
  background: var(--teal);
  border-color: var(--teal);
  color: #fffaf0;
}

.door-button {
  background: var(--gold);
  border-color: var(--gold);
  color: #fffaf0;
}

.studio-link {
  background: rgba(255, 253, 248, 0.7);
  color: var(--soft-ink);
}

.spotlight-band {
  display: grid;
  grid-template-columns: minmax(230px, 0.28fr) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 46px);
  align-items: start;
  min-height: calc(100svh - 112px);
  align-content: start;
  max-width: 1180px;
  margin: 0 auto;
  padding-top: clamp(14px, 3vw, 34px);
}

.quote-page {
  display: grid;
  gap: 16px;
  min-height: 80vh;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

.back-button {
  width: fit-content;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf8;
  padding: 0 14px;
  color: var(--soft-ink);
  font-weight: 830;
}

.quote-page-head {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  padding: clamp(16px, 3vw, 26px);
}

.quote-page-head h2 {
  max-width: 780px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 8vw, 7rem);
  font-weight: 540;
  line-height: 0.9;
}

.quote-page-head p:not(.eyebrow) {
  max-width: 620px;
  margin: 12px 0 0;
  color: var(--soft-ink);
  font-size: 1rem;
  line-height: 1.45;
}

.quote-controls {
  display: inline-flex;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.quote-controls button {
  min-height: 42px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  padding: 0 14px;
  font-weight: 830;
}

.quote-controls button:last-child {
  border-right: 0;
}

.quote-controls button.active {
  background: var(--ink);
  color: #fffaf0;
}

.section-heading {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 12px;
  padding: 12px 2px;
}

.section-heading h2 {
  margin: 0;
  max-width: 280px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.6rem);
  font-weight: 560;
  line-height: 0.96;
}

.section-heading p:not(.eyebrow) {
  max-width: 260px;
  margin: 0;
  color: var(--soft-ink);
  line-height: 1.45;
}

.spotlight-row {
  display: grid;
  gap: 14px;
  overflow: visible;
  padding: 8px 0 42px;
}

.quote-row {
  display: grid;
  gap: 8px;
}

.quote-row.is-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.quote-row.is-grid .quote-review-box {
  display: none;
}

.quote-row.is-focus {
  max-width: none;
  margin: 0;
  gap: clamp(18px, 3vw, 34px);
  scroll-snap-type: y mandatory;
}

.spotlight-card {
  display: grid;
  gap: 8px;
  min-height: 164px;
  min-width: 0;
  width: min(100%, 820px);
  border: 1px solid var(--line);
  border-left: 6px solid var(--teal);
  border-radius: 10px;
  padding: clamp(14px, 2.5vw, 22px);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 10px 26px rgba(44, 38, 28, 0.08);
  text-align: left;
}

.spotlight-card:nth-child(3n + 2) {
  margin-left: min(5vw, 44px);
}

.spotlight-card:nth-child(3n) {
  margin-left: min(9vw, 86px);
}

.spotlight-open,
.quote-open {
  display: grid;
  gap: 6px;
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  text-align: left;
}

.spotlight-open {
  grid-template-columns: 56px minmax(0, 1fr);
  column-gap: 16px;
  align-items: start;
}

.spotlight-open b {
  grid-row: 1 / span 3;
  color: rgba(32, 34, 38, 0.28);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 4.5vw, 3.4rem);
  font-weight: 520;
  line-height: 0.9;
}

.spotlight-card:hover,
.spotlight-card.active {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.spotlight-card span {
  color: var(--soft-ink);
  font-size: 0.78rem;
  font-weight: 820;
  text-transform: uppercase;
}

.spotlight-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 580;
  line-height: 1.06;
}

.spotlight-card small {
  color: var(--soft-ink);
  font-size: 0.91rem;
  line-height: 1.35;
}

.door-feedback {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(217, 208, 191, 0.75);
}

.door-feedback em {
  flex-basis: 100%;
  color: var(--soft-ink);
  font-size: 0.78rem;
  font-style: normal;
}

.door-feedback button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 9px;
  color: var(--soft-ink);
  font-size: 0.75rem;
  font-weight: 820;
}

.quote-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  scroll-margin-top: 220px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: 8px;
  padding: 11px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(250, 247, 239, 0.88)),
    repeating-linear-gradient(0deg, transparent 0 25px, rgba(49, 95, 141, 0.07) 25px 26px);
  box-shadow: 0 8px 18px rgba(44, 38, 28, 0.08);
}

.quote-row.is-focus .quote-card {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  min-height: calc(100svh - 126px);
  border-top-width: 8px;
  border-radius: 18px;
  padding: clamp(22px, 5vw, 46px);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  box-shadow: 0 22px 70px rgba(44, 38, 28, 0.18);
}

.quote-row.is-focus .quote-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: clamp(8px, 2vw, 18px);
  background: currentColor;
  opacity: 0.08;
  pointer-events: none;
}

.quote-open span {
  color: var(--red);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.quote-open strong {
  font-family: Georgia, "Times New Roman", serif;
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 0.94rem;
  font-weight: 560;
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.quote-open small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--soft-ink);
  font-size: 0.68rem;
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.quote-open em {
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.82);
  padding: 5px 9px;
  color: var(--soft-ink);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 830;
}

.quote-row.is-grid .quote-open em {
  display: none;
}

.quote-row.is-focus .quote-open {
  align-content: center;
  min-height: 0;
  padding-block: clamp(22px, 7vh, 84px);
}

.quote-row.is-focus .quote-open span {
  font-size: 0.84rem;
}

.quote-row.is-focus .quote-open strong {
  display: block;
  overflow: visible;
  max-width: 1060px;
  font-size: clamp(2.25rem, 7vw, 5.8rem);
  font-style: italic;
  font-weight: 520;
  line-height: 0.96;
  -webkit-line-clamp: initial;
}

.quote-row.is-focus .quote-open strong::before {
  content: "“";
}

.quote-row.is-focus .quote-open strong::after {
  content: "”";
}

.quote-row.is-focus .quote-open small {
  display: block;
  overflow: visible;
  max-width: 620px;
  font-size: 1rem;
  line-height: 1.35;
  -webkit-line-clamp: initial;
}

.quote-review-box {
  display: grid;
  gap: 10px;
  align-self: end;
  border-top: 1px solid rgba(217, 208, 191, 0.8);
  padding-top: 14px;
}

.quote-review-box p {
  margin: 0;
  color: var(--soft-ink);
  font-size: 0.82rem;
  line-height: 1.35;
}

.quote-card-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.quote-card-tools button,
.quote-card-tools a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.9);
  padding: 0 10px;
  color: var(--soft-ink);
  font-size: 0.74rem;
  font-weight: 840;
  text-decoration: none;
}

.quote-card-tools button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fffaf0;
}

.quote-card-tools button b {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  min-height: 20px;
  margin-left: 6px;
  border-radius: 999px;
  background: rgba(32, 34, 38, 0.08);
  color: var(--ink);
  font-size: 0.68rem;
  line-height: 1;
}

.quote-card-tools button.active b {
  background: rgba(255, 250, 240, 0.18);
  color: #fffaf0;
}

.quote-card-tools span {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 780;
}

.quote-change-note {
  display: grid;
  gap: 8px;
  max-width: 680px;
  margin-top: 2px;
}

.quote-change-note label {
  gap: 6px;
}

.quote-change-note textarea {
  min-height: 74px;
  background: rgba(255, 253, 248, 0.92);
  text-transform: none;
}

.quote-change-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.quote-change-actions button {
  min-height: 34px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  padding: 0 11px;
  color: #fffaf0;
  font-size: 0.75rem;
  font-weight: 840;
}

.quote-change-actions small {
  color: var(--soft-ink);
  font-size: 0.72rem;
  line-height: 1.25;
}

.quote-row.is-focus .quote-card-tools {
  gap: 8px;
}

.quote-row.is-focus .quote-card-tools button,
.quote-row.is-focus .quote-card-tools a {
  min-height: 38px;
  padding-inline: 13px;
}

.quote-card.active {
  outline: 3px solid rgba(166, 120, 34, 0.26);
  outline-offset: 3px;
}

.reaction-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 3px;
  align-self: end;
}

.reaction-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 22px;
  min-height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 4px;
  font-size: 0.72rem;
}

.reaction-row span {
  color: var(--soft-ink);
  font-size: 0.75rem;
  font-weight: 820;
}

.quote-row.is-focus .reaction-row {
  gap: 8px;
}

.quote-row.is-focus .reaction-row button {
  min-width: 46px;
  min-height: 46px;
  padding: 0 10px;
  font-size: 1.2rem;
}

.reader-shell {
  display: grid;
  grid-template-columns: minmax(268px, 340px) minmax(0, 1fr);
  gap: 16px;
  min-height: 72vh;
}

.reader-shell[hidden] {
  display: none;
}

.archive-titlebar {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #fffdf8;
}

.archive-titlebar h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 2.3vw, 2.05rem);
  font-weight: 560;
  line-height: 1;
}

.archive-counts {
  grid-template-columns: 1fr 1fr;
  border-radius: 8px;
}

.archive-counts .occasion-stat,
.archive-counts .occasion-note {
  min-height: 64px;
  padding: 10px 12px;
}

.archive-counts .occasion-stat strong {
  font-size: 1.7rem;
}

.toc-panel,
.reader-panel {
  min-width: 0;
}

.toc-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  max-height: calc(100svh - 82px);
  position: sticky;
  top: 72px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 14px 38px rgba(44, 38, 28, 0.08);
}

.toc-top {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

label {
  display: grid;
  gap: 7px;
  color: var(--soft-ink);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  min-height: 92px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.35;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(23, 107, 114, 0.18);
  outline: none;
}

.chapter-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.chapter-pill,
.year-chip {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 12px;
  font-size: 0.88rem;
  font-weight: 800;
}

.chapter-pill span,
.year-chip span {
  color: var(--soft-ink);
  font-weight: 700;
}

.chapter-pill.active,
.year-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fffaf0;
}

.chapter-pill.active span,
.year-chip.active span {
  color: #fffaf0;
}

.year-rail {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.year-chip {
  flex: 0 0 auto;
}

.toc-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--soft-ink);
  font-size: 0.85rem;
}

.toc-meta strong {
  color: var(--ink);
  font-size: 1.1rem;
}

.toc-list {
  overflow-y: auto;
  padding: 10px 8px 16px;
}

.toc-year-group {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 7px 10px;
  margin-bottom: 0;
}

.toc-year-group h3 {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  align-self: start;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 8px 8px 8px 0;
  color: var(--red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 650;
}

.toc-year-group h3 span {
  color: var(--soft-ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.74rem;
  font-weight: 800;
}

.toc-year-group > div {
  display: grid;
  gap: 6px;
  padding-bottom: 12px;
}

.toc-item {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 76px;
  margin-bottom: 6px;
  border: 1px solid transparent;
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  background: transparent;
  padding: 9px 10px;
  text-align: left;
}

.toc-item:hover,
.toc-item.active {
  border-color: var(--line);
  background: #fff;
  box-shadow: 0 10px 24px rgba(44, 38, 28, 0.08);
}

.toc-date {
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 860;
  text-transform: uppercase;
}

.toc-item strong {
  font-size: 1.02rem;
  line-height: 1.18;
}

.toc-item small {
  color: var(--soft-ink);
  font-size: 0.78rem;
  line-height: 1.3;
}

.toc-tags,
.tag-row,
.people-row,
.evidence-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.toc-tags span,
.tag-row span,
.people-row a,
.evidence-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(250, 247, 239, 0.9);
  padding: 4px 8px;
  color: var(--soft-ink);
  font-size: 0.75rem;
  font-weight: 760;
  text-decoration: none;
}

.reader-panel {
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.72);
  box-shadow: var(--shadow);
}

.reader-hero {
  position: sticky;
  top: 72px;
  z-index: 10;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  min-height: 118px;
  border-bottom: 1px solid var(--line);
  border-top: 8px solid var(--teal);
  padding: clamp(16px, 3vw, 26px);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.9), rgba(250, 247, 239, 0.52)),
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(23, 107, 114, 0.045) 30px 31px);
}

.reader-hero h2 {
  margin: 0;
  max-width: 900px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 3.6rem);
  font-weight: 540;
  line-height: 0.98;
}

.reader-hero p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--soft-ink);
  font-size: 1rem;
}

.reader-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: min(100%, 520px);
}

.reader-toggle,
.reader-stepper,
.text-tools {
  display: inline-flex;
  overflow: hidden;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.reader-toggle button,
.reader-toggle a,
.reader-stepper button,
.text-tools button {
  min-width: 78px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  padding: 0 10px;
  font-weight: 820;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reader-toggle button:last-child,
.reader-toggle a:last-child,
.reader-stepper button:last-child,
.text-tools button:last-child {
  border-right: 0;
}

.reader-toggle button.active {
  background: var(--ink);
  color: #fffaf0;
}

.reader-stepper button:disabled {
  opacity: 0.42;
  cursor: default;
}

.text-tools {
  flex: 0 1 auto;
}

.tool-button,
.open-pdf,
.font-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 12px;
  color: var(--ink);
  font-weight: 820;
  text-decoration: none;
}

.font-select {
  width: auto;
  min-width: 96px;
  min-height: 44px;
  border: 0;
  border-radius: 0;
}

.open-pdf {
  background: var(--ink);
  border-color: var(--ink);
  color: #fffaf0;
}

.reader-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  min-height: calc(100svh - 196px);
}

.reader-grid.is-simple {
  grid-template-columns: minmax(0, 1fr);
}

.pdf-stage {
  min-height: calc(100svh - 196px);
  border-right: 1px solid var(--line);
  background: #f4f1ea;
}

.reader-grid.is-simple .pdf-stage,
.reader-grid.is-simple .text-stage {
  border-right: 0;
}

.text-stage {
  min-height: calc(100svh - 196px);
  border-right: 1px solid var(--line);
  background: #f4f1ea;
  padding: clamp(16px, 3vw, 34px);
  overflow: auto;
}

.text-page {
  max-width: 820px;
  margin: 0 auto;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(49, 95, 141, 0.08) 30px 31px),
    #fffdf8;
  padding: clamp(22px, 5vw, 52px);
  box-shadow: 0 16px 42px rgba(44, 38, 28, 0.12);
}

.text-page p:not(.eyebrow),
.text-empty p:not(.eyebrow) {
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--reader-font-size);
  line-height: 1.62;
}

.scan-note {
  margin-top: 32px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--soft-ink);
  font-size: 0.86rem;
  line-height: 1.45;
}

.scan-note strong {
  display: block;
  margin-top: 8px;
  color: var(--green);
}

.suggest-button {
  border-color: var(--gold);
  background: #fff8e7;
}

.text-empty h3 {
  margin-bottom: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
}

.pdf-stage iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: calc(100svh - 196px);
  border: 0;
  background: #fff;
}

.memory-panel {
  display: grid;
  align-content: start;
  gap: 1px;
  background: var(--line);
}

.note-section {
  padding: 16px;
  background: rgba(255, 253, 248, 0.95);
}

.note-section p:last-child {
  margin-bottom: 0;
}

.reader-copy p:not(.eyebrow) {
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--reader-font-size);
  line-height: 1.58;
}

html[data-reader-font="sans"] .reader-copy p:not(.eyebrow) {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

html[data-reader-font="mono"] .reader-copy p:not(.eyebrow) {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: calc(var(--reader-font-size) - 2px);
}

.quiet {
  color: var(--soft-ink);
}

.moment-list {
  display: grid;
  gap: 8px;
}

.moment-chip {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  text-align: left;
}

.moment-chip strong {
  font-size: 0.92rem;
}

.moment-chip span {
  color: var(--soft-ink);
  font-size: 0.84rem;
  line-height: 1.35;
}

.context-list {
  display: grid;
  gap: 8px;
}

.context-link {
  display: grid;
  gap: 3px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  text-decoration: none;
}

.context-link:hover {
  border-color: var(--teal);
}

.context-link span {
  color: var(--soft-ink);
  font-size: 0.84rem;
  line-height: 1.35;
}

.archive-note p:not(.eyebrow) {
  color: var(--soft-ink);
  line-height: 1.45;
}

.studio-section {
  border-top: 8px solid var(--ink);
  background: #fdf8ec;
}

.studio-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.studio-status {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 5px 9px;
  color: var(--soft-ink);
  font-size: 0.75rem;
  font-weight: 780;
}

.studio-status.saved,
.studio-status.ready {
  color: var(--green);
}

.studio-status.saving {
  color: var(--gold);
}

.studio-status.error,
.studio-status.local {
  color: var(--red);
}

.studio-form {
  display: grid;
  gap: 10px;
}

.studio-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.save-moment {
  min-height: 46px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: #fffaf0;
  font-weight: 860;
}

.source-link-line {
  margin-top: 10px;
  color: var(--soft-ink);
  font-size: 0.78rem;
  line-height: 1.35;
}

.curated-list {
  display: grid;
  gap: 9px;
}

.curated-moment {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  background: #fff;
  padding: 11px;
}

.curated-moment.status-hidden {
  opacity: 0.64;
}

.curated-moment > span {
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.curated-moment strong {
  font-size: 1rem;
  line-height: 1.2;
}

.curated-moment p,
.curated-moment small {
  margin: 0;
  color: var(--soft-ink);
  line-height: 1.38;
}

.curated-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.curated-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  padding: 0 9px;
  font-size: 0.78rem;
  font-weight: 820;
}

.empty-state {
  padding: 18px;
  color: var(--soft-ink);
}

.color-teal {
  border-left-color: var(--teal);
  border-top-color: var(--teal);
}

.color-red {
  border-left-color: var(--red);
  border-top-color: var(--red);
}

.color-blue {
  border-left-color: var(--blue);
  border-top-color: var(--blue);
}

.color-green {
  border-left-color: var(--green);
  border-top-color: var(--green);
}

.color-gold {
  border-left-color: var(--gold);
  border-top-color: var(--gold);
}

.color-violet {
  border-left-color: var(--violet);
  border-top-color: var(--violet);
}

.color-brown {
  border-left-color: var(--brown);
  border-top-color: var(--brown);
}

.quote-row.is-focus .color-teal::before {
  background: var(--teal);
}

.quote-row.is-focus .color-red::before {
  background: var(--red);
}

.quote-row.is-focus .color-blue::before {
  background: var(--blue);
}

.quote-row.is-focus .color-green::before {
  background: var(--green);
}

.quote-row.is-focus .color-gold::before {
  background: var(--gold);
}

.quote-row.is-focus .color-violet::before {
  background: var(--violet);
}

.quote-row.is-focus .color-brown::before {
  background: var(--brown);
}

@keyframes typeDear {
  from {
    width: 0;
  }

  to {
    width: 8.35ch;
  }
}

@keyframes blinkCaret {
  50% {
    border-color: transparent;
  }
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .masthead,
  .spotlight-band,
  .reader-shell,
  .reader-grid {
    grid-template-columns: 1fr;
  }

  .reader-panel {
    order: 1;
  }

  .toc-panel {
    order: 2;
  }

  .quote-page-head {
    align-items: start;
    flex-direction: column;
  }

  .section-heading {
    position: relative;
    top: auto;
  }

  .explore-panel .intro-actions {
    grid-template-columns: 1fr;
  }

  .toc-panel {
    position: relative;
    top: auto;
    max-height: none;
  }

  .toc-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 14px;
  }

  .toc-year-group {
    flex: 0 0 min(320px, 84vw);
    grid-template-columns: 1fr;
  }

  .toc-year-group h3 {
    position: relative;
    top: auto;
    display: flex;
    justify-content: space-between;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px 2px;
  }

  .toc-year-group > div {
    display: grid;
    gap: 6px;
  }

  .toc-item {
    margin-bottom: 0;
  }

  .pdf-stage,
  .pdf-stage iframe,
  .text-stage {
    min-height: 68vh;
  }
}

@media (max-width: 720px) {
  .masthead {
    padding-top: 22px;
  }

  .brand-block h1 {
    font-size: clamp(3.3rem, 19vw, 6.4rem);
  }

  body[data-view="doors"] .brand-block h1,
  body[data-view="isms"] .brand-block h1,
  body[data-view="archive"] .brand-block h1 {
    font-size: 1.85rem;
    white-space: nowrap;
  }

  body[data-view="doors"] .masthead,
  body[data-view="isms"] .masthead,
  body[data-view="archive"] .masthead {
    gap: 8px;
    padding: 8px 10px;
  }

  .menu-button {
    top: 10px;
    right: 10px;
  }

  .app-nav {
    top: 8px;
    right: 8px;
    bottom: 8px;
    width: min(330px, calc(100vw - 16px));
  }

  .occasion-block {
    grid-template-columns: 1fr;
  }

  .occasion-note {
    grid-column: auto;
  }

  body[data-view="home"] .masthead,
  .letter-intro,
  .explore-panel {
    min-height: 92svh;
  }

  .explore-panel {
    padding-inline: 0;
  }

  .explore-panel > div:first-child,
  .explore-panel .intro-actions {
    margin-inline: 14px;
  }

  .reader-hero {
    align-items: start;
    flex-direction: column;
  }

  .reader-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .open-pdf,
  .reader-toggle {
    flex: 1 1 140px;
  }

  .spotlight-card:nth-child(3n + 2),
  .spotlight-card:nth-child(3n) {
    margin-left: 0;
  }

  .spotlight-open {
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 12px;
  }

  .spotlight-open b {
    font-size: 2.1rem;
  }

  .quote-row.is-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-page {
    margin-inline: -14px;
  }

  .quote-page-head {
    top: 50px;
    margin-inline: 14px;
    gap: 10px;
    padding: 14px;
  }

  .quote-page-head h2 {
    font-size: clamp(2.1rem, 12vw, 3.45rem);
  }

  .quote-page-head p:not(.eyebrow) {
    font-size: 0.92rem;
  }

  .quote-row.is-focus {
    width: 100vw;
    max-width: none;
    gap: 0;
  }

  .quote-row.is-focus .quote-card {
    width: 100vw;
    min-height: calc(100svh - 92px);
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding: 22px;
  }

  .quote-row.is-focus .quote-card-tools {
    gap: 5px;
  }

  .quote-row.is-focus .quote-card-tools button,
  .quote-row.is-focus .quote-card-tools a {
    min-height: 34px;
    padding-inline: 10px;
  }

  .quote-row.is-focus .quote-open strong {
    font-size: clamp(2.5rem, 13vw, 5.7rem);
  }

  .quote-row.is-focus .reaction-row {
    gap: 6px;
  }

  .quote-row.is-focus .reaction-row button {
    min-width: 42px;
    min-height: 42px;
  }

  .pdf-stage,
  .pdf-stage iframe,
  .text-stage {
    min-height: 620px;
  }
}


/* App-style quote reel and archive reader */
body[data-view="isms"] .app-shell,
body[data-view="archive"] .app-shell {
  gap: 0;
  padding: 0;
}

body[data-view="doors"] .masthead,
body[data-view="isms"] .masthead,
body[data-view="archive"] .masthead {
  height: 66px;
  min-height: 66px;
  padding-block: 8px;
}

body[data-view="isms"][data-quote-mode="focus"] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100svh;
  overflow: hidden;
}

body[data-view="isms"][data-quote-mode="focus"] .app-shell {
  height: 100%;
  min-height: 0;
}

body[data-view="isms"][data-quote-mode="focus"] .quote-page {
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
}

.quote-page {
  gap: 0;
  max-width: none;
  min-height: 0;
  width: 100%;
  margin: 0;
}

.quote-page-head {
  position: relative;
  top: auto;
  z-index: 15;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 78px;
  border-width: 0 0 1px;
  border-radius: 0;
  padding: 10px clamp(14px, 3vw, 32px);
  background: rgba(255, 253, 248, 0.97);
  box-shadow: 0 8px 24px rgba(44, 38, 28, 0.07);
}

.quote-page-title {
  min-width: 0;
}

.quote-page-head .eyebrow {
  margin-bottom: 2px;
}

.quote-page-head h2 {
  max-width: none;
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  line-height: 1;
}

.quote-page-head p:not(.eyebrow) {
  margin: 4px 0 0;
  font-size: 0.82rem;
  line-height: 1.25;
}

.quote-page-head .back-button {
  min-height: 38px;
  padding-inline: 12px;
}

.quote-controls button {
  min-height: 40px;
}

.quote-row.is-focus {
  display: block;
  height: auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

.quote-row.is-focus::-webkit-scrollbar {
  display: none;
}

.quote-row.is-focus .quote-card {
  --band-accent: var(--gold);
  --band-wash: rgba(166, 120, 34, 0.12);
  position: relative;
  width: 100%;
  min-height: 100%;
  border-width: 8px 0 1px;
  border-color: var(--band-accent) transparent var(--line);
  border-radius: 0;
  padding: clamp(22px, 5vw, 64px) clamp(22px, 7vw, 96px);
  background:
    linear-gradient(135deg, var(--band-wash), rgba(255, 253, 248, 0.96) 38%, rgba(250, 247, 239, 0.98)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(49, 95, 141, 0.05) 31px 32px);
  box-shadow: none;
  color: var(--ink);
  scroll-margin-top: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.quote-row.is-focus .quote-card::before {
  width: clamp(6px, 1vw, 12px);
  background: var(--band-accent);
  opacity: 0.22;
}

.quote-card.color-teal {
  --band-accent: var(--teal);
  --band-wash: rgba(23, 107, 114, 0.12);
}

.quote-card.color-red {
  --band-accent: var(--red);
  --band-wash: rgba(154, 63, 54, 0.11);
}

.quote-card.color-blue {
  --band-accent: var(--blue);
  --band-wash: rgba(49, 95, 141, 0.12);
}

.quote-card.color-green {
  --band-accent: var(--green);
  --band-wash: rgba(85, 117, 45, 0.12);
}

.quote-card.color-gold {
  --band-accent: var(--gold);
  --band-wash: rgba(166, 120, 34, 0.12);
}

.quote-card.color-violet {
  --band-accent: var(--violet);
  --band-wash: rgba(105, 85, 145, 0.12);
}

.quote-card.color-brown {
  --band-accent: var(--brown);
  --band-wash: rgba(122, 85, 65, 0.12);
}

.quote-row.is-focus .quote-open {
  align-content: center;
  gap: clamp(9px, 2vh, 18px);
  min-height: 0;
  padding-block: clamp(10px, 3vh, 36px);
}

.quote-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1060px;
}

.quote-meta b,
.quote-meta i {
  font-size: inherit;
  font-style: normal;
}

.quote-meta i {
  color: var(--soft-ink);
}

.quote-row.is-focus .quote-open strong {
  font-size: clamp(2.35rem, min(7vw, 8vh), 5.4rem);
  line-height: 0.98;
}

.quote-row.is-focus .quote-open em {
  border-color: var(--band-accent);
  color: var(--band-accent);
}

.quote-row.is-focus .quote-review-box {
  gap: 7px;
  padding-top: 10px;
}

.quote-row.is-focus .reaction-row {
  padding-top: 4px;
}

.reader-shell {
  grid-template-columns: minmax(260px, 304px) minmax(0, 1fr);
  gap: 0;
  min-height: calc(100svh - 66px);
}

.toc-panel {
  top: 66px;
  max-height: calc(100svh - 66px);
  border-width: 0 1px 0 0;
  box-shadow: none;
}

.archive-titlebar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 10px;
}

.archive-titlebar h2 {
  font-size: 1.8rem;
}

.archive-titlebar p:not(.eyebrow) {
  margin: 4px 0 0;
  color: var(--soft-ink);
  font-size: 0.78rem;
}

.archive-counts {
  display: none;
}

.toc-meta {
  display: none;
}

.toc-list {
  padding-top: 6px;
}

.reader-panel {
  border-width: 0;
  box-shadow: none;
}

.reader-hero {
  top: 66px;
  min-height: 104px;
  border-top-width: 6px;
  padding: 12px clamp(14px, 2.5vw, 24px);
}

.reader-hero h2 {
  font-size: clamp(1.45rem, 3vw, 2.6rem);
  line-height: 1.02;
}

.reader-hero p:not(.eyebrow) {
  margin-top: 6px;
  font-size: 0.86rem;
}

.reader-actions {
  min-width: 0;
}

.reader-toggle,
.reader-stepper,
.text-tools {
  min-height: 40px;
}

.reader-toggle button,
.reader-toggle a,
.reader-stepper button,
.text-tools button {
  min-width: 68px;
}

.font-select {
  min-height: 40px;
}

@media (max-width: 1120px) {
  .reader-shell {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .reader-panel {
    order: 1;
  }

  .toc-panel {
    order: 2;
    position: relative;
    top: auto;
    max-height: none;
    border-width: 1px 0 0;
  }

  .archive-titlebar {
    padding: 14px clamp(14px, 3vw, 28px) 10px;
  }

  .toc-top {
    grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.25fr);
    align-items: end;
    padding-inline: clamp(14px, 3vw, 28px);
  }

  .year-rail {
    padding-inline: clamp(14px, 3vw, 28px);
  }

  .toc-list {
    display: flex;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px clamp(14px, 3vw, 28px) 20px;
    scroll-snap-type: x proximity;
  }

  .toc-year-group {
    align-items: stretch;
    display: flex;
    flex: 0 0 auto;
    grid-template-columns: none;
    gap: 0;
    margin: 0;
  }

  .toc-year-group h3 {
    position: relative;
    top: auto;
    display: flex;
    flex: 0 0 58px;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    padding: 8px;
  }

  .toc-year-group > div {
    display: flex;
    gap: 8px;
    padding: 0 10px;
  }

  .toc-item {
    flex: 0 0 230px;
    width: 230px;
    min-height: 104px;
    margin: 0;
    background: rgba(255, 253, 248, 0.72);
    scroll-snap-align: start;
  }

  .pdf-stage,
  .pdf-stage iframe {
    min-height: calc(100svh - 156px);
  }
}

@media (max-width: 720px) {
  body[data-view="isms"] .masthead,
  body[data-view="archive"] .masthead {
    height: 54px;
    min-height: 54px;
  }

  .quote-page-head {
    top: auto;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    min-height: 68px;
    padding: 7px 10px;
  }

  body[data-view="isms"][data-quote-mode="focus"] .quote-page {
    height: 100%;
  }

  .quote-page-title .eyebrow,
  .quote-page-head p:not(.eyebrow) {
    display: none;
  }

  .quote-page-head h2 {
    overflow: hidden;
    font-size: 1.28rem;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .quote-page-head .back-button {
    min-height: 36px;
    padding-inline: 10px;
  }

  .quote-controls {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
  }

  .quote-controls button {
    flex: 1 1 50%;
    min-height: 34px;
    padding-inline: 8px;
    font-size: 0.82rem;
  }

  .quote-row.is-focus .quote-card {
    width: 100%;
    min-height: 100%;
    padding: 18px 22px 16px 28px;
  }

  .quote-row.is-focus .quote-open {
    gap: 8px;
    padding-block: 8px;
  }

  .quote-row.is-focus .quote-open span {
    font-size: 0.75rem;
  }

  .quote-row.is-focus .quote-open strong {
    font-size: clamp(2.1rem, min(10.5vw, 6.7vh), 3.9rem);
    line-height: 0.98;
  }

  .quote-row.is-focus .quote-open small {
    font-size: 0.88rem;
  }

  .quote-row.is-focus .quote-open em {
    padding: 4px 8px;
    font-size: 0.65rem;
  }

  .quote-row.is-focus .quote-review-box p {
    font-size: 0.72rem;
  }

  .quote-row.is-focus .quote-card-tools button,
  .quote-row.is-focus .quote-card-tools a {
    min-height: 31px;
    padding-inline: 9px;
    font-size: 0.7rem;
  }

  .quote-row.is-focus .reaction-row button {
    min-width: 38px;
    min-height: 38px;
    padding-inline: 7px;
    font-size: 1rem;
  }

  .quote-row.is-grid {
    padding: 10px;
  }

  .reader-hero {
    top: 54px;
    gap: 8px;
    min-height: 0;
    padding: 9px 10px 10px;
  }

  .reader-hero .eyebrow {
    display: none;
  }

  .reader-hero h2 {
    display: -webkit-box;
    overflow: hidden;
    font-size: 1.28rem;
    line-height: 1.08;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .reader-hero p:not(.eyebrow) {
    margin-top: 4px;
    font-size: 0.75rem;
  }

  .reader-actions {
    display: grid;
    grid-template-columns: 0.78fr 1.22fr;
    gap: 6px;
  }

  .reader-stepper,
  .reader-toggle {
    width: 100%;
    min-height: 38px;
  }

  .reader-toggle button,
  .reader-toggle a,
  .reader-stepper button,
  .text-tools button {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 5px;
    font-size: 0.75rem;
  }

  .text-tools {
    grid-column: 1 / -1;
    width: fit-content;
    min-height: 38px;
  }

  .font-select {
    min-width: 88px;
    min-height: 38px;
    font-size: 0.75rem;
  }

  .pdf-stage,
  .pdf-stage iframe {
    min-height: calc(100svh - 153px);
  }

  .text-stage {
    min-height: calc(100svh - 174px);
  }

  .archive-titlebar {
    padding: 14px 14px 8px;
  }

  .archive-titlebar h2 {
    font-size: 1.55rem;
  }

  .toc-top {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px 14px 10px;
  }

  .year-rail {
    padding: 8px 14px;
  }

  .toc-list {
    padding: 10px 14px 18px;
  }

  .toc-year-group h3 {
    flex-basis: 52px;
    font-size: 0.9rem;
  }

  .toc-year-group > div {
    gap: 7px;
    padding-inline: 8px;
  }

  .toc-item {
    flex-basis: 214px;
    width: 214px;
    min-height: 98px;
    padding: 8px 9px;
  }
}
/* Simplified quote navigation and collection-first archive */
.quote-page-head {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 62px;
  padding-block: 8px;
}

.quote-page-head h2 {
  font-size: clamp(1.55rem, 3vw, 2.25rem);
}

.quote-info {
  position: relative;
}

.quote-info-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fffdf8;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 700;
}

.quote-info-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 9px);
  right: 0;
  width: min(320px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf8;
  padding: 14px;
  box-shadow: 0 18px 44px rgba(44, 38, 28, 0.18);
}

.quote-info-popover[hidden] {
  display: none;
}

.quote-info-popover strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
}

.quote-info-popover p {
  margin: 5px 0 12px;
  color: var(--soft-ink);
  font-size: 0.84rem;
  line-height: 1.4;
}

.quote-info-popover .quote-controls {
  display: flex;
  width: 100%;
}

.quote-info-popover .quote-controls button {
  flex: 1 1 50%;
}

body[data-view="archive"][data-archive-mode="browse"] .reader-shell {
  display: block;
  width: min(100%, 1320px);
  margin: 0 auto;
  padding: clamp(12px, 3vw, 34px);
}

body[data-view="archive"][data-archive-mode="browse"] .reader-panel {
  display: none;
}

body[data-view="archive"][data-archive-mode="browse"] .toc-panel {
  position: relative;
  top: auto;
  display: block;
  max-height: none;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 18px 52px rgba(44, 38, 28, 0.09);
}

body[data-view="archive"][data-archive-mode="browse"] .archive-titlebar {
  align-items: end;
  padding: clamp(22px, 4vw, 46px);
}

body[data-view="archive"][data-archive-mode="browse"] .archive-titlebar h2 {
  font-size: clamp(2.4rem, 6vw, 5.8rem);
  line-height: 0.92;
}

body[data-view="archive"][data-archive-mode="browse"] .archive-titlebar p:not(.eyebrow) {
  margin-top: 10px;
  font-size: 1rem;
}

body[data-view="archive"][data-archive-mode="browse"] .toc-top {
  grid-template-columns: minmax(230px, 0.72fr) minmax(0, 1.28fr);
  align-items: end;
  gap: 14px;
  padding: 16px clamp(18px, 4vw, 46px) 20px;
}

body[data-view="archive"] .year-rail {
  display: none;
}

body[data-view="archive"][data-archive-mode="browse"] .toc-list {
  display: grid;
  gap: clamp(18px, 3vw, 30px);
  overflow: visible;
  padding: clamp(22px, 4vw, 46px);
}

.toc-collection-group {
  --collection-color: var(--teal);
}

.toc-collection-group.color-red { --collection-color: var(--red); }
.toc-collection-group.color-blue { --collection-color: var(--blue); }
.toc-collection-group.color-green { --collection-color: var(--green); }
.toc-collection-group.color-gold { --collection-color: var(--gold); }
.toc-collection-group.color-violet { --collection-color: var(--violet); }
.toc-collection-group.color-brown { --collection-color: var(--brown); }

.toc-collection-group > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  margin: 0 6px 10px;
  border-top: 5px solid var(--collection-color);
  padding: 12px 4px 0;
}

.toc-collection-group > header span {
  color: var(--collection-color);
  font-size: 0.72rem;
  font-weight: 880;
  text-transform: uppercase;
}

.toc-collection-group > header h3 {
  margin: 2px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 580;
  line-height: 1.05;
}

.toc-collection-group > header b {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  color: var(--collection-color);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
}

.toc-collection-group > header p {
  grid-column: 1 / -1;
  margin: 3px 0 0;
  color: var(--soft-ink);
  font-size: 0.78rem;
  line-height: 1.35;
}

.toc-collection-items {
  display: grid;
  gap: 7px;
}

body[data-view="archive"][data-archive-mode="browse"] .toc-collection-group > header {
  min-height: 116px;
  margin: 0;
  padding: 16px 18px 12px;
}

body[data-view="archive"][data-archive-mode="browse"] .toc-collection-group > header h3 {
  font-size: clamp(1.65rem, 3vw, 2.6rem);
}

body[data-view="archive"][data-archive-mode="browse"] .toc-collection-group > header p {
  max-width: 660px;
  font-size: 0.92rem;
}

body[data-view="archive"][data-archive-mode="browse"] .toc-collection-items {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

body[data-view="archive"][data-archive-mode="browse"] .toc-item {
  min-height: 96px;
  margin: 0;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.58);
  padding: 14px;
}

body[data-view="archive"][data-archive-mode="browse"] .toc-excerpt {
  display: none;
}

body[data-view="archive"][data-archive-mode="browse"] .toc-item:hover {
  transform: translateY(-2px);
}

.reader-browse-button {
  display: none;
  min-height: 32px;
  margin: 0 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf8;
  padding: 0 10px;
  color: var(--soft-ink);
  font-size: 0.75rem;
  font-weight: 830;
}

@media (max-width: 1120px) {
  body[data-view="archive"][data-archive-mode="reader"] .toc-panel {
    display: none;
  }

  body[data-view="archive"][data-archive-mode="reader"] .reader-browse-button {
    display: inline-flex;
    align-items: center;
  }

  body[data-view="archive"][data-archive-mode="browse"] .toc-collection-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .quote-page-head {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 50px;
    padding: 6px 10px;
  }

  .quote-page-head h2 {
    font-size: 1.25rem;
  }

  .quote-info-button {
    width: 34px;
    height: 34px;
  }

  .quote-page-head .quote-info-popover p:not(.eyebrow) {
    display: block;
  }

  body[data-view="archive"][data-archive-mode="browse"] .reader-shell {
    padding: 0;
  }

  body[data-view="archive"][data-archive-mode="browse"] .toc-panel {
    border-width: 0;
    border-radius: 0;
  }

  body[data-view="archive"][data-archive-mode="browse"] .archive-titlebar {
    padding: 26px 16px 18px;
  }

  body[data-view="archive"][data-archive-mode="browse"] .archive-titlebar h2 {
    font-size: clamp(2.55rem, 14vw, 4.4rem);
  }

  body[data-view="archive"][data-archive-mode="browse"] .toc-top {
    grid-template-columns: 1fr;
    padding: 12px 14px 16px;
  }

  body[data-view="archive"][data-archive-mode="browse"] .toc-list {
    display: grid;
    gap: 24px;
    padding: 20px 14px 34px;
  }

  body[data-view="archive"][data-archive-mode="browse"] .toc-collection-items {
    grid-template-columns: 1fr;
  }

  body[data-view="archive"][data-archive-mode="browse"] .toc-collection-group > header {
    min-height: 0;
    padding-inline: 8px;
  }

  body[data-view="archive"][data-archive-mode="browse"] .toc-item {
    min-height: 92px;
  }

  .reader-browse-button {
    margin-bottom: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-view="home"] .typewriter,
  body[data-view="home"] .dek {
    width: auto;
    opacity: 1;
    transform: none;
    animation: none;
  }

  .letter-intro.reveal-ready {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Grandpa-ism reactions and guided desktop paging */
.quote-desktop-guide {
  display: contents;
}

.quote-desktop-guide button {
  position: fixed;
  z-index: 32;
  right: 18px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.96);
  padding: 0 14px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
  box-shadow: 0 10px 28px rgba(44, 38, 28, 0.14);
  backdrop-filter: blur(8px);
}

.quote-desktop-guide button[data-quote-step="-1"] {
  top: 84px;
}

.quote-desktop-guide button[data-quote-step="1"] {
  bottom: 18px;
}

.quote-desktop-guide button span {
  color: var(--teal);
  font-size: 1rem;
}

.quote-desktop-guide button:disabled {
  opacity: 0.34;
  cursor: default;
  box-shadow: none;
}

body[data-quote-mode="grid"] .quote-desktop-guide button {
  display: none;
}

.emoji-rain-layer {
  position: fixed;
  z-index: 160;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.emoji-rain-layer > span {
  position: absolute;
  top: 0;
  left: var(--rain-x);
  font-size: var(--rain-size);
  filter: drop-shadow(0 4px 5px rgba(32, 34, 38, 0.16));
  animation: emojiFall var(--rain-duration) cubic-bezier(0.18, 0.72, 0.28, 1) var(--rain-delay) forwards;
  will-change: transform, opacity;
}

.reaction-row button.is-reacting {
  position: relative;
  z-index: 2;
  animation: reactionPop 500ms cubic-bezier(0.2, 1.7, 0.4, 1);
  border-color: var(--teal);
  background: #fffdf8;
}

@keyframes emojiFall {
  0% {
    opacity: 0;
    transform: translate3d(0, var(--rain-y), 0) rotate(0deg) scale(0.7);
  }

  10% {
    opacity: 1;
  }

  100% {
    opacity: 0.96;
    transform: translate3d(var(--rain-drift), 108vh, 0) rotate(var(--rain-spin)) scale(1.08);
  }
}

@keyframes reactionPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.42) rotate(-7deg); }
  100% { transform: scale(1); }
}

@media (max-width: 900px) {
  .quote-desktop-guide {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .emoji-rain-layer {
    display: none;
  }

  .reaction-row button.is-reacting {
    animation: none;
  }
}

/* Direct, guided archive experience */
.desk-line {
  margin: 0 0 18px;
  color: var(--red);
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  font-weight: 800;
  text-transform: uppercase;
}

.desk-typewriter {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 3px;
  white-space: nowrap;
}

body[data-view="home"] .desk-typewriter {
  width: 0;
  border-right: 2px solid var(--red);
  animation: typeDesk 2.2s steps(40, end) 240ms forwards, blinkCaret 720ms steps(1) 240ms 5;
}

body[data-view="home"] .brand-home h1 {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 1.1s cubic-bezier(0.22, 1, 0.36, 1) 2.5s forwards;
}

body[data-view="home"] .dek {
  animation-delay: 3.15s;
}

body:not([data-view="home"]) .desk-line {
  display: none;
}

.explore-panel .intro-actions small {
  max-width: 38ch;
  color: inherit;
  font-size: 1.02rem;
  font-weight: 560;
  line-height: 1.45;
  opacity: 0.88;
}

.spotlight-open em {
  grid-column: 2;
  width: fit-content;
  margin-top: 5px;
  border-bottom: 1px solid currentColor;
  color: var(--teal);
  font-size: 0.88rem;
  font-style: normal;
  font-weight: 850;
}

.quote-onboarding {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 100%;
  padding: clamp(28px, 7vw, 96px);
  border-top: 8px solid var(--teal);
  background:
    linear-gradient(135deg, rgba(23, 107, 114, 0.12), rgba(255, 253, 248, 0.96) 44%),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(49, 95, 141, 0.06) 31px 32px);
  text-align: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.quote-onboarding h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.2rem, 10vw, 8rem);
  font-weight: 540;
  line-height: 0.92;
}

.quote-onboarding > p:not(.eyebrow) {
  max-width: 650px;
  margin: 20px auto 24px;
  color: var(--soft-ink);
  font-size: clamp(1.15rem, 2.2vw, 1.42rem);
  line-height: 1.55;
}

.quote-onboarding > button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  padding: 0 18px;
  color: #fffaf0;
  font-weight: 850;
}

.swipe-cue {
  display: grid;
  gap: 2px;
  justify-items: center;
  margin-top: clamp(24px, 7vh, 70px);
  color: var(--teal);
}

.swipe-cue span {
  font-size: 2rem;
  animation: pullUp 1.5s ease-in-out infinite;
}

.swipe-cue b {
  font-size: 0.72rem;
  text-transform: uppercase;
}

.quote-row.is-grid .quote-onboarding {
  grid-column: 1 / -1;
  min-height: 360px;
  border: 1px solid var(--line);
  border-top: 8px solid var(--teal);
  border-radius: 6px;
}

.quote-row.is-focus .quote-card {
  grid-template-rows: minmax(0, 1fr) auto;
}

.quote-response {
  display: grid;
  gap: 8px;
  align-self: end;
  border-top: 1px solid rgba(217, 208, 191, 0.82);
  padding-top: 12px;
}

.quote-response p {
  margin: 0;
  color: var(--soft-ink);
  font-size: 0.86rem;
  font-weight: 820;
  text-transform: uppercase;
}

.source-preview {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2vw, 24px);
}

.preview-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(32, 34, 38, 0.72);
  backdrop-filter: blur(4px);
}

.preview-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1120px, 100%);
  height: min(92svh, 900px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

.preview-header {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.preview-header .eyebrow {
  margin-bottom: 3px;
}

.preview-header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 3vw, 2.35rem);
  font-weight: 560;
  line-height: 1;
}

.preview-header p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--soft-ink);
  font-size: 0.78rem;
}

.preview-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-size: 1.5rem;
  line-height: 1;
}

.preview-pdf,
.preview-pdf iframe {
  width: 100%;
  min-height: 0;
  height: 100%;
  border: 0;
  background: #e7e4dd;
}

.preview-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: #fffdf8;
}

.preview-actions span {
  color: var(--soft-ink);
  font-size: 0.78rem;
}

.preview-actions button {
  min-height: 40px;
  border: 0;
  border-radius: 5px;
  background: var(--ink);
  padding: 0 14px;
  color: #fffaf0;
  font-weight: 840;
}

body[data-preview="open"] {
  overflow: hidden;
}

.site-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  border-top: 1px solid var(--line);
  padding: 24px;
  color: var(--soft-ink);
  font-size: 0.78rem;
  font-weight: 760;
}

.site-footer img {
  width: 118px;
  height: auto;
}

body:not([data-view="home"]) .site-footer {
  display: none;
}

.toc-collection-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  width: 100%;
  margin: 0 6px 10px;
  border: 0;
  border-top: 5px solid var(--collection-color);
  background: transparent;
  padding: 12px 4px 0;
  color: inherit;
  text-align: left;
}

.toc-collection-header span {
  color: var(--collection-color);
  font-size: 0.72rem;
  font-weight: 880;
  text-transform: uppercase;
}

.toc-collection-header h3 {
  margin: 2px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 580;
  line-height: 1.05;
}

.toc-collection-header b {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  color: var(--collection-color);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
}

.toc-collection-header p {
  grid-column: 1 / -1;
  margin: 3px 0 0;
  color: var(--soft-ink);
  font-size: 0.78rem;
  line-height: 1.35;
}

.toc-collection-header i {
  display: none;
}

body[data-view="archive"][data-archive-mode="browse"] .toc-collection-header {
  min-height: 116px;
  margin: 0;
  padding: 16px 18px 12px;
}

body[data-view="archive"][data-archive-mode="browse"] .toc-collection-header h3 {
  font-size: clamp(1.65rem, 3vw, 2.6rem);
}

body[data-view="archive"][data-archive-mode="browse"] .toc-collection-header p {
  max-width: 660px;
  font-size: 0.92rem;
}

@media (min-width: 901px) {
  .nav-mobile-label {
    display: none;
  }

  .nav-desktop-label {
    display: inline;
  }

  .menu-button {
    display: none;
  }

  .app-nav,
  body[data-menu="open"] .app-nav {
    position: absolute;
    inset: 50% clamp(18px, 3vw, 34px) auto auto;
    display: flex;
    flex-direction: row;
    gap: 6px;
    width: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%);
  }

  body[data-view="home"] .app-nav,
  body[data-view="home"][data-menu="open"] .app-nav {
    top: 22px;
    transform: none;
  }

  .app-nav a {
    min-height: 38px;
    border-radius: 999px;
    padding: 0 12px;
    font-size: 0.82rem;
  }

  .app-nav .menu-credit {
    display: none;
  }
}

@media (max-width: 720px) {
  .desk-line {
    margin-bottom: 14px;
    font-size: 0.82rem;
  }

  .explore-panel .intro-actions small {
    font-size: 0.86rem;
  }

  .quote-onboarding {
    min-height: 100%;
    padding: 28px 24px;
  }

  .quote-onboarding h3 {
    font-size: clamp(3rem, 17vw, 4.7rem);
  }

  .source-preview {
    padding: 0;
  }

  .preview-dialog {
    width: 100%;
    height: 100svh;
    border: 0;
    border-radius: 0;
  }

  .preview-header {
    padding: 10px 12px;
  }

  .preview-header h2 {
    display: -webkit-box;
    overflow: hidden;
    font-size: 1.2rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .preview-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .preview-actions span {
    display: none;
  }

  .preview-actions button {
    width: 100%;
  }

  body[data-view="archive"][data-archive-mode="browse"] .toc-collection-header {
    position: relative;
    min-height: 0;
    padding: 14px 42px 14px 8px;
    border-bottom: 1px solid var(--line);
  }

  body[data-view="archive"][data-archive-mode="browse"] .toc-collection-header h3 {
    font-size: 1.55rem;
  }

  body[data-view="archive"][data-archive-mode="browse"] .toc-collection-header p {
    font-size: 0.84rem;
  }

  .toc-collection-header i {
    position: absolute;
    top: 18px;
    right: 10px;
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    font-size: 1.2rem;
    font-style: normal;
    transition: transform 180ms ease;
  }

  body[data-view="archive"][data-archive-mode="browse"] .toc-collection-items {
    display: none;
  }

  body[data-view="archive"][data-archive-mode="browse"] .toc-collection-group.is-open .toc-collection-items {
    display: grid;
  }

  .toc-collection-group.is-open .toc-collection-header i {
    transform: rotate(45deg);
  }
}

@media (max-width: 420px) {
  .desk-line {
    font-size: 0.74rem;
  }
}

@keyframes typeDesk {
  from { width: 0; }
  to { width: 40ch; }
}

@keyframes pullUp {
  0%, 100% { transform: translateY(8px); }
  50% { transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
  body[data-view="home"] .desk-typewriter,
  body[data-view="home"] .brand-home h1 {
    width: auto;
    opacity: 1;
    transform: none;
    animation: none;
  }

  .swipe-cue span {
    animation: none;
  }
}

/* Simple archive discovery controls */
.archive-title-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.archive-surprise-button,
.home-surprise-button {
  border: 1px solid var(--ink);
  background: var(--panel);
  color: var(--ink);
  font-weight: 850;
}

.archive-surprise-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  border-radius: 999px;
  padding: 0 16px;
  white-space: nowrap;
}

.home-surprise-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 12px;
  align-items: center;
  justify-self: start;
  width: min(520px, 100%);
  min-height: 82px;
  border-radius: 8px;
  padding: 14px 18px;
  text-align: left;
}

.home-surprise-button > span {
  grid-row: 1 / 3;
  color: var(--gold);
  font-size: 2rem;
}

.home-surprise-button strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 580;
}

.home-surprise-button small {
  color: var(--soft-ink);
  font-size: 0.92rem;
  line-height: 1.35;
}

[data-surprise-me]:hover {
  border-color: var(--gold);
  box-shadow: 0 8px 24px rgba(44, 38, 28, 0.12);
}

body[data-surprise="picking"] [data-surprise-me] {
  opacity: 0.68;
}

body[data-surprise="picking"] [data-surprise-me] > span {
  animation: surpriseSpin 520ms ease-in-out infinite;
}

.archive-filter-block {
  min-width: 0;
}

.archive-filter-toggle {
  display: none;
}

.archive-filter-panel > p {
  display: none;
}

.archive-filter-panel .chapter-pills {
  flex-wrap: wrap;
  overflow: visible;
  padding: 0;
}

body[data-view="archive"] .archive-filter-panel .year-rail {
  display: none;
}

.archive-empty-state {
  display: grid;
  gap: 8px;
  justify-items: start;
  max-width: 560px;
  margin: 10px auto;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.archive-empty-state strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
}

.archive-empty-state span {
  color: var(--soft-ink);
  line-height: 1.5;
}

.archive-empty-state button {
  min-height: 44px;
  margin-top: 5px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  padding: 0 15px;
  color: #fffaf0;
  font-weight: 820;
}

@keyframes surpriseSpin {
  50% { transform: rotate(22deg) scale(1.3); }
}

@media (max-width: 720px) {
  body[data-view="archive"][data-archive-mode="browse"] .archive-titlebar {
    align-items: stretch;
    flex-direction: column;
  }

  .archive-title-actions {
    width: 100%;
  }

  .archive-surprise-button {
    width: 100%;
    justify-content: center;
  }

  .home-surprise-button {
    justify-self: stretch;
    width: auto;
    margin-inline: 14px;
  }

  .archive-filter-toggle {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px 10px;
    align-items: center;
    width: 100%;
    min-height: 62px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 9px 12px;
    text-align: left;
  }

  .archive-filter-toggle span {
    grid-column: 1;
    color: var(--red);
    font-size: 0.75rem;
    font-weight: 850;
    text-transform: uppercase;
  }

  .archive-filter-toggle strong {
    grid-row: 2;
    grid-column: 1 / 3;
    overflow: hidden;
    font-size: 0.96rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .archive-filter-toggle i {
    grid-row: 1 / 3;
    grid-column: 3;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    font-size: 1.25rem;
    font-style: normal;
    transition: transform 180ms ease;
  }

  .archive-filter-panel {
    display: none;
    gap: 9px;
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.9);
    padding: 12px;
  }

  body[data-archive-filters="open"] .archive-filter-panel {
    display: grid;
  }

  body[data-archive-filters="open"] .archive-filter-toggle i {
    transform: rotate(45deg);
  }

  .archive-filter-panel > p {
    display: block;
    margin: 0;
    color: var(--soft-ink);
    font-size: 0.78rem;
    font-weight: 820;
    text-transform: uppercase;
  }

  .archive-filter-panel .chapter-pills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .archive-filter-panel .chapter-pill {
    width: 100%;
    min-height: 48px;
    border-radius: 7px;
    padding: 6px 10px;
    text-align: left;
    white-space: normal;
  }

  .archive-filter-panel .chapter-pill:first-child {
    grid-column: 1 / -1;
  }

  .archive-empty-state {
    margin-inline: 0;
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-surprise="picking"] [data-surprise-me] > span {
    animation: none;
  }
}

/* Focused letter reader: browsing belongs on the archive screen */
body[data-view="archive"][data-archive-mode="reader"] .reader-shell {
  grid-template-columns: minmax(0, 1fr);
}

body[data-view="archive"][data-archive-mode="reader"] .toc-panel {
  display: none;
}

body[data-view="archive"][data-archive-mode="reader"] .reader-panel {
  width: 100%;
  min-width: 0;
}

body[data-view="archive"][data-archive-mode="reader"] .reader-browse-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  margin: 0 0 10px;
  border-color: var(--ink);
  border-radius: 6px;
  padding: 0 13px;
  color: var(--ink);
  font-size: 0.9rem;
}

body[data-view="archive"][data-archive-mode="reader"] .reader-browse-button span {
  color: var(--red);
  font-size: 1.15rem;
}

/* Large-print desktop controls */
@media (min-width: 901px) {
  html {
    font-size: 20px;
  }

  .app-nav a {
    min-height: 52px;
    padding-inline: 17px;
    font-size: 0.92rem;
  }

  .back-button,
  .archive-surprise-button,
  .quote-onboarding > button,
  .preview-actions button,
  body[data-view="archive"][data-archive-mode="reader"] .reader-browse-button {
    min-height: 56px;
    padding-inline: 18px;
    font-size: 1rem;
  }

  .home-surprise-button {
    min-height: 104px;
    padding: 18px 22px;
  }

  .home-surprise-button strong {
    font-size: 1.55rem;
  }

  .home-surprise-button small {
    font-size: 1rem;
  }

  .quote-info-button {
    width: 52px;
    height: 52px;
    font-size: 1.05rem;
  }

  .quote-info-popover {
    width: min(400px, calc(100vw - 40px));
    padding: 20px;
  }

  .quote-info-popover p,
  .quote-info-popover strong {
    font-size: 1rem;
  }

  .quote-info-popover .quote-controls button {
    min-height: 52px;
    padding-inline: 16px;
    font-size: 0.95rem;
  }

  .quote-desktop-guide button {
    right: 24px;
    min-height: 58px;
    padding-inline: 20px;
    font-size: 1rem;
  }

  .quote-desktop-guide button[data-quote-step="-1"] {
    top: 96px;
  }

  .quote-desktop-guide button[data-quote-step="1"] {
    bottom: 24px;
  }

  .quote-desktop-guide button span {
    font-size: 1.3rem;
  }

  .quote-row.is-focus .quote-open em {
    display: inline-flex;
    align-items: center;
    min-height: 50px;
    padding-inline: 16px;
    font-size: 0.95rem;
  }

  .quote-response {
    gap: 12px;
    padding-top: 16px;
  }

  .quote-response p {
    font-size: 1rem;
  }

  .quote-row.is-focus .reaction-row {
    flex-wrap: wrap;
    gap: 12px;
  }

  .quote-row.is-focus .reaction-row button {
    min-width: 64px;
    min-height: 64px;
    padding-inline: 14px;
    font-size: 1.7rem;
  }

  .quote-row.is-focus .reaction-row span {
    font-size: 0.9rem;
  }

  .reader-hero {
    flex-wrap: wrap;
    gap: 22px 30px;
    padding: 20px clamp(22px, 3vw, 36px);
  }

  .reader-hero > div:first-child {
    flex: 1 1 440px;
  }

  .reader-actions {
    flex: 1 1 620px;
    gap: 12px;
    min-width: 0;
  }

  .reader-toggle,
  .reader-stepper,
  .text-tools,
  .font-select {
    min-height: 56px;
  }

  .reader-toggle button,
  .reader-toggle a,
  .reader-stepper button,
  .text-tools button {
    min-width: 104px;
    padding-inline: 16px;
    font-size: 1rem;
  }

  .font-select {
    min-width: 130px;
    padding-inline: 14px 38px;
    font-size: 1rem;
  }

  label {
    font-size: 0.86rem;
  }

  input,
  select {
    min-height: 56px;
    padding-inline: 15px;
    font-size: 1rem;
  }

  .chapter-pill,
  .year-chip {
    min-height: 52px;
    padding-inline: 16px;
    font-size: 1rem;
  }

  body[data-view="archive"][data-archive-mode="browse"] .toc-item {
    min-height: 118px;
    padding: 18px;
  }

  .toc-date {
    font-size: 0.88rem;
  }

  .toc-item strong {
    font-size: 1.15rem;
  }

  .preview-close {
    width: 52px;
    height: 52px;
    font-size: 1.7rem;
  }
}

/* Cover-page shortcuts */
.home-cover-entry {
  display: none;
}

body[data-view="home"] .home-cover-entry {
  display: grid;
  gap: 14px;
  width: min(720px, 100%);
  margin: 28px auto 0;
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp 1.35s cubic-bezier(0.22, 1, 0.36, 1) 4.45s forwards;
}

.home-cover-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-cover-actions button {
  min-height: 66px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--teal);
  padding: 0 18px;
  color: #fffaf0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-weight: 650;
}

.home-cover-actions button:last-child {
  background: var(--ink);
}

.home-cover-actions button:hover,
.home-cover-actions button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(44, 38, 28, 0.16);
}

.home-cover-search {
  display: grid;
  gap: 7px;
  text-align: left;
}

.home-cover-search label {
  color: var(--soft-ink);
  font-size: 0.82rem;
}

.home-cover-search > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(44, 38, 28, 0.08);
}

.home-cover-search input {
  min-width: 0;
  min-height: 62px;
  border: 0;
  border-radius: 0;
  padding-inline: 17px;
  font-size: 1rem;
}

.home-cover-search button {
  min-width: 122px;
  min-height: 62px;
  border: 0;
  border-left: 1px solid var(--ink);
  background: var(--panel);
  padding-inline: 18px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 850;
}

@media (min-width: 901px) {
  .home-cover-actions button {
    min-height: 74px;
    font-size: 1.3rem;
  }

  .home-cover-search input,
  .home-cover-search button {
    min-height: 68px;
  }
}

@media (max-width: 480px) {
  .home-cover-entry {
    margin-top: 20px;
  }

  .home-cover-actions {
    gap: 8px;
  }

  .home-cover-actions button {
    min-height: 58px;
    padding-inline: 10px;
    font-size: 1.05rem;
  }

  .home-cover-search > div {
    grid-template-columns: minmax(0, 1fr) 94px;
  }

  .home-cover-search input,
  .home-cover-search button {
    min-height: 58px;
  }

  .home-cover-search input {
    padding-inline: 12px;
    font-size: 0.9rem;
  }

  .home-cover-search button {
    min-width: 0;
    padding-inline: 8px;
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-view="home"] .home-cover-entry {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
