:root {
  --stone: #f5f3ef;
  --ink: #2f3a40;
  --sage: #7c8c7a;
  --dusk: #4a5a6e;
  --hairline: #d9d4cc;
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --column: 42rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--stone);
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--dusk);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--sage);
}

:focus-visible {
  outline: 2px solid var(--dusk);
  outline-offset: 2px;
}

.site-header {
  border-bottom: 1px solid var(--hairline);
  padding: 1rem 1.25rem;
  background: var(--stone);
}

.site-header-inner {
  max-width: 56rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

.logo svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.95rem;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:hover {
  text-decoration: underline;
}

main {
  max-width: 56rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.reading-column {
  max-width: var(--column);
  margin-left: auto;
  margin-right: auto;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  letter-spacing: -0.02em;
  margin-top: 0;
}

h2 {
  font-size: 1.45rem;
  margin-top: 2.5rem;
}

.lead {
  font-size: 1.125rem;
  color: var(--dusk);
}

.hairline {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 2.5rem 0;
}

.breadcrumbs {
  font-size: 0.9rem;
  color: var(--dusk);
  margin-bottom: 1.5rem;
}

.breadcrumbs a {
  text-decoration: none;
}

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

.tool-section {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.tool-section legend,
.tool-section h2 {
  margin-top: 0;
  font-size: 1.2rem;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

input[type='text'],
input[type='email'],
textarea,
select {
  width: 100%;
  font: inherit;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  background: var(--stone);
  color: var(--ink);
}

textarea {
  min-height: 5rem;
  resize: vertical;
}

.field-hint {
  font-size: 0.85rem;
  color: var(--dusk);
  margin-top: 0.25rem;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.radio-group label {
  font-weight: 400;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.btn {
  font: inherit;
  cursor: pointer;
  border-radius: 3px;
  padding: 0.65rem 1.25rem;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--dusk);
  color: #fff;
  border-color: var(--dusk);
}

.btn-primary:hover {
  background: #3d4a5a;
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  border-color: var(--hairline);
  color: var(--ink);
}

.turnstile-wrap {
  margin: 1rem 0;
}

.form-error {
  color: #8b3a3a;
  font-size: 0.9rem;
}

#tool-status {
  margin-top: 1rem;
  color: var(--dusk);
}

.preview-wrap {
  margin-top: 2rem;
  display: none;
}

.preview-wrap.visible {
  display: block;
}

.preview-meta {
  font-size: 0.9rem;
  color: var(--dusk);
  margin-bottom: 0.75rem;
}

.eulogy-preview {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.preview-filler {
  filter: blur(6px);
  user-select: none;
  -webkit-user-select: none;
  color: var(--dusk);
  opacity: 0.85;
  margin-top: 0.5rem;
}

.paywall-card {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--hairline);
  background: #fff;
  border-radius: 4px;
}

.paywall-card h3 {
  margin-top: 0;
  font-size: 1.15rem;
}

.paywall-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(47, 58, 64, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.paywall-modal {
  background: #fff;
  max-width: 24rem;
  width: 100%;
  padding: 1.5rem;
  border-radius: 4px;
  border: 1px solid var(--hairline);
}

.paywall-modal[hidden],
.paywall-card[hidden] {
  display: none !important;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.steps li {
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1.25rem;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--dusk);
}

.faq details {
  border-bottom: 1px solid var(--hairline);
  padding: 0.75rem 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.pricing-table th,
.pricing-table td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--hairline);
}

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 2rem 1.25rem;
  font-size: 0.9rem;
  color: var(--dusk);
  max-width: 56rem;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 1rem;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.disclaimer {
  margin-top: 1rem;
  font-size: 0.85rem;
}

.checkout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(47, 58, 64, 0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.checkout-dialog {
  background: #fff;
  max-width: 28rem;
  width: 100%;
  padding: 1.5rem;
  border-radius: 4px;
  border: 1px solid var(--hairline);
  max-height: 90vh;
  overflow-y: auto;
}

.checkout-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2001;
  background: #fff;
  border: 1px solid var(--hairline);
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}

.checkout-plan {
  margin: 0.75rem 0 0.25rem;
  font-size: 1.1rem;
}

.checkout-lead {
  margin: 0 0 0.75rem;
  color: var(--dusk);
}

.checkout-pay {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

.checkout-pay .btn {
  width: 100%;
}

.btn-paypal {
  background: #ffc439;
  border-color: #e6ae27;
  color: #003087;
  font-weight: 600;
}

.btn-paypal:hover {
  background: #f4b820;
}

.btn-paypal:disabled,
.btn-card:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.paypal-word {
  font-style: italic;
  font-weight: 700;
}

.checkout-reserved {
  background: var(--stone);
  border: 1px solid var(--hairline);
  padding: 1rem;
}

.checkout-list {
  padding-left: 1.25rem;
}

.unlocked-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

@media print {
  .site-header,
  .site-footer,
  .nav-links,
  .unlocked-actions,
  .no-print {
    display: none !important;
  }
  body {
    background: #fff;
  }
}

.print-eulogy {
  font-family: var(--font-serif);
  font-size: 14pt;
  line-height: 1.65;
  max-width: 6in;
  margin: 0 auto;
}

.reading-card {
  page-break-after: always;
  font-family: var(--font-serif);
  font-size: 18pt;
  line-height: 1.5;
  padding: 1in;
  min-height: 4in;
  border: 1px solid var(--hairline);
  margin-bottom: 1rem;
}

@media (max-width: 600px) {
  .nav-links {
    font-size: 0.85rem;
  }
}
