:root {
  --brand: #d4281c;       /* ribbon red: masthead, accents, buttons, stamps */
  --brand-dark: #a91e14;
  --brand-ink: #ffffff;   /* text on red */
  --ink: #141414;
  --body: #262626;
  --muted: #6b6b6b;
  --line: #e4e4e4;
  --paper: #ffffff;
  --wash: #f6f4f1;
  --display: "Archivo", "Noto Sans TC", "PingFang TC", "Helvetica Neue", Arial, sans-serif;
  --sans: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
  --serif: "Noto Serif TC", "Songti TC", Georgia, serif;
  --radius: 6px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

main { flex: 1; }

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

.wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

@media (min-width: 768px) {
  .wrap { padding-left: 32px; padding-right: 32px; }
}

.narrow { max-width: 680px; }

/* ---------- Masthead ---------- */

.masthead { background: var(--brand); color: #fff; }

.masthead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 26px;
  letter-spacing: -0.02em;
  line-height: 1;
}
.wordmark small {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  opacity: 0.85;
}

/* Header logo mark (brand/icon.mjs). At rest it shows the open frame, same as the favicon.
   With .play it starts closed, lifts the lid, and pops the twinkles. */
.logo-mark { flex: none; width: 38px; height: 38px; margin-right: 2px; }
.footer .logo-mark { width: 44px; height: 44px; }
.logo-mark .sol-lid { transform-origin: 51px 48px; transform: translateY(-24px) rotate(-4deg); }
.logo-mark .sol-st { transform-box: fill-box; transform-origin: center; }
.logo-mark.play .sol-lid { animation: solLid 1.6s cubic-bezier(.34, 1.5, .5, 1) both; }
.logo-mark.play .sol-tray { transform-origin: 50px 100px; animation: solTray 1.6s ease-in-out both; }
.logo-mark.play .sol-hop { transform-origin: 50px 58px; animation: solHop 1.6s ease-out both; }
.logo-mark.play .sol-st { animation: solTwinkle 1.7s cubic-bezier(.2, .7, .3, 1) both; animation-delay: calc(var(--i) * 0.11s); }
@keyframes solLid {
  0%, 15% { transform: translateY(0) rotate(0); }
  55% { transform: translateY(-27px) rotate(-5deg); }
  75% { transform: translateY(-22px) rotate(-3deg); }
  100% { transform: translateY(-24px) rotate(-4deg); }
}
@keyframes solTray { 0%, 15% { transform: scaleY(1); } 35% { transform: scaleY(.95); } 55% { transform: scaleY(1.02); } 75%, 100% { transform: scaleY(1); } }
/* The envelope starts tucked (up 2, 88%) so it stays hidden under the closed lid, then pops to full size. */
@keyframes solHop {
  0%, 30% { transform: translateY(-2px) scale(.88); }
  52% { transform: translateY(-1.8px) scale(1.04); }
  64% { transform: translateY(-1.6px) scale(1); }
  80%, 100% { transform: translateY(0) scale(1); }
}
@keyframes solTwinkle {
  0%, 38% { transform: translate(var(--dx), var(--dy)) scale(0) rotate(-90deg); }
  72% { transform: translate(0, -1.5px) scale(1.08) rotate(-12deg); }
  86% { transform: translate(0, .4px) scale(.96) rotate(-3deg); }
  100% { transform: translate(0, 0) scale(1) rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-mark.play * { animation: none !important; }
}
/* Optical alignment: the drawing's visual centre (about 51% down the open dome) sits on the middle of the
   capitals, measured from the Archivo glyphs. */
.masthead .logo-mark { position: relative; top: -0.4px; }
.footer .logo-mark { position: relative; top: -1px; }

/* Secondary mark (brand/icon.mjs peekMark): the 小籠包 lifts, shows the invitation, and closes again. */
.peek-mark { display: block; width: 132px; height: 132px; margin-bottom: 20px; }
.peek-mark .sol-lid { transform-origin: 51px 48px; transform: none; }
.peek-mark .sol-st { transform-box: fill-box; transform-origin: center; }
.peek-mark.play .sol-lid { animation: pkLid 2.8s cubic-bezier(.4, 0, .3, 1) both; }
.peek-mark.play .sol-tray { transform-origin: 50px 100px; animation: pkTray 2.8s ease-in-out both; }
.peek-mark.play .sol-hop { animation: pkHop 2.8s ease-out both; }
.peek-mark.play .sol-st { animation: pkTwinkle 2.8s cubic-bezier(.2, .7, .3, 1) both; animation-delay: calc(var(--i) * 0.08s); }
@keyframes pkLid {
  0%, 8% { transform: translateY(0) rotate(0); }
  28% { transform: translateY(-27px) rotate(-5deg); }
  36% { transform: translateY(-22px) rotate(-3deg); }
  44%, 64% { transform: translateY(-24px) rotate(-4deg); }
  82% { transform: translateY(1px) rotate(0); }
  89% { transform: translateY(-.8px) rotate(0); }
  100% { transform: translateY(0) rotate(0); }
}
@keyframes pkTray { 0%, 8% { transform: scaleY(1); } 18% { transform: scaleY(.95); } 28% { transform: scaleY(1.02); } 36%, 78% { transform: scaleY(1); } 84% { transform: scaleY(.96); } 92%, 100% { transform: scaleY(1); } }
@keyframes pkHop { 0%, 34% { transform: translateY(0); } 40% { transform: translateY(-1.6px); } 48%, 100% { transform: translateY(0); } }
@keyframes pkTwinkle {
  0%, 26% { transform: translate(var(--dx), var(--dy)) scale(0) rotate(-90deg); }
  46% { transform: translate(0, -1.5px) scale(1.08) rotate(-12deg); }
  56% { transform: translate(0, .4px) scale(.96) rotate(-3deg); }
  64%, 100% { transform: translate(0, 0) scale(1) rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
  .peek-mark.play * { animation: none !important; }
}
.wordmark { white-space: nowrap; }
@media (max-width: 420px) {
  .masthead .wordmark { font-size: 21px; gap: 6px; }
  .masthead .wordmark small { display: none; }
  .masthead .logo-mark { width: 32px; height: 32px; top: -0.6px; }
}

.masthead-cta {
  font-size: 14px;
  font-weight: 900;
  padding: 8px 16px;
  background: #fff;
  color: var(--brand);
  border: 2px solid #fff;
  border-radius: 999px;
  white-space: nowrap;
}
.masthead-cta:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

.subnav {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
}

.subnav-row {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.subnav-row::-webkit-scrollbar { display: none; }

.subnav a {
  flex: none;
  padding: 14px 0 12px;
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
  border-bottom: 4px solid transparent;
}
.subnav a[aria-current="page"] { border-bottom-color: var(--ink); }
.subnav a:hover { border-bottom-color: var(--brand); }

.subnav .soon {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0 12px 20px;
  border-left: 1px solid var(--line);
  font-size: 15px;
  font-weight: 700;
  color: #b3b3b3;
  white-space: nowrap;
}
.subnav .soon small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
}

/* ---------- Type ---------- */

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 12px 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.tags span { border-bottom: 1.5px solid var(--ink); line-height: 1.5; }

.dek {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.6;
  color: var(--body);
  margin: 6px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stamp {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  border-radius: 3px;
}

/* ---------- Photos ---------- */

.ph {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--wash);
}
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }

.ph-empty {
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(255, 255, 255, 0.07) 14px 28px),
    var(--tone, var(--ink));
}
.ph-empty span {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(18px, 3vw, 28px);
  color: #fff;
  text-align: center;
  line-height: 1.2;
}

/* ---------- Cards ---------- */

.card { position: relative; display: block; }
.card h3 { font-size: 20px; line-height: 1.3; }
.card:hover h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.card:hover .ph img { transform: scale(1.03); }

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 16px;
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(4, 1fr); gap: 40px 24px; }
}
@media (max-width: 420px) {
  .grid .card h3 { font-size: 17px; }
  .grid .dek { display: none; }
}

