/* Layout concept: a blush stationery counter. Editorial hero with the live gift inside a phone,
   quiet sections on paper below. The gift itself is a separate, single-look world per theme. */
:root {
  --paper: #FBF0F2;
  --surface: #FFFFFF;
  --ink: #36192A;
  --muted: #86606F;
  --line: #EDD3DA;
  --soft: #F6DEE5;
  --accent: #D23A6C;
  --accent-ink: #FFFFFF;
  --device: #2B1B23;

  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  --f-hand: "Gaegu", "Comic Sans MS", "Chalkboard SE", cursive;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1B1116; --surface: #261920; --ink: #F6E5EB; --muted: #C39CAA; --line: #43293A;
    --soft: #33202A; --accent: #FF6F9E; --accent-ink: #2B0A18; --device: #0B0709; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1B1116; --surface: #261920; --ink: #F6E5EB; --muted: #C39CAA; --line: #43293A;
  --soft: #33202A; --accent: #FF6F9E; --accent-ink: #2B0A18; --device: #0B0709; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }

.wrap {
  max-width: 1160px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-in { display: flex; align-items: center; gap: 22px; height: 64px; }
.logo {
  font-family: var(--f-display); font-weight: 800; font-size: 20px; letter-spacing: -0.01em;
  text-decoration: none; display: flex; align-items: center; gap: 9px;
}
.logo svg { width: 28px; height: 28px; flex: none; }
.nav-links { display: flex; gap: 22px; margin-left: auto; font-weight: 600; font-size: 15px; }
.nav-links a { text-decoration: none; color: var(--muted); }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 15px/1 var(--f-body);
  padding: 13px 22px; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { transform: translateY(-1px); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.text { background: none; color: var(--muted); padding-inline: 8px; }
.btn.text:hover { color: var(--ink); }
.btn.small { padding: 9px 15px; font-size: 14px; }

/* ---------- Hero ---------- */
.hero { padding-block: 56px 80px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 56px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; } }
.eyebrow { font-family: var(--f-hand); font-size: 22px; font-weight: 700; color: var(--accent); margin: 0 0 10px; }
.display {
  font-family: var(--f-display); font-weight: 800;
  font-size: clamp(40px, 6.2vw, 74px); line-height: .98; letter-spacing: -0.035em;
  margin: 0; text-wrap: balance;
}
.display em {
  font-style: normal; font-family: var(--f-hand); font-weight: 700; letter-spacing: 0;
  color: var(--accent); font-size: 1.08em;
}
.lede { font-size: clamp(17px, 1.6vw, 19px); color: var(--muted); max-width: 33em; margin: 22px 0 30px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-facts { margin: 26px 0 0; padding: 0; list-style: none; display: flex; gap: 8px 22px; flex-wrap: wrap; font-size: 14px; color: var(--muted); font-weight: 600; }
.hero-facts li::before { content: "♥"; color: var(--accent); margin-right: 7px; font-size: 12px; }

.hero-stage { position: relative; }
.hero-stage .device { height: 590px; }
.sticky-note {
  position: absolute; left: -14px; bottom: 56px; max-width: 160px; margin: 0;
  font-family: var(--f-hand); font-size: 20px; line-height: 1.1; font-weight: 700;
  background: #FFF3A6; color: #4A3B12; padding: 12px 14px 10px;
  transform: rotate(-5deg); box-shadow: 0 10px 20px -12px rgba(0, 0, 0, .45);
}
@media (max-width: 900px) { .sticky-note { left: 0; bottom: -18px; } }

/* ---------- Sections ---------- */
.section { padding-block: 76px; border-top: 1px solid var(--line); }
.section h2 {
  font-family: var(--f-display); font-weight: 800; font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.03em; line-height: 1.04; margin: 0 0 12px; text-wrap: balance;
}
.section .intro { color: var(--muted); max-width: 40em; margin: 0 0 36px; font-size: 17px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; list-style: none; padding: 0; margin: 0; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 24px 26px; }
.step-n { font-family: var(--f-hand); font-size: 46px; font-weight: 700; color: var(--accent); line-height: 1; }
.steps h3 { font-family: var(--f-display); font-size: 21px; letter-spacing: -0.01em; margin: 12px 0 6px; }
.steps p { margin: 0; color: var(--muted); }
@media (max-width: 800px) { .steps { grid-template-columns: minmax(0, 1fr); } }

.theme-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 980px) { .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .theme-grid { grid-template-columns: minmax(0, 1fr); } }
.theme-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.theme-swatch {
  background: linear-gradient(165deg, var(--g-bg), var(--g-bg2)); color: var(--g-ink);
  font-family: var(--f-hand); aspect-ratio: 4 / 3.3; display: grid; place-items: center; padding: 16px; text-align: center;
}
.theme-swatch .g-mascot { width: 66px; animation: none; }
.ts-title { font-weight: 700; font-size: 21px; line-height: 1.05; margin: 4px 0 10px; }
.ts-btns { display: flex; gap: 8px; justify-content: center; }
.theme-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; flex-wrap: wrap; }
.theme-meta h3 { margin: 0; font-family: var(--f-display); font-size: 17px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0; }
.chips li { font-family: var(--f-hand); font-size: 21px; font-weight: 700; padding: 6px 18px 4px; border-radius: 999px; background: var(--soft); }

.price-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 880px; }
@media (max-width: 720px) { .price-grid { grid-template-columns: minmax(0, 1fr); } }
.price { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; }
.price.featured { border: 2px solid var(--accent); }
.price-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.price h3 { font-family: var(--f-display); font-size: 22px; margin: 0; }
.amount { font-family: var(--f-display); font-size: 46px; font-weight: 800; letter-spacing: -0.03em; margin: 10px 0 0; line-height: 1; }
.amount small { font-size: 15px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.badge { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; background: var(--soft); color: var(--accent); }
.price ul { list-style: none; padding: 0; margin: 20px 0 24px; display: grid; gap: 9px; flex: 1; }
.price li::before { content: "♥"; color: var(--accent); margin-right: 10px; font-size: 12px; }

.footer { padding-block: 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer-in { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }

/* ---------- Device frame ---------- */
.device {
  width: min(100%, 375px); height: 640px; margin-inline: auto;
  border: 10px solid var(--device); border-radius: 38px; overflow: auto; overscroll-behavior: contain;
  background: var(--surface); box-shadow: 0 34px 60px -34px rgba(54, 25, 42, .6);
  scrollbar-width: thin;
}
.device.desktop { width: 100%; height: 560px; border-radius: 14px; border-width: 9px; }
.device > .gift { min-height: 100%; }

/* ---------- Builder ---------- */
.b-page { padding-block: 36px 80px; }
.b-head h1 { font-family: var(--f-display); font-size: clamp(32px, 4vw, 46px); letter-spacing: -0.03em; line-height: 1.04; margin: 0 0 8px; }
.b-head p { margin: 0; color: var(--muted); }
.builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; margin-top: 30px; align-items: start; }
@media (max-width: 960px) {
  .builder { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .b-preview { position: static !important; order: -1; }
  .b-preview .device { height: 500px; }
}
.b-form { display: grid; gap: 18px; min-width: 0; }
.b-form fieldset {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 20px; margin: 0; display: grid; gap: 14px; min-width: 0;
}
.b-form fieldset:disabled > :not(legend):not(.fs-note) { opacity: .45; }
.b-form legend { float: left; width: 100%; padding: 0; font-family: var(--f-display); font-weight: 700; font-size: 18px; }
.b-form legend + * { clear: both; }
.fs-note { margin: 0; font-size: 13.5px; color: var(--accent); font-weight: 700; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .field-label { font-weight: 700; font-size: 14px; }
.field .hint { font-size: 13px; color: var(--muted); }
.b-form input[type="text"], .b-form textarea {
  font: inherit; font-size: 16px; width: 100%; padding: 11px 13px;
  border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
}
.b-form input[type="text"]:focus, .b-form textarea:focus { border-color: var(--accent); outline: none; }
.b-form textarea { min-height: 210px; resize: vertical; line-height: 1.5; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 520px) { .row2 { grid-template-columns: minmax(0, 1fr); } }

.opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.opts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 520px) { .opts, .opts.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.opt { position: relative; display: block; }
.opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.opt span {
  display: grid; gap: 7px; justify-items: center; align-content: start; text-align: center; height: 100%;
  padding: 10px 8px; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 13px; font-weight: 700; line-height: 1.25; cursor: pointer;
}
.opt small { font-weight: 600; color: var(--muted); font-size: 12px; }
.opt input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.opt input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.opt .g-mascot { width: 46px; animation: none; }
.opt-none { width: 46px; height: 46px; display: grid; place-items: center; font-size: 22px; color: var(--muted); }
.swatch { width: 100%; height: 36px; border-radius: 8px; background: linear-gradient(135deg, var(--g-bg) 0 55%, var(--g-accent) 55%); border: 1px solid var(--line); }

.ph-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ph { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--soft); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph button {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%;
  border: none; background: rgba(20, 8, 14, .7); color: #FFFFFF; cursor: pointer; font-size: 15px; line-height: 1;
}
.ph.empty { display: grid; place-items: center; background: transparent; border: 1.5px dashed var(--line); color: var(--muted); font-size: 12.5px; }
.ph-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.b-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.b-result { border: 2px solid var(--accent); border-radius: var(--radius); background: var(--surface); padding: 20px; display: grid; gap: 12px; }
.b-result h2 { font-family: var(--f-display); font-size: 22px; margin: 0; }
.b-result p { margin: 0; }
.b-link-row { display: flex; gap: 8px; }
.b-link-row input {
  flex: 1; min-width: 0; font: 600 13.5px/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace;
  padding: 11px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
}
.warn { color: var(--accent); font-weight: 700; }

.b-preview { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); display: grid; gap: 12px; min-width: 0; }
.b-preview-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.seg button { font: inherit; font-size: 13px; font-weight: 700; border: none; background: none; color: var(--muted); padding: 6px 13px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.hint-center { font-size: 13px; color: var(--muted); text-align: center; margin: 0; }

/* ---------- Full-screen preview overlay ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; overflow: auto; background: var(--paper); }
.overlay > .gift { min-height: 100%; }
.ov-close {
  position: fixed; z-index: 120;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  right: calc(env(safe-area-inset-right, 0px) + 14px);
}

/* =====================================================================
   The gift. Each theme is a deliberate single look, set as --g-* vars.
   ===================================================================== */
.gift {
  --g-bg: #F5D5E1; --g-bg2: #FCEFF4; --g-card: #FFF8FB; --g-ink: #B12E5C; --g-sub: #80505F;
  --g-accent: #E0457A; --g-on-accent: #FFFFFF; --g-paper: #FFFDFE; --g-letter-ink: #5E3443;
  --g-letter-head: #B12E5C; --g-rule: rgba(224, 69, 122, .14);
  container-type: inline-size;
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; place-items: center;
  padding: 44px 18px 60px;
  background: linear-gradient(165deg, var(--g-bg), var(--g-bg2));
  color: var(--g-ink);
  font-family: var(--f-hand);
}
.gift::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--g-accent) 22%, transparent) 1.4px, transparent 1.6px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 75%);
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}
.gift.full { min-height: 100vh; min-height: 100dvh; }
.g-stage { width: 100%; display: grid; place-items: center; }

