/* Change the look of the whole site from these values. */
:root {
  color-scheme: light;
  --primary: #1a2744;
  --navy-deep: #111a33;
  --gold: #d4af37;
  --gold-text: #7d6119;
  --bg: #f8f4e8;
  --surface: #fffdf7;
  --fg: #1a2744;
  --muted: #5a6275;
  --button-fg: #f8f4e8;
  --note-bg: #f5edd2;
  --note-fg: #5c4813;
  --ink: #1a2744;
  --line: rgb(26 39 68 / 0.16);
  --gifted-bg: #f5edd2;
  --gifted-fg: #5c4813;
  --error: #b3261e;
  --serif: 'Cormorant Garamond', 'Palatino Linotype', Georgia, serif;
  --script: 'Pinyon Script', 'Apple Chancery', cursive;
  --sans: Inter, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* Header and hero */
.site-header {
  background: var(--navy-deep);
  border-bottom: 1px solid rgb(212 175 55 / 0.18);
  color: var(--bg);
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 72rem;
  min-height: 3.25rem;
  margin: 0 auto;
  padding: 0 1rem;
}
.site-header a { color: rgb(248 244 232 / 0.8); font-size: 0.8125rem; }
.site-header a:hover { color: var(--bg); }
.monogram { color: var(--gold); font: 600 1.25rem/1 var(--serif); letter-spacing: 0.08em; }
.monogram span { margin-inline: 0.25rem; font-family: var(--script); font-size: 1.375rem; letter-spacing: 0; }

.eyebrow {
  color: var(--gold-text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.hero {
  overflow: hidden;
  background: radial-gradient(90% 70% at 80% 20%, #22335c 0%, transparent 60%), linear-gradient(180deg, var(--navy-deep), var(--primary));
  color: var(--bg);
}
.hero .eyebrow { color: var(--gold); }
.hero-inner {
  display: grid;
  gap: 2.5rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}
.hero-copy { display: grid; gap: 1.25rem; justify-items: start; min-width: 0; }
.hero h1 {
  color: var(--gold);
  font: 400 clamp(3.25rem, 9vw, 6.5rem)/1.2 var(--script);
  letter-spacing: 0;
  text-wrap: balance;
}
.hero-names {
  font: 600 clamp(1.5rem, 3.6vw, 2.5rem)/1.15 var(--serif);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-wrap: balance;
}
.hero-names em { color: var(--gold); font-style: normal; }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  color: rgb(248 244 232 / 0.78);
  font-size: 0.9375rem;
}
.hero-meta b { display: block; color: var(--bg); font-size: 1.0625rem; font-weight: 600; }
.hero-intro {
  max-width: 34rem;
  color: rgb(248 244 232 / 0.88);
  line-height: 1.6;
  text-wrap: pretty;
}
.passport {
  order: -1;
  justify-self: center;
  width: min(13rem, 60%);
  height: auto;
  border-radius: 8px 20px 20px 8px;
  box-shadow: 0 50px 80px -30px rgb(0 0 0 / 0.7), 0 0 0 1px rgb(212 175 55 / 0.15);
  transform: perspective(1400px) rotateY(-14deg) rotateX(6deg) rotate(2deg);
}

/* List */
.page {
  max-width: 72rem;
  margin: 0 auto;
  padding: 3rem 1rem 5rem;
}
.list-heading { margin-bottom: 1rem; }
.list-heading h2 { margin-top: 0.5rem; font-size: 2.5rem; line-height: 1.05; }
.list-heading p { margin-top: 0.25rem; font-size: 0.875rem; }

.filter-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 0.5rem;
  margin: 0 -1rem 2rem;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
}
.pill {
  flex-shrink: 0;
  min-height: 2.25rem;
  padding: 0 0.875rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  font: 500 0.875rem var(--sans);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.pill[aria-pressed='true'] {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--button-fg);
}

.gift-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gift-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 1.75rem;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(11 18 38 / 0.06), 0 12px 40px -12px rgb(11 18 38 / 0.22);
}
.gift-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--primary);
}
.gift-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gift-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: radial-gradient(90% 90% at 75% 20%, #22335c, var(--navy-deep));
  color: var(--gold);
}
.gift-placeholder svg { width: 3rem; height: 3rem; }
.gift-count {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.95);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 500;
}
.gift-locked {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(17 26 51 / 0.55);
  backdrop-filter: blur(2px);
}
.gift-locked span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 1rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.92);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.gift-locked svg, .button svg { width: 0.95rem; height: 0.95rem; flex-shrink: 0; }

.gift-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
}
.gift-store {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.gift-title { color: var(--ink); font-size: 1.5rem; line-height: 1.2; }
.gift-price { color: var(--ink); font-weight: 600; }
.gift-description { flex: 1; color: var(--muted); font-size: 0.875rem; line-height: 1.6; }
.gift-note {
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  background: var(--note-bg);
  color: var(--note-fg);
  font-size: 0.875rem;
}
.gift-note strong { font-weight: 500; }
.gift-yours { color: var(--gifted-fg); font-size: 0.875rem; font-weight: 500; }
.gift-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
}

/* Footer */
.site-footer {
  padding: 3rem 1.25rem;
  background: var(--navy-deep);
  color: rgb(248 244 232 / 0.72);
  text-align: center;
}
.footer-line { margin-bottom: 0.75rem; color: var(--gold); font: 400 clamp(1.75rem, 5vw, 2.5rem)/1.2 var(--script); }

