/* Covenant (working name) — design system.
   The feel: a beautifully printed wedding invitation. Warm ivory paper, deep
   brown-black ink, candlelight gold, a quiet sage. Fraunces for display,
   Newsreader for reading. Hairline rules, small-caps labels, portrait mats.
   Nothing neon, nothing glossy, no purple, no pink gradients. */

:root {
  --paper: #f6f1e7;
  --paper-deep: #eee6d6;
  --paper-card: #fbf8f1;
  --ink: #2b2117;
  --ink-soft: #6f6151;
  --ink-faint: #a3937f;
  --gold: #b8862b;
  --gold-deep: #96691c;
  --sage: #7c8a6e;
  --sage-deep: #5d6b50;
  --wine: #8a3b2c;
  --line: rgba(43, 33, 23, 0.16);
  --line-soft: rgba(43, 33, 23, 0.09);
  --shadow: 0 1px 2px rgba(43, 33, 23, 0.06), 0 10px 30px -12px rgba(43, 33, 23, 0.22);
  --disp: "Fraunces", Georgia, serif;
  --body: "Newsreader", Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}
/* Paper grain, faint, over everything. */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.17 0 0 0 0 0.13 0 0 0 0 0.09 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, .disp { font-family: var(--disp); font-weight: 500; line-height: 1.12; }
a { color: var(--gold-deep); text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: var(--body); font-size: 17px; color: var(--ink); }

.smallcaps {
  font-family: var(--body); font-size: 11.5px; letter-spacing: 0.18em;
  text-transform: uppercase; font-weight: 500; color: var(--ink-soft);
}
.rule { border: 0; border-top: 1px solid var(--line); }
.rule.double { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); height: 4px; }

/* ---------- Structure: sidebar on desktop, bottom tabs on phone ---------- */
.wrap { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; padding: 20px 18px 96px; }

.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: space-around; align-items: stretch;
  background: color-mix(in srgb, var(--paper-card) 92%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.nav .brandside { display: none; }
.nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--ink-soft); font-family: var(--body); font-size: 10.5px;
  letter-spacing: 0.12em; text-transform: uppercase; padding: 4px 10px;
  border-radius: 8px; position: relative;
}
.nav a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.nav a.on { color: var(--gold-deep); }
.nav a .dot {
  position: absolute; top: 0; right: 6px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9px; background: var(--wine); color: var(--paper-card);
  font-size: 10px; letter-spacing: 0; display: flex; align-items: center; justify-content: center;
}

@media (min-width: 900px) {
  .wrap { max-width: 760px; margin: 0; padding: 34px 40px 60px; margin-left: 228px; }
  .nav {
    top: 0; bottom: 0; right: auto; width: 228px; flex-direction: column;
    justify-content: flex-start; border-top: 0; border-right: 1px solid var(--line);
    padding: 26px 14px;
    background: color-mix(in srgb, var(--paper-deep) 55%, var(--paper));
  }
  .nav .brandside { display: block; padding: 0 10px 22px; }
  .nav .brandside .bname { font-family: var(--disp); font-size: 24px; font-weight: 500; }
  .nav .brandside .btag { font-size: 12.5px; color: var(--ink-soft); font-style: italic; margin-top: 2px; }
  .nav a {
    flex-direction: row; gap: 12px; font-size: 12.5px; padding: 11px 12px;
    justify-content: flex-start;
  }
  .nav a.on { background: color-mix(in srgb, var(--gold) 12%, transparent); }
  .nav a .dot { position: static; margin-left: auto; }
}

/* ---------- Cards & common blocks ---------- */
.card {
  position: relative; background: var(--paper-card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); padding: 22px;
}
.mat { /* the portrait mat: photo mounted inside a border like a printed portrait */
  border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: var(--paper-card);
}
.mat img { border-radius: 7px; width: 100%; aspect-ratio: 4/5; object-fit: cover; }

.chip {
  display: inline-block; font-size: 13.5px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-soft); background: transparent;
}
.chip.gold { border-color: color-mix(in srgb, var(--gold) 55%, transparent); color: var(--gold-deep); background: color-mix(in srgb, var(--gold) 9%, transparent); }
.chip.sample { border-color: color-mix(in srgb, var(--sage) 70%, transparent); color: var(--sage-deep); background: color-mix(in srgb, var(--sage) 12%, transparent); font-style: italic; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--body); font-size: 16px; border-radius: 999px;
  padding: 12px 26px; border: 1px solid var(--ink); background: var(--ink);
  color: var(--paper-card); transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); opacity: 0.85; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fffdf7; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink-soft); }
.btn.wine { background: transparent; color: var(--wine); border-color: color-mix(in srgb, var(--wine) 40%, transparent); }
.btn.small { font-size: 14px; padding: 8px 18px; }
.btn:disabled { opacity: 0.45; pointer-events: none; }

.field { margin: 18px 0; }
.field label { display: block; margin-bottom: 7px; }
.field input[type="text"], .field input[type="tel"], .field input[type="date"],
.field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper-card); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); }
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.hint { font-size: 14px; color: var(--ink-faint); font-style: italic; margin-top: 6px; }

.err { color: var(--wine); font-size: 15px; margin-top: 10px; }
.ok-note { color: var(--sage-deep); font-size: 15px; margin-top: 10px; }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper-card); padding: 12px 22px; border-radius: 999px;
  font-size: 15px; opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 90;
  max-width: 88vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 900px) { #toast { bottom: 40px; } }

/* Modal sheet */
.sheet-back {
  position: fixed; inset: 0; background: rgba(43, 33, 23, 0.45); z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--paper); border-radius: 18px 18px 0 0; width: 100%; max-width: 560px;
  padding: 26px 22px calc(26px + env(safe-area-inset-bottom)); max-height: 86vh; overflow: auto;
  border: 1px solid var(--line); border-bottom: 0;
}
@media (min-width: 900px) {
  .sheet-back { align-items: center; }
  .sheet { border-radius: 18px; border-bottom: 1px solid var(--line); padding-bottom: 26px; }
}

/* The interlocking rings mark */
.rings { display: inline-block; }

/* Empty states: never a bare "no data" */
.empty { text-align: center; padding: 52px 24px; }
.empty .rings { opacity: 0.5; margin-bottom: 14px; }
.empty h3 { font-size: 24px; margin-bottom: 8px; font-style: italic; font-weight: 400; }
.empty p { color: var(--ink-soft); max-width: 380px; margin: 0 auto; }

.fadein { animation: fadein 0.4s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
