:root {
  --background: #f5efe6;
  --paper: #fffaf1;
  --paper-strong: #fff6e7;
  --ink: #21170f;
  --muted: #76695c;
  --line: #ddcdbc;
  --accent: #b5672f;
  --accent-dark: #713b1c;
  --premium: #8d4aff;
  --premium-soft: #f1e9ff;
  --shadow: 0 24px 70px rgba(58, 35, 18, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(181, 103, 47, 0.18), transparent 28rem),
    radial-gradient(circle at bottom right, rgba(141, 74, 255, 0.11), transparent 26rem),
    linear-gradient(135deg, #fbf6ee 0%, var(--background) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-header {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.35rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 800;
}

nav a:hover {
  color: var(--accent-dark);
}

.subscribe-link {
  padding: 0.65rem 0.9rem;
  color: white;
  background: var(--accent-dark);
  border-radius: 999px;
}

.subscribe-link:hover {
  color: white;
  background: var(--accent);
}

.page {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4.5rem) 0 5rem;
}

.hero {
  max-width: 760px;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.4rem, 9vw, 7.3rem);
  line-height: 0.88;
  letter-spacing: -0.085em;
}

.hero-copy {
  max-width: 610px;
  margin: 1.25rem 0 0;
  color: #4b3b2d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.5;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

.article-tile {
  position: relative;
  min-height: 310px;
  padding: 1.3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--ink);
  background: rgba(255, 250, 241, 0.84);
  border: 1px solid var(--line);
  border-radius: 1.45rem;
  box-shadow: 0 12px 35px rgba(58, 35, 18, 0.08);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.article-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(181, 103, 47, 0.45);
  box-shadow: var(--shadow);
}

.article-tile.premium {
  background:
    linear-gradient(145deg, rgba(255, 250, 241, 0.92), rgba(241, 233, 255, 0.78)),
    var(--paper-strong);
  border-color: rgba(141, 74, 255, 0.32);
}

.article-tile.premium::after {
  content: "";
  position: absolute;
  inset: 0.55rem;
  pointer-events: none;
  border: 1px solid rgba(141, 74, 255, 0.16);
  border-radius: 1.05rem;
}

.tile-topline {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.category,
.premium-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0 0.62rem;
  border-radius: 999px;
}

.category {
  color: var(--accent-dark);
  background: #f3e3cf;
}

.premium-badge {
  color: #4e238f;
  background: var(--premium-soft);
}

time {
  margin-left: auto;
}

.article-tile h2 {
  margin: auto 0 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 2.4vw, 2.25rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.article-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.load-more-section {
  display: grid;
  place-items: center;
  gap: 0.9rem;
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

.load-more-button {
  min-height: 3.2rem;
  padding: 0 1.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: white;
  background: var(--accent-dark);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(113, 59, 28, 0.22);
}

.load-more-button:hover:not(.is-loading) {
  background: var(--accent);
}

.load-more-button::after {
  content: "";
  display: none;
  width: 1.05rem;
  height: 1.05rem;
  border: 3px solid rgba(255, 255, 255, 0.42);
  border-top-color: white;
  border-radius: 50%;
  flex: 0 0 auto;
}

.load-more-button.is-loading {
  cursor: wait;
  opacity: 0.9;
}

.load-more-button.is-loading::after,
.load-more-button[aria-busy="true"]::after {
  display: inline-block;
  animation: spin 800ms linear infinite;
}

.loading-message {
  min-height: 1.4rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.article-page {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4.5rem) 0 5rem;
}

.back-link {
  display: inline-flex;
  margin-bottom: 2rem;
  color: var(--accent-dark);
  font-size: 0.95rem;
  font-weight: 900;
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
}

.story {
  padding: clamp(1.5rem, 5vw, 4rem);
  background: rgba(255, 250, 241, 0.9);
  border: 1px solid var(--line);
  border-radius: 2rem;
  box-shadow: var(--shadow);
}

.story-header {
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.story-header h1 {
  max-width: 14ch;
  font-size: clamp(2.8rem, 7vw, 5.8rem);
}

.story-summary {
  max-width: 680px;
  margin: 1.35rem 0 1.25rem;
  color: #4b3b2d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.5;
}

.story-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.story-meta span + time::before,
.story-meta time + span::before {
  content: "•";
  margin-right: 0.75rem;
  color: var(--line);
}

.story-body {
  color: #312419;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 2vw, 1.22rem);
  line-height: 1.85;
}

.story-body p {
  margin: 0 0 1.45rem;
}

.story-body p:last-child {
  margin-bottom: 0;
}

.premium-heading-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.premium-heading-row .eyebrow {
  margin-bottom: 0;
}

.premium-story {
  border-color: rgba(141, 74, 255, 0.28);
  background:
    linear-gradient(145deg, rgba(255, 250, 241, 0.94), rgba(241, 233, 255, 0.62)),
    var(--paper);
}

.story-preview {
  max-width: 740px;
  margin-bottom: 2rem;
  color: #312419;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 2vw, 1.22rem);
  line-height: 1.85;
}

.story-preview p {
  margin: 0 0 1.45rem;
}

.paywall-panel {
  max-width: 620px;
  margin: 2.5rem auto 0;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
  background: white;
  border: 1px solid rgba(141, 74, 255, 0.24);
  border-radius: 1.6rem;
  box-shadow: 0 18px 50px rgba(58, 35, 18, 0.14);
}

.lock {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  background: var(--premium-soft);
  border-radius: 50%;
  font-size: 1.35rem;
}

.paywall-panel h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.paywall-panel p {
  max-width: 440px;
  margin: 0.9rem auto 1.4rem;
  color: var(--muted);
  line-height: 1.55;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0 1.2rem;
  color: white;
  background: var(--accent-dark);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.button:hover {
  background: var(--accent);
}

.premium-story .paywall-panel {
  display: block;
}

.premium-story .premium-content {
  display: none;
  padding-top: 1rem;
}

.premium-story.authenticated .paywall-panel {
  display: none;
}

.premium-story.authenticated .premium-content {
  display: block;
}

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

@media (max-width: 680px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    gap: 0.75rem;
  }

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

  .article-tile {
    min-height: 260px;
  }

  time {
    margin-left: 0;
  }
}
