/* Bochuang Dental — regulatory catalog, not a brochure template. */

@font-face {
  font-family: "Fraunces Local";
  src: url("../fonts/fraunces-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif SC Local";
  src: url("../fonts/noto-serif-sc-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans SC Local";
  src: url("../fonts/noto-sans-sc-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans SC Local";
  src: url("../fonts/noto-sans-sc-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1b1916;
  --ink-soft: #3a342c;
  --muted: #5c564c;
  --brass: #6d5424;
  --brass-bright: #d4bc8a;
  --line: #ddd4c6;
  --line-strong: #1b1916;
  --paper: #f3efe8;
  --paper-2: #f7f4ee;
  --pine: #1b3930;
  --pine-deep: #13211c;
  --titanium: #5c6970;
  --gum: #e7d4cc;
  --crown: #f7f3ec;
  --serif: "Fraunces Local", "Noto Serif SC Local", "Songti SC", "STSong", "PMingLiU", "SimSun", serif;
  --sans: "Noto Sans SC Local", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --wrap: min(1120px, calc(100% - 2.5rem));
  --header-h: 7.4rem;
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.75;
  font-weight: 400;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }

button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, .brand strong, .tats b, .facts dd, .sec-no {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1, h2, h3 { text-wrap: balance; line-height: 1.2; margin: 0; }

h1 { font-size: clamp(2.35rem, 4.7vw, 4.05rem); }
h2 { font-size: clamp(1.7rem, 2.6vw, 2.25rem); }
h3 { font-size: 1.25rem; letter-spacing: 0; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 500; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 3px;
}

::selection { background: #d5e3db; color: var(--pine-deep); }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 80;
  background: var(--ink);
  color: var(--paper);
  padding: 0.55rem 0.8rem;
  text-decoration: none;
}
.skip:focus { top: 0.75rem; }

.wrap { width: var(--wrap); margin-inline: auto; }
.measure { max-width: 42rem; }
.muted { color: var(--muted); }
.id { font-variant-numeric: tabular-nums; }

.kicker {
  margin: 0 0 0.85rem;
  color: var(--pine);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
}
html[lang="en"] .kicker {
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lede {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 40rem;
}

.rule {
  margin: 1.25rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  max-width: 42rem;
}

/* Header / masthead */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(243, 239, 232, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}

.mast {
  width: var(--wrap);
  margin: 0 auto;
  padding: 0.95rem 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  text-decoration: none;
  min-width: 0;
}
.brand svg { flex: none; }
.brand strong {
  display: block;
  font-size: 1.05rem;
  letter-spacing: 0;
  line-height: 1.25;
}
.brand small {
  display: block;
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: none;
  padding-top: 0.35rem;
}

.lang {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.86rem;
}
.lang a {
  text-decoration: none;
  padding: 0.2rem 0.15rem;
  color: var(--muted);
}
.lang a[aria-current="true"],
.lang a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -1px 0 var(--ink);
}
.lang span { color: var(--line-strong); opacity: 0.35; }

.nav-toggle {
  display: none;
  min-height: 44px;
  padding: 0 0.85rem;
  background: transparent;
  border: 1px solid var(--ink);
  cursor: pointer;
}

.site-nav {
  width: var(--wrap);
  margin: 0.7rem auto 0;
  display: flex;
  gap: 1.35rem;
  padding: 0.55rem 0 0.75rem;
  border-top: 1px solid var(--line);
}
.site-nav a {
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 500;
  padding: 0.2rem 0;
}
.site-nav a[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--ink); }

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.88fr);
  gap: 3rem;
  align-items: end;
  padding: 3.2rem 0 2.2rem;
}

.hero h1 { margin: 0 0 1rem; }
.legal-line {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1.05rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  border: 1px solid var(--ink);
  cursor: pointer;
}
.btn:hover { background: var(--pine-deep); border-color: var(--pine-deep); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-small { min-height: 40px; padding: 0.4rem 0.75rem; font-size: 0.92rem; }

.plate {
  border: 1px solid #d9d1c4;
  background-color: var(--paper-2);
  background-image:
    linear-gradient(to right, rgba(27, 25, 22, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(27, 25, 22, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  padding: 0.85rem 0.85rem 0.95rem;
}
.plate img { display: block; width: 100%; height: auto; background: transparent; }
.plate figcaption,
.legend { color: var(--muted); font-size: 0.88rem; }
.plate figcaption { margin-top: 0.75rem; }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.1rem;
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}
.legend li { display: flex; align-items: center; gap: 0.4rem; }
.swatch {
  width: 0.8rem;
  height: 0.8rem;
  border: 1px solid var(--ink);
  flex: none;
}
.swatch-crown { background: var(--crown); }
.swatch-ti { background: var(--titanium); }
.swatch-gum { background: var(--gum); }

.facts { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.facts dl {
  width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.facts div { padding: 1.05rem 1rem 1.1rem 0; }
.facts div + div { padding-left: 1rem; box-shadow: inset 1px 0 0 var(--line); }
.facts dt {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}
.facts dd {
  margin: 0;
  font-size: clamp(1rem, 1.5vw, 1.28rem);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.section { padding: 4.4rem 0; }
.section-head { margin-bottom: 1.6rem; }
.section-head h2 { margin-bottom: 0.75rem; }
.sec-label {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  margin-bottom: 0.75rem;
}
.sec-no {
  color: var(--brass);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

/* Malo band */

.band { background: var(--pine-deep); color: #f4f0e7; }
.band .wrap { padding: 4.6rem 0; }
.band .kicker { color: var(--brass-bright); }
.band .lede { color: #e7e1d6; }
.band a { color: #f4f0e7; }

.malo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.7fr);
  gap: 3rem;
  align-items: start;
}

.tats { display: flex; gap: 2rem; margin: 1.6rem 0 0.4rem; }
.tats div { min-width: 7rem; }
.tats b {
  display: block;
  font-size: clamp(3.2rem, 6vw, 4.4rem);
  line-height: 0.85;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tats span { display: block; margin-top: 0.45rem; color: #c9c2b4; font-size: 0.92rem; }
.tats.on-paper span { color: var(--muted); }

.points { list-style: none; margin: 1.5rem 0 0; padding: 0; counter-reset: point; }
.points li {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  gap: 0.8rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(244, 240, 231, 0.16);
}
.points li::before {
  counter-increment: point;
  content: counter(point, decimal-leading-zero);
  font-family: var(--serif);
  color: var(--brass-bright);
  font-size: 1.05rem;
  padding-top: 0.15rem;
}
.points.on-paper li { border-top-color: var(--line); }
.points.on-paper li::before { color: var(--brass); }

.band .rule { border-top-color: rgba(244, 240, 231, 0.2); color: #d9d3c8; }

/* Product index rows */

.prows { border-top: 1px solid var(--ink); }
.prow {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 1rem;
  align-items: baseline;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.prow:hover { background: rgba(27, 25, 22, 0.03); }
.prow-no { color: var(--brass); font-family: var(--serif); font-size: 0.95rem; }
.prow-name { font-size: 1.08rem; font-weight: 500; }
.prow-en, .prow-tat { color: var(--muted); text-wrap: pretty; }
.prow.is-feature {
  background: var(--pine-deep);
  color: #f4f0e7;
  padding-left: 0.8rem;
  padding-right: 0.8rem;
  border-bottom-color: var(--pine-deep);
}
.prow.is-feature .prow-no { color: var(--brass-bright); }
.prow.is-feature .prow-en,
.prow.is-feature .prow-tat { color: #d9d3c8; }

.why {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem 2rem;
  border-top: 1px solid var(--ink);
}
.why article { padding-top: 1rem; }
.why h3 { margin-bottom: 0.55rem; }

.cta-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: end;
  border-top: 1px solid var(--ink);
  padding-top: 1.6rem;
}

/* Tables */

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0 1rem 0.55rem 0;
  border-bottom: 1px solid var(--ink);
  vertical-align: bottom;
}
.data-table td {
  padding: 0.95rem 1rem 0.95rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.data-table tr:last-child td { border-bottom-color: var(--line); }
.data-table a { text-underline-offset: 0.18em; }

html[lang="en"] .data-table th {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

/* Registry, notes, pending */

.registry { margin: 0.5rem 0 0; border-top: 1px solid var(--ink); }
.registry div {
  display: grid;
  grid-template-columns: minmax(7.5rem, 14rem) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.registry dt { margin: 0; color: var(--muted); }
.registry dd { margin: 0; }

.note, .warn {
  margin: 1.25rem 0;
  padding: 0.15rem 0 0.15rem 0.95rem;
  border-left: 3px solid var(--brass);
  max-width: 44rem;
}

.pending { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 1px solid var(--ink); }
.pending li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: baseline;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}
.pending b {
  font-weight: 500;
  color: var(--brass);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.sheet {
  border: 1px solid var(--ink);
  background: var(--paper-2);
  padding: 1.25rem 1.3rem 1.15rem;
  max-width: 40rem;
}
.sheet p { margin: 0; }
.sheet .addr {
  margin-top: 0.45rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.45;
}
.sheet-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }

.vendors { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.vendor {
  border: 1px solid var(--line);
  background: var(--paper-2);
  padding: 1rem 1rem 1.1rem;
}
.vendor h3 { margin-bottom: 0.45rem; }
.vendor .addr { margin: 0; }

.subnav {
  display: flex;
  gap: 0.4rem 1.1rem;
  overflow-x: auto;
  padding: 0 0 0.65rem;
  margin: 1.6rem 0 0;
  border-bottom: 1px solid var(--line);
}
.subnav a {
  flex: none;
  text-decoration: none;
  color: var(--muted);
  padding-bottom: 0.35rem;
}
.subnav a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -1px 0 var(--ink);
}

.crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 1.4rem;
}
.crumb a { color: var(--muted); }

.page-intro { padding-top: 2.4rem; }
.stack > * + * { margin-top: 1rem; }
.stack h2 { margin-top: 2.2rem; }

.statline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.4rem 0;
  max-width: 40rem;
}
.statline div { border-top: 1px solid var(--ink); padding-top: 0.6rem; }
.statline b {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  font-weight: 600;
  line-height: 1.35;
}
.statline span { color: var(--muted); font-size: 0.92rem; }

/* Certificates */

.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.2rem; }
.doc {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: #fff;
  border: 1px solid #d7cec1;
  box-shadow: 0 1px 0 rgba(27, 25, 22, 0.04);
  min-height: 100%;
}
.doc img {
  width: 100%;
  height: 280px;
  object-fit: contain;
  object-position: top center;
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(27, 25, 22, 0.04) 28px);
  padding: 0.75rem;
}
.doc-cap { padding: 0.85rem 0.95rem 1rem; border-top: 1px solid var(--line); }
.doc-cap strong { display: block; font-weight: 500; }
.doc-cap span { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 0.2rem; }
.doc-text {
  padding: 1rem 0.95rem 1.1rem;
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(#f7f4ee, #f7f4ee 27px, rgba(27, 25, 22, 0.05) 28px);
  min-height: 180px;
}
.doc-missing {
  border: 1px dashed #b7ad9e;
  background: transparent;
  padding: 1rem;
}

dialog {
  border: 0;
  padding: 0;
  width: min(960px, calc(100vw - 1.5rem));
  max-height: calc(100vh - 1.5rem);
  background: var(--paper-2);
  color: var(--ink);
}
dialog::backdrop { background: rgba(19, 16, 12, 0.72); }
.dialog-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--paper-2);
}
.dialog-scroll { overflow: auto; max-height: calc(100vh - 5.5rem); padding: 0.8rem; background: #e7e1d6; }
.dialog-scroll img { display: block; width: 100%; height: auto; background: white; }

/* Form */

form.enquiry { margin-top: 0.6rem; max-width: 42rem; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem; }
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field.wide { grid-column: 1 / -1; }
.field span { font-size: 0.82rem; color: var(--muted); }
.field input,
.field select,
.field textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 0.55rem 0;
  outline: none;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { border-bottom-width: 2px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; margin-top: 1rem; }
#form-status { min-height: 1.5rem; color: var(--ink-soft); }

/* Footer */

.site-footer {
  border-top: 1px solid var(--ink);
  margin-top: 1rem;
  padding: 2.4rem 0 1.6rem;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.3fr 1.15fr 0.9fr;
  gap: 2rem;
}
.site-footer h2 {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.55rem;
}
html[lang="zh-CN"] .site-footer h2 { letter-spacing: 0.08em; text-transform: none; font-size: 0.86rem; }
.site-footer a { text-underline-offset: 0.16em; }
.site-footer p { margin: 0 0 0.45rem; }
.foot-name {
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.35;
  margin-bottom: 0.4rem;
}
.foot-base {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.8rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

/* 404 uses its own inline CSS when served for unknown URLs. */

@media (max-width: 980px) {
  .hero, .malo-grid, .why, .cta-panel, .vendors, .doc-grid, .foot-grid {
    grid-template-columns: 1fr;
  }
  .facts dl { grid-template-columns: 1fr 1fr; }
  .facts div:nth-child(odd) { padding-left: 0; box-shadow: none; }
  .facts div:nth-child(even) { box-shadow: inset 1px 0 0 var(--line); }
  .facts div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .prow { grid-template-columns: 2.4rem minmax(0, 1fr); }
  .prow-en { grid-column: 2; }
  .prow-tat { grid-column: 2; }
}

@media (max-width: 860px) {
  :root { --header-h: auto; }
  .mast { flex-wrap: wrap; }
  .brand { flex: 1 1 100%; }
  .header-tools { width: 100%; justify-content: space-between; padding-top: 0.15rem; }
  .nav-toggle { display: inline-flex; align-items: center; }
  .site-nav {
    display: none;
    flex-direction: column;
    gap: 0;
    width: var(--wrap);
    margin: 0 auto;
    padding: 0.2rem 0 1.1rem;
    border-top: 0;
    background: transparent;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a {
    font-family: var(--serif);
    font-size: 1.55rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
  }
  .brand strong { font-size: 0.92rem; }
  .brand small { display: none; }
  body.nav-open { overflow: hidden; }
}

@media (max-width: 640px) {
  :root { --wrap: min(1120px, calc(100% - 1.4rem)); }
  .facts dl, .fields, .statline, .registry div, .pending li {
    grid-template-columns: 1fr;
  }
  .facts div, .facts div + div { padding-left: 0; box-shadow: none; border-top: 1px solid var(--line); }
  .facts div:first-child { border-top: 0; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
  .data-table td { border: 0; padding: 0.28rem 0; }
  .data-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
  }
  .doc img { height: 220px; }
  .hero { padding-top: 1.8rem; }
  .section { padding: 3rem 0; }
  .band .wrap { padding: 3rem 0; }
  .tats b { font-size: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  .site-header, .site-footer, .actions, .nav-toggle, .subnav, .no-print { display: none !important; }
  body { background: white; color: black; }
  .band { background: white; color: black; }
  .band .lede, .band .rule, .tats span, .points li::before { color: black; }
  .prow.is-feature { background: white; color: black; }
  a { text-decoration: none; }
  .sheet { break-inside: avoid; }
}