/* MaoChen International — shared stylesheet (Muji-inspired) */

:root {
  --paper: #fbfaf7;
  --paper-deep: #f3efe6;
  --ink: #6b4a35;
  --ink-soft: #7c6350;
  --ink-faint: #a58f7a;
  --line: #ddd4c2;
  --accent: #b0452c;
  --accent-soft: #c8654a;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(43,39,35,0.06);
  --shadow-md: 0 10px 26px rgba(43,39,35,0.08);
  --radius: 3px;
  --max-width: 1160px;
  --font-latin: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-cjk: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", var(--font-latin);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-cjk);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

html[lang="en"] body { font-family: var(--font-latin); }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 600; letter-spacing: -0.005em; }
p { margin: 0 0 1em; color: var(--ink-soft); }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--white); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-outline-dark { background: transparent; color: var(--ink); border-color: rgba(43,39,35,0.28); }
.btn-outline-dark:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}
html[lang="en"] .brand-mark { width: 54px; height: 54px; }
.brand-text { line-height: 1.15; }
.brand-text small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--ink);
  border-color: var(--accent);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
}
.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.lang-switch a {
  padding: 5px 10px;
  border-radius: var(--radius);
  color: var(--ink-faint);
}
.lang-switch a.active {
  background: var(--ink);
  color: var(--paper);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: transform .2s ease, opacity .2s ease;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper-deep);
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 24px 20px;
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; padding: 10px 0; }
  .nav { flex-wrap: wrap; row-gap: 10px; }
  .brand { min-width: 0; font-size: 15px; gap: 10px; }
  .brand-mark { width: 34px; height: 34px; }
  html[lang="en"] .brand-mark { width: 42px; height: 42px; }
  .brand-text { min-width: 0; overflow-wrap: break-word; line-height: 1.25; }
  .nav-right { gap: 12px; }
}

@media (max-width: 400px) {
  .brand-text small { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(180deg, rgba(30,26,22,0.66), rgba(30,26,22,0.78)), url("../img/home-hero-bg.jpg") center/cover no-repeat;
  color: var(--paper);
  padding: 140px 0 110px;
}
.hero-inner { position: relative; z-index: 1; max-width: 680px; }
.hero .eyebrow { color: var(--accent-soft); text-shadow: 0 1px 4px rgba(0,0,0,0.35); }
.hero h1 {
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.15;
  margin-bottom: 20px;
  color: var(--paper);
  text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.hero p.lead {
  font-size: 18px;
  color: rgba(251,250,247,0.9);
  max-width: 560px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}
.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 34px;
  flex-wrap: wrap;
}
.hero .btn-outline {
  color: var(--paper);
  border-color: rgba(251,250,247,0.55);
}
.hero .btn-outline:hover {
  background: rgba(251,250,247,0.14);
  border-color: var(--paper);
  color: var(--paper);
}
.hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 48px;
  margin-top: 72px;
}
.hero-stats div strong {
  display: block;
  font-size: 30px;
  color: var(--paper);
  font-family: var(--font-latin);
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(0,0,0,0.35);
}
.hero-stats div span {
  font-size: 13px;
  color: rgba(251,250,247,0.85);
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
@media (max-width: 640px) {
  .hero { padding: 96px 0 70px; }
  .hero-stats { gap: 28px; }
}

/* ---------- Page header (non-home) ---------- */
.page-hero {
  position: relative;
  background: linear-gradient(180deg, rgba(30,26,22,0.66), rgba(30,26,22,0.78)), var(--hero-bg) center/cover no-repeat;
  color: var(--paper);
  padding: 96px 0 76px;
  text-align: left;
}
.page-hero h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 10px; color: var(--paper); text-shadow: 0 2px 10px rgba(0,0,0,0.35); }
.page-hero p { color: rgba(251,250,247,0.9); max-width: 560px; margin-bottom: 0; text-shadow: 0 1px 6px rgba(0,0,0,0.3); }
.breadcrumb {
  font-size: 13px;
  color: var(--accent-soft);
  margin-bottom: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

/* ---------- Sections ---------- */
section { padding: 96px 0; }
.section-cream { background: var(--paper-deep); }
.section-head { max-width: 620px; margin-bottom: 52px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 36px); }

