:root {
  color-scheme: light;
  --ink: #13201b;
  --muted: #5f6d66;
  --paper: #f4f0e7;
  --paper-strong: #fffdf8;
  --line: #d8cebd;
  --forest: #0d362f;
  --forest-2: #174a40;
  --moss: #8a9a73;
  --clay: #a14d36;
  --gold: #c9933e;
  --blue: #285d76;
  --shadow: 0 22px 70px rgba(19, 32, 27, 0.16);
  --serif: "Libre Baskerville", Georgia, serif;
  --sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(201, 147, 62, 0.16), transparent 30rem),
    linear-gradient(180deg, #fbf7ef 0%, var(--paper) 42%, #ece4d7 100%);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
}

section { scroll-margin-top: 96px; }

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

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

.site-header {
  align-items: center;
  background: rgba(244, 240, 231, 0.84);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid transparent;
  display: grid;
  gap: 24px;
  grid-template-columns: auto auto 1fr auto;
  left: 0;
  padding: 16px clamp(18px, 4vw, 56px);
  position: fixed;
  right: 0;
  top: 0;
  transition: border-color 180ms ease, background 180ms ease;
  z-index: 20;
}

.site-header[data-scrolled="true"] {
  background: rgba(244, 240, 231, 0.96);
  border-bottom-color: rgba(19, 32, 27, 0.12);
}

.brand,
.nav-links,
.nav-library-link,
.site-footer div { align-items: center; display: flex; }

.brand { font-weight: 900; gap: 12px; letter-spacing: -0.02em; }

