/* PicSpeak — generated from 05_note/N02_artistic theme and style.md
   Soft & calm (Montessori) · warm earthy + Morandi palette */

/* ---- Fonts ---- */
@font-face {
  font-family: "Iansui";
  src: url("03_refs/Iansui-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "IansuiBpmf";
  src: url("03_refs/Iansui-bpmf-Regular.ttf") format("truetype");
  font-display: swap;
}

/* ---- Theme tokens ---- */
:root {
  /* base + surface */
  --bg:        #EDE7DB; /* warm oatmeal */
  --surface:   #FAF6EE; /* soft cream */
  --well:      #E4DCCD; /* light clay-grey */
  --border:    #DAD2C3; /* soft sand */

  /* Morandi accents */
  --sage:      #A1AA8E;
  --clay:      #C79D88;
  --blue:      #93A1A6;
  --rose:      #C9A6A0;

  /* text */
  --text:      #463F36; /* warm dark brown */
  --text-soft: #8A8073; /* muted taupe */
  --on-accent: #FAF6EE; /* cream on filled accent */

  /* type */
  --sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --zh:   "Iansui", var(--sans);
  --bpmf: "IansuiBpmf", "Iansui", var(--sans);

  --radius:   20px;
  --radius-sm: 14px;
  --shadow:   0 10px 30px rgba(70, 63, 54, 0.10);
  --shadow-sm: 0 4px 12px rgba(70, 63, 54, 0.08);
  --ease: 180ms ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* thin sage brand band */
.brand-band {
  height: 6px;
  background: var(--sage);
}

/* ---- Layout shell ---- */
.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 16px 32px;
}

.app-title {
  display: block;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin: 4px 0 12px;
  text-decoration: none;
  transition: color var(--ease);
}
.app-title:hover {
  color: var(--text);
}

/* ---- Site header / nav (content pages) ---- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin: 6px 0 24px;
}
.site-header__logo {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  color: var(--text);
  text-decoration: none;
}
.nav-link {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text-soft);
  text-decoration: none;
  transition: color var(--ease);
}
.nav-link:hover,
.nav-link[aria-current="page"] { color: var(--text); }

/* ---- Content pages (about, contact) ---- */
.content {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 26px 34px;
}
.content h1 {
  font-family: var(--sans);
  font-size: 1.7rem;
  margin: 0 0 4px;
}
.content h2 {
  font-family: var(--sans);
  font-size: 1.2rem;
  margin: 28px 0 8px;
}
.content h1 .zh,
.content h2 .zh {
  font-family: var(--zh);
  font-weight: 400;
  color: var(--text-soft);
  margin-left: 8px;
}
.content p {
  margin: 0 0 14px;
}
.content p .zh {
  font-family: var(--zh);
  color: var(--text-soft);
  display: block;
  margin-top: 3px;
}
.content .lead {
  font-size: 1.1rem;
}

/* ---- Roadmap ---- */
.roadmap {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}
.roadmap li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 16px;
}
.roadmap li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
}
.roadmap .done::before    { background: var(--sage); }
.roadmap .active::before  { background: var(--clay); box-shadow: 0 0 0 4px rgba(199, 157, 136, 0.22); }
.roadmap .planned::before { background: var(--well); border: 1px solid var(--border); }
.roadmap .status {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-left: 8px;
}
.roadmap .zh {
  font-family: var(--zh);
  color: var(--text-soft);
  display: block;
  margin-top: 2px;
}

/* ---- Contact ---- */
.contact-name {
  font-size: 1.15rem;
  margin: 4px 0 2px;
}
.contact-name .zh {
  font-family: var(--zh);
  margin-right: 8px;
}
.contact-email {
  font-family: var(--sans);
  color: var(--clay);
  text-decoration: none;
  font-weight: 600;
}
.contact-email:hover { text-decoration: underline; }
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}
.contact-btn {
  flex: 1 1 180px;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--on-accent);
  padding: 13px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--ease), filter var(--ease);
}
.contact-btn .zh {
  font-family: var(--zh);
  font-weight: 400;
  display: block;
  margin-top: 3px;
  opacity: 0.92;
}
.contact-btn--suggest { background: var(--sage); }
.contact-btn--report  { background: var(--clay); }
.contact-btn:hover  { filter: brightness(1.04); }
.contact-btn:active { transform: scale(0.97); }

/* ---- Footer ---- */
.site-footer {
  text-align: center;
  margin-top: 28px;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--text-soft);
}
.site-footer a {
  color: var(--text-soft);
  text-decoration: none;
}
.site-footer a:hover { color: var(--text); }
.site-footer .sep { margin: 0 8px; opacity: 0.5; }

