@font-face {
  font-family: Figtree;
  src: url('figtree.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: Fraunces;
  src: url('fraunces.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: Fraunces;
  src: url('fraunces-italic.woff2') format('woff2');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0b2522;
  --surface: #12332d;
  --line: #40594d;
  --text: #fcf4e9;
  --muted: #b8c9bf;
  --gold: #e5c78d;
  --paper: #fbf3e5;
  --ink: #243b32;
  --sans: Figtree, system-ui, sans-serif;
  --serif: Fraunces, 'Noto Serif CJK SC', 'Songti SC', 'YuMincho', 'Batang', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--bg);
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  font: 400 16px/1.55 var(--sans);
  color: var(--text);
  background: var(--bg) url('pine-paper.webp') repeat;
  background-size: 512px 512px;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; }
details summary { cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.shell { width: min(1144px, calc(100% - 64px)); margin-inline: auto; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-header {
  border-bottom: 1px solid #d9e8dc21;
  background: #0b2522b8;
}

.header-inner, .header-actions, .brand, .tree-link, .back-link {
  display: flex;
  align-items: center;
}

.header-inner { justify-content: space-between; min-height: 75px; gap: 12px; }
.header-actions { gap: 12px; }
.brand { gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -.035em; }
.brand img { border-radius: 10px; flex: none; }

.tree-link {
  gap: 9px;
  color: var(--gold);
  font-size: .88rem;
  font-weight: 700;
  min-height: 44px;
}

.header-tree {
  padding: 8px 14px;
  border: 1px solid #d2b57966;
  border-radius: 10px;
}

.tree-link:hover, .back-link:hover { color: #fff0cb; }
.header-tree:hover { background: #d2b57917; border-color: var(--gold); }

.language-menu { position: relative; z-index: 3; }
.language-menu summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
}
.language-menu summary:hover, .language-menu[open] summary { color: var(--text); background: #ffffff0e; }
.language-menu ul {
  margin: 6px 0 0;
  padding: 5px;
  list-style: none;
  position: absolute;
  top: 100%;
  inset-inline-end: 0;
  min-width: 174px;
  max-height: min(55dvh, 416px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 12px 28px #03140fa6;
}
.language-menu li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 8px;
  padding: 9px 12px;
  min-height: 44px;
}
.language-menu li a:hover, .language-menu li a[aria-current="page"] { background: #ffffff0b; color: var(--gold); }

.language-suggestion {
  position: fixed;
  z-index: 5;
  inset-inline: 0;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  width: min(420px, calc(100% - 28px));
  margin-inline: auto;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d2b57950;
  border-radius: 12px;
  background: #1b372f;
  box-shadow: 0 14px 38px #051510a8;
}
.language-suggestion p { font-size: .96rem; font-weight: 700; }
.suggestion-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.suggestion-actions .button { padding-inline: 8px; text-align: center; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: .9rem;
  font-weight: 700;
}
.button-gold { background: var(--gold); color: #1d342a; }
.button-gold:hover { background: #f5dba9; }
.button-quiet { color: var(--muted); background: #142d26; border-color: var(--line); }
.button-quiet:hover { color: var(--text); background: #254037; }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr .93fr;
  align-items: center;
  column-gap: 36px;
  padding: 36px 0 48px;
  min-height: 400px;
}

.hero-copy { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(3.75rem, 7.3vw, 6.65rem);
  line-height: .96;
  letter-spacing: -.07em;
}

.hero h1 em { display: block; color: var(--gold); font-weight: 600; }
:lang(zh-CN) .hero h1, :lang(zh-TW) .hero h1 {
  font-size: clamp(3.3rem, 7vw, 5.7rem);
  letter-spacing: .015em;
  line-height: 1.04;
}
:lang(ja) .hero h1, :lang(ko) .hero h1 {
  font-size: clamp(2.6rem, 5.2vw, 4.75rem);
  letter-spacing: -.06em;
  line-height: 1.09;
}
:lang(th) .hero h1 {
  font-family: var(--sans);
  font-size: clamp(2.85rem, 6.5vw, 5.5rem);
  letter-spacing: -.035em;
  line-height: 1.18;
}
html:not([lang="en"]) .hero h1 em { font-style: normal; }

.hero p {
  max-width: 32ch;
  margin-top: 21px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.24rem);
  line-height: 1.5;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 14px;
  color: var(--gold);
  font-weight: 700;
  font-size: .91rem;
}
.hero-link:hover { color: #ffebc5; }
.hero-link .icon { transition: transform .2s; }
.hero-link:hover .icon { transform: translateY(3px); }

.hero-art {
  position: relative;
  isolation: isolate;
  justify-self: end;
  width: min(100%, 510px);
  aspect-ratio: 1.34;
  background: radial-gradient(ellipse at 48% 57%, #4d6d4a7a, #31594424 49%, transparent 72%);
}
.hero-art::before {
  content: '';
  position: absolute;
  inset: 19% 13% 4%;
  z-index: -1;
  border: 1px solid #d8c58a36;
  border-radius: 50% 50% 40% 40% / 60% 60% 33% 33%;
  transform: rotate(-13deg);
  mask-image: linear-gradient(155deg, #000 3%, transparent 55%, #000 94%);
}

.hero-art::after {
  content: '';
  position: absolute;
  left: 14%;
  right: 9%;
  bottom: 5%;
  height: 11%;
  z-index: -1;
  border-radius: 50%;
  background: #051b16a1;
  filter: blur(11px);
}

.hero-art img { position: absolute; height: auto; }
.art-arc {
  position: absolute;
  inset: 8% 8% 5% 7%;
  border: 1px dashed #d2b57960;
  border-radius: 50%;
  transform: rotate(22deg);
  mask-image: linear-gradient(30deg, #000, transparent 43%, transparent 60%, #000);
}
.tree-art {
  width: 53%;
  left: 16%;
  bottom: 6%;
  filter: drop-shadow(0 14px 14px #031a10a8);
}
.star-art { width: 15%; left: 35%; top: 3%; transform: rotate(-6deg); }
.bauble-art { width: 10.5%; left: 34%; top: 40%; transform: rotate(11deg); }
.bell-art { width: 11%; left: 48%; top: 50%; transform: rotate(-14deg); }
.blue-art { width: 9.2%; left: 25%; top: 63%; transform: rotate(-8deg); }
.gift-art { width: 21%; left: 11%; bottom: 4%; transform: rotate(-11deg); filter: drop-shadow(0 6px 5px #08180d80); }
.envelope-art { width: 38%; right: 6%; bottom: 3%; transform: rotate(11deg); filter: drop-shadow(0 12px 9px #031a10a0); }

.postcard-art {
  position: absolute;
  display: grid;
  align-content: start;
  gap: 8%;
  bottom: 21%;
  right: 14%;
  width: 29%;
  aspect-ratio: 1.36;
  padding: 5%;
  border: 2px solid #f3e0b8;
  border-radius: 7%;
  background: #f8edcf;
  box-shadow: 0 5px 12px #031a1080, inset 0 0 0 3px #d5b88666;
  transform: rotate(15deg);
}
.postcard-art span { height: 1px; width: 100%; background: #9a784957; }
.postcard-art span:first-child { width: 45%; height: 2px; background: #b1795e91; }

.art-sparkle { position: absolute; color: var(--gold); line-height: 1; }
.sparkle-one { top: 18%; right: 17%; font-size: clamp(1.3rem, 3.5vw, 2.75rem); }
.sparkle-two { top: 34%; left: 8%; font-size: clamp(1rem, 2vw, 1.8rem); }
.sparkle-three { right: 3%; bottom: 35%; font-size: clamp(.9rem, 2vw, 1.5rem); }
.art-snow { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #f9e1ad; opacity: .72; }
.snow-one { top: 23%; left: 19%; }
.snow-two { top: 34%; right: 23%; }
.snow-three { bottom: 29%; left: 4%; }
.snow-four { top: 13%; right: 32%; width: 3px; height: 3px; }

.library { border-top: 1px solid #d9e8dc2e; padding-top: 26px; }
.library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.library h2, .faq h2 { font-size: clamp(1.55rem, 3vw, 2rem); letter-spacing: -.035em; }
.search { position: relative; width: min(100%, 320px); color: var(--muted); }
.search > .icon { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #122e28;
  padding: 10px 46px 10px 41px;
  color: var(--text);
  appearance: none;
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.search-clear:hover { background: #ffffff10; color: var(--text); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid #788d744d;
  border-radius: 999px;
  background: #13352d80;
  color: var(--text);
  font-size: .88rem;
  font-weight: 600;
  white-space: nowrap;
}
.filter-chip img { object-fit: contain; }
.filter-chip:hover { border-color: #d2b57991; background: #244238; }
.filter-chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #183428; }
.wish-count { margin: 20px 0 10px; color: var(--muted); font-size: .87rem; font-weight: 600; }

.wish-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.wish-card {
  --accent: #c9aa70;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 185px;
  border-radius: 12px;
  border: 1px solid #e9d8be;
  border-top: 3px solid var(--accent);
  padding: 16px 17px 12px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 4px 10px #04160e37;
  color-scheme: light;
}
.wish-friends { --accent: #90b3aa; }
.wish-family { --accent: #b8af80; }
.wish-partner { --accent: #d79a92; }
.wish-coworkers { --accent: #a0af9e; }
.wish-funny { --accent: #d2a477; }
.wish-besties { --accent: #b8a6b7; }
.wish-seasonal { --accent: #b8a479; }
.card-category {
  display: flex;
  align-items: center;
  align-self: start;
  gap: 6px;
  color: #4e6258;
  font-size: .77rem;
  font-weight: 700;
}
.card-category img { object-fit: contain; }
.wish-text { margin: 10px 0 13px; line-height: 1.5; overflow-wrap: anywhere; }
.card-actions { display: flex; justify-content: end; margin-top: auto; border-top: 1px solid #273d3026; padding-top: 5px; }
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 9px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #305447;
  background: transparent;
  font-size: .86rem;
  font-weight: 700;
}
.copy-button:hover, .copy-button.is-copied { background: #e8e5d7; }
.copy-button:focus-visible { outline-color: #426653; }

.empty-state { text-align: center; padding: 45px 16px; }
.empty-state img { object-fit: contain; margin: 0 auto 10px; }
.empty-state p { color: var(--muted); margin-top: 6px; }
.empty-state .button { margin-top: 16px; }

.faq { padding: 56px 0 48px; }
.faq h2 { margin-bottom: 14px; }
.faq-list { border: 1px solid #d9e8dc25; border-radius: 12px; background: #122e2888; }
.faq details + details { border-top: 1px solid #d9e8dc25; }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 12px 17px;
  font-weight: 600;
}
.faq summary:hover { color: var(--gold); }
.faq details p { padding: 0 17px 14px; max-width: 70ch; color: var(--muted); }
.faq details[open] .icon { transform: rotate(180deg); }

.site-footer { border-top: 1px solid #d9e8dc21; background: #0b2522b8; }
.footer-inner, .footer-actions { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; }
.footer-inner { justify-content: space-between; padding: 16px 0; }
.footer-inner p, .back-link { color: var(--muted); font-size: .86rem; }
.footer-actions { column-gap: 20px; }
.back-link { gap: 7px; min-height: 44px; }

dialog {
  background: var(--surface);
  color: var(--text);
  width: min(440px, calc(100% - 34px));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}
dialog::backdrop { background: #051510c4; }
dialog form { display: grid; gap: 14px; }
dialog .button { justify-self: end; }
dialog textarea {
  width: 100%;
  min-height: 126px;
  padding: 9px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--bg);
}
.clipboard-field {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.icon { display: inline-block; position: relative; flex: none; width: 16px; height: 16px; color: inherit; }
.icon::before, .icon::after { content: ''; position: absolute; }
.icon-globe { border: 1.4px solid currentColor; border-radius: 50%; }
.icon-globe::before { inset: -1px 3px; border: 1.2px solid currentColor; border-block: 0; border-radius: 50%; }
.icon-globe::after { top: 6px; left: 0; width: 100%; border-top: 1.2px solid currentColor; }
.icon-chevron::before { width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); left: 4px; top: 3px; }
.icon-external::before { width: 8px; height: 8px; border: solid currentColor; border-width: 1.5px 1.5px 0 0; top: 3px; right: 3px; }
.icon-external::after { width: 11px; border-top: 1.5px solid currentColor; top: 8px; left: 2px; transform: rotate(-45deg); }
.icon-down::before, .icon-up::before { width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); top: 6px; left: 4.5px; }
.icon-down::after, .icon-up::after { width: 1.5px; height: 11px; top: 2px; left: 7px; background: currentColor; }
.icon-up { transform: rotate(180deg); }
.icon-search::before { width: 11px; height: 11px; border: 1.5px solid currentColor; border-radius: 50%; top: 0; left: 0; }
.icon-search::after { width: 7px; height: 1.5px; transform: rotate(45deg); top: 11px; left: 8px; background: currentColor; }
.icon-close::before, .icon-close::after { width: 13px; border-top: 1.5px solid currentColor; transform: rotate(45deg); left: 1px; top: 7px; }
.icon-close::after { transform: rotate(-45deg); }
.icon-copy::before { width: 10px; height: 11px; top: 4px; left: 5px; border: 1.5px solid currentColor; border-radius: 2px; }
.icon-copy::after { width: 10px; height: 11px; top: 0; left: 1px; border: solid currentColor; border-width: 1.5px 0 0 1.5px; border-radius: 2px 0 0; }
.icon-check::before { width: 11px; height: 6px; top: 3px; left: 3px; border: solid currentColor; border-width: 0 0 1.75px 1.75px; transform: rotate(-45deg); }

@media (max-width: 900px) {
  .shell { width: min(1144px, calc(100% - 48px)); }
  .hero { column-gap: 22px; min-height: 340px; padding-block: 30px 40px; }
  .wish-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .shell { width: calc(100% - 32px); }
  .header-inner { min-height: 62px; }
  .brand { gap: 7px; font-size: 1rem; }
  .brand img { width: 32px; height: 32px; border-radius: 8px; }
  .header-actions { gap: 5px; }
  .header-tree { padding-inline: 8px; font-size: .78rem; gap: 4px; }
  .language-menu summary { padding-inline: 8px; min-width: 44px; gap: 5px; }
  .current-language { display: none; }
  .hero { gap: 0; padding-block: 20px 18px; grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding-top: 14px; }
  .hero h1 { font-size: clamp(3.1rem, 12vw, 5.15rem); }
  .hero p { margin-top: 12px; }
  .hero-link { margin-top: 4px; }
  .hero-art { justify-self: center; width: min(100%, 390px); margin-top: -12px; }
  .library { padding-top: 17px; }
  .library-head { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 12px; }
  .search { width: 100%; }
  .filter-chip { padding-inline: 10px; }
  .filters { gap: 6px; }
  .wish-grid { grid-template-columns: 1fr; gap: 10px; }
  .wish-card { min-height: 0; }
  .faq { padding-block: 35px; }
}

@media (max-width: 360px) {
  .header-inner { width: calc(100% - 24px); gap: 6px; }
  .brand { font-size: .9rem; white-space: nowrap; }
  .header-tree { font-size: .75rem; white-space: nowrap; }
  .header-tree .icon, .language-menu summary .icon-chevron { display: none; }
  .language-menu summary { justify-content: center; }
  .hero-art { margin-top: 4px; }
}
