/* ============================================================
   Daddy Mi portal — stylesheet C "Ink & Light" 水墨之光 (LIVE)
   Boss ruling 2026-11-09: candidate C design + Track A calligraphy.
   Palette and typography are candidate C's, verbatim: pale
   rice-paper ground, deep indigo ink, gold used as LIGHT — one
   soft glow behind the hero, never metal trim. Noto Serif SC/TC
   text, EB Garamond italic Latin accents. The rules are mapped
   onto the live portal's structure (portal-src/build.py template);
   page structure and content never change with the stylesheet.
   No dark-mode rules anywhere: the design is light-locked, so the
   indigo ink can never land on a dark background.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;1,400;1,500&family=Noto+Serif+SC:wght@400;500;600&family=Noto+Serif+TC:wght@400;500;600&display=swap');

:root {
  --rice:       #F8F4EA;
  --rice-deep:  #F3EDDD;
  --ink:        #1E2A38;   /* deep indigo ink */
  --ink-soft:   #45536A;
  --muted:      #7E8698;
  --light:      #C9A227;   /* gold as light */
  --light-soft: #E9D48A;
  --hairline:   #E0D7BE;
  --gold-text:  #8A6D1F;   /* deep gold, text links only */
  --serif-zh: "Noto Serif SC", "Noto Serif TC", "Songti SC", "Songti TC", serif;
  --serif-latin: "EB Garamond", "Noto Serif SC", "Noto Serif TC", serif;
  --wrap-max: 900px;
  --radius: 14px;
  --radius-lg: 18px;
}
html[lang="zh-Hant"] { --serif-zh: "Noto Serif TC", "Noto Serif SC", "Songti TC", "Songti SC", serif; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--rice); color: var(--ink);
  font-family: var(--serif-latin); font-size: 18px; line-height: 1.8;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  min-height: 100vh;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--wrap-max); margin: 0 auto; padding: 0 28px 46px; position: relative; }
section { margin-top: 72px; position: relative; }
h2 { font-family: var(--serif-zh); font-weight: 600; font-size: 24px; letter-spacing: .04em; margin: 0 0 10px; }
::selection { background: rgba(201, 162, 39, .25); }
input, button { -webkit-tap-highlight-color: transparent; }

/* ---------- top bar / nav (44px tap targets, wrap without overlap) ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  column-gap: 12px; row-gap: 0; flex-wrap: wrap; padding: 16px 0 0;
}
.brand { font-family: var(--serif-zh); font-size: 17px; letter-spacing: .16em; font-weight: 400; }
.langswitch { display: flex; flex-wrap: wrap; column-gap: 8px; font-family: var(--serif-zh); font-size: 14px; color: var(--ink-soft); }
.langswitch a, .langswitch .cur { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 4px; }
.langswitch a { transition: color .3s ease; }
.langswitch a:hover { color: var(--ink); }
.langswitch .cur { font-weight: 600; color: var(--ink); }
.nav {
  display: flex; flex-wrap: wrap; justify-content: center; column-gap: 22px; row-gap: 0;
  padding: 8px 0 0; font-family: var(--serif-zh); font-size: 15px; letter-spacing: .12em;
}
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 10px 4px;
  color: var(--ink-soft);
  text-decoration: underline; text-decoration-color: transparent;
  text-decoration-thickness: 1px; text-underline-offset: 6px;
  transition: color .3s ease, text-decoration-color .3s ease;
}
.nav a:hover { color: var(--ink); text-decoration-color: var(--light); }

/* ---------- hero: the glow is the ornament ---------- */
header { text-align: center; padding: 58px 0 0; position: relative; }
header::before {
  content: ""; position: absolute; left: 50%; top: -30px;
  width: 560px; height: 560px; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(233, 212, 138, .38) 0%, rgba(233, 212, 138, .14) 42%, rgba(233, 212, 138, 0) 68%);
  pointer-events: none; z-index: -1;
}
.heromark { width: 124px; height: 124px; margin: 0 auto 36px; position: relative; }
h1.brand-en {
  font-family: var(--serif-latin); font-weight: 500;
  font-size: clamp(34px, 6vw, 52px); line-height: 1.25;
  letter-spacing: .01em; margin: 0; color: var(--ink);
}
.tagline {
  font-family: var(--serif-zh); text-align: center; color: var(--muted);
  font-size: 16px; letter-spacing: .08em; line-height: 1.9;
  margin: 26px auto 0; max-width: 660px;
}
.heroimg {
  width: 100%; height: clamp(200px, 34vw, 320px);
  object-fit: cover; object-position: 50% 18%;
  border-radius: 10px; border: 1px solid var(--hairline);
  margin: 42px 0 0; box-shadow: 0 18px 44px rgba(30, 42, 56, .14);
}

