:root {
  --bg: #f6f3ee;
  --bg-soft: #fffdf9;
  --ink: #2e2a26;
  --ink-soft: #6b635a;
  --line: #e4ddd2;
  --accent: #7c6f5b;
  --accent-warm: #a8794f;
  --shadow: 0 6px 24px rgba(60, 50, 40, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }

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

.serif {
  font-family: Georgia, "Times New Roman", serif;
}

a { color: var(--accent-warm); }

/* --- hero ------------------------------------------------------------- */
.hero {
  text-align: center;
  padding: 5rem 1.5rem 3.5rem;
  background: linear-gradient(180deg, #efe9df 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.hero .kicker {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin: 0 0 1.2rem;
}
.hero h1 {
  font-family: Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  margin: 0;
  letter-spacing: 0.01em;
}
.hero .dates {
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin-top: 0.8rem;
  font-style: italic;
}
.hero .intro {
  max-width: 620px;
  margin: 2rem auto 0;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

/* portrait at the top (shown once a hero photo is added) */
.hero-portrait {
  width: min(400px, 88vw);
  aspect-ratio: 3 / 4;
  margin: 0 auto 2.4rem;
  border-radius: 16px;
  background-size: cover;
  background-position: center top;
  box-shadow: 0 12px 36px rgba(60, 50, 40, 0.16);
  border: 7px solid var(--bg-soft);
  outline: 1px solid var(--line);
}

/* social links */
.socials {
  margin-top: 2rem;
  display: flex;
  gap: 1.4rem;
  justify-content: center;
  flex-wrap: wrap;
}
.socials a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.socials a:hover { color: var(--accent-warm); border-color: var(--accent-warm); }

/* --- layout ----------------------------------------------------------- */
.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section {
  padding: 3.5rem 0;
}
.section h2 {
  font-family: Georgia, serif;
  font-weight: 500;
  font-size: 1.7rem;
  text-align: center;
  margin: 0 0 0.4rem;
}
.section .sub {
  text-align: center;
  color: var(--ink-soft);
  margin: 0 0 2.5rem;
}

/* --- about / bio ------------------------------------------------------ */
.bio {
  max-width: 640px;
  margin: 0 auto;
  font-size: 1.08rem;
}
.bio p { margin: 0 0 1.1rem; }
.bio-placeholder {
  color: var(--accent-warm);
  font-style: italic;
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 1rem 1.2rem;
}

/* --- song / video ----------------------------------------------------- */
.video-frame {
  max-width: 640px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  background: #000;
}
.video-frame iframe { width: 100%; height: 100%; display: block; border: 0; }

/* --- photo gallery ---------------------------------------------------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.9rem;
}
.photo-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease;
  display: block;
}
.photo-grid img:hover { transform: scale(1.02); }

/* lightbox */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(20, 16, 12, 0.88);
  display: none; align-items: center; justify-content: center;
  padding: 2rem; z-index: 80;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw; max-height: 88vh;
  border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute; top: 1.2rem; right: 1.6rem;
  background: none; border: none; color: #fff;
  font-size: 2.4rem; line-height: 1; cursor: pointer;
}

/* --- share button / form ---------------------------------------------- */
.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0.85rem 1.8rem;
  border-radius: 999px;
  background: var(--accent-warm);
  color: #fff;
  font-weight: 600;
  transition: transform 0.1s ease, background 0.2s ease;
}
.btn:hover { background: #96683f; }
.btn:active { transform: translateY(1px); }
.btn.ghost {
  background: transparent;
  color: var(--accent-warm);
  border: 1px solid var(--accent-warm);
}
.btn.small { padding: 0.5rem 1rem; font-size: 0.9rem; }
.btn:disabled { opacity: 0.5; cursor: default; }

.card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.8rem;
}

form label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin: 1.1rem 0 0.4rem;
}
form input[type="text"],
form textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
form textarea { min-height: 130px; resize: vertical; }
form .row { display: flex; gap: 1rem; flex-wrap: wrap; }
form .row > div { flex: 1 1 200px; }
.hint { color: var(--ink-soft); font-size: 0.85rem; margin-top: 0.3rem; }