.list-message { padding: 4rem 1rem; color: var(--muted); text-align: center; }
.list-message button {
  display: block;
  margin: 0.75rem auto 0;
  padding: 0.25rem;
  border: 0;
  background: none;
  color: var(--primary);
  font: 500 0.875rem var(--sans);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 1.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 600 0.9375rem var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s, background-color 0.15s;
}
.button:disabled { cursor: not-allowed; }
.button-primary { background: var(--primary); color: var(--button-fg); }
.button-primary:hover:not(:disabled) { background: #22325a; }
.button-gold { background: var(--gold); color: #0b1226; }
.button-gold:hover { background: #ddbc4e; }
.button-primary:disabled { opacity: 0.6; }
.button-quiet { border-color: #e5e5e5; background: #fff; color: #404040; }
.button-quiet:hover:not(:disabled) { background: #fafafa; }
.button-outline { border-color: var(--line); background: #fff; color: var(--primary); }
.button-outline:hover { background: var(--note-bg); }
.button-locked { background: var(--gifted-bg); color: var(--gifted-fg); }
.button-danger { border-color: #f3d3cf; background: #fff; color: var(--error); }
.button-danger:hover:not(:disabled) { background: #fef3f2; }
.button-small { min-height: 2.25rem; padding: 0 0.75rem; font-size: 0.8125rem; }
.button-full { width: 100%; }

/* Dialogs and forms */
.dialog {
  width: calc(100% - 2rem);
  max-width: 28rem;
  max-height: calc(100dvh - 2rem);
  padding: 1.5rem;
  overflow-y: auto;
  border: 0;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 20px 50px rgb(0 0 0 / 0.25);
  color: var(--ink);
}
.dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.dialog h2 { font-size: 2rem; line-height: 1.1; }
.dialog h2 + .muted { margin-top: 0.5rem; }
.dialog-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.lock-warning {
  margin-top: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  background: var(--note-bg);
  color: var(--note-fg);
  font-size: 0.875rem;
}
#done-note { margin-top: 0.75rem; }

label {
  display: block;
  margin-top: 1rem;
  color: #57534e;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.optional { color: #78716c; font-weight: 400; letter-spacing: 0; text-transform: none; }
input, textarea {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.625rem 1rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.75rem;
  background: #fff;
  color: var(--ink);
  font: 400 1rem var(--sans);
}
input { min-height: 2.75rem; }
textarea { resize: vertical; }
input:focus, textarea:focus {
  border-color: var(--primary);
  outline: 2px solid color-mix(in srgb, var(--primary) 25%, transparent);
  outline-offset: 0;
}
.form-error { margin-top: 0.75rem; color: var(--error); font-size: 0.875rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.form-row label { min-height: 2.25rem; }

/* Admin */
.admin-page { padding-top: 2rem; color: var(--ink); }
.login-card {
  max-width: 24rem;
  margin: 4rem auto;
  padding: 2rem;
  border-radius: 1.75rem;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(11 18 38 / 0.06), 0 12px 40px -12px rgb(11 18 38 / 0.22);
}
.login-card h1 { color: var(--fg); font-size: 2.25rem; }
.login-card .button { margin-top: 1.25rem; }
.admin-header { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
.admin-header h1 { color: var(--fg); font-size: 2.5rem; line-height: 1.1; }
.admin-header-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.admin-list { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.admin-gift {
  padding: 1.25rem;
  border-radius: 1.75rem;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(11 18 38 / 0.06), 0 12px 40px -12px rgb(11 18 38 / 0.22);
}
.admin-gift-top { display: flex; flex-direction: column; gap: 0.75rem; }
.admin-gift h2 { font-size: 1.5rem; line-height: 1.2; }
.admin-gift-actions { display: flex; flex-shrink: 0; gap: 0.5rem; }
.status {
  display: inline-block;
  margin-top: 0.375rem;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  background: var(--note-bg);
  color: var(--note-fg);
  font-size: 0.75rem;
  font-weight: 500;
}
.status-full { background: var(--gifted-bg); color: var(--gifted-fg); }
.claim-list { margin: 1rem 0 0; padding: 0; list-style: none; border-top: 1px solid #f0f0f0; }
.claim {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.claim:last-child { border-bottom: 0; padding-bottom: 0; }
.claim-name { font-weight: 500; overflow-wrap: anywhere; }
.claim-message { margin-top: 0.125rem; font-size: 0.875rem; overflow-wrap: anywhere; }
.claim-date { margin-top: 0.125rem; font-size: 0.75rem; }

@media (min-width: 640px) {
  .dialog-actions { flex-direction: row; justify-content: flex-end; }
  .site-header-inner { padding-inline: 2rem; }
  .page { padding: 4rem 2rem 5rem; }
  .filter-bar { margin-inline: -2rem; padding-inline: 2rem; }
  .list-heading h2 { font-size: 3.25rem; }
  .admin-header { flex-direction: row; align-items: flex-start; justify-content: space-between; }
  .admin-gift-top { flex-direction: row; align-items: flex-start; justify-content: space-between; }
}
@media (min-width: 768px) {
  .gift-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: 3rem; padding: 4.5rem 2rem 6rem; }
  .passport { order: 0; width: min(22rem, 100%); }
}
@media (min-width: 1024px) {
  .gift-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
