:root {
  --ink: #161513;
  --paper: #fdfbf7;
  --card-bg: #ffffff;
  --card-border: rgba(22, 21, 19, 0.14);
  --rule: #d8d0c4;
  --mute: #5c574f;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto !important;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  min-height: 100svh;
}

a {
  color: inherit;
}

.wrap {
  width: min(720px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: max(2.5rem, calc(env(safe-area-inset-top, 0px) + 1.5rem)) 0 4rem;
}

.mast {
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.mast h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2rem;
  margin: 0;
  letter-spacing: -0.02em;
}

.mast p {
  margin: 0.35rem 0 0;
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--mute);
}

h1, h2 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h1 {
  font-size: 1.7rem;
  margin: 0;
}

h2 {
  font-size: 1.25rem;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list li {
  border-top: 1px solid var(--rule);
  padding: 1.2rem 0;
}

.list a {
  text-decoration: none;
  display: block;
}

.list a:hover h2 {
  text-decoration: underline;
}

.list h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  color: var(--ink);
}

.meta {
  color: var(--mute);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.98rem;
  margin: 0 0 1.2rem;
}

.standfirst {
  margin: 0;
  max-width: 38rem;
  color: var(--mute);
  font-size: 1.05rem;
}

/* Essay Page Styles */
.kicker {
  margin: 0 0 1rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #5c574f;
}

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

.kicker a:hover {
  text-decoration: underline;
}

.essay-page h1 {
  font-family: var(--serif);
  font-size: clamp(1.85rem, 4.5vw, 2.45rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
  color: var(--ink);
}

/* Share Card */
.share-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 1.4rem 0 2rem;
  padding: 14px 20px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card-bg);
  box-shadow: 0 3px 14px rgba(22, 21, 19, 0.04);
}

.share-label {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.share-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.share-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  line-height: 1;
}

.share-btn svg {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  display: block;
  flex-shrink: 0;
}

.share-btn span {
  display: block;
  text-align: center;
  color: #3b3731;
  white-space: nowrap;
}

.share-btn:hover span {
  text-decoration: underline;
}

/* Essay Content */
.essay {
  font-size: 1.08rem;
}

.essay p {
  margin: 0 0 1.25rem;
}

.essay .rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.2rem 0;
}

.share-card-top {
  margin: 1.4rem 0 2rem;
}

.share-card-bottom {
  margin: 2.5rem 0 1rem;
}

/* Essay Footer */
.essay-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin: 2.2rem 0 1.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--mute);
}

.essay-foot .back-link {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
}

.essay-foot .back-link a {
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.essay-foot .back-link a:hover {
  text-decoration: underline;
}

.essay-foot .copy {
  margin: 0;
  white-space: nowrap;
  font-family: var(--sans);
  font-size: 0.80rem;
  color: var(--mute);
}

/* Mobile Responsive */
@media (max-width: 580px) {
  .wrap {
    width: calc(100% - 2rem);
    padding: max(2rem, calc(env(safe-area-inset-top, 0px) + 1.25rem)) 0 3.5rem;
  }

  .share-card-top {
    margin: 1.2rem 0 1.6rem;
  }

  .share-card-bottom {
    margin: 2rem 0 1rem;
  }

  .share-label {
    font-size: 0.88rem;
  }

  .share-actions {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .essay-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}
