/* === Hallmark Floor rules === */

/* 1. Token-only colours and fonts (no literal colours past this block) */
/* All colours and fonts are declared in tokens.css above */

/* 2. No transition: all; no animating width/height/top/left */
/* Only transform and opacity are animated */

/* 3. No italic word in roman heading */
/* Chinese text: no italic at all */

/* 4. overflow-x: clip on html and body */
html, body {
  overflow-x: clip;
  margin: 0;
  padding: 0;
}

/* 5. minmax(0, 1fr) on image-bearing grid tracks */
.grid-images > * {
  min-width: 0;
}

/* 6. :focus-visible on every interactive element */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* 7. prefers-reduced-motion fallback */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 8. Never invent metrics, testimonials, logo walls, case-study counts */
/* All numbers on this page are real, sourced from company records */

/* 9. No eyebrow, no tracked capitals, no small caps */
/* Labels are body face, one step smaller, sentence case, untracked */

/* 10. No middle-dot meta strings, no arrows glued to links, no decorative status dots */

/* 11. No purple-to-blue gradient, no card-in-card, no emoji as icon */

/* 12. Hero visible at 1280x800 without scrolling */

/* 13. ~80 words per screen max */

/* 14. Container capped and centred */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* 15. Hallmark stamp (this comment block) */

/* === Base reset === */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  /* Vantage survey grid: hairline graph-paper over blue-black ground */
  background-color: var(--color-paper);
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -10%, oklch(30% 0.05 240 / 0.35), transparent 60%),
    linear-gradient(oklch(50% 0.03 240 / 0.055) 1px, transparent 1px),
    linear-gradient(90deg, oklch(50% 0.03 240 / 0.055) 1px, transparent 1px),
    linear-gradient(oklch(50% 0.03 240 / 0.03) 1px, transparent 1px),
    linear-gradient(90deg, oklch(50% 0.03 240 / 0.03) 1px, transparent 1px);
  background-size:
    100% 100%,
    160px 160px,
    160px 160px,
    32px 32px,
    32px 32px;
  background-attachment: fixed;
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: var(--body-weight);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 浅色主题：网格线改浅、去掉深色顶部光晕 */
html[data-theme="light"] body {
  background-image:
    linear-gradient(oklch(70% 0.02 240 / 0.10) 1px, transparent 1px),
    linear-gradient(90deg, oklch(70% 0.02 240 / 0.10) 1px, transparent 1px),
    linear-gradient(oklch(70% 0.02 240 / 0.05) 1px, transparent 1px),
    linear-gradient(90deg, oklch(70% 0.02 240 / 0.05) 1px, transparent 1px);
  background-size:
    160px 160px,
    160px 160px,
    32px 32px,
    32px 32px;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--tracking-display);
  line-height: 1.15;
  margin: 0;
  overflow-wrap: break-word;
  min-width: 0;
  text-wrap: balance;
}

h1 {
  font-size: var(--text-display);
  max-width: 20ch;
}

h2 {
  font-size: var(--text-section);
  max-width: 30ch;
}

h3 {
  font-size: var(--text-title);
  max-width: 40ch;
}

p {
  margin: 0;
  max-width: 65ch;
  text-wrap: pretty;
}

.lead {
  font-size: var(--text-lead);
  color: var(--color-ink-2);
  line-height: 1.6;
}

small, figcaption, th, .label {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* === Links === */
a {
  color: var(--color-ink);
  text-decoration: none;
  transition: color var(--dur-short) var(--ease-out);
}

a:hover {
  color: var(--color-accent);
}

/* === Abbreviations === */
abbr[title] {
  text-decoration: none;
  cursor: help;
}

/* === Images === */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* === Focus ring === */
:focus {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* === Selection === */
::selection {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}

/* === Utility: corner ticks (Vantage signature) === */
.ticks {
  position: relative;
}
.ticks::before,
.ticks::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: var(--rule-hair) solid var(--color-rule-2);
  -webkit-mask: conic-gradient(at var(--tick) var(--tick), transparent 75%, var(--color-ink) 0) 0 0 / calc(100% - var(--tick)) calc(100% - var(--tick));
  mask: conic-gradient(at var(--tick) var(--tick), transparent 75%, var(--color-ink) 0) 0 0 / calc(100% - var(--tick)) calc(100% - var(--tick));
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--space-lg);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font: 400 var(--text-md)/1 var(--font-body);
  cursor: pointer;
  transition: background var(--dur-short) var(--ease-out);
}

.btn:hover {
  background: var(--color-accent-hi);
}

.btn--line {
  background: transparent;
  color: var(--color-ink);
  box-shadow: inset 0 0 0 var(--rule-hair) var(--color-rule-2);
}

.btn--line:hover {
  box-shadow: inset 0 0 0 var(--rule-hair) var(--color-accent);
  color: var(--color-accent);
}

/* === Numbers (tabular) === */
.num {
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}
.num .u {
  color: var(--color-muted);
  font-size: 0.75em;
}

/* === Slot (placeholder) === */
.slot {
  background: var(--color-slot);
  border: var(--rule-hair) dashed var(--color-rule-2);
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: var(--text-sm);
  min-height: 200px;
}

/* === Hairline separator === */
.hairline {
  border: 0;
  border-top: var(--rule-hair) solid var(--color-rule);
  margin: 0;
}

/* === Grid helpers === */
.grid {
  display: grid;
  gap: var(--gap-columns);
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* === Responsive === */
@media (max-width: 960px) {
  :root {
    --gutter: 24px;
    --text-display: 3rem;
    --text-section: 2.25rem;
  }
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
    --text-display: 2.25rem;
    --text-section: 1.75rem;
    --text-title: 1.25rem;
  }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* === Language switch (中 / EN) === */
.lang-switch {
  display: inline-flex;
  align-items: center;
  flex: none;
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-pill);
  padding: 2px;
  line-height: 1;
}
.lang-btn {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  color: var(--color-muted);
  font-family: inherit;
  font-size: var(--text-sm);
  line-height: 1;
  padding: 5px 9px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out);
}
.lang-btn:hover { color: var(--color-ink); }
.lang-btn.active {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}
.lang-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
.lang-sep {
  color: var(--color-rule-2);
  font-size: var(--text-sm);
  user-select: none;
}

/* === Theme toggle === */
.theme-toggle {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  padding: 0;
}
.theme-toggle:hover { color: var(--color-ink); border-color: var(--color-rule-2); }
.theme-toggle:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.theme-toggle svg { width: 17px; height: 17px; }
/* 深色显示太阳（点它变浅色），浅色显示月亮 */
.theme-toggle .ic-moon { display: none; }
.theme-toggle .ic-sun { display: block; }
html[data-theme="light"] .theme-toggle .ic-sun { display: none; }
html[data-theme="light"] .theme-toggle .ic-moon { display: block; }

.nav-cta { display: flex; align-items: center; gap: var(--space-sm); }

@media (max-width: 960px) {
  .nav-cta { margin-left: auto; }
}
@media (max-width: 640px) {
  .lang-btn { padding: 4px 7px; font-size: 12px; }
  .theme-toggle { width: 30px; height: 30px; }
}

/* 英文文案普遍比中文长，收紧大标题避免首屏被撑爆 */
html[lang="en"] h1 {
  font-size: var(--text-display-s);
  max-width: 24ch;
  line-height: 1.1;
}
@media (max-width: 960px) {
  html[lang="en"] h1 { font-size: 2.5rem; }
}
@media (max-width: 640px) {
  html[lang="en"] h1 { font-size: 2rem; }
}
