:root {
  --ink: #4a3026;
  --muted: #78665d;
  --soft: #9a8a80;
  --rose: #c98f7d;
  --rose-dark: #b0735f;
  --cream: #fffaf5;
  --blush: #f8e9e2;
  --sage: #7f8f78;
  --sage-bg: #eaf0e6;
  --line: #efe2d8;
  --card: #fffdfb;
  --shadow: 0 8px 30px rgba(109, 71, 50, .07);
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --script: 'Great Vibes', 'Brush Script MT', cursive;
  --nav-h: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.script { font-family: var(--script); font-weight: 400; color: var(--rose); }
.eyebrow { margin: 0; letter-spacing: .28em; text-transform: uppercase; font-size: 10.5px; color: var(--muted); }
section[id] { scroll-margin-top: 16px; }

/* ---------- buttons & inputs ---------- */
.btn {
  border: 0; border-radius: 12px; padding: 12px 18px; font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s, transform .1s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--rose); color: #fff; }
.btn-primary:hover { background: var(--rose-dark); }
.btn-ghost { background: #fff; border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--blush); }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--soft); font-size: 12px; text-decoration: underline; padding: 6px; }
input, textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 12px 14px; font-size: 16px; /* 16px: cegah auto-zoom iOS */
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(201, 143, 125, .18); }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }

