@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;600;700;800;900&display=swap');

:root,
html[data-theme="pink"] {
  --bg: #fff7fb;
  --card: rgba(255, 255, 255, .86);
  --text: #321725;
  --muted: #7b5d6d;
  --primary: #e84d89;
  --primary-dark: #b51f61;
  --accent: #ffd7e8;
  --border: rgba(232, 77, 137, .18);
  --shadow: 0 24px 70px rgba(145, 32, 83, .18);
}

html[data-theme="gold"] {
  --bg: #fffaf0;
  --card: rgba(255, 255, 255, .88);
  --text: #2e2116;
  --muted: #7d6b4c;
  --primary: #c9912e;
  --primary-dark: #805816;
  --accent: #ffe8b8;
  --border: rgba(201, 145, 46, .22);
  --shadow: 0 24px 70px rgba(135, 96, 19, .18);
}

html[data-theme="night"] {
  --bg: #130d1f;
  --card: rgba(35, 26, 52, .88);
  --text: #fff2f8;
  --muted: #c7b3c8;
  --primary: #ff75a8;
  --primary-dark: #ff4d91;
  --accent: #38203b;
  --border: rgba(255, 117, 168, .22);
  --shadow: 0 24px 70px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Be Vietnam Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, var(--accent), transparent 34rem),
    radial-gradient(circle at 95% 10%, rgba(255,255,255,.55), transparent 22rem),
    var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.hearts-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.hearts-bg::before,
.hearts-bg::after {
  content: "♥ ♥ ♥ ♥ ♥ ♥ ♥";
  position: absolute;
  color: rgba(232, 77, 137, .16);
  font-size: 28px;
  letter-spacing: 34px;
  animation: floatHearts 22s linear infinite;
}

.hearts-bg::before { left: -120px; top: 12%; }
.hearts-bg::after { right: -120px; top: 58%; animation-duration: 28s; }

@keyframes floatHearts {
  from { transform: translateY(40px) rotate(0deg); }
  to { transform: translateY(-140px) rotate(360deg); }
}

.hero, main, footer, .topbar { position: relative; z-index: 1; }

.hero {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.topbar {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.brand span {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.admin-link,
.primary-btn,
.ghost-btn,
.danger-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 900;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: transform .2s ease, opacity .2s ease;
}

.admin-link,
.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 12px 28px rgba(232, 77, 137, .24);
}

.ghost-btn {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

.danger-btn {
  background: #dc3434;
  color: white;
}

.admin-link:hover,
.primary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover {
  transform: translateY(-2px);
}

.hero-content {
  width: min(980px, 100%);
  margin: auto;
  text-align: center;
  padding: 70px 0 40px;
}

.kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 12px;
  color: var(--primary-dark);
  font-weight: 900;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 88px);
  line-height: 1.03;
  letter-spacing: -0.07em;
}

h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: -0.05em;
}

h3 { margin: 0 0 10px; }

.subtitle {
  margin: 24px auto 0;
  width: min(760px, 100%);
  color: var(--muted);
  line-height: 1.8;
  font-size: 18px;
}

.couple-card {
  margin: 40px auto 0;
  padding: 18px;
  width: min(680px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 30px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
}

.person {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--primary-dark);
  font-weight: 900;
  font-size: 24px;
}

.person strong {
  font-size: 24px;
}

.love-mid {
  min-width: 165px;
  display: grid;
  gap: 5px;
  color: var(--primary-dark);
  font-weight: 900;
}

.love-mid span {
  font-size: 34px;
}

.love-mid small {
  color: var(--muted);
  font-size: 12px;
}

.section {
  width: min(1180px, calc(100% - 32px));
  margin: 70px auto;
}

.intro {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 32px;
  align-items: center;
  padding: clamp(24px, 5vw, 54px);
  border: 1px solid var(--border);
  border-radius: 34px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.intro p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
  font-size: 18px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.pill {
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--primary-dark);
  font-weight: 900;
}

.timeline {
  display: grid;
  gap: 18px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  align-items: start;
}

.timeline-date {
  position: sticky;
  top: 92px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--accent);
  color: var(--primary-dark);
  font-weight: 900;
  text-align: center;
}

.memory-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 18px;
}

.memory-card p {
  color: var(--muted);
  line-height: 1.75;
}

.image-btn {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.memory-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 22px;
  display: block;
}

.gallery {
  columns: 3 260px;
  column-gap: 18px;
}

.gallery-card {
  width: 100%;
  break-inside: avoid;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--card);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: var(--text);
}

.gallery-card img {
  width: 100%;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.gallery-card span {
  display: block;
  padding: 16px;
  font-weight: 900;
}

.empty,
.success,
.error-box {
  padding: 20px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--border);
}

.success { color: #136c35; }
.error-box { color: #b00020; }

footer {
  text-align: center;
  color: var(--muted);
  padding: 42px 16px;
}

dialog {
  border: 0;
  background: transparent;
  padding: 0;
}

dialog::backdrop {
  background: rgba(26, 12, 26, .65);
  backdrop-filter: blur(8px);
}

.lightbox {
  width: min(930px, calc(100% - 24px));
  background: var(--bg);
  color: var(--text);
  border-radius: 34px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.lightbox img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 24px;
  background: #000;
}

.lightbox h3,
.lightbox p {
  padding: 0 8px;
}

.lightbox p {
  color: var(--muted);
  line-height: 1.7;
}

.close-x {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--primary-dark);
  font-size: 24px;
  font-weight: 900;
  position: absolute;
  top: 18px;
  right: 18px;
}

.install-page,
.admin-page {
  padding: 24px;
}

.install-card,
.admin-box {
  width: min(980px, 100%);
  margin: 30px auto;
  padding: clamp(22px, 5vw, 42px);
  border: 1px solid var(--border);
  border-radius: 34px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(460px, 100%);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
  margin: 14px 0;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 13px 15px;
  background: rgba(255,255,255,.75);
  color: #321725;
  outline: none;
}

textarea { resize: vertical; }

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-section {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px dashed var(--border);
}

.memories-admin {
  display: grid;
  gap: 12px;
}

.memory-admin-item {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 12px;
  background: rgba(255,255,255,.58);
}

.memory-admin-item img {
  width: 92px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
}

.small-muted {
  color: var(--muted);
  margin: 4px 0 0;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .topbar, .admin-header {
    flex-direction: column;
    align-items: stretch;
    border-radius: 24px;
  }

  .couple-card,
  .intro,
  .timeline-item,
  .memory-card,
  .form-grid,
  .memory-admin-item {
    grid-template-columns: 1fr;
  }

  .timeline-date {
    position: static;
  }

  .memory-admin-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }
}
