/* Shared look for jeenhailey.com: light pink (Jeen's favorite), system fonts only (loads fine from mainland China). */
:root {
  --bg: #fff6f8;
  --card: #ffffff;
  --ink: #3b2a31;
  --muted: #8c7580;
  --line: #f4dce4;
  --pink: #f7bccd;
  --pink-2: #fbd7e2;
  --pink-soft: #fff0f4;
  --rose: #c4466f;
  --gold: #b88a4a;
  --ok: #3f8f6b;
  --shadow: 0 1px 2px rgba(196, 70, 111, .06), 0 8px 24px rgba(196, 70, 111, .08);
  --on-pink: #5a1d33; /* text on pink buttons */
  --mono-ink: #fff;
  --glow-a: rgba(247, 188, 205, .98); --glow-b: rgba(251, 215, 226, .96); --glow-c: rgba(255, 244, 247, .95); --glow-ink: #5a1d33;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC", "STSong", serif;
  --zh: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --r: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1317; --card: #271b21; --ink: #f8eaf0; --muted: #b99fa9; --line: #42303a;
    --pink: #f4a9c0; --pink-2: #5a3443; --pink-soft: #33222a; --rose: #f6a6be; --gold: #d8b47a; --ok: #7cc7a2; --on-pink: #2a1018; --mono-ink: #2a1018; --glow-a: rgba(122, 52, 82, .97); --glow-b: rgba(64, 32, 46, .97); --glow-c: rgba(28, 19, 23, .96); --glow-ink: #fbe4ec;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1317; --card: #271b21; --ink: #f8eaf0; --muted: #b99fa9; --line: #42303a;
  --pink: #f4a9c0; --pink-2: #5a3443; --pink-soft: #33222a; --rose: #f6a6be; --gold: #d8b47a; --ok: #7cc7a2; --on-pink: #2a1018; --mono-ink: #2a1018; --glow-a: rgba(122, 52, 82, .97); --glow-b: rgba(64, 32, 46, .97); --glow-c: rgba(28, 19, 23, .96); --glow-ink: #fbe4ec;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a { color: var(--rose); }

/* ---------- language ----------
   html[data-lang] is en, zh or both. T(en, zh) renders <span class="l-en"> + <span class="l-zh">. */
.l-zh { font-family: var(--zh); }
/* !important: page styles that lay text out (display:block etc.) must never bring the other language back */
html[data-lang="en"] .l-zh { display: none !important; }
html[data-lang="zh"] .l-en { display: none !important; }
html[data-lang="both"] .l-en + .l-zh { margin-left: .4em; }
html[data-lang="both"] .l-en + .l-zh.sub, html[data-lang="both"] .stack > .l-zh { opacity: .72; }
html[data-lang="both"] .stack > .l-en, html[data-lang="both"] .stack > .l-zh { display: block; margin-left: 0; }
/* When Chinese is the only language, it gets full-size headings (in "both" it plays the subtitle) */
html[data-lang="zh"] .page-head h1 .l-zh, html[data-lang="zh"] .sheet h3 .l-zh, html[data-lang="zh"] .glow .msg .l-zh,
html[data-lang="zh"] .heart-label .l-zh { font-size: 1em; color: inherit; }
html[data-lang="zh"] .page-head h1 .l-zh { letter-spacing: .04em; }
/* dates are easy to read in either language, so "both" shows just one */
html[data-lang="both"] .dt .l-zh { display: none !important; }

/* language choices */
.lang-opts { display: grid; gap: 8px; }
@media (min-width: 640px) { .settings-lang .lang-opts { grid-template-columns: repeat(3, 1fr); } }
.lang-opts button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  min-height: 56px; padding: 10px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
}
.lang-opts button b { font-size: 16px; }
.lang-opts button span { font-size: 12px; color: var(--muted); font-family: var(--sans); }
.lang-opts button[aria-pressed="true"] { border-color: var(--rose); background: var(--pink-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--pink) 60%, transparent); }
.lang-opts button[aria-pressed="true"] b::after { content: " ✓"; color: var(--rose); }
/* text someone typed in only one language */
.only { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; font: 600 10px/16px var(--sans); color: var(--muted); border: 1px solid var(--line); vertical-align: 2px; white-space: nowrap; }

/* ---------- header + menu ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.top-row {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 6px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font: 18px/1 var(--serif); white-space: nowrap; margin-right: auto; }
.brand .mono { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--pink); color: var(--mono-ink); font: 600 12px/1 var(--serif); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink);
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--pink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--card); padding: 2px; }
.seg button { white-space: nowrap; border: 0; background: none; border-radius: 999px; min-height: 30px; padding: 0 10px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--pink); color: var(--on-pink); }

.menu {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 12px 8px;
  list-style: none;
  scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent);
}
.menu::-webkit-scrollbar { display: none; }
.menu a {
  scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 44px; min-width: 64px; padding: 4px 12px;
  border-radius: 12px;
  text-decoration: none; color: var(--ink);
  font: 600 13px/1.2 var(--sans);
  white-space: nowrap;
}
.menu a .l-zh { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: .06em; }
html[data-lang="both"] .menu a .l-en + .l-zh { margin-left: 0; opacity: 1; }
html[data-lang="zh"] .menu a .l-zh { font-size: 13px; color: inherit; font-weight: 600; }
.menu a:hover { background: var(--pink-soft); }
.menu a[aria-current="page"] { background: var(--pink-2); color: var(--rose); }
.menu .ico { font-size: 15px; line-height: 1; margin-bottom: 2px; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }

@media (max-width: 420px) {
  .top-row { gap: 6px; padding: 8px 12px 4px; }
  .brand { font-size: 16px; gap: 7px; }
  .brand .mono { width: 26px; height: 26px; font-size: 11px; }
  .seg button { padding: 0 7px; font-size: 11px; }
  .chip { padding: 0 10px; }
}
@media (max-width: 350px) { .brand .txt { display: none; } }

/* ---------- page ---------- */
main.page { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 20px 16px 40px; }
.page-head { margin: 4px 0 18px; }
.page-head h1 { font: 400 clamp(30px, 7vw, 42px)/1.1 var(--serif); margin: 0; }
.page-head h1 .l-zh { font-family: var(--zh); font-weight: 500; font-size: .62em; color: var(--rose); letter-spacing: .08em; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.foot { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: .06em; padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.card h2 { font: 700 12px/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.card h2 .l-zh { letter-spacing: .1em; }
.grid { display: grid; gap: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid transparent;
  background: var(--pink); color: var(--on-pink);
  font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, filter .2s ease;
}
.btn:hover { filter: brightness(1.03) saturate(1.1); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--pink); }
.btn.quiet { background: none; color: var(--rose); padding: 0 10px; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn.danger { background: none; color: #c0392b; border-color: var(--line); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 16px; color: var(--ink); }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, textarea.input, select.input {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink);
  font-size: 16px;
}
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink) 45%, transparent); }
.hint { font-size: 12px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: var(--pink-soft); color: var(--rose); font-size: 11px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.pill.neil { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; min-height: 40px; padding: 0 16px; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--pink-2); border-color: var(--pink); color: var(--rose); }

/* ---------- help ---------- */
.help-chip { width: 36px; padding: 0; justify-content: center; font-size: 15px; color: var(--rose); }
.help-i {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; vertical-align: -5px;
  border-radius: 50%; border: 1.5px solid var(--pink); background: var(--card); color: var(--rose);
  font: italic 700 12px/1 Georgia, serif; cursor: pointer; letter-spacing: 0; text-transform: none;
}
.help-i::before { content: ""; position: absolute; inset: -11px; }
.help-i { position: relative; }
.help-i:hover { background: var(--pink-soft); }
.card h2.with-help { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.help-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.help-head h3 { margin: 0; }
.help-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--pink-soft); font-size: 24px; flex: none; }
.help-intro { color: var(--muted); margin: 6px 0 14px; }
.help-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.help-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.help-steps .hs-ico { font-size: 20px; line-height: 1.3; flex: none; width: 26px; text-align: center; }
.help-steps .stack { flex: 1; min-width: 0; }
html[data-lang="both"] .help-steps .stack > .l-zh { margin-top: 3px; font-size: .93em; }
.help-tip { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--pink-soft); font-size: 14px; }