/* ---------- Home: lead ---------- */

.lead {
  display: grid;
  gap: 28px;
  padding-top: 24px;
  padding-bottom: 48px;
}
@media (min-width: 900px) {
  .lead { grid-template-columns: 1.5fr 1fr; gap: 32px; padding-top: 32px; }
}

.lead-main { position: relative; display: block; }
.lead-main .ph { aspect-ratio: 3 / 2; }
.lead-main h1 {
  font-size: clamp(32px, 5.2vw, 56px);
  line-height: 1.12;
  margin-top: 4px;
}
.lead-main:hover h1 { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.lead-main .dek { font-size: 17px; -webkit-line-clamp: 3; }

.lead-side { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; align-content: start; }
@media (min-width: 900px) {
  .lead-side { grid-template-columns: 1fr; }
  .card-side { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
  .card-side .ph { grid-row: span 4; }
  .card-side .stamp { left: 10px; }
  .card-side .tags { margin-top: 0; }
}
.card-side .ph-empty span, .grid .ph-empty span { font-size: clamp(16px, 2vw, 22px); }
.ph-empty span { margin-top: 18px; }

@media (max-width: 899px) {
  .lead-side .card-side:nth-child(3) { display: none; }
  .card-side .dek { display: none; }
  .card-side h3 { font-size: 17px; }
}

/* ---------- Sections ---------- */

.block { padding-top: 16px; padding-bottom: 56px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}
.section-head h2 {
  font-size: 26px;
  padding-bottom: 8px;
  background: linear-gradient(var(--brand), var(--brand)) left bottom / 56px 5px no-repeat;
}
.section-head a { font-size: 14px; font-weight: 700; border-bottom: 1.5px solid var(--ink); }

.intro, .page-head { padding-top: 56px; padding-bottom: 48px; }
.intro h1 { font-size: clamp(40px, 8vw, 88px); line-height: 1.08; }
.page-head h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1.1; }
.intro-dek {
  max-width: 640px;
  font-family: var(--serif);
  font-size: 18px;
  margin: 20px 0 0;
}
.empty { font-family: var(--serif); color: var(--muted); }

/* ---------- CTA band ---------- */

.cta-band { background: var(--brand); color: var(--brand-ink); margin: 8px 0 56px; }
.cta-row { padding-top: 48px; padding-bottom: 48px; }
.cta-band h2 { color: var(--brand-ink); font-size: clamp(30px, 5vw, 48px); line-height: 1.15; }
.cta-band p { font-family: var(--serif); font-size: 17px; margin: 12px 0 24px; max-width: 520px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 32px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--brand-dark); }
.btn-light { background: var(--ink); color: #fff; }
.btn-light:hover { background: #333; }
.btn[disabled] { opacity: 0.6; cursor: wait; }
.btn.block { width: 100%; }

/* ---------- Article ---------- */

.article { padding-top: 32px; padding-bottom: 48px; }
.article-head { max-width: 860px; }
.article-head h1 { font-size: clamp(32px, 5.5vw, 60px); line-height: 1.12; margin-top: 8px; }
.article-dek { font-family: var(--serif); font-size: 20px; line-height: 1.6; margin: 16px 0 0; }
.byline { font-size: 14px; color: var(--muted); margin: 16px 0 24px; }
.ph-article { aspect-ratio: 16 / 9; }

.article-body { display: grid; gap: 32px; margin-top: 32px; }
@media (min-width: 900px) {
  .article-body { grid-template-columns: 300px minmax(0, 680px); gap: 64px; }
  .facts { position: sticky; top: 72px; align-self: start; }
}

.facts { border-top: 5px solid var(--brand); padding-top: 16px; }
.facts h2 { font-size: 22px; margin-bottom: 12px; }
.facts dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 15px; }
.facts dt { font-weight: 700; color: var(--ink); }
.facts dd { margin: 0; }
.facts a { border-bottom: 3px solid var(--brand); }

.prose { font-family: var(--serif); font-size: 18px; line-height: 1.85; color: var(--body); }
.prose p { margin: 0 0 1.2em; }
.prose h2, .prose h3 { margin: 1.6em 0 0.6em; }
.prose h2 { font-size: 26px; }
.prose h3 { font-size: 21px; }
.prose img { border-radius: var(--radius); margin: 1.5em 0; }
.prose a { border-bottom: 3px solid var(--brand); }
.prose blockquote { margin: 1.5em 0; padding-left: 20px; border-left: 5px solid var(--brand); font-weight: 600; }

/* ---------- Submit form ---------- */

.form-head { padding-top: 40px; padding-bottom: 8px; }
.form-head h1 { font-size: clamp(36px, 8vw, 56px); line-height: 1.1; margin-bottom: 12px; }
.form-head p { font-family: var(--serif); font-size: 17px; margin: 0; }

form { padding-bottom: 56px; }

fieldset { border: 0; margin: 0; padding: 28px 0 8px; border-top: 1px solid var(--line); }
fieldset:first-of-type { border-top: 0; }

legend {
  float: left;
  width: 100%;
  padding: 0 0 8px;
  margin-bottom: 20px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 900;
  color: var(--ink);
  background: linear-gradient(var(--brand), var(--brand)) left bottom / 40px 4px no-repeat;
}

.field { margin-bottom: 18px; clear: both; }

label, .label { display: block; font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.req { color: var(--ink); margin-left: 2px; }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], select, textarea {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1.5px solid #cfcfcf;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* 16px stops iOS from zooming in on focus */
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 380px) { .row { grid-template-columns: 1fr; gap: 0; } }

.picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1.5px dashed #bdbdbd;
  border-radius: var(--radius);
  cursor: pointer;
}
.picker input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.picker-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
}
.picker-text { font-size: 15px; font-weight: 700; color: var(--ink); }
.picker-text span { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }

