:root {
  --bg: #faf8f5;
  --bg-elevated: #ffffff;
  --bg-soft: #f3efe8;
  --ink: #2b2622;
  --ink-soft: #5c554d;
  --ink-muted: #8a8278;
  --line: #e6e0d6;
  --line-strong: #d4cdc2;
  --accent: #7a6b5d;
  --accent-strong: #5c4f43;
  --accent-soft: #ece6dc;
  --focus: #b89878;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(43, 38, 34, 0.06);
  --shadow-md: 0 6px 20px rgba(43, 38, 34, 0.08);
  --max-width: 960px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
}
.brand:hover { text-decoration: none; color: var(--accent-strong); }
.brand-mark { color: var(--accent); }
.site-nav {
  display: flex;
  gap: 20px;
  font-size: 14px;
}
.site-nav a {
  color: var(--ink-soft);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover {
  color: var(--accent-strong);
  text-decoration: none;
  border-bottom-color: var(--accent);
}

/* Hero */
.hero {
  padding: 80px 0 60px;
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  text-align: center;
}
.eyebrow {
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 16px;
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.15;
  margin: 0 0 20px;
  color: var(--ink);
  font-weight: 600;
}
.lede {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 620px;
  margin: 0 auto 32px;
  line-height: 1.65;
}

/* Buttons */
.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  font-family: var(--font);
}
.btn-primary {
  background: var(--accent-strong);
  color: #fff;
}
.btn-primary:hover { background: #4a4036; text-decoration: none; color: #fff; }
.btn-primary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn-ghost {
  background: transparent;
  color: var(--accent-strong);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--accent-soft); text-decoration: none; }
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

/* Sections */
section { padding: 64px 0; }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head h2 {
  font-family: var(--font-serif);
  font-size: clamp(26px, 3.5vw, 34px);
  margin: 0 0 12px;
  color: var(--ink);
}
.section-head p { color: var(--ink-soft); margin: 0; font-size: 16px; }

/* Ceremony */
.ceremony-section { background: var(--bg-elevated); }
.ceremony-shell {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.step-indicator {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  flex-wrap: wrap;
}
.step-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-soft);
  font-family: var(--font);
  transition: all 0.15s ease;
}
.step-dot:hover { border-color: var(--accent); color: var(--accent-strong); }
.step-dot.active {
  background: var(--accent-strong);
  color: #fff;
  border-color: var(--accent-strong);
}
.step-dot:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}
.step-dot.active .step-num { background: rgba(255,255,255,0.25); color: #fff; }
.step-label { font-weight: 500; }

.step-panel { display: none; }
.step-panel.active { display: block; }
.step-panel h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  margin: 0 0 8px;
}
.hint { color: var(--ink-muted); font-size: 14px; margin: 0 0 20px; }
.field-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--ink);
}
.text-input, .text-area {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg-elevated);
  transition: border-color 0.15s ease;
  margin-bottom: 16px;
}
.text-input:focus, .text-area:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(122, 107, 93, 0.15);
}
.text-area { resize: vertical; min-height: 100px; }

.presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.preset-label { font-size: 13px; color: var(--ink-muted); margin-right: 4px; }
.preset-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s ease;
}
.preset-chip:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.preset-chip:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.prompt-suggestions {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-top: 8px;
}
.prompt-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); display: block; margin-bottom: 8px; }
.prompt-suggestions ul { margin: 0; padding-left: 20px; color: var(--ink-soft); font-size: 14px; }
.prompt-suggestions li { margin-bottom: 4px; }

.step-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* Letter output */
.letter-output {
  margin-top: 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-md);
}
.letter-head { text-align: center; margin-bottom: 24px; }
.letter-head h2 { font-family: var(--font-serif); font-size: 24px; margin: 0 0 8px; }
.letter-date { color: var(--ink-muted); font-size: 14px; margin: 0; }
.letter-body {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  white-space: pre-wrap;
  padding: 24px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}
.letter-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.save-note { color: var(--ink-muted); font-size: 13px; margin-top: 12px; }

/* Examples */
.examples-section { background: var(--bg); }
.example-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.example-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.example-card h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  margin: 0 0 12px;
  color: var(--ink);
}
.example-card p { color: var(--ink-soft); font-size: 14px; margin: 0 0 10px; line-height: 1.6; }
.example-card p:last-child { margin-bottom: 0; }

/* Guilt reframe */
.guilt-section { background: var(--bg-elevated); }
.reframe-list {
  max-width: 720px;
  margin: 0 auto;
}
.reframe-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: var(--bg);
}
.reframe-item summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  font-size: 15px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.reframe-item summary::-webkit-details-marker { display: none; }
.reframe-item summary::before {
  content: "+";
  font-weight: 700;
  color: var(--accent);
  font-size: 18px;
  width: 20px;
  text-align: center;
}
.reframe-item[open] summary::before { content: "−"; }
.reframe-item summary:hover { color: var(--accent-strong); }
.reframe-item p {
  padding: 0 20px 16px 48px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
}

/* Timeline */
.timeline-section { background: var(--bg); }
.timeline-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-muted);
  background: var(--bg-elevated);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}
.timeline-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.timeline-item {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.timeline-item:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.timeline-item:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.timeline-item h4 {
  font-family: var(--font-serif);
  font-size: 17px;
  margin: 0 0 4px;
  color: var(--ink);
}
.timeline-item .timeline-date { font-size: 13px; color: var(--ink-muted); margin: 0 0 8px; }
.timeline-item .timeline-preview { font-size: 14px; color: var(--ink-soft); margin: 0; line-height: 1.5; }
.timeline-actions {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.timeline-note { font-size: 13px; color: var(--ink-muted); margin: 0; }

/* Closing */
.closing-section { background: var(--bg-soft); text-align: center; }
.closing-section h2 { font-family: var(--font-serif); font-size: 26px; margin: 0 0 16px; }
.closing-section p { color: var(--ink-soft); max-width: 640px; margin: 0 auto 16px; font-size: 16px; }

/* Footer */
.site-footer {
  background: var(--ink);
  color: #d4cdc2;
  padding: 48px 0 24px;
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-brand { font-weight: 600; color: #fff; margin: 0 0 4px; font-size: 15px; }
.footer-small { color: var(--ink-muted); margin: 0; font-size: 13px; }
.footer-label { font-weight: 600; color: #fff; margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 6px; }
.footer-links a { color: #d4cdc2; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; margin: 0; color: var(--ink-muted); font-size: 13px; }
.footer-bottom a { color: #d4cdc2; }

/* Print */
@media print {
  .site-header, .site-footer, .step-indicator, .step-actions, .letter-actions, .hero, .examples-section, .guilt-section, .timeline-section, .closing-section { display: none; }
  .ceremony-section { padding: 0; }
  .letter-output { box-shadow: none; border: none; padding: 0; }
  .letter-body { border-left: 2px solid #000; background: #fff; }
}

/* Responsive */
@media (max-width: 720px) {
  .site-nav { gap: 12px; font-size: 13px; }
  .hero { padding: 56px 0 40px; }
  section { padding: 48px 0; }
  .ceremony-shell { padding: 20px; }
  .step-dot { padding: 6px 10px; font-size: 13px; }
  .step-label { display: none; }
  .letter-output { padding: 24px; }
  .letter-body { padding: 16px; font-size: 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .example-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero h1 { font-size: 28px; }
  .lede { font-size: 16px; }
  .letter-actions { flex-direction: column; }
  .letter-actions button { width: 100%; }
}

/* Focus visible for accessibility */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
