:root {
  color-scheme: light;
  --paper: #f4f3ed;
  --paper-deep: #e8e7df;
  --ink: #171914;
  --muted: #62665b;
  --line: #c9cabe;
  --acid: #d5fa53;
  --white: #fffefa;
  --display: "Fraunces", Georgia, serif;
  --body: "DM Sans", Arial, sans-serif;
  --page-width: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    linear-gradient(90deg, transparent 0 49.95%, rgba(23, 25, 20, .035) 50%, transparent 50.05%),
    var(--paper);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.topbar {
  height: 76px;
  padding: 0 max(24px, calc((100vw - var(--page-width)) / 2));
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-decoration: none;
}

.brand b { font-weight: 500; }

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--acid);
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: -.08em;
}

.account {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--acid);
  border: 1px solid var(--ink);
  border-radius: 50%;
}

main, .footer {
  width: min(var(--page-width), calc(100% - 48px));
  margin-inline: auto;
}

.hero {
  min-height: 570px;
  padding: 96px 0 78px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr);
  align-items: end;
  gap: 50px;
  border-bottom: 1px solid var(--ink);
}

.hero-copy { position: relative; z-index: 1; }

.eyebrow, .note-index {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(58px, 8.7vw, 118px);
  font-weight: 600;
  line-height: .91;
  letter-spacing: -.075em;
}

h1 em {
  color: var(--muted);
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -.07em;
}

.hero-text {
  max-width: 510px;
  margin: 28px 0 26px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.text-link span { color: #657d18; font-size: 18px; }

.hero-note {
  position: relative;
  z-index: 1;
  padding: 25px;
  background: var(--ink);
  color: var(--white);
}

.hero-note .note-index { color: var(--acid); }
.hero-note p {
  margin: 36px 0 29px;
  font-family: var(--display);
  font-size: 31px;
  line-height: 1.13;
  letter-spacing: -.035em;
}

.note-rule { display: block; height: 1px; background: #5f6259; }
.hero-note small { display: block; margin-top: 16px; color: #c4c6bd; line-height: 1.5; }

.hero-stamp {
  position: absolute;
  top: 54px;
  right: 20px;
  color: #a2a497;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .18em;
  line-height: 1.4;
  transform: rotate(8deg);
}

.content-section { padding: 78px 0 94px; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 31px;
}

.section-heading .eyebrow { margin-bottom: 10px; }
h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(39px, 5vw, 61px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.055em;
}

.section-note {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: right;
}

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.filter-button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
}
.filter-button[aria-pressed="true"] { border-color: var(--ink); background: var(--acid); color: var(--ink); }

.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.article-card {
  min-height: 244px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.article-card:hover { transform: translateY(-3px); border-color: var(--ink); box-shadow: 4px 4px 0 var(--acid); }
.card-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; }
.access-tag { padding: 4px 7px; background: var(--paper-deep); color: var(--ink); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.access-tag.paid { background: var(--acid); }
.article-card h3 { margin: 26px 0 10px; font-family: var(--display); font-size: 25px; font-weight: 500; line-height: 1.1; letter-spacing: -.025em; }
.article-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.card-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; padding-top: 24px; color: var(--muted); font-size: 10px; }
.card-arrow { color: var(--ink); font-size: 18px; }
.loading, .empty-state { grid-column: 1 / -1; padding: 28px 0; color: var(--muted); }

.reader, .auth-panel {
  margin: 0 0 70px;
  padding: clamp(24px, 5vw, 54px);
  border: 1px solid var(--ink);
  background: var(--white);
}
.reader-top { display: flex; justify-content: space-between; gap: 20px; }
.reader h2 { max-width: 760px; margin: 15px 0 20px; }
.reader-summary { max-width: 690px; color: var(--muted); font-size: 17px; line-height: 1.6; }
.reader-body { max-width: 720px; margin-top: 30px; font-size: 16px; line-height: 1.8; white-space: pre-line; }
.source-list { max-width: 720px; margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); }
.source-list h3 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.source-list li { margin: 10px 0; color: var(--muted); font-size: 13px; }
.source-list a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.reader-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.button {
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.button:hover { background: #34372d; }
.button.secondary { background: transparent; color: var(--ink); }
.button.acid { background: var(--acid); color: var(--ink); }
.button:disabled { cursor: wait; opacity: .55; }
.close-button { padding: 7px 10px; border: 1px solid var(--line); background: transparent; cursor: pointer; }

.auth-panel { display: grid; grid-template-columns: .8fr 1.2fr; gap: 36px; }
.auth-panel h2 { font-size: 35px; }
.auth-panel p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.auth-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.auth-form { display: grid; gap: 10px; align-content: start; }
.auth-form h3 { margin: 0 0 4px; font-size: 12px; }
.auth-form label { color: var(--muted); font-size: 11px; }
.auth-form input { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); background: var(--paper); }
.auth-form .button { margin-top: 4px; }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  max-width: min(420px, calc(100% - 44px));
  padding: 13px 16px;
  background: var(--ink);
  color: var(--white);
  font-size: 12px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
}
.toast.visible { opacity: 1; transform: translateY(0); }
.hidden { display: none !important; }

.footer {
  min-height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}
.footer span:first-child { color: var(--ink); font-weight: 700; letter-spacing: .1em; }

@media (max-width: 760px) {
  .topbar { height: 64px; padding-inline: 20px; }
  main, .footer { width: calc(100% - 40px); }
  .hero { min-height: 0; padding: 74px 0 45px; grid-template-columns: 1fr; gap: 34px; }
  .hero-stamp { top: 25px; right: 0; }
  .hero-note { max-width: 420px; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-note { text-align: left; }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-panel { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .brand { font-size: 10px; }
  .account { font-size: 10px; }
  .hero { padding-top: 64px; }
  h1 { font-size: clamp(51px, 14vw, 74px); }
  .hero-text { font-size: 14px; }
  .content-section { padding: 56px 0 65px; }
  .article-grid, .auth-forms { grid-template-columns: 1fr; }
  .article-card { min-height: 215px; }
  .footer { align-items: start; flex-direction: column; justify-content: center; padding: 16px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