/* ---------- Cards / grid ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 860px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 28px;
  transition: border-color .2s ease;
}
.card:hover { border-color: var(--ink); }
.card-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.card h3 { font-size: 18px; margin-bottom: 8px; }
.card p { margin-bottom: 0; font-size: 14.5px; }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: var(--ink);
  border-radius: var(--radius);
  padding: 56px;
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.cta-banner h3 { font-size: 24px; margin-bottom: 6px; color: var(--paper); }
.cta-banner p { color: rgba(251,250,247,0.68); margin-bottom: 0; }
.cta-banner .btn-primary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.cta-banner .btn-primary:hover { background: var(--accent); color: var(--white); border-color: var(--accent); }

/* ---------- About page ---------- */
.value-list li {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.value-list li:last-child { border-bottom: none; }
.value-list .num {
  font-family: var(--font-latin);
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
  min-width: 28px;
}
.value-list h4 { margin: 0 0 4px; font-size: 16px; }
.value-list p { margin: 0; font-size: 14.5px; }

.placeholder-note {
  background: var(--paper-deep);
  border: 1px dashed var(--accent);
  color: #7a4126;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 13.5px;
  margin: 0 0 28px;
}

/* ---------- Timeline ---------- */
.timeline { position: relative; margin-top: 20px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line);
}
.timeline-item {
  position: relative;
  padding-left: 56px;
  margin-bottom: 40px;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: 10px;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
}
.timeline-year {
  font-family: var(--font-latin);
  font-weight: 700;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}
.timeline-item h4 { font-size: 17px; margin-bottom: 6px; }
.timeline-item p { margin-bottom: 0; }

/* ---------- Contact page ---------- */
.contact-info li {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.contact-info li:first-child { padding-top: 0; }
.contact-info .icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.contact-info strong { display: block; font-size: 13px; color: var(--ink-faint); font-weight: 600; letter-spacing: 0.03em; }
.contact-info span { font-size: 15.5px; color: var(--ink); }

.form-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 36px;
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  transition: border-color .15s ease, background .15s ease;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--white);
}
.field textarea { min-height: 130px; resize: vertical; }
.form-note { font-size: 12.5px; color: var(--ink-faint); margin-top: 10px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(251,250,247,0.66);
  padding: 64px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(251,250,247,0.14);
}
.footer-grid h4 {
  color: var(--paper);
  font-size: 14px;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}
.footer-grid a {
  display: block;
  padding: 5px 0;
  font-size: 14px;
  color: rgba(251,250,247,0.6);
}
.footer-grid a:hover { color: var(--accent-soft); }
.footer-brand { display: flex; align-items: center; gap: 12px; color: var(--paper); font-weight: 700; line-height: 1.15; margin-bottom: 14px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- Photo upload placeholder ---------- */
.photo-slot {
  position: relative;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--paper-deep);
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 32px;
  overflow: hidden;
}
.photo-slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.photo-slot.has-image img { display: block; }
.photo-slot.has-image .photo-slot-icon,
.photo-slot.has-image .photo-slot-label,
.photo-slot.has-image .photo-slot-btn { display: none; }
.photo-slot-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
}
.photo-slot-label {
  font-size: 13px;
  color: var(--ink-faint);
  max-width: 260px;
}
.photo-slot-btn { position: relative; z-index: 1; cursor: pointer; }
.photo-slot-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.photo-slot-remove {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(43,39,35,0.55);
  color: var(--paper);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.photo-slot.has-image .photo-slot-remove { display: flex; align-items: center; justify-content: center; }

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Language dropdown ---------- */
.lang-dropdown { position: relative; }
.lang-dropdown-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-latin); font-size: 13px; font-weight: 600;
  color: var(--ink); background: transparent; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 7px 12px; cursor: pointer;
}
.lang-dropdown-btn:hover { border-color: var(--ink); }
.lang-dropdown-btn svg { width: 12px; height: 12px; transition: transform .15s ease; flex: none; }
.lang-dropdown.open .lang-dropdown-btn svg { transform: rotate(180deg); }
.lang-dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 128px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(43,39,35,0.14); padding: 6px; margin: 0; list-style: none;
  display: none; z-index: 50;
}
.lang-dropdown.open .lang-dropdown-menu { display: block; }
.lang-dropdown-menu li + li { margin-top: 2px; }
.lang-dropdown-menu li a {
  display: block; padding: 8px 10px; border-radius: 3px; font-size: 13px; font-family: var(--font-latin);
  color: var(--ink-soft); text-decoration: none;
}
.lang-dropdown-menu li a:hover { background: var(--paper-deep); color: var(--ink); }
.lang-dropdown-menu li a.active { color: var(--accent); font-weight: 600; }

/* ---------- Contact form status + honeypot ---------- */
.hp-field { position: absolute; left: -9999px; top: -9999px; opacity: 0; height: 0; width: 0; overflow: hidden; }
.form-status { margin-top: 12px; font-size: 13px; min-height: 18px; }
.form-status.is-pending { color: var(--ink-faint); }
.form-status.is-success { color: #3a7a4a; font-weight: 600; }
.form-status.is-error { color: var(--accent); font-weight: 600; }
button[type="submit"]:disabled { opacity: 0.6; cursor: default; }