.g-screen { position: relative; width: min(100%, 540px); display: grid; justify-items: center; text-align: center; animation: g-in .55s cubic-bezier(.2, .8, .2, 1) both; }
.g-card {
  width: 100%; display: grid; justify-items: center; gap: 4px;
  background: var(--g-card); border-radius: 24px; padding: 26px 20px 30px;
  border: 2px solid color-mix(in srgb, var(--g-accent) 24%, transparent);
  box-shadow: 0 26px 50px -30px rgba(60, 20, 40, .5);
}
.g-mascot { width: min(124px, 32cqi); height: auto; animation: g-bob 2.6s ease-in-out infinite; }
.g-title { font-size: clamp(27px, 7.6cqi, 40px); font-weight: 700; line-height: 1.04; margin: 8px 0 0; text-wrap: balance; }
.g-sub { font-size: clamp(18px, 4.8cqi, 22px); color: var(--g-sub); margin: 2px 0 0; }
.g-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 18px; }
.g-btn {
  font-family: var(--f-hand); font-weight: 700; font-size: 19px; line-height: 1.1; letter-spacing: .05em; text-transform: uppercase;
  padding: 9px 26px 7px; border-radius: 999px; cursor: pointer;
  background: var(--g-card); color: var(--g-ink); border: 2px solid var(--g-accent);
  box-shadow: 0 3px 0 var(--g-accent);
  transition: transform .3s cubic-bezier(.3, 1.6, .5, 1), box-shadow .15s ease;
}
.g-btn:hover { box-shadow: 0 5px 0 var(--g-accent); }
.g-btn:active { box-shadow: 0 1px 0 var(--g-accent); }
.g-btn.primary { background: var(--g-accent); color: var(--g-on-accent); box-shadow: 0 3px 0 color-mix(in srgb, var(--g-accent) 60%, #000); }
.g-btn:focus-visible { outline: 3px solid var(--g-ink); outline-offset: 3px; }
.g-btn.sm { font-size: 13px; padding: 4px 13px 3px; box-shadow: 0 2px 0 var(--g-accent); cursor: default; }
.g-btn.dodging { position: relative; z-index: 4; transition: transform .38s cubic-bezier(.3, 1.4, .5, 1); }

.g-letter-screen { width: min(100%, 800px); }
.g-letter {
  width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: start;
  background: var(--g-paper); color: var(--g-letter-ink); text-align: left;
  border-radius: 18px; padding: 26px 28px 28px;
  box-shadow: 0 32px 60px -36px rgba(40, 10, 30, .6);
}
.g-letter.no-strip { grid-template-columns: minmax(0, 1fr); }
.g-strip {
  position: relative; display: flex; flex-direction: column; gap: 7px; margin-top: 6px;
  background: #FFFFFF; padding: 8px 8px 30px; transform: rotate(-3deg);
  box-shadow: 0 12px 24px -14px rgba(0, 0, 0, .5);
}
.g-frame { width: 104px; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.g-frame-ph {
  display: grid; place-items: center; font-size: 22px; color: var(--g-accent);
  background: linear-gradient(135deg, var(--g-bg), var(--g-bg2));
}
.g-strip-label { position: absolute; left: 0; right: 0; bottom: 7px; text-align: center; font-size: 14px; letter-spacing: .06em; color: #8D8186; }
.g-head { color: var(--g-letter-head); font-size: clamp(27px, 5.6cqi, 38px); line-height: 1.04; font-weight: 700; margin: 0 0 12px; text-wrap: balance; }
.g-body {
  margin: 0; white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: 19.5px; line-height: 30px;
  background-image: repeating-linear-gradient(to bottom, transparent 0 29px, var(--g-rule) 29px 30px);
}
.g-sign { margin: 18px 0 0; text-align: right; font-size: 23px; font-weight: 700; color: var(--g-letter-head); }
.g-replay {
  margin-top: 20px; font-family: var(--f-hand); font-size: 18px; color: var(--g-sub);
  background: none; border: none; cursor: pointer; text-decoration: underline; text-underline-offset: 4px;
}
@container (max-width: 600px) {
  .g-letter { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 20px 18px 22px; }
  .g-strip { flex-direction: row; justify-self: center; transform: rotate(-2deg); padding: 7px 7px 27px; }
  .g-frame { width: min(96px, 19cqi); }
}
.g-made {
  position: absolute; left: 0; right: 0; bottom: 16px; text-align: center;
  font-family: var(--f-body); font-size: 12.5px; font-weight: 600; color: var(--g-sub); text-decoration: none;
}
.g-made:hover { text-decoration: underline; }

.g-fx { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.gift.full .g-fx { position: fixed; }
.g-heart { position: absolute; top: 100%; line-height: 1; color: var(--g-accent); animation: g-rise 2.1s cubic-bezier(.2, .7, .3, 1) forwards; }
.g-error .g-card { gap: 10px; }
.g-error a { color: var(--g-ink); font-size: 19px; }

@keyframes g-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes g-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes g-rise {
  0% { top: 100%; opacity: 1; transform: translateX(0) rotate(0); }
  100% { top: -12%; opacity: 0; transform: translateX(var(--dx)) rotate(var(--rot)); }
}
@media (prefers-reduced-motion: reduce) {
  .g-screen, .g-mascot { animation: none; }
  .g-btn, .g-btn.dodging, .btn { transition: none; }
}
