/* ============================================================
   BRUCE — official site
   base.css : tokens, type system, grid, primitives
   Single typeface: Times New Roman. Paper, ink, one green.
   ============================================================ */

:root {
  /* ---- paper & ink ------------------------------------------------ */
  --paper:        #f1efe9;
  --paper-raise:  #f8f6f1;
  --paper-deep:   #e7e3d9;
  --paper-warm:   #ece7dc;

  --ink:          #17160f;
  --ink-90:       rgba(23, 22, 15, 0.90);
  --ink-70:       rgba(23, 22, 15, 0.70);
  --ink-52:       rgba(23, 22, 15, 0.52);
  --ink-38:       rgba(23, 22, 15, 0.38);
  --ink-24:       rgba(23, 22, 15, 0.24);

  --rule:         rgba(23, 22, 15, 0.14);
  --rule-strong:  rgba(23, 22, 15, 0.34);

  /* ---- the one accent --------------------------------------------- */
  --green:        #4d7a52;
  --green-deep:   #2f5138;
  --green-wash:   rgba(77, 122, 82, 0.12);

  /* ---- night plate (privacy section) ------------------------------ */
  --night:        #15140f;
  --night-raise:  #1d1c16;
  --night-ink:    #ece8dd;
  --night-ink-70: rgba(236, 232, 221, 0.70);
  --night-ink-45: rgba(236, 232, 221, 0.45);
  --night-rule:   rgba(236, 232, 221, 0.16);
  --night-green:  #8fb894;

  /* ---- type ------------------------------------------------------- */
  --serif: "Times New Roman", Times, "Songti SC", "Noto Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;

  --t-display: clamp(3.6rem, 11.6vw, 11.5rem);
  --t-h2:      clamp(2.1rem, 5.6vw, 4.4rem);
  --t-h3:      clamp(1.45rem, 2.4vw, 2.05rem);
  --t-lede:    clamp(1.08rem, 1.55vw, 1.42rem);
  --t-body:    clamp(0.98rem, 1.02vw, 1.09rem);
  --t-small:   clamp(0.78rem, 0.86vw, 0.86rem);
  --t-micro:   0.6875rem;

  /* ---- space ------------------------------------------------------ */
  --gutter: clamp(20px, 5.2vw, 92px);
  --gap:    clamp(14px, 2vw, 28px);
  --section: clamp(84px, 12.5vh, 178px);
  --hairline: 1px;

  /* ---- motion ----------------------------------------------------- */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 720ms;
}

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

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--t-body);
  line-height: 1.58;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

::selection {
  background: var(--green);
  color: var(--paper-raise);
}

:focus-visible {
  outline: 1px solid var(--green-deep);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------- shell */
.shell {
  width: 100%;
  padding-inline: var(--gutter);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
}

/* ---------------------------------------------------------------- type */
.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--t-display);
  line-height: 0.86;
  letter-spacing: -0.038em;
  margin: 0;
  text-wrap: balance;
}

.h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--t-h2);
  line-height: 0.96;
  letter-spacing: -0.028em;
  margin: 0;
  text-wrap: balance;
}

.h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--t-h3);
  line-height: 1.12;
  letter-spacing: -0.014em;
  margin: 0;
  text-wrap: pretty;
}

em, .it { font-style: italic; }

.lede {
  font-size: var(--t-lede);
  line-height: 1.46;
  letter-spacing: -0.008em;
  color: var(--ink-90);
  max-width: 34ch;
  margin: 0;
  text-wrap: pretty;
}

.body-copy {
  max-width: 52ch;
  color: var(--ink-70);
  text-wrap: pretty;
}

.body-copy + .body-copy { margin-top: 0.9em; }

/* small caps labels — letterspaced Times, the editorial tic */
.label {
  font-family: var(--serif);
  font-size: var(--t-micro);
  letter-spacing: 0.24em;
  text-transform: none;
  color: var(--ink-52);
  font-variant-numeric: lining-nums;
}

.label--ink { color: var(--ink); }
.label--night { color: var(--night-ink-45); }

.num {
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1;
}

.rule {
  height: var(--hairline);
  background: var(--rule);
  border: 0;
  margin: 0;
}

/* ---------------------------------------------------------------- links */
.link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5em;
  font-size: var(--t-body);
  color: var(--ink);
  padding-bottom: 2px;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 520ms var(--ease), color 240ms var(--ease);
}

.link:hover { background-size: 0% 1px; color: var(--green-deep); }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.85em;
  font-size: var(--t-lede);
  letter-spacing: -0.01em;
  padding: 0.62em 1.15em 0.66em;
  border: var(--hairline) solid var(--ink);
  color: var(--ink);
  background: transparent;
  transition: background-color 340ms var(--ease), color 340ms var(--ease);
}

.cta:hover {
  background: var(--ink);
  color: var(--paper);
}

.cta__arrow {
  display: inline-block;
  transition: transform 460ms var(--ease-out);
}

.cta:hover .cta__arrow { transform: translateX(4px); }

/* ---------------------------------------------------------------- reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 900ms var(--ease-out), transform 1100ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------------------------------------------------------------- a11y */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--t-small);
  transform: translateY(-160%);
  transition: transform 200ms var(--ease);
}

.skip-link:focus { transform: none; }

/* ================================================================
   CJK TYPOGRAPHY — 中文主语言
   西文排 Times New Roman，汉字回落宋体；强调用字重，不用斜体。
   ================================================================ */
:root {
  --serif: "Times New Roman", "Songti SC", "STSong", "Noto Serif CJK SC", "Noto Serif SC", serif;

  --t-display: clamp(2.35rem, 8.1vw, 8rem);
  --t-h2:      clamp(1.65rem, 4.05vw, 3.35rem);
  --t-h3:      clamp(1.12rem, 1.75vw, 1.5rem);
  --t-lede:    clamp(1rem, 1.28vw, 1.18rem);
  --t-body:    clamp(0.95rem, 0.99vw, 1.02rem);
  --t-small:   clamp(0.8rem, 0.86vw, 0.87rem);
  --t-micro:   0.7rem;
}

body {
  line-height: 1.85;
  letter-spacing: 0.012em;
}

/* 中文大标题：行高不能用拉丁的 0.86，字距也不能为负 */
.display,
.h2,
.h3 { letter-spacing: 0.008em; }

.display { line-height: 1.07; }
.h2 { line-height: 1.18; }
.h3 { line-height: 1.45; }

/* 强调：宋体真粗体，替代英文的斜体 */
.hl {
  font-weight: 700;
  letter-spacing: 0.004em;
}

.lede {
  line-height: 1.82;
  max-width: 24em;
}

.body-copy {
  max-width: 31em;
  line-height: 1.85;
}

.label {
  letter-spacing: 0.3em;
  font-size: 0.7rem;
}

/* 拉丁字串里的斜体（路径、代码）仍保留 */
em {
  font-style: italic;
  letter-spacing: 0.01em;
}
