/* Dora light design system — tokens, base and shared components.
   Design authority: dora/docs/designs/website-redesign/README.md */

@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F7F1E8;
  --surface: #FFFDF8;
  --ink: #2B2118;
  --ink-2: #6B5A4B;
  --ink-3: #8C7967;
  --accent: #8A5A3B;
  --line: rgba(43, 33, 24, 0.10);
  --shadow: 0 24px 48px rgba(138, 90, 59, 0.16);

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  --s-7: 40px; --s-8: 48px; --s-9: 64px; --s-10: 80px; --s-11: 96px;

  --t-xs: 12px; --t-sm: 14px; --t-base: 16px; --t-lg: 18px; --t-2xl: 24px;
  --t-3xl: 30px; --t-4xl: 36px; --t-5xl: 48px; --t-6xl: 60px;

  --r-md: 12px; --r-lg: 16px; --r-2xl: 24px; --r-full: 9999px;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --z-nav: 20; --z-skip: 40; --z-consent: 30;

  --font: "Manrope", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p, dl, dd, figure, ol, ul { margin: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; }

html[data-lang="zh"] .lang-en, html[data-lang="en"] .lang-zh { display: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-md); }

.skip {
  position: absolute; left: var(--s-4); top: -64px; z-index: var(--z-skip);
  background: var(--ink); color: var(--surface); text-decoration: none;
  padding: var(--s-2) var(--s-3); border-radius: var(--r-md);
  transition: top 300ms var(--ease);
}
.skip:focus { top: var(--s-4); }

.wrap { max-width: 1200px; margin: 0 auto; }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-size: var(--t-sm); line-height: 20px; font-weight: 600; color: var(--accent);
  margin-bottom: var(--s-5);
}
.eyebrow::before { content: ""; width: 24px; height: 1px; background: currentColor; }

h2 { font-size: var(--t-4xl); line-height: 1.35; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
h3 { font-size: var(--t-2xl); line-height: 1.4; font-weight: 700; margin-bottom: var(--s-3); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font: inherit; font-size: var(--t-base); line-height: 24px; font-weight: 600; white-space: nowrap;
  padding: var(--s-3) var(--s-5); border: 0; border-radius: var(--r-full);
  text-decoration: none; cursor: pointer;
  transition: background 300ms var(--ease), color 300ms var(--ease), transform 300ms var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--ink); color: var(--surface); box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--accent); transform: translateY(-1px); }
.btn-text { color: var(--ink); padding-left: var(--s-2); padding-right: var(--s-2); }
.btn-text:hover { color: var(--accent); }
.btn:active { transform: scale(0.98); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); }

/* Floating island nav */
.nav {
  position: fixed; top: var(--s-5); left: 50%; transform: translateX(-50%); z-index: var(--z-nav);
  display: flex; align-items: center; gap: var(--s-5);
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-5);
  font-size: var(--t-sm); line-height: 20px; white-space: nowrap;
  background: rgba(255, 253, 248, 0.76);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--line); border-radius: var(--r-full);
}
.nav .brand { display: flex; align-items: center; gap: var(--s-2); font-weight: 700; text-decoration: none; }
.nav .brand img { width: 24px; height: 24px; }
.nav ul { display: flex; gap: var(--s-5); list-style: none; padding: 0; }
.nav ul a { color: var(--ink-2); text-decoration: none; transition: color 300ms var(--ease); }
.nav ul a:hover, .nav ul a[aria-current="page"] { color: var(--ink); }
.nav ul a[aria-current="page"] { font-weight: 600; }
.nav .lang-toggle {
  font: inherit; font-weight: 600; color: var(--ink-2); background: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-full); padding: var(--s-1) var(--s-3);
  transition: color 300ms var(--ease), border-color 300ms var(--ease);
}
.nav .lang-toggle:hover { color: var(--ink); border-color: var(--ink-3); }
.nav .cta {
  background: var(--ink); color: var(--surface); font-weight: 600; text-decoration: none;
  padding: var(--s-2) var(--s-4); border-radius: var(--r-full);
  transition: background 300ms var(--ease), transform 300ms var(--ease);
}
.nav .cta:hover { background: var(--accent); }
.nav .cta:active { transform: scale(0.98); }

/* Footer */
.footer { padding: var(--s-9) var(--s-6) var(--s-6); border-top: 1px solid var(--line); font-size: var(--t-sm); line-height: 20px; color: var(--ink-3); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: var(--s-8) var(--s-6); }
.foot-brand .brand { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 700; color: var(--ink); text-decoration: none; margin-bottom: var(--s-3); }
.foot-brand .brand img { width: 24px; height: 24px; }
.foot-brand p { margin-bottom: var(--s-3); }
.foot-col { display: grid; gap: var(--s-2); align-content: start; }
.foot-col h4 { margin: 0 0 var(--s-1); font-size: var(--t-sm); line-height: 20px; color: var(--ink); }
.footer a { color: var(--ink-2); text-decoration: none; transition: color 300ms var(--ease); }
.footer a:hover { color: var(--ink); }
.footer .beian { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); }
.footer .beian a { display: inline-flex; align-items: center; gap: var(--s-1); color: var(--ink-3); }
.footer .beian img { height: 14px; width: auto; }