/* ---- Landing hero (root index.html) ---- */
.hero {
  min-height: 76vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.hero__logo {
  font-family: var(--sans);
  font-size: 2.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text);
  margin: 0;
}
.hero__tagline-en {
  font-family: var(--sans);
  font-size: 1.18rem;
  color: var(--text);
  margin: 18px 0 0;
}
.hero__tagline-zh {
  font-family: var(--zh);
  font-size: 1.22rem;
  color: var(--text-soft);
  margin: 6px 0 0;
}
.hero__cta {
  display: inline-block;
  margin-top: 32px;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--on-accent);
  background: var(--sage);
  padding: 14px 34px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--ease), filter var(--ease);
}
.hero__cta-zh {
  font-family: var(--zh);
  font-weight: 400;
  margin-left: 8px;
  opacity: 0.92;
}
.hero__cta:hover { filter: brightness(1.04); }
.hero__cta:active { transform: scale(0.97); }

/* ---- Card ---- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px 12px;
}

/* word block (sits below the image grid) */
.word {
  text-align: center;
  margin-top: 10px;
}
.word__en {
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}
.word__zh {
  /* Use the Bpmf Iansui face on the whole word so the ruby zhuyin
     (tone marks, side glyphs) aligns to the base characters. */
  font-family: var(--bpmf);
  font-size: 1.4rem;
  font-weight: 400;
  margin: 2px 0 0;
  line-height: 1.5; /* room for ruby annotation above/beside */
}

/* Zhuyin (Bopomofo) shown beside each character via <ruby>.
   Default to inter-character (Taiwan side placement); browsers that
   don't support it ignore that line and keep the `over` fallback. */
.word__zh ruby {
  ruby-position: over;
  ruby-position: inter-character;
  -webkit-ruby-position: inter-character;
}
.word__zh rt {
  font-family: var(--bpmf);
  font-size: 0.5em;
  font-weight: 400;
  color: var(--text-soft);
}

.word__pinyin {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: #6B6357; /* deeper than --text-soft, lighter than --text */
  margin: 2px 0 0;
}

/* ---- Audio pills (bottom of card, below the word) ---- */
.audio {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 0;
}
.audio__btn {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--on-accent);
  border: none;
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: transform var(--ease), filter var(--ease);
}
.audio__btn--en { background: var(--clay); }
.audio__btn--zh { background: var(--sage); }
.audio__btn:hover { filter: brightness(1.04); }
.audio__btn:active { transform: scale(0.96); }
.audio__btn:disabled {
  background: var(--well);
  color: var(--text-soft);
  cursor: not-allowed;
  filter: none;
  transform: none;
}

/* ---- 2x2 image grid (top of card) ---- */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--well);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  transition: transform var(--ease), box-shadow var(--ease);
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}
.tile:active { transform: translateY(-1px); }
.tile:focus-visible {
  outline: 3px solid var(--sage);
  outline-offset: 2px;
}

/* Empty image slot: a card with fewer than 4 images leaves inert wells. */
.tile--empty { cursor: default; }
.tile--empty:hover { transform: none; box-shadow: none; }

/* ---- Navigation control (prev/next and card counter) ---- */
.nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
}

.nav__counter {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--text-soft);
  margin: 0;
  font-weight: 500;
}

.nav__buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.nav__btn {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--on-accent);
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--ease), filter var(--ease);
}

.nav__btn--prev { background: var(--clay); }
.nav__btn--next { background: var(--sage); }

.nav__btn-zh {
  font-family: var(--zh);
  font-weight: 400;
  margin-left: 8px;
  opacity: 0.92;
}

.nav__btn:hover { filter: brightness(1.04); }
.nav__btn:active { transform: scale(0.97); }

.nav__report {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--text-soft);
  text-decoration: none;
  transition: color var(--ease);
}
.nav__report:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ---- Lightbox modal ---- */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(70, 63, 54, 0.55);
  z-index: 50;
}
.modal[aria-hidden="false"] { display: flex; }
.modal__panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 460px;
  width: 100%;
  overflow: hidden;
}
.modal__img {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  background: var(--well);
  display: block;
}
.modal__caption {
  padding: 18px 20px 22px;
  text-align: center;
}
.modal__caption-en {
  font-family: var(--sans);
  font-size: 1.02rem;
  margin: 0;
}
.modal__caption-zh {
  font-family: var(--zh);
  font-size: 1.05rem;
  color: var(--text-soft);
  margin: 8px 0 0;
}
.modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: var(--surface);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