/* ---------- song card (listen) ---------- */
.listen {
  display: flex; gap: 46px; align-items: center; text-align: left;
  background: linear-gradient(180deg, #FDFBF4 0%, var(--rice-deep) 100%);
  border: 1px solid var(--hairline); border-radius: var(--radius-lg);
  padding: 30px 34px; overflow: hidden;
}
.listen img { width: 208px; height: 277px; object-fit: cover; border-radius: 10px; flex: none; box-shadow: 0 18px 44px rgba(30, 42, 56, .14); }
.listen h2 { font-size: 13px; letter-spacing: .3em; color: var(--ink-soft); font-weight: 400; margin-bottom: 14px; }
.listen .song { font-family: var(--serif-zh); font-weight: 600; font-size: 24px; line-height: 1.5; margin: 0 0 4px; }
.listen .by { font-family: var(--serif-zh); font-size: 13px; letter-spacing: .18em; color: var(--ink-soft); margin: 0 0 8px; }
.listen audio { width: 100%; margin: 10px 0 4px; }
.disclosure { font-size: 12.5px; color: var(--muted); line-height: 1.8; margin: 8px 0 0; }
.songpage { font-size: 14.5px; margin: 12px 0 0; }
.likeprompt { font-size: 14.5px; margin: 6px 0 0; }
.songpage a, .likeprompt a { color: var(--ink); border-bottom: 1px solid var(--light); padding-bottom: 2px; }
.songpage a:hover, .likeprompt a:hover { color: var(--gold-text); }

/* ---------- explore cue ---------- */
.explore {
  display: block; text-align: center; margin-top: 44px;
  font-family: var(--serif-zh); font-size: 14.5px; letter-spacing: .3em; text-indent: .3em;
  color: var(--ink-soft);
  text-decoration: underline; text-decoration-color: var(--light);
  text-underline-offset: 7px; text-decoration-thickness: 1px;
}
.explore:hover { color: var(--ink); }

/* ---------- subscribe ---------- */
.band { text-align: center; padding-top: 24px; }
.band h2 { font-size: 32px; letter-spacing: .05em; }
.band p { font-family: var(--serif-zh); color: var(--ink-soft); font-size: 16.5px; line-height: 2; max-width: 520px; margin: 14px auto 0; }
/* Form: label on its own line, then ONE joined pill — input + button in
   a single 56px shell. The shell is a ROW at every width (never stacks),
   and its height is fixed, so no native control appearance or flex
   basis can inflate the field (the iOS Safari "balloon" of 2026-11-09:
   the old mobile rule made the form a column, turning the input's
   240px flex-basis into its height). */
.subform { display: block; max-width: 520px; margin: 30px auto 0; text-align: center; }
.subform label { display: block; margin: 0 0 10px; font-family: var(--serif-zh); font-size: 13px; letter-spacing: .2em; color: var(--muted); }
.subfield {
  display: inline-flex; align-items: center; vertical-align: top; width: 100%; max-width: 520px;
  height: 56px; max-height: 56px; overflow: hidden;
  background: #FFFDF6; border: 1px solid var(--hairline); border-radius: 999px;
  transition: border-color .3s ease, box-shadow .3s ease;
}
.subfield:focus-within { border-color: var(--light); box-shadow: 0 0 0 4px rgba(201, 162, 39, .15); }
.subform input {
  -webkit-appearance: none; appearance: none;
  flex: 1 1 auto; min-width: 0; height: 100%; max-height: 56px; margin: 0;
  font-family: var(--serif-latin); font-size: 16px; line-height: normal; color: var(--ink);
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
  padding: 0 8px 0 24px; outline: none;
}
.subform input::placeholder { color: var(--muted); opacity: .8; }
.subform input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #FFFDF6 inset; -webkit-text-fill-color: var(--ink); }
.subform button {
  -webkit-appearance: none; appearance: none;
  flex: none; height: calc(100% - 8px); margin: 4px;
  font-family: var(--serif-zh); font-size: 15px; line-height: 1; letter-spacing: .25em; text-indent: .25em;
  color: var(--ink); background: var(--light-soft);
  border: 0; border-radius: 999px;
  padding: 0 26px; cursor: pointer; transition: background .3s ease, color .3s ease;
}
.subform button:hover, .subform button:focus-visible { background: var(--light); color: #FFFDF6; outline: none; }
.formnote { font-size: 12.5px !important; color: var(--muted) !important; margin-top: 16px !important; letter-spacing: .06em; }
.formnote a { color: var(--gold-text); }

/* ---------- works cards ---------- */
#works h2 { text-align: center; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 30px; }
.cards .card {
  background: #FDFBF4; border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 34px 22px 30px; text-align: center;
  transition: transform .35s ease, border-color .35s ease;
}
@media (hover: hover) {
  .cards .card:hover { transform: translateY(-3px); border-color: var(--light-soft); }
}
.cards .card:active { transform: translateY(0); border-color: var(--light); }
.cards h3 { font-family: var(--serif-latin); font-weight: 600; font-size: 20px; margin: 0 0 6px; line-height: 1.5; }
.cards .card p { font-family: var(--serif-zh); line-height: 1.9; color: var(--muted); font-size: 13.5px; margin: 10px 0 14px; }
.cards .card a { font-family: var(--serif-zh); font-size: 14.5px; color: var(--ink); border-bottom: 1px solid var(--light); padding-bottom: 2px; }
.cards .card a:hover { color: var(--gold-text); }

/* ---------- about / footer ---------- */
.about { text-align: center; }
.about p { font-family: var(--serif-zh); line-height: 2.1; color: var(--ink-soft); font-size: 16px; letter-spacing: .06em; max-width: 720px; margin: 12px auto 0; }
.about .faith { color: var(--ink); font-weight: 500; margin-top: 16px; }
footer {
  text-align: center; color: var(--muted); font-size: 14px; line-height: 1.9;
  margin: 88px auto 0; padding: 34px 0 0; border-top: 1px solid var(--hairline);
}
footer div { line-height: 2; }
footer a { color: var(--gold-text); }
.footmark { height: 28px; width: auto; margin: 0 auto 8px; }

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  .wrap { padding: 0 20px 40px; }
  header { padding-top: 40px; }
  section { margin-top: 56px; }
  h2 { font-size: 22px; letter-spacing: .05em; }
  header::before { width: 420px; height: 420px; }
  .heromark { width: 102px; height: 102px; margin-bottom: 28px; }
  .listen { flex-direction: column; align-items: center; gap: 24px; padding: 22px; text-align: left; }
  .listen > img { width: 168px; height: 224px; }
  .listen > div { align-self: stretch; width: 100%; }
  .cards { grid-template-columns: 1fr; gap: 14px; }
  .cards .card { text-align: left; padding: 26px 22px; }
  .band h2 { font-size: 27px; }
  footer { margin-top: 76px; }
}
@media (max-width: 400px) {
  /* the pill stays joined: the input shrinks, the button keeps a firm size */
  .subform input { padding-left: 18px; }
  .subform button { min-width: 104px; padding: 0 16px; }
}

/* ---------- reveal-on-scroll (enabled only by the inline script) ---------- */
.js .reveal { transition: opacity .7s ease, transform .7s ease; }
.js .reveal:not(.in) { opacity: 0; transform: translateY(14px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .reveal:not(.in) { opacity: 1; transform: none; transition: none; }
  .cards .card, .cards .card:hover, .cards .card:active { transform: none; transition: none; }
}

/* ===== Track A calligraphy: semantic layer + image-failure fallback ===== */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
.brand-art { line-height: 1.2; margin: 0; }
.brand-art img { display: block; margin: 0 auto; }
.brand-art .callig-line1 { width: min(430px, 92%); }
.brand-art .callig-line2 { width: min(414px, 89%); margin-top: 12px; }
.callig-text { display: none; }
.brand-art.callig-failed img { display: none; }
.brand-art.callig-failed .callig-text {
  display: block;
  font-family: "Noto Serif TC", "Noto Serif SC", "Songti TC", "Songti SC", serif;
  font-weight: 600; color: var(--ink);
  font-size: clamp(30px, 5.4vw, 46px); line-height: 1.55; letter-spacing: .02em;
}
.callig-text .ct-line { display: block; }
.inscr-strip {
  position: absolute; right: 14px; top: 22px; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  opacity: .34; pointer-events: none;
}
.inscr-strip img { width: 19px; height: auto; flex: none; box-shadow: none; border-radius: 0; }
@media (max-width: 720px) { .inscr-strip { display: none; } }