/* Cookie consent */
.consent {
  position: fixed; left: 50%; bottom: var(--s-5); z-index: var(--z-consent);
  width: min(560px, calc(100% - var(--s-6)));
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4);
  padding: var(--s-4) var(--s-5); font-size: var(--t-sm); line-height: 20px; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2xl); box-shadow: var(--shadow);
  opacity: 0; transform: translate(-50%, 24px); pointer-events: none;
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}
.consent.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.consent p { flex: 1 1 260px; }
.consent .consent-actions { display: flex; gap: var(--s-2); }
.consent button {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: var(--r-full);
  padding: var(--s-2) var(--s-4); border: 1px solid var(--line); background: none; color: var(--ink);
  transition: background 300ms var(--ease), color 300ms var(--ease);
}
.consent button.accept { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.consent button:hover { border-color: var(--ink-3); }

/* Scroll reveal */
.js .reveal { opacity: 0; transform: translateY(40px); filter: blur(8px); transition: opacity 900ms var(--ease-out), transform 1000ms var(--ease-out), filter 900ms var(--ease-out); transition-delay: var(--d, 0ms); }
.js .reveal.seen { opacity: 1; transform: none; filter: none; }

@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }

@media (max-width: 900px) {
  .nav ul { display: none; }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
  h2 { font-size: var(--t-3xl); }
}
@media (max-width: 480px) {
  h2 { font-size: var(--t-2xl); }
  h3 { font-size: 20px; }
  .nav { gap: var(--s-3); padding-left: var(--s-4); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; filter: none; }
}

/* Brand mark: the product name is set as a soft tinted label (accent-colored
   text on a light accent wash), never a dark outlined box. In Chinese a black
   rectangle around a name reads as an obituary. */
b.brand, .brand-mark { display: inline-block; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); padding: 0 0.32em; border-radius: 0.3em; line-height: 1.4; vertical-align: 0.02em; }
.door h2 b.brand { background: none; padding: 0; color: var(--accent); }
h1 b.brand { background: none; padding: 0; color: var(--accent); }

/* Shared page components (home, about and later pages) */
.section { padding: var(--s-11) var(--s-6); }
.section.surface { background: var(--surface); }
.sec-head { margin-bottom: var(--s-9); }
.lede { font-size: var(--t-lg); line-height: 1.8; color: var(--ink-2); max-width: 560px; text-wrap: pretty; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-10); align-items: center; }
.split.flip > figure { order: 2; }
.split figure { margin: 0; border-radius: var(--r-2xl); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 3 / 2; }
.split figure img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1600ms var(--ease-out); }
.split.seen figure img, .split figure.seen img { transform: scale(1); }
.split p { color: var(--ink-2); text-wrap: pretty; }
.split h2 { margin-bottom: var(--s-4); }
.split .actions { margin-top: var(--s-6); }

.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-4); list-style: none; padding: 0; }
.chips li { font-size: var(--t-sm); line-height: 20px; padding: var(--s-1) var(--s-3); border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.note { font-size: var(--t-sm); line-height: 20px; color: var(--ink-3); margin-top: var(--s-3); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s-5); }
.card { padding: var(--s-6); border-radius: var(--r-2xl); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--s-3); }
.card .tag { font-size: var(--t-xs); line-height: 16px; font-weight: 600; color: var(--accent); }
.card h3 { margin: 0; }
.card p { color: var(--ink-2); flex: 1; }
.card a { color: var(--ink); font-weight: 600; text-decoration: none; transition: color 300ms var(--ease); }
.card a:hover { color: var(--accent); }

.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--s-3) var(--s-6); }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }

/* Product theme: Suanliqiao keeps its own terracotta accent */
.theme-slq { --accent: #A44B21; }
.theme-slq .btn-primary { background: #A44B21; }
.theme-slq .btn-primary:hover { background: #8A3D1A; }

@media (max-width: 900px) {
  .section { padding: var(--s-10) var(--s-6); }
  .split { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
  .split.flip > figure { order: 0; }
}
@media (max-width: 480px) {
  .section { padding-left: var(--s-5); padding-right: var(--s-5); }
  .lede { font-size: var(--t-base); }
  .facts { grid-template-columns: minmax(0, 1fr); gap: var(--s-1); }
  .facts dd { margin-bottom: var(--s-3); }
}
@media (prefers-reduced-motion: reduce) { .split figure img { transform: none; } }

/* Home: two product doors */
.doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6); }
.door { display: grid; grid-template-rows: auto 1fr; border-radius: var(--r-2xl); overflow: hidden; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit; transition: transform 500ms var(--ease), box-shadow 500ms var(--ease); }
.door:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.door figure { margin: 0; aspect-ratio: 16 / 9; overflow: hidden; }
.door figure img { width: 100%; height: 100%; object-fit: cover; transition: transform 1200ms var(--ease-out); }
.door:hover figure img { transform: scale(1.04); }
.door .body { padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-3); }
.door .tag { font-size: var(--t-xs); line-height: 16px; font-weight: 600; color: var(--accent); }
.door h2 { font-size: var(--t-3xl); line-height: 1.25; display: flex; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; }
.door h2 .lang-zh, .door h2 .lang-en { display: inline-flex; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; }
html[data-lang="zh"] .door h2 .lang-en, html[data-lang="en"] .door h2 .lang-zh { display: none; }
.door h2 .sub { font-size: var(--t-base); line-height: 24px; font-weight: 500; color: var(--ink-3); }
.door p { color: var(--ink-2); flex: 1; }
.door .go { font-weight: 600; color: var(--ink); transition: color 300ms var(--ease); }
.door:hover .go { color: var(--accent); }
.door.theme-slq .go:hover, .door.theme-slq:hover .go { color: #A44B21; }
@media (max-width: 900px) { .doors { grid-template-columns: minmax(0, 1fr); } .door h2 { font-size: var(--t-2xl); } }

/* Code sample */
.code { margin: 0; padding: var(--s-5) var(--s-6); border-radius: var(--r-lg); background: #2B2118; color: #F7F1E8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--t-sm); line-height: 1.7; overflow-x: auto; white-space: pre; }
.code .k { color: #F2B78C; }