.brand small {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-mark {
  display: inline-block;
  flex: 0 0 auto;
  height: 38px;
  object-fit: contain;
  width: 38px;
}

.nav-links { gap: clamp(14px, 3vw, 34px); justify-content: center; }

.nav-library-link {
  background: var(--forest-2);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(13, 54, 47, 0.16);
  color: var(--paper-strong);
  justify-self: start;
  padding: 9px 16px;
}

.nav-links a,
.header-action,
.site-footer a { color: var(--muted); font-size: 0.95rem; font-weight: 700; }

.nav-links a:hover,
.header-action:hover,
.site-footer a:hover { color: var(--forest); }

.nav-library-link:hover {
  background: var(--forest);
  color: var(--paper-strong);
}

.header-action {
  border: 1px solid rgba(13, 54, 47, 0.24);
  border-radius: 999px;
  padding: 10px 16px;
}

.hero {
  min-height: 760px;
  padding: 140px clamp(20px, 5vw, 76px) 80px;
}

.hero-grid {
  align-items: stretch;
  display: grid;
  gap: clamp(28px, 5vw, 64px);
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  margin: 0 auto;
  max-width: 1180px;
}

.hero-copy-block,
.hero-panel,
.intro-section,
.subscriber-section,
.article-workspace,
.create-section,
.topic-band,
.newsletter-section {
  border: 1px solid rgba(216, 206, 189, 0.82);
  box-shadow: var(--shadow);
}

.hero-copy-block {
  background: linear-gradient(135deg, rgba(13, 54, 47, 0.96), rgba(23, 74, 64, 0.92));
  color: var(--paper-strong);
  padding: clamp(34px, 6vw, 72px);
}

.home-hero {
  padding-left: 0;
  padding-right: 0;
}

.home-hero .hero-grid {
  gap: clamp(24px, 4vw, 44px);
  grid-template-columns: 1fr;
  max-width: none;
}

.home-hero .hero-copy-block {
  border-left: 0;
  border-right: 0;
  min-height: min(760px, calc(100vh - 220px));
}

.home-hero .hero-copy-block > * {
  margin-left: auto;
  margin-right: auto;
  max-width: 1180px;
}

.home-hero .hero-copy-block .hero-actions {
  justify-content: center;
  margin-top: 26px;
  max-width: 920px;
  row-gap: 16px;
}

.home-hero .hero-panel {
  display: block;
  margin: 0 auto;
  max-width: 1180px;
  width: calc(100% - clamp(40px, 10vw, 152px));
}

.home-hero .hero-panel ul {
  gap: 14px clamp(28px, 4vw, 48px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

h1,
h2,
h3 { line-height: 1.08; margin: 0; }

h1,
h2 { font-family: var(--serif); }

h1 { font-size: clamp(3rem, 8vw, 6.8rem); letter-spacing: -0.07em; max-width: 920px; }

h2 { font-size: clamp(2rem, 4vw, 4rem); letter-spacing: -0.055em; }

h3 { font-size: clamp(1.3rem, 2.2vw, 2rem); letter-spacing: -0.04em; }

.hero-copy { color: rgba(255, 253, 248, 0.82); font-size: clamp(1.08rem, 2vw, 1.32rem); max-width: 760px; }

.hero-banner {
  border: 1px solid rgba(255, 253, 248, 0.24);
  border-radius: 28px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
  display: block;
  margin-top: 28px;
  max-height: 280px;
  object-fit: cover;
  width: min(100%, 920px);
}

.hero-actions,
.form-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 14px; }

.button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  padding: 13px 20px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover { transform: translateY(-2px); }

.button.primary { background: var(--gold); color: #21160a; }
.button.secondary { background: rgba(255, 253, 248, 0.12); color: var(--paper-strong); outline: 1px solid rgba(255, 253, 248, 0.28); }
.button.ghost { background: transparent; color: var(--forest); outline: 1px solid rgba(13, 54, 47, 0.24); }

.hero-panel {
  background: var(--paper-strong);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(28px, 4vw, 46px);
}

.panel-label { color: var(--clay); font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }

.hero-panel ul { display: grid; gap: 18px; margin: 0; padding-left: 20px; }
.hero-panel li { font-size: 1.08rem; font-weight: 700; }

.intro-section,
.subscriber-section,
.article-workspace,
.create-section,
.topic-band,
.newsletter-section {
  background: rgba(255, 253, 248, 0.76);
  margin: 0 auto 34px;
  max-width: 1180px;
  padding: clamp(28px, 5vw, 56px);
}

.intro-section {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
}

.intro-section p,
.section-heading p { color: var(--muted); font-size: 1.05rem; margin: 0; }

.about-content { display: grid; gap: 18px; }

.section-divider {
  border: 0;
  border-top: 1px solid rgba(216, 206, 189, 0.9);
  margin: 4px 0;
  width: 100%;
}

.eic-section {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 140px;
}

.eic-section .eyebrow { margin-bottom: 8px; }

.eic-section h3 { margin-bottom: 10px; }

.eic-image {
  aspect-ratio: 1;
  background: rgba(138, 154, 115, 0.16);
  border: 1px solid rgba(138, 154, 115, 0.34);
  border-radius: 24px;
  object-fit: cover;
  width: 100%;
}


.section-heading { margin-bottom: 28px; max-width: 850px; }
.section-heading.compact { margin-bottom: 20px; }
.section-heading h2 { margin-bottom: 14px; }

.toolbar {
  align-items: end;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr minmax(180px, 260px);
  margin-bottom: 22px;
}

label span,
.search-box span,
.select-box span {
  color: var(--forest);
  display: block;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  margin-bottom: 7px;
  text-transform: uppercase;
}

input,
select,
textarea {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  outline: 0;
  padding: 13px 15px;
  width: 100%;
}

textarea { resize: vertical; }
input:focus,
select:focus,
textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 147, 62, 0.18); }

.article-layout { display: grid; gap: 22px; grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr); }
.article-list { display: grid; gap: 14px; }

.article-card {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 26px;
  color: inherit;
  cursor: pointer;
  display: block;
  padding: 20px;
  text-align: left;
  width: 100%;
}

.article-card[aria-current="true"] { border-color: var(--forest); box-shadow: 0 14px 36px rgba(13, 54, 47, 0.14); }
.article-card h3 { font-size: 1.16rem; margin: 8px 0; }
.article-card p { color: var(--muted); margin: 0; }

