:root {
  color-scheme: light;
  --linen: #fbf7ed;
  --linen-deep: #efe6d5;
  --paper: #fffdf7;
  --parchment: #e6dbc6;
  --ink: #142231;
  --ink-soft: #405060;
  --gold: #a87922;
  --cinnabar: #9d332b;
  --sage: #64735f;
  --line: rgba(20, 34, 49, 0.18);
  --line-strong: rgba(20, 34, 49, 0.34);
  --max: 1180px;
  --gutter: 28px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

#search,
#collection,
#reader,
#thread {
  scroll-margin-top: 132px;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(168, 121, 34, 0.08), transparent 34rem),
    linear-gradient(180deg, var(--linen), #f7f0e2 54%, var(--linen));
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(157, 51, 43, 0.18);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0.28;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.12'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 40px;
  min-height: 108px;
  padding: 0 66px;
  border-bottom: 1px solid rgba(168, 121, 34, 0.34);
  background: rgba(250, 249, 246, 0.96);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  font-family: var(--sans);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.site-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 44px;
  color: var(--ink-soft);
  font-size: 1.18rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.site-nav a,
.site-footer a {
  border-bottom: 1px solid transparent;
  transition: color 180ms ease, border-color 180ms ease;
}

.site-nav a {
  padding: 8px 0 12px;
}

.site-nav a.is-active {
  color: var(--ink);
  border-color: rgba(168, 121, 34, 0.58);
}

.site-nav a:hover,
.site-footer a:hover {
  color: var(--ink);
  border-color: var(--gold);
}

.quiet-action,
.nav-toggle {
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
}

.quiet-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border-color: var(--ink);
  background: #030303;
  color: #fffaf0;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.06em;
}

.button--secondary:hover,
.filter-chip:hover {
  background: rgba(168, 121, 34, 0.1);
}

.quiet-action:hover {
  background: rgba(20, 34, 49, 0.9);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
}

.hero {
  position: relative;
  min-height: 690px;
  display: grid;
  align-items: end;
  overflow: hidden;
  border-bottom: 1px solid rgba(168, 121, 34, 0.24);
  background: var(--ink);
}

.hero__image,
.hero__shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__image {
  object-fit: cover;
  object-position: center;
  filter: saturate(0.92) contrast(1.04);
}

.hero__shade {
  background:
    linear-gradient(90deg, rgba(13, 22, 32, 0.82) 0%, rgba(13, 22, 32, 0.5) 38%, rgba(13, 22, 32, 0.12) 70%),
    linear-gradient(0deg, rgba(13, 22, 32, 0.52), rgba(13, 22, 32, 0.06) 50%);
}

.hero__content {
  position: relative;
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 92px 44px 86px;
  color: #fffaf0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1,
.section h2,
.reader h2,
.reader h3 {
  margin: 0;
  font-family: var(--serif);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: 0;
}

.hero h1 {
  font-size: 5rem;
}

.hero__lead {
  max-width: 690px;
  margin: 24px 0 0;
  color: rgba(255, 250, 240, 0.84);
  font-size: 1.16rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.button--primary {
  background: var(--linen);
  color: var(--ink);
}

.button--primary:hover {
  background: #fff7df;
}

.button--secondary {
  border-color: rgba(255, 250, 240, 0.55);
  color: #fffaf0;
}

.section {
  width: min(calc(100% - 64px), var(--max));
  margin: 0 auto;
  padding: 96px 0;
}

.intro-band {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: var(--gutter);
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}

.section h2 {
  font-size: 2.6rem;
}

.featured-strip {
  position: relative;
  min-height: 176px;
  padding: 28px 32px;
  border: 1px solid rgba(168, 121, 34, 0.42);
  background: rgba(255, 253, 247, 0.58);
}

.featured-strip::before,
.reader::before {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  border-top: 1px solid var(--gold);
  border-left: 1px solid var(--gold);
  top: 10px;
  left: 10px;
}

.featured-strip h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 1.8rem;
  line-height: 1.18;
}

.featured-strip p {
  max-width: 760px;
  margin: 0;
  color: var(--ink-soft);
}

.featured-strip button {
  margin-top: 18px;
}

.section__heading {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: var(--gutter);
  align-items: end;
  margin-bottom: 34px;
}

.section__heading p {
  margin: 0;
  color: var(--ink-soft);
}

.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 390px) 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 253, 247, 0.72);
}

.search-box span[aria-hidden="true"] {
  color: var(--gold);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search-box:focus-within {
  border-color: var(--gold);
  background: var(--paper);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-chip.is-active {
  background: var(--ink);
  color: var(--linen);
  border-color: var(--ink);
}

.catalog-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: var(--gutter);
  align-items: stretch;
}

.text-card {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.62);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
  overflow: hidden;
}

.text-card:hover {
  transform: translateY(-3px);
  border-color: rgba(168, 121, 34, 0.58);
  background: rgba(255, 253, 247, 0.86);
}

.text-card::after {
  content: "✧";
  position: absolute;
  top: 18px;
  right: 22px;
  color: rgba(168, 121, 34, 0.55);
}

