/*
 * Official-site theme and accessibility layer.
 * Loaded after page-specific styles so light/dark tokens and permanent dark
 * surfaces cannot accidentally inherit low-contrast colours from another page.
 */
:root {
  color-scheme: light;
  --bg: #f3f0e9;
  --surface: #fcfaf6;
  --ink: #15141a;
  --muted: #5f5966;
  --line: #cfc5b5;
  --gold: #7a5622;
  --gold-light: #a3722c;
  --v2-ink: #17151d;
  --v2-muted: #5f5966;
  --v2-line: #cfc5b5;
  --v2-gold: #7a5622;
  --v2-surface: #fffdf8;
  --case-bg: #f3f0e9;
  --case-ink: #17151a;
  --case-muted: #5f5966;
  --case-line: #cfc5b5;
  --case-gold: #7a5622;
  --case-surface: #fcfaf6;
  --brand-gold: #7a5622;
  --brand-gold-light: #a3722c;
  --focus-ring: #8a5d20;
  --on-dark-ink: #f8f6fa;
  --on-dark-muted: #cbc5d0;
  --on-dark-accent: #e2c58d;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0d;
  --surface: #15151b;
  --ink: #f7f5f0;
  --muted: #c0bdc6;
  --line: rgba(255, 255, 255, .2);
  --gold: #e0c183;
  --gold-light: #f0d79e;
  --v2-ink: #f7f5f0;
  --v2-muted: #c8c4cd;
  --v2-line: rgba(255, 255, 255, .2);
  --v2-gold: #e0c183;
  --v2-surface: #17151d;
  --case-bg: #0a0a0d;
  --case-ink: #f7f5f0;
  --case-muted: #c8c4cd;
  --case-line: rgba(255, 255, 255, .2);
  --case-gold: #e0c183;
  --case-surface: #15151b;
  --brand-gold: #e0c183;
  --brand-gold-light: #f0d79e;
  --focus-ring: #f0d79e;
}

html,
body {
  background: var(--bg);
  color: var(--ink);
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

::selection {
  color: #17120b;
  background: #efd49d;
}

[id] {
  scroll-margin-top: 88px;
}

/* Header and brand contrast */
.v2-header .v2-brand.brand-lockup {
  color: var(--v2-ink);
}

.hero-brand-lockup,
.dev-mark span {
  color: var(--gold);
}

.v2-nav a {
  font-size: 13px;
}

.v2-theme,
.v2-menu,
.case-actions button,
.theme-toggle {
  min-height: 38px;
  font-size: 12px;
}

/* Small but meaningful labels must not become decorative microcopy. */
.v2-kicker,
.case-kicker,
.case-overview span,
.case-section .eyebrow,
.flow-list b,
.v2-art-card small,
.service-index,
.price-card > p,
.why-grid b,
.case-copy > p,
.case-copy li,
.case-copy small {
  font-size: 11px;
}

.v2-section-head > p,
.service-card p,
.why-grid p,
.faq-item p,
.process-list p,
.tech-list span,
.case-copy > span {
  font-size: 14px;
}

.case-copy small {
  color: #cbc4d0;
}

/* A dark block stays readable even while the page is in light mode. */
.v2-section.dark,
.v2-contact,
.v2-rail,
.v2-bottom-cta,
.v2-footer.brand-footer {
  --gold: var(--on-dark-accent);
  --muted: var(--on-dark-muted);
  --v2-ink: var(--on-dark-ink);
  --v2-muted: var(--on-dark-muted);
  --v2-gold: var(--on-dark-accent);
}

.v2-section.dark .v2-section-head > p,
.v2-contact-copy > p:not(.v2-kicker) {
  color: var(--on-dark-muted);
}

.v2-footer.brand-footer .v2-brand.brand-lockup {
  color: var(--on-dark-ink);
}

.v2-footer.brand-footer .footer-brand-copy p,
.v2-footer.brand-footer .footer-legal small,
.v2-footer.brand-footer .footer-legal a {
  color: var(--on-dark-muted);
}

.v2-footer.brand-footer .footer-links a,
.v2-footer.brand-footer .footer-links .wechat-trigger {
  color: #ded7e2;
}

.v2-rail .wechat-trigger,
.v2-bottom-cta .wechat-trigger {
  color: var(--on-dark-ink);
}

/* Contact form: labels, placeholders and native select UI are always readable. */
.v2-contact {
  color-scheme: dark;
}

.v2-contact label {
  color: #eee8f1;
  font-size: 12px;
  font-weight: 600;
}

.v2-contact input,
.v2-contact select,
.v2-contact textarea {
  color: #fff;
  font-size: 14px;
}

.v2-contact input::placeholder,
.v2-contact textarea::placeholder {
  color: #d8d0dd;
  opacity: 1;
}

.v2-contact select option {
  color: #17151d;
  background: #fff;
}

.v2-contact label:focus-within {
  border-color: #e7c98f;
  background: rgba(255, 255, 255, .09);
}

.v2-contact :is(input, select, textarea):invalid:focus {
  box-shadow: inset 0 -2px 0 #ffb3ba;
}

.v2-contact form button:disabled {
  cursor: wait;
  opacity: .72;
}

/* Keep the refreshed child-page mark in the same visual system as the homepage. */
.case-brand .case-brand-mark {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: contain;
}

.case-brand > span {
  display: inline;
  width: auto;
  height: auto;
  border: 0;
  color: inherit;
  font-size: inherit;
}

@media (max-width: 900px) {
  .v2-bottom-cta {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .v2-contact {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
}

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

.v2-contact .form-field-hint {
  display: block;
  margin-top: 7px;
  color: #d6cfdb;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.header .brand .brand-mark,
footer .brand .brand-mark {
  grid-row: span 2;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: contain;
}

.v2-menu[aria-expanded="true"] {
  color: var(--v2-ink);
  border-color: var(--gold);
}

.v2-footer.brand-footer {
  --brand-gold: var(--on-dark-accent);
  --brand-gold-light: #f0d79e;
}
