:root {
  --green: #0E5A41;
  --green-deep: #093D2C;
  --jade: #12805C;
  --lime: #CDEB6B;
  --mint: #EAF6EE;
  --ink: #06261B;
  --ink-soft: #35503F;
  --on-green: #F2FAF5;
  --on-green-muted: #B8DAC7;
  --line-green: rgba(242, 250, 245, .32);
  --el: #2E7D57;
  --sans: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --han: "Noto Serif TC", "Songti TC", "PingFang TC", "Noto Serif CJK TC", "Microsoft JhengHei", serif;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); background: var(--green); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; font-family: var(--sans); font-size: 17px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
body.page-home, body.page-privacy-dark { background: var(--green); color: var(--on-green); }
body.page-guide, body.page-doc { background: #F3FAF6; color: var(--ink); }
a { color: inherit; }

/* element colors */
.el-wood { --el: #2E7D57; }
.el-fire { --el: #CC3A2B; }
.el-earth { --el: #B5841C; }
.el-metal { --el: #6F7C85; }
.el-water { --el: #24527F; }

/* ---------- header and footer ---------- */
.bar { background: var(--green); color: #fff; }
.bar-in { max-width: 1060px; margin: 0 auto; padding: 10px 16px 10px 22px; display: flex; justify-content: space-between; align-items: center; gap: 0 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; font-size: 21px; letter-spacing: -0.02em; text-decoration: none; color: #fff; }
.brand b { color: var(--lime); font-weight: 700; }
.mark { width: 26px; height: 26px; border-radius: 8px; background: var(--lime); display: grid; place-items: center; }
.mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.bar-links { display: flex; align-items: center; gap: 8px; }
.bar-link { font-weight: 600; font-size: 15px; color: #fff; text-underline-offset: 4px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; }
.bar-link:hover { color: var(--lime); }

@media (max-width: 420px) {
  .brand { font-size: 18px; gap: 8px; }
  .mark { width: 22px; height: 22px; border-radius: 7px; }
  .mark::after { width: 8px; height: 8px; }
  .bar-link { font-size: 14px; }
}

.foot { color: var(--on-green-muted); font-size: 14px; }
.foot-in { max-width: 1060px; margin: 0 auto; padding: 8px 22px 44px; }
.foot p { margin: 0 0 10px; max-width: 70ch; }
.foot a { text-underline-offset: 3px; }
.foot .links a { display: inline-block; padding: 12px 18px 12px 0; }
.page-guide .foot, .page-doc .foot { color: var(--ink-soft); border-top: 1px solid rgba(6, 38, 27, .14); }
.page-guide .foot-in, .page-doc .foot-in { padding-top: 26px; }

a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.page-guide a:focus-visible, .page-guide summary:focus-visible, .page-doc a:focus-visible { outline-color: var(--jade); }

/* ---------- home ---------- */
.wrap { max-width: 1060px; margin: 0 auto; padding: 18px 22px 56px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 384px); gap: 64px; align-items: center; }
@media (max-width: 860px) { .layout { grid-template-columns: minmax(0, 1fr); gap: 32px; } body.made .stage { order: -1; } }
body.made .intro { display: none; }
.stage { scroll-margin-top: 12px; }

h1 { font-weight: 700; font-size: clamp(40px, 6.6vw, 68px); line-height: 1.02; margin: 0 0 20px; letter-spacing: -0.035em; }
.page-home h1 { color: #fff; }
.lede { max-width: 46ch; margin: 0 0 16px; font-size: 18px; }
.page-home .lede { color: var(--on-green-muted); }
.page-home .lede.gift { color: var(--on-green); margin-bottom: 30px; }

form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; max-width: 440px; }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
label, .legend { font-size: 15px; font-weight: 600; }
.hint { font-size: 14px; font-weight: 400; color: var(--on-green-muted); }
input[type="text"], input[type="email"], input[type="date"], input[type="time"] {
  font: inherit; color: #fff; color-scheme: dark; background: rgba(255, 255, 255, .09); border: 1.5px solid var(--line-green); border-radius: 12px; padding: 12px 14px; width: 100%; min-height: 50px;
}
input::placeholder { color: var(--on-green-muted); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 420px) { .row { grid-template-columns: 1fr; } }
.zi { display: none; gap: 8px; padding: 14px; border: 1.5px solid var(--line-green); border-radius: 12px; margin: 0; }
.zi.on { display: grid; }
.radio { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 15px; cursor: pointer; }
.radio input { margin-top: 4px; accent-color: var(--lime); width: 18px; height: 18px; flex: none; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.more { border: 1.5px dashed var(--line-green); border-radius: 12px; padding: 0 16px; }
.more[open] { padding-bottom: 18px; }
.more > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; padding: 10px 0; cursor: pointer; font-weight: 600; color: var(--on-green); }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after { content: "+"; font-size: 24px; font-weight: 500; line-height: 1; flex: none; }
.more[open] > summary::after { content: "\2212"; }
.more .stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 6px; }

button, .btn { font: inherit; font-weight: 700; border-radius: 999px; padding: 14px 26px; min-height: 52px; cursor: pointer; border: 2px solid var(--lime); letter-spacing: -0.01em; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.primary { background: var(--lime); color: var(--ink); }
.primary:hover { background: #DBF58A; border-color: #DBF58A; }
.secondary { background: transparent; color: var(--on-green); border-color: var(--line-green); }
.secondary:hover { border-color: var(--on-green); }
.fine { font-size: 14px; color: var(--on-green-muted); margin: 0; }
.error { color: #FFD3CC; font-weight: 600; font-size: 15px; margin: 0; min-height: 1.4em; }
.error:empty { min-height: 0; margin-block: -9px; }

.after { display: none; max-width: 460px; }
body.made .after { display: block; }
body.made form { display: none; }
.after h2 { font-weight: 700; font-size: 32px; line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 12px; color: #fff; }
.after p { margin: 0 0 20px; color: var(--on-green-muted); }
.after p.fine { margin: 0 0 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.textlink { color: var(--on-green); font-weight: 600; text-underline-offset: 4px; display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 8px; }
.status { min-height: 1.5em; margin: 0 0 18px; color: var(--on-green); font-weight: 600; font-size: 15px; }
.share { border-top: 1px solid var(--line-green); padding-top: 18px; margin-top: 6px; }
.share p { margin-bottom: 12px; }
.share button { min-height: 44px; padding: 10px 20px; }

/* ---------- the card (sized in container units so it scales on screen and prints at 4 x 6 in) ---------- */
.stage { container-type: inline-size; width: 100%; max-width: 384px; justify-self: center; }
.card {
  position: relative; background: #fff; color: var(--ink); border: 1px solid rgba(6, 38, 27, .12); border-top: 3cqw solid var(--jade);
  border-radius: 3cqw; aspect-ratio: 2 / 3; padding: 4.6cqw 7cqw 4.2cqw; display: flex; flex-direction: column;
  box-shadow: 0 30px 60px -24px rgba(3, 30, 20, .55);
  font-family: var(--sans);
}
.card-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 3.8cqw; color: #4A6156; }
.wm { font-weight: 700; font-size: 5.4cqw; letter-spacing: -0.02em; color: var(--ink); }
.wm b { color: var(--jade); font-weight: 700; }
.head { display: flex; gap: 5cqw; align-items: center; margin-top: 2.5cqw; }
.glyph { font-family: var(--han); font-weight: 700; font-size: 35cqw; line-height: 1; color: var(--el); margin: -1cqw 0 0 -1.5cqw; }
.names { min-width: 0; }
.pinyin { font-weight: 700; font-size: 8.6cqw; line-height: 1.05; letter-spacing: -0.03em; }
.kind { display: flex; align-items: center; gap: 2cqw; font-size: 4.7cqw; font-weight: 600; margin-top: 1.8cqw; }
.kind::before { content: ""; width: 3.2cqw; height: 3.2cqw; border-radius: 50%; background: var(--el); flex: none; }
.image { font-size: 4cqw; color: #4A6156; margin-top: 1cqw; }
.animal { font-size: 4cqw; line-height: 1.3; margin-top: 1cqw; color: #4A6156; }
.for { font-weight: 700; font-size: 5.8cqw; letter-spacing: -0.02em; margin: 3.2cqw 0 1cqw; }
.desc { font-size: 4.3cqw; line-height: 1.4; margin: 0; color: #24382F; }
.facts { margin: auto 0 0; padding: 1cqw 4cqw; display: grid; background: var(--mint); border-radius: 2.4cqw; }
.fact { display: grid; grid-template-columns: 31cqw 1fr; gap: 3cqw; align-items: center; padding: 2.6cqw 0; border-bottom: 1px solid rgba(6, 38, 27, .12); }
.fact:last-child { border-bottom: 0; }
.fact dt { font-size: 3.8cqw; color: #4A6156; line-height: 1.25; }
.fact dd { margin: 0; font-size: 4.4cqw; font-weight: 600; line-height: 1.3; }
.swatches { display: flex; flex-wrap: wrap; gap: 1.4cqw 3cqw; }
.sw { display: inline-flex; align-items: center; gap: 1.4cqw; font-weight: 600; }
.sw i { width: 3.6cqw; height: 3.6cqw; border-radius: 50%; border: 1px solid rgba(6, 38, 27, .35); flex: none; }
.card-foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 3.4cqw; font-size: 3.8cqw; color: #4A6156; }
.card-foot .pillar { font-family: var(--han); font-weight: 700; font-size: 4.4cqw; color: var(--ink); margin-left: 1cqw; }
.tag { position: absolute; top: 5.6cqw; right: 7cqw; font-size: 3.8cqw; font-weight: 700; color: var(--ink); background: var(--lime); border-radius: 99px; padding: 0.6cqw 2.6cqw; display: none; }
body:not(.made) .tag { display: block; }
body:not(.made) .lbl { visibility: hidden; }

@media (prefers-reduced-motion: no-preference) {
  .card.reveal .glyph { animation: ink 0.9s cubic-bezier(.2, .7, .2, 1) both; }
  @keyframes ink { from { opacity: 0; filter: blur(6px); transform: scale(1.06); } to { opacity: 1; filter: none; transform: none; } }
}

/* ---------- guide ---------- */
.guide-in { max-width: 740px; margin: 0 auto; padding: 44px 22px 64px; }
.page-guide h1 { color: var(--ink); }
.page-guide .lede { color: var(--ink-soft); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; margin: 30px 0 28px; }
.tile { background: #fff; border: 1px solid rgba(6, 38, 27, .14); border-radius: 16px; padding: 14px 10px 12px; text-decoration: none; text-align: center; display: grid; gap: 2px; }
.tile:hover { border-color: var(--jade); }
.tile-han { font-family: var(--han); font-weight: 700; font-size: 44px; line-height: 1.1; color: var(--el); }
.tile-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.page-guide .btn, .page-doc .btn { background: var(--green); color: #fff; border-color: var(--green); }
.page-guide .btn:hover { background: var(--green-deep); border-color: var(--green-deep); }
.cta-row { margin: 28px 0; }
.dm { padding: 40px 0 8px; border-top: 1px solid rgba(6, 38, 27, .14); scroll-margin-top: 16px; }
.dm-head { display: flex; gap: 20px; align-items: center; margin-bottom: 14px; }
.dm-han { font-family: var(--han); font-weight: 700; font-size: 92px; line-height: 1; color: var(--el); }
.dm h2 { font-size: 32px; line-height: 1.1; letter-spacing: -0.03em; margin: 0; }
.py { font-weight: 500; color: var(--ink-soft); font-size: 0.6em; margin-left: 8px; letter-spacing: 0; }
.dm-image { margin: 4px 0 0; color: var(--ink-soft); }
.dm-portrait { font-size: 19px; line-height: 1.55; }
.dm h3 { font-size: 16px; margin: 24px 0 6px; font-weight: 700; }
.dm ul { padding-left: 20px; margin: 0; }
.dm li { margin-bottom: 4px; }
.dm p { margin: 0 0 12px; }
.dm .dm-colors { font-size: 15px; color: var(--ink-soft); }
.back { display: inline-flex; align-items: center; min-height: 44px; margin: 4px 0 8px; font-weight: 600; color: var(--jade); text-underline-offset: 4px; }
.faq { margin-top: 24px; padding-top: 36px; border-top: 1px solid rgba(6, 38, 27, .14); }
.faq h2 { font-size: 30px; letter-spacing: -0.03em; margin: 0 0 14px; }
details { border-bottom: 1px solid rgba(6, 38, 27, .14); padding: 4px 0; }
summary { cursor: pointer; font-weight: 600; padding: 12px 0; min-height: 44px; }
details p { margin: 0 0 14px; color: var(--ink-soft); max-width: 62ch; }
@media (max-width: 480px) { .dm-han { font-size: 72px; } .dm h2 { font-size: 26px; } }

/* ---------- plain documents (privacy, 404) ---------- */
.doc-in { max-width: 700px; margin: 0 auto; padding: 44px 22px 64px; }
.page-doc h1 { font-size: clamp(34px, 5vw, 48px); color: var(--ink); }
.page-doc h2 { font-size: 22px; letter-spacing: -0.02em; margin: 32px 0 8px; }
.page-doc p, .page-doc li { color: #24382F; max-width: 66ch; }
.page-doc .updated { color: var(--ink-soft); font-size: 15px; }

/* home: the "why a Day Master" note */
.why { max-width: 640px; margin: 56px 0 0; padding-top: 32px; border-top: 1px solid var(--line-green); }
.why h2 { font-size: clamp(26px, 4vw, 34px); line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 14px; color: #fff; }
.why p { margin: 0 0 14px; color: var(--on-green-muted); }

/* about, terms */
.page-doc .lede-doc { font-size: 20px; color: var(--ink-soft); margin: 0 0 8px; }
.page-doc .value { padding-left: 20px; margin: 0 0 16px; }
.page-doc .value li { margin-bottom: 10px; }
.page-doc h2 { scroll-margin-top: 16px; }

/* ---------- print ---------- */
@page { margin: 0.5in; }
@media print {
  html, body { background: #fff !important; }
  .wrap { padding: 0; max-width: none; }
  .bar, .foot, .copy, .why, .no-print { display: none !important; }
  .layout { display: block; }
  .stage { width: 4in; max-width: none; margin: 0 auto; }
  .card { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; break-inside: avoid; }
  .card * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body:not(.made) .stage { display: none; }
}