.text-card__image {
  aspect-ratio: 4 / 3;
  margin: -28px -28px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--parchment);
  overflow: hidden;
}

.text-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.94) contrast(1.03);
  transition: transform 500ms ease;
}

.text-card__image picture {
  display: block;
  width: 100%;
  height: 100%;
}

.text-card:hover .text-card__image img {
  transform: scale(1.035);
}

.text-card__category {
  margin-bottom: 26px;
  color: var(--cinnabar);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.text-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.7rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.text-card p {
  margin: 16px 0 0;
  color: var(--ink-soft);
}

.text-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding-top: 28px;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.text-card button,
.featured-strip button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reader-section {
  padding-top: 48px;
}

.reader-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--gutter);
  align-items: start;
}

.reader {
  position: relative;
  min-height: 520px;
  padding: 46px 52px;
  border: 1px solid rgba(168, 121, 34, 0.42);
  background: rgba(255, 253, 247, 0.74);
}

.reader h2 {
  margin-bottom: 18px;
  font-size: 3rem;
}

.reader h3 {
  margin-top: 44px;
  margin-bottom: 14px;
  font-size: 1.75rem;
}

.reader__meta-line {
  margin: 0 0 34px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.reader__body {
  max-width: 760px;
}

.reader__body p {
  margin: 0 0 22px;
}

.reader__body p:first-of-type::first-letter {
  float: left;
  margin: 0.08em 0.12em 0 0;
  color: var(--cinnabar);
  font-family: var(--serif);
  font-size: 4.6rem;
  line-height: 0.76;
}

.reader__body blockquote {
  margin: 34px 0;
  padding: 24px 30px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  color: var(--sage);
  font-family: var(--serif);
  font-size: 1.35rem;
  font-style: italic;
  line-height: 1.45;
}

.reader__body ul {
  margin: 20px 0 28px;
  padding-left: 20px;
}

.reader__body hr {
  height: 1px;
  margin: 42px 0;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

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

.reader-aside {
  display: grid;
  gap: 18px;
}

.aside-block {
  padding: 24px;
  border: 1px solid var(--line);
  background: rgba(230, 219, 198, 0.38);
}

.aside-block dl {
  margin: 0;
}

.aside-block dl > div {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.aside-block dl > div:first-child {
  border-top: 0;
}

.aside-block dt {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.aside-block dd {
  margin: 4px 0 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.thread {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: var(--gutter);
  border-top: 1px solid var(--line);
}

.thread__text p:last-child {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.thread__steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.thread__steps div {
  min-height: 210px;
  padding: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.5);
}

.thread__steps span {
  display: block;
  margin-bottom: 30px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 2rem;
}

.thread__steps strong {
  display: block;
  margin-bottom: 10px;
  font-family: var(--serif);
  font-size: 1.4rem;
}

.thread__steps p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 44px;
  border-top: 1px solid rgba(168, 121, 34, 0.34);
  color: var(--ink-soft);
}

.site-footer div {
  display: grid;
  gap: 4px;
}

.site-footer strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.25rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

.is-hidden {
  display: none;
}

@media (max-width: 940px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-header {
    grid-template-columns: auto auto;
    justify-content: space-between;
    min-height: 72px;
    padding: 0 24px;
  }

  .brand {
    font-size: 1.35rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .quiet-action {
    display: none;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    justify-self: stretch;
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 24px 24px;
    border-bottom: 1px solid rgba(168, 121, 34, 0.34);
    background: rgba(251, 247, 237, 0.98);
    box-shadow: 0 20px 40px rgba(20, 34, 49, 0.12);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    width: 100%;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
    letter-spacing: 0.14em;
    text-align: left;
  }

  .site-nav a.is-active {
    border-color: var(--gold);
  }

  .hero {
    min-height: 640px;
  }

  .hero__content {
    padding: 72px 28px 64px;
  }

  .hero h1 {
    font-size: 3.7rem;
  }

  .intro-band,
  .section__heading,
  .catalog-toolbar,
  .reader-shell,
  .thread {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  body {
    font-size: 16px;
  }

  .section {
    width: min(calc(100% - 36px), var(--max));
    padding: 68px 0;
  }

  .hero {
    min-height: 590px;
  }

  .hero__shade {
    background:
      linear-gradient(0deg, rgba(13, 22, 32, 0.76), rgba(13, 22, 32, 0.12) 74%),
      linear-gradient(90deg, rgba(13, 22, 32, 0.7), rgba(13, 22, 32, 0.1));
  }

  .hero h1 {
    font-size: 3rem;
  }

  .hero__lead {
    font-size: 1.02rem;
  }

  .button {
    width: 100%;
  }

  .section h2 {
    font-size: 2.1rem;
  }

  .thread__steps {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .catalog-meta,
  .site-footer {
    flex-direction: column;
  }

  .reader {
    padding: 34px 24px;
  }

  .reader h2 {
    font-size: 2.2rem;
  }

  .reader__body p:first-of-type::first-letter {
    font-size: 3.6rem;
  }
}
