@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Work+Sans:wght@400;500;600&display=swap');

:root {
  --bone: #F7F3EC;
  --ink: #2B3428;
  --ink-soft: #5B6558;
  --gold: #B8935A;
  --accent: #8A9A7E; /* default: natural */
}

body[data-theme="boy"] { --accent: #4C5B70; }
body[data-theme="girl"] { --accent: #C08877; }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: 'Work Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

/* ---- Seal / signature element ---- */
.seal {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.seal::before {
  content: "";
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  opacity: 0.5;
}
.seal svg { position: absolute; width: 26px; height: 26px; stroke: var(--accent); }

/* ---- Hero ---- */
.hero-photo {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 24px;
  box-shadow: 0 1px 2px rgba(43,52,40,0.08);
}
.hero-photo-empty {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 4px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #EDE8DC, #E3DDCE);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: 13px; letter-spacing: 0.04em;
}

.pet-name {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 40px;
  line-height: 1.05;
  text-align: center;
  margin: 0 0 6px;
  color: var(--ink);
}

.pet-type {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
  font-weight: 600;
}

.dates-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
  color: var(--ink-soft);
  font-size: 14px;
}
.dates-row .dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold);
}
.dates-row .rule {
  flex: 1; max-width: 48px; height: 1px;
  background: var(--gold); opacity: 0.5;
}

.story {
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  white-space: pre-wrap;
  margin-bottom: 40px;
}
.story-empty {
  font-style: italic;
  color: var(--ink-soft);
  text-align: center;
  margin-bottom: 40px;
}

.fresh-banner {
  background: rgba(184,147,90,0.08);
  border: 1px solid rgba(184,147,90,0.25);
  border-radius: 6px;
  padding: 18px 20px;
  margin-bottom: 40px;
  text-align: center;
}
.fresh-banner p {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.fresh-banner p:first-child {
  font-weight: 600;
  color: var(--ink);
}

.divider {
  border: none;
  border-top: 1px solid rgba(43,52,40,0.12);
  margin: 32px 0 24px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 32px;
}
.gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 3px;
}

.owner-toggle {
  display: block;
  margin: 0 auto;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  font-family: 'Work Sans', sans-serif;
}

/* ---- Forms ---- */
.card {
  background: #fff;
  border: 1px solid rgba(43,52,40,0.08);
  border-radius: 6px;
  padding: 28px 24px;
  margin-top: 24px;
  box-shadow: 0 1px 3px rgba(43,52,40,0.06);
}

.card h1 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 24px;
  margin: 0 0 20px;
  color: var(--ink);
}

label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 16px 0 6px;
}
label:first-of-type { margin-top: 0; }

input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(43,52,40,0.18);
  border-radius: 4px;
  font-family: 'Work Sans', sans-serif;
  font-size: 15px;
  background: var(--bone);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

textarea { resize: vertical; min-height: 110px; }

.btn {
  width: 100%;
  margin-top: 22px;
  padding: 13px;
  background: var(--ink);
  color: var(--bone);
  border: none;
  border-radius: 4px;
  font-family: 'Work Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.btn:hover { background: var(--accent); }

.msg { font-size: 13px; margin-top: 12px; color: var(--ink-soft); }
.msg.error { color: #A24A3B; }

.center { text-align: center; }
.loading { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
