:root {
  --ink: #2b2b28;
  --ink-soft: #5c5a52;
  --cream: #faf7f2;
  --card: #ffffff;
  --forest: #24423e;
  --forest-dark: #172c29;
  --gold: #b98b33;
  --gold-bright: #e3b45b;
  --gold-soft: #f3e6cf;
  --border: #e4ddd0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  color: var(--forest-dark);
  margin: 0 0 0.5rem;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.lede {
  color: var(--ink-soft);
  font-size: 16px;
  max-width: 58ch;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.couple-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.couple-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--forest-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  flex-shrink: 0;
}

.couple-card .avatar { width: 84px; height: 84px; font-size: 24px; }
.couple-card h3 { margin-bottom: 2px; }
.field-note { color: var(--ink-soft); font-size: 14px; margin: 0 0 0.75rem; }

.btn {
  display: inline-block;
  background: var(--forest);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--forest-dark); }

/* Hero */
.hero {
  background: var(--forest-dark);
  padding: 3.5rem 1.5rem 3rem;
}
.hero-inner {
  max-width: 760px;
  margin: 0 auto;
}
.hero .eyebrow { color: var(--gold-bright); }
.hero h1 {
  color: #fff;
  font-size: 36px;
  line-height: 1.3;
  max-width: 22ch;
  margin: 0 0 1rem;
}
.hero-lede {
  color: #d9d4c7;
  font-size: 16px;
  max-width: 58ch;
  margin: 0 0 2rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn-outline {
  display: inline-block;
  border: 1px solid rgba(250, 247, 242, 0.45);
  color: #faf7f2;
  background: transparent;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.btn-outline:hover { background: rgba(250, 247, 242, 0.1); border-color: #faf7f2; }

.scroll-hint {
  display: inline-block;
  margin-top: 1.75rem;
  font-size: 13px;
  color: #b7b1a0;
  text-decoration: none;
}
.scroll-hint:hover { color: #fff; }

.impact-block {
  background: var(--gold-soft);
  border-radius: 14px;
  padding: 1.75rem;
  margin-top: 1.5rem;
}
.impact-block h2 { font-size: 20px; margin-bottom: 0.6rem; }
.impact-block p { color: var(--ink); font-size: 15px; margin: 0; }
.impact-block p + p { margin-top: 0.85rem; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}
.step {
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
}
.step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-weight: 600;
  font-size: 13px;
}

@media (max-width: 480px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 28px; }
}

/* Couple page */
.couple-header {
  text-align: center;
  padding: 1rem 0 1.5rem;
}
.couple-header .avatar {
  width: 150px;
  height: 150px;
  font-size: 42px;
  margin: 0 auto 1rem;
}
.couple-header h1 { font-size: 24px; }
.couple-header p { color: var(--ink-soft); font-size: 14px; margin: 4px auto 0; max-width: 40ch; }

.avatar-photo { display: none; object-fit: cover; }

.bio-toggle {
  display: block;
  margin: 1rem auto 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.bio-content {
  margin-top: 0.75rem;
}
.bio-content p {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
  white-space: pre-line;
}

/* Profile editor on feed page */
.profile-card { margin-bottom: 1.25rem; }
.profile-photo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 1rem;
}
.profile-photo-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--gold-soft);
  flex-shrink: 0;
}
.profile-photo-preview.empty { display: none; }
input[type="file"] {
  font-size: 13px;
  color: var(--ink-soft);
}

/* Photo crop modal */
.crop-modal {
  position: fixed;
  inset: 0;
  background: rgba(23, 44, 41, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}
.crop-modal-inner {
  background: var(--card);
  border-radius: 14px;
  padding: 1.25rem;
  max-width: 340px;
  width: 100%;
}
.crop-circle-wrap {
  width: 280px;
  height: 280px;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
}
.crop-circle-wrap img { display: block; max-width: 100%; }
.crop-circle-wrap .cropper-view-box,
.crop-circle-wrap .cropper-face {
  border-radius: 50%;
}
.crop-modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.presets {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 1rem 0;
}
.preset-btn {
  text-align: left;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink);
}
.preset-btn.selected {
  border-color: var(--gold);
  background: var(--gold-soft);
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 1rem 0 6px;
}

textarea, input[type="text"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 80px; resize: vertical; }

.submit-btn {
  width: 100%;
  margin-top: 1.25rem;
  background: var(--forest);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.submit-btn:hover { background: var(--forest-dark); }
.submit-btn:disabled { opacity: 0.6; cursor: default; }

.success-box {
  display: none;
  text-align: center;
  padding: 2rem 1rem;
}
.success-box .check {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--forest-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 22px;
  font-weight: 700;
}
.error-box {
  display: none;
  color: #a13d2f;
  font-size: 13px;
  margin-top: 10px;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
}

footer.qr-note {
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2rem;
}

/* Feed page */
.login-box {
  max-width: 360px;
  margin: 3rem auto 0;
}
.login-box .btn { width: 100%; text-align: center; margin-top: 0.75rem; }
.muted-link-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 10px;
  background: none;
  border: none;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: underline;
  cursor: pointer;
}
.muted-link {
  display: block;
  text-align: center;
  margin-top: 2rem;
  font-size: 13px;
  color: var(--ink-soft);
}

.retention-note {
  background: var(--gold-soft);
  color: var(--forest-dark);
  font-size: 13px;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 1.25rem;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feed-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.feed-item.pinned { border-color: var(--gold); background: #fffaf0; }

.feed-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.feed-sender { font-weight: 600; font-size: 14px; }
.feed-date { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.feed-message { font-size: 14px; margin: 6px 0 10px; }

.feed-actions { display: flex; gap: 8px; }
.pill-btn {
  font-size: 12px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  color: var(--ink-soft);
}
.pill-btn.pinned { border-color: var(--gold); background: var(--gold-soft); color: var(--forest-dark); }
.pill-btn.danger:hover { border-color: #a13d2f; color: #a13d2f; }

.load-more-btn {
  display: block;
  margin: 1rem auto 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
}

.empty-state {
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  padding: 2rem 0;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.logout-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}

.feed-hero {
  background: var(--forest-dark);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 1.25rem;
}
.feed-hero .eyebrow { color: var(--gold-bright); margin-bottom: 2px; }
.feed-hero h1 { color: #fff; font-size: 21px; margin: 0 0 4px; }
.feed-hero-sub { color: #d9d4c7; font-size: 13px; margin: 0; }

.feed-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--gold-soft);
  color: var(--forest-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
}
.feed-avatar.avatar-photo { display: none; object-fit: cover; }

.feed-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.feed-actions-row .pill-btn {
  font-size: 13px;
  padding: 7px 14px;
}