/* ---------- gate ---------- */
.gate {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 16px calc(24px + env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse at 15% 15%, #f6e3da 0, transparent 45%),
    radial-gradient(ellipse at 85% 85%, #e6ece0 0, transparent 45%),
    var(--cream);
}
.gate-card {
  width: min(420px, 100%); text-align: center; background: rgba(255, 253, 251, .85);
  border: 1px solid var(--line); border-radius: 28px; padding: 36px 24px 28px; box-shadow: var(--shadow);
}
.gate-mark { font-size: 34px; color: var(--rose); line-height: 1; margin-bottom: 14px; }
.gate-title { font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1; margin: 12px 0 14px; }
.gate-title .script { display: block; font-size: 1.25em; margin-top: 4px; }
.gate-text { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.gate-form { display: flex; flex-direction: column; gap: 10px; }
.gate-form input { text-align: center; letter-spacing: .18em; text-transform: uppercase; }
.gate-form input::placeholder { letter-spacing: normal; text-transform: none; }
.gate-error { min-height: 1.4em; color: #b2554a; font-size: 13px; margin: 12px 0 0; }
.gate-foot { font-family: var(--serif); font-style: italic; color: var(--soft); margin-top: 22px; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

/* ---------- top ---------- */
.demo-banner { background: #f3e2c7; color: #6b5134; text-align: center; font-size: 12px; padding: 7px 16px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 6px; }
.brand { font-family: var(--serif); font-size: 22px; font-weight: 500; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand-mark { color: var(--rose); font-size: 22px; }
.nav { display: none; gap: 26px; font-size: 13px; color: var(--muted); }
.nav a { text-decoration: none; }
.nav a:hover { color: var(--ink); }
.pill { border: 0; border-radius: 999px; background: #f1ddd3; padding: 9px 15px; font-size: 13px; white-space: nowrap; }

/* ---------- hero ---------- */
.hero { display: grid; gap: 26px; padding: 18px 0 34px; }
.hero-copy { text-align: center; }
.hero-title { font-family: var(--serif); font-weight: 400; font-size: clamp(46px, 12vw, 76px); line-height: .95; letter-spacing: -1px; margin: 12px 0 10px; }
.hero-title .script { display: block; font-size: 1.12em; letter-spacing: 0; }
.hero-sub { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--muted); margin: 0; }

.photo-stack { position: relative; height: 310px; max-width: 380px; width: 100%; margin: 0 auto; }
.photo-frame { position: relative; overflow: hidden; background: linear-gradient(150deg, #f4e1d7, #e8ece2); box-shadow: var(--shadow); }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; position: relative; z-index: 1; }
.photo-frame.no-photo img { display: none; }
.photo-ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 42px; opacity: .55; }
.photo-main { width: 72%; height: 100%; margin: 0 auto; border-radius: 999px 999px 14px 14px; }
.photo-main img { object-position: center 35%; }
.photo-inset { position: absolute; width: 42%; height: 42%; right: 0; bottom: 6px; border: 7px solid var(--cream); border-radius: 16px; }
.signature { position: absolute; left: 2%; bottom: -8px; font-family: var(--script); font-size: 26px; transform: rotate(-7deg); color: var(--muted); z-index: 2; }

.note { background: linear-gradient(145deg, #fbefe9, #f7e6de); padding: 22px 18px; border-radius: 26px; }
.note h2 { font-family: var(--serif); font-weight: 500; font-size: 26px; margin: 0 0 8px; }
.note p { font-size: 14px; color: #65534a; margin: 0 0 14px; }
.note-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.note-tile { background: rgba(255, 250, 246, .75); border-radius: 16px; padding: 12px 8px; text-align: center; }
.tile-icon { font-size: 22px; color: var(--rose); line-height: 1.2; }
.note-tile strong { display: block; font-family: var(--serif); font-weight: 600; font-size: 15px; margin: 4px 0 2px; line-height: 1.2; }
.note-tile small { display: block; font-size: 11px; color: var(--muted); line-height: 1.4; }
.note .thanks { font-family: var(--serif); font-style: italic; font-size: 16px; margin: 14px 0 0; }

/* ---------- toolbar ---------- */
.gift-section { border-top: 1px solid var(--line); padding-top: 18px; }
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.filters {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px; padding: 2px 16px; scroll-snap-type: x proximity; scroll-padding-inline: 16px;
}
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: none; border: 1px solid var(--line); background: #f7efe8; color: var(--muted);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; white-space: nowrap; scroll-snap-align: start;
}
.filter.active { background: var(--rose); color: #fff; border-color: var(--rose); }
.filter .count { opacity: .7; margin-left: 3px; font-size: 11px; }
.search { position: relative; display: block; }
.search svg { position: absolute; left: 14px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); fill: none; stroke: var(--soft); stroke-width: 2; stroke-linecap: round; }
.search input { padding-left: 40px; border-radius: 999px; }

/* ---------- products ---------- */
.main-grid { display: grid; gap: 26px; align-items: start; }
.list-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.section-title { font-family: var(--serif); font-weight: 500; font-size: 30px; line-height: 1.1; margin: 0; }
.subtext { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
.progress { font-size: 13px; color: var(--muted); min-width: 200px; }
.progress-bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.progress-bar span { display: block; height: 100%; background: var(--sage); border-radius: 99px; transition: width .4s; }

.products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.product {
  background: #fff; border: 1px solid #f1e8e0; border-radius: 18px; padding: 8px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0;
  transition: opacity .35s, transform .35s;
}
.product.leaving { opacity: 0; transform: scale(.94); }
.product-img { position: relative; aspect-ratio: 1 / 1; border-radius: 12px; display: grid; place-items: center; overflow: hidden; font-size: 46px; }
.product-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.product-img.has-img { border: 1px solid #f3ece6; }
.product-body { padding: 10px 4px 4px; display: flex; flex-direction: column; flex: 1; min-width: 0; }
.chip { align-self: flex-start; font-size: 10.5px; color: var(--muted); background: #f6efe9; border-radius: 99px; padding: 2px 8px; margin-bottom: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product h3 { font-family: var(--serif); font-weight: 600; font-size: 18px; line-height: 1.15; margin: 0 0 4px; }
.product .detail { font-size: 12px; color: var(--muted); margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product .brand-name { font-size: 12px; color: var(--soft); margin: 0; }
.product .brand-name b { color: var(--ink); font-weight: 500; }
.price { font-family: var(--serif); font-size: 16px; font-weight: 600; margin: 8px 0 10px; }
.price small { font-family: var(--sans); font-weight: 400; font-size: 11px; color: var(--soft); }
.product-actions { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.product-actions .btn { padding: 10px 8px; font-size: 13px; border-radius: 10px; }
.empty { padding: 30px 16px; color: var(--muted); text-align: center; grid-column: 1 / -1; font-size: 14px; }
.empty .big { display: block; font-size: 30px; margin-bottom: 6px; }
.skeleton { height: 270px; border-radius: 18px; background: linear-gradient(90deg, #f6eee8 25%, #fbf5f0 50%, #f6eee8 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.my-claims { background: var(--sage-bg); border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; }
.my-claims h3 { font-family: var(--serif); font-weight: 600; font-size: 18px; margin: 0 0 8px; }
.my-claim { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid rgba(127, 143, 120, .2); }
.my-claim span { min-width: 0; }
.my-claim b { display: block; font-weight: 500; font-size: 14px; }
.my-claim small { color: var(--muted); font-size: 12px; }
.my-claim .btn { flex: none; padding: 8px 14px; font-size: 13px; }
.my-claims p { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }

/* ---------- side card ---------- */
.side-card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); scroll-margin-top: 16px; }
.side-card h2 { font-family: var(--serif); font-weight: 500; font-size: 24px; margin: 0 0 12px; }
.address { background: #f8eee6; border-radius: 15px; padding: 14px 16px; font-size: 14px; margin-bottom: 10px; overflow-wrap: anywhere; }
.address strong { display: block; font-size: 15px; margin-bottom: 4px; }
.address p { margin: 0; }
.address .phone { margin-top: 8px; }
.side-note { background: #f7f0e8; padding: 12px 14px; border-radius: 13px; margin-top: 10px; color: var(--muted); font-size: 13px; }

/* ---------- messages ---------- */
.messages { margin: 34px 0 30px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 20px 16px; box-shadow: var(--shadow); }
.messages-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.message-form { display: grid; gap: 10px; margin: 18px 0 22px; }
.message-form label { display: block; }
.message-form textarea { min-height: 100px; resize: vertical; }
.message-list { display: grid; gap: 10px; }
.message-card { border: 1px solid #f0e5dd; border-radius: 16px; padding: 14px 16px; background: #fff; }
.message-card strong { font-size: 14px; font-weight: 600; }
.message-card .rel { color: var(--soft); font-weight: 400; }
.message-card time { display: block; color: var(--soft); font-size: 11px; margin: 1px 0 8px; }
.message-card p { margin: 0; color: #6f5e55; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.more-btn { grid-column: 1 / -1; justify-self: center; }

/* ---------- footer ---------- */
.footer { text-align: center; color: var(--muted); padding-bottom: calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
.footer p { margin: 0 auto 6px; max-width: 560px; }
.footer .blessing { font-family: var(--serif); font-style: italic; font-size: 17px; }
.footer .script { font-size: 26px; }

/* ---------- bottom nav (mobile) ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 250, 245, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a { height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--soft); text-decoration: none; }
.bottom-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bottom-nav a.active { color: var(--rose-dark); }

/* ---------- modal & toast ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(42, 27, 22, .55); display: flex; align-items: flex-end; justify-content: center; }
.modal {
  background: var(--cream); width: 100%; max-height: 92vh; overflow-y: auto;
  padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 50px rgba(0, 0, 0, .15); animation: up .25s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.modal h2 { font-family: var(--serif); font-weight: 500; font-size: 26px; margin: 0 0 10px; }
.modal label { font-size: 13px; display: block; margin: 14px 0 6px; color: var(--muted); }
.modal-product { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.modal-product .mini { position: relative; width: 52px; height: 52px; flex: none; border-radius: 10px; display: grid; place-items: center; font-size: 26px; overflow: hidden; }
.modal-product .mini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.modal-product b { display: block; font-family: var(--serif); font-size: 17px; line-height: 1.2; }
.modal-product span { font-size: 12px; color: var(--muted); }
.modal-hint { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.modal-hint.small { font-size: 12px; text-align: center; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }
.thanks-mark { font-size: 40px; text-align: center; }
#thanksStep h2 { text-align: center; }
#thanksStep .address { margin-top: 12px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); z-index: 40;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; border-radius: 12px; padding: 11px 16px; font-size: 13px;
  max-width: calc(100% - 32px); width: max-content; text-align: center; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ tablet ============ */
@media (min-width: 640px) {
  .wrap { padding: 0 24px; }
  .filters { margin: 0; padding: 2px 0; flex-wrap: wrap; overflow: visible; }
  .products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .product { padding: 10px; }
  .product-img { font-size: 56px; }
  .product-actions { flex-direction: row; }
  .product-actions .btn { flex: 1; }
  .product-actions .btn-ghost { flex: 0 0 auto; padding: 10px 12px; }
  .note { padding: 26px; }
  .messages { padding: 26px; }
  .message-form { grid-template-columns: 1fr 1fr; }
  .message-form .full { grid-column: 1 / -1; }
  .message-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .list-head { flex-direction: row; justify-content: space-between; align-items: flex-end; }
  .modal-backdrop { align-items: center; padding: 20px; }
  .modal { width: min(440px, 100%); border-radius: 22px; padding: 26px; }
  .toast { bottom: 24px; }
}

/* ============ laptop ============ */
@media (min-width: 1000px) {
  .nav { display: flex; }
  .bottom-nav { display: none; }
  .footer { padding-bottom: 36px; }
  .topbar { padding-top: 22px; }
  .hero { grid-template-columns: 1.05fr 1fr 1.1fr; align-items: center; gap: 28px; padding: 26px 0 46px; }
  .hero-copy { text-align: left; }
  .hero-title { font-size: clamp(56px, 5.4vw, 80px); }
  .photo-stack { height: 400px; }
  .toolbar { flex-direction: row; align-items: center; }
  .search { margin-left: auto; min-width: 250px; }
  .main-grid { grid-template-columns: minmax(0, 1fr) 330px; }
  .side-card { position: sticky; top: 18px; }
  .message-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .section-title { font-size: 36px; }
}
@media (min-width: 640px) and (max-width: 999px) {
  .hero { grid-template-columns: 1fr 1fr; align-items: center; }
  .hero-copy { text-align: left; }
  .note { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