.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumbs:empty { display: none; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.thumbs.logo img { object-fit: contain; padding: 6px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; font-weight: 500; }
.check input { width: 20px; height: 20px; margin: 4px 0 0; accent-color: var(--ink); flex: none; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.error {
  display: none;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-left: 5px solid var(--brand);
  background: var(--wash);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}
.error.show { display: block; }

.done { display: none; padding-top: 10vh; padding-bottom: 56px; }
.done.show { display: block; }
.done h1 { font-size: clamp(40px, 9vw, 64px); line-height: 1.1; }
.done p { font-family: var(--serif); font-size: 18px; }
.done a { border-bottom: 3px solid var(--brand); }

/* ---------- Footer ---------- */

.footer { background: var(--ink); color: #fff; }
.footer-row { padding-top: 40px; padding-bottom: 40px; }
.footer .wordmark { font-size: 32px; margin-bottom: 12px; }
.footer p { margin: 4px 0; font-size: 15px; }
.footer a { border-bottom: 2px solid var(--brand); }
.footer .wordmark { border: 0; }
.footer .fine { margin-top: 20px; font-size: 13px; opacity: 0.8; }

@media (prefers-reduced-motion: reduce) {
  .ph img { transition: none; }
  .card:hover .ph img { transform: none; }
}