.file-drop {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 0.9rem;
  background: #fff;
}

/* --- voice recorder --------------------------------------------------- */
.recorder { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.rec-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #c0392b; display: inline-block;
}
.rec-dot.blink { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { opacity: 0.2; } }
audio { width: 100%; margin-top: 0.6rem; }

/* --- memory wall ------------------------------------------------------ */
.memory {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem 1.8rem;
  margin-bottom: 1.4rem;
}
.memory .who { font-weight: 700; }
.memory .rel { color: var(--ink-soft); font-size: 0.9rem; }
.memory .msg { margin: 0.9rem 0 0; white-space: pre-wrap; }
.memory img {
  width: 100%; border-radius: 10px; margin-top: 1rem; display: block;
}
.memory .when { color: var(--ink-soft); font-size: 0.8rem; margin-top: 1rem; }

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

/* --- toast / status --------------------------------------------------- */
.status { text-align: center; margin-top: 1rem; min-height: 1.4rem; font-weight: 600; }
.status.ok { color: #3f7d3f; }
.status.err { color: #b0413a; }

footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--line);
}

/* --- admin edit mode -------------------------------------------------- */
.admin-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 90;
  background: #2e2a26;
  color: #f6f3ee;
  font-size: 0.86rem;
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.admin-bar a { color: #e9c9a3; text-decoration: none; margin-right: 1rem; }
.admin-bar-actions { display: flex; align-items: center; gap: 0.5rem; }
.admin-bar button {
  font: inherit; font-size: 0.82rem; cursor: pointer;
  background: transparent; color: #f6f3ee;
  border: 1px solid #6b635a; border-radius: 999px; padding: 0.2rem 0.8rem;
}
body.admin-mode { padding-top: 2.6rem; }

.editable {
  cursor: pointer;
  outline: 1px dashed transparent;
  transition: background 0.15s ease, outline-color 0.15s ease;
  border-radius: 6px;
}
.editable:hover {
  background: rgba(168, 121, 79, 0.12);
  outline-color: var(--accent-warm);
}
.edit-wrap { max-width: 640px; margin: 0.4rem auto; text-align: left; }
.edit-area {
  width: 100%; min-height: 90px; padding: 0.7rem 0.85rem;
  border: 1px solid var(--accent-warm); border-radius: 10px;
  font: inherit; color: var(--ink); background: #fff; resize: vertical;
}

/* --- discreet admin launcher + login --------------------------------- */
.admin-launch {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 60;
  background: var(--bg-soft);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  opacity: 0.55;
  box-shadow: var(--shadow);
  transition: opacity 0.2s ease;
}
.admin-launch:hover { opacity: 1; }
.admin-login-back {
  position: fixed; inset: 0; background: rgba(40, 34, 28, 0.45);
  display: none; align-items: center; justify-content: center;
  padding: 1.5rem; z-index: 70;
}
.admin-login-back.open { display: flex; }
.admin-login-card { max-width: 360px; width: 100%; position: relative; }
.admin-login-card .close {
  position: absolute; top: 0.6rem; right: 0.9rem;
  background: none; border: none; font-size: 1.5rem;
  cursor: pointer; color: var(--ink-soft); line-height: 1;
}
.admin-login-card input {
  width: 100%; padding: 0.7rem 0.85rem; margin-top: 0.4rem;
  border: 1px solid var(--line); border-radius: 10px; font: inherit;
  background: #fff; color: var(--ink);
}

/* modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(40, 34, 28, 0.45);
  display: none; align-items: flex-start; justify-content: center;
  padding: 3rem 1rem; overflow-y: auto; z-index: 50;
}
.modal-back.open { display: flex; }
.modal { max-width: 560px; width: 100%; }
.modal h2 { text-align: left; }
.modal .close {
  float: right; background: none; border: none; font-size: 1.5rem;
  cursor: pointer; color: var(--ink-soft); line-height: 1;
}