.article-meta,
.reader-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.86rem;
  gap: 8px;
  margin-top: 14px;
}

.topic-pill {
  background: rgba(138, 154, 115, 0.2);
  border-radius: 999px;
  color: var(--forest);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 5px 10px;
  text-transform: uppercase;
}

.article-reader {
  background: linear-gradient(180deg, #fffdf8, #f8f1e5);
  border: 1px solid var(--line);
  border-radius: 32px;
  min-height: 460px;
  padding: clamp(24px, 4vw, 42px);
}

.article-reader h3 { font-family: var(--serif); font-size: clamp(1.8rem, 3vw, 3.1rem); }
.reader-body { color: #2f3c35; font-size: 1.04rem; margin-top: 24px; }
.reader-body p { margin: 0 0 1em; }

.article-form { display: grid; gap: 18px; }
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-note { color: var(--muted); margin: 0; }

.topic-grid { display: grid; gap: 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.topic-grid article {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
}
.topic-grid span { color: var(--gold); font-weight: 900; }
.topic-grid h3 { font-size: 1.2rem; margin: 18px 0 10px; }
.topic-grid p { color: var(--muted); margin: 0; }

.newsletter-section {
  background:
    linear-gradient(135deg, rgba(13, 54, 47, 0.92), rgba(23, 74, 64, 0.86)),
    var(--forest);
  color: var(--paper-strong);
}

.newsletter-section .section-heading p,
.newsletter-section .form-note { color: rgba(255, 253, 248, 0.78); }

.newsletter-form {
  display: grid;
  gap: 18px;
  max-width: 780px;
}

.subscriber-auth-grid {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-form,
.subscriber-status {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(22px, 4vw, 32px);
}

.auth-form h3,
.subscriber-status h3 {
  margin-bottom: 10px;
}

.subscriber-status {
  grid-column: 1 / -1;
}

.subscriber-status .muted-copy {
  margin-bottom: 18px;
}

.newsletter-form label span { color: var(--paper-strong); }

.newsletter-form input {
  background: rgba(255, 253, 248, 0.96);
  border-color: rgba(255, 253, 248, 0.32);
}

.newsletter-form .button.primary { min-width: 138px; }

.newsletter-form[data-state="success"] .form-note { color: #dbeecf; }
.newsletter-form[data-state="error"] .form-note { color: #ffd6ca; }

.empty-state {
  background: rgba(255, 253, 248, 0.7);
  border: 1px dashed var(--line);
  border-radius: 24px;
  color: var(--muted);
  padding: 24px;
}

.site-footer {
  align-items: center;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1180px;
  padding: 34px clamp(20px, 5vw, 0px) 50px;
}
.site-footer div { gap: 16px; }
.site-footer p { margin: 0; }
.footer-brand { color: var(--ink); }

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto auto; }
  .nav-links { display: none; }
  .hero { min-height: auto; padding-top: 112px; }
  .hero-grid,
  .intro-section,
  .article-layout,
  .toolbar { grid-template-columns: 1fr; }
  .topic-grid,
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .brand small,
  .header-action { display: none; }
  .home-hero .hero-panel { width: calc(100% - 40px); }
  .home-hero .hero-panel ul { grid-template-columns: 1fr; }
  .hero-copy-block,
  .intro-section,
  .subscriber-section,
  .article-workspace,
  .create-section,
  .topic-band,
  .newsletter-section { border-left: 0; border-right: 0; }
  .topic-grid,
  .form-grid { grid-template-columns: 1fr; }
  .site-footer,
  .site-footer div { align-items: flex-start; flex-direction: column; }
}

.button-link {
  background: transparent;
  cursor: pointer;
}

.author-body .hero {
  min-height: 620px;
}

.author-hero .hero-copy-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sign-in-card {
  justify-content: center;
}

.signed-in-panel h2 {
  font-size: clamp(1.6rem, 3vw, 2.8rem);
  margin-bottom: 12px;
}

.muted-copy {
  color: var(--muted);
  margin: 0 0 18px;
}

.locked-panel[data-locked="true"] {
  display: none;
}

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

.admin-card {
  cursor: default;
}

.admin-card .topic-pill {
  background: rgba(201, 147, 62, 0.2);
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .admin-list,
  .subscriber-auth-grid {
    grid-template-columns: 1fr;
  }
}

.home-hero .newsletter-section {
  grid-column: 1 / -1;
  margin-top: -18px;
  width: calc(100% - clamp(40px, 10vw, 152px));
}

.publication-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.library-section {
  background: rgba(255, 253, 248, 0.86);
  border: 1px solid rgba(216, 206, 189, 0.82);
  box-shadow: var(--shadow);
  margin: 112px auto 34px;
  max-width: min(1760px, calc(100% - 32px));
  min-height: calc(100vh - 132px);
  padding: clamp(24px, 4vw, 48px);
}

.library-shell {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.35fr);
}

.library-shell[data-view="search"] {
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 0.58fr);
}

.library-shell[data-view="article"] {
  grid-template-columns: minmax(0, 1fr);
}

.library-sidebar,
.article-details {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 28px;
  display: grid;
  gap: 16px;
  padding: 20px;
}

.library-sidebar {
  position: sticky;
  top: 96px;
}

.library-shell[data-view="search"] .library-sidebar {
  position: static;
}

.library-shell[data-view="search"] .library-results {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.library-reader {
  border-radius: 30px;
  min-height: calc(100vh - 240px);
}

.library-reader-wrap {
  display: grid;
  gap: 16px;
}

.library-shell[data-view="search"] .library-reader-wrap {
  display: none;
}

.library-back-button {
  justify-self: start;
}

.library-reader h3 {
  font-size: clamp(2.1rem, 4.2vw, 4.8rem);
}

.library-reader .reader-body {
  font-size: clamp(1.05rem, 1.2vw, 1.28rem);
  line-height: 1.75;
  max-width: 88ch;
}

.library-reader .article-details {
  margin-top: 22px;
  width: 100%;
}

.library-reader .article-detail-list {
  column-gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.library-results,
.popular-list {
  display: grid;
  gap: 12px;
}

.compact-card {
  border-radius: 20px;
  padding: 16px;
}

.compact-card h3 {
  font-size: 1rem;
}

.compact-card .article-meta {
  font-size: 0.78rem;
}

.popular-item {
  align-items: baseline;
  background: rgba(138, 154, 115, 0.14);
  border: 1px solid rgba(138, 154, 115, 0.28);
  border-radius: 18px;
  color: var(--forest);
  cursor: pointer;
  display: flex;
  font-weight: 800;
  gap: 10px;
  padding: 12px;
  text-align: left;
}

.popular-item span {
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.article-detail-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.article-detail-list div {
  border-top: 1px solid rgba(216, 206, 189, 0.72);
  padding-top: 12px;
}

.article-detail-list dt {
  color: var(--forest);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.article-detail-list dd {
  color: var(--muted);
  margin: 4px 0 0;
}

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

.tag-list span {
  background: rgba(201, 147, 62, 0.18);
  border-radius: 999px;
  color: var(--forest);
  padding: 4px 8px;
}

@media (max-width: 1100px) {
  .publication-list,
  .library-shell,
  .library-shell[data-view="search"],
  .library-shell[data-view="article"] {
    grid-template-columns: 1fr;
  }

  .library-sidebar,
  .article-details {
    position: static;
  }
}

@media (max-width: 620px) {
  .library-reader .article-detail-list {
    grid-template-columns: 1fr;
  }

  .eic-section { grid-template-columns: 1fr; }

  .eic-image { max-width: 180px; }

  .library-section {
    border-left: 0;
    border-right: 0;
    max-width: 100%;
  }

  .home-hero .newsletter-section {
    width: 100%;
  }
}