/* ---------- sheet (dialog) ---------- */
.sheet-back { position: fixed; inset: 0; z-index: 50; background: rgba(40, 15, 25, .38); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
.sheet {
  width: 100%; max-width: 520px; max-height: 92svh; overflow: auto;
  background: var(--bg); border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .2);
  animation: up .28s cubic-bezier(.2, .8, .2, 1);
}
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet h3 { font: 400 24px/1.2 var(--serif); margin: 0 0 14px; }
.sheet h3 .l-zh { font-family: var(--zh); font-size: .7em; color: var(--rose); }
.sheet .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
@media (min-width: 640px) {
  .sheet-back { align-items: center; padding: 20px; }
  .sheet { border-radius: 22px; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 70;
  transform: translateX(-50%);
  background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  max-width: calc(100vw - 32px); text-align: center;
  animation: up .25s ease;
}

/* ---------- photos ---------- */
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.ph-grid:empty { display: none; }
.ph-grid .th { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--pink-2); }
.ph-grid .th img { width: 100%; height: 100%; object-fit: cover; }
.ph-grid .rm { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; cursor: pointer; }
.ph-add { position: relative; cursor: pointer; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-top: 10px; }
.gallery .g { padding: 0; border: 0; aspect-ratio: 1; border-radius: 12px; overflow: hidden; cursor: zoom-in; background: var(--pink-2); }
.gallery .g img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.gallery .g:hover img { transform: scale(1.04); }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(20, 8, 14, .94); display: grid; place-items: center; animation: fade .2s ease; }
.lightbox img { max-width: 96vw; max-height: 86svh; object-fit: contain; border-radius: 8px; }
.lightbox button { position: absolute; border: 0; background: rgba(255,255,255,.14); color: #fff; border-radius: 50%; width: 48px; height: 48px; font-size: 26px; cursor: pointer; display: grid; place-items: center; }
.lightbox .lb-x { top: calc(14px + env(safe-area-inset-top)); right: 14px; font-size: 18px; }
.lightbox .lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-count { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: #fff; font-size: 13px; opacity: .8; }

/* ---------- thinking-of-you glow ---------- */
.glow {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 50% 45%, var(--glow-a), var(--glow-b) 50%, var(--glow-c) 85%);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  animation: glowpulse 1.6s ease-in-out 3, fade .3s ease;
  cursor: pointer;
}
.glow .big { font-size: 110px; line-height: 1; animation: beat 1.1s ease-in-out infinite; filter: drop-shadow(0 8px 24px rgba(196, 70, 111, .45)); }
.glow .msg { margin-top: 18px; font: 400 30px/1.25 var(--serif); color: var(--glow-ink); padding: 0 20px; }
.glow .msg .l-zh { font-family: var(--zh); font-size: .8em; }
html[data-lang="both"] .glow .msg .l-zh { display: block; margin: 6px 0 0; opacity: .85; }
.glow .tap { margin-top: 14px; font-size: 13px; color: var(--glow-ink); opacity: .7; }
.floaty { position: fixed; bottom: -40px; z-index: 81; pointer-events: none; font-size: 26px; animation: floatup 3.2s ease-in forwards; }
@keyframes glowpulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.08) saturate(1.3); } }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1); } 45% { transform: scale(1.12); } }
@keyframes floatup { to { transform: translateY(-110vh) rotate(25deg); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
