/* ==========================================================================
   base.css — Reset / 变量 / 排版 / 工具类 / reveal / btn
   JEVYX 品牌展示站 · 轻奢克制 / 大留白 / 杂志感
   ========================================================================== */

/* ---------- 1. Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* 多页站点视图过渡（Chrome 126+ 原生支持，其余浏览器自动忽略、无副作用） */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: jvVtOut .28s ease both; }
  ::view-transition-new(root) { animation: jvVtIn .42s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes jvVtOut { to { opacity: 0; } }
  @keyframes jvVtIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd,
ul, ol {
  margin: 0;
  padding: 0;
}
ul, ol {
  list-style: none;
}
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}
a {
  color: inherit;
  text-decoration: none;
}
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  background: none;
  cursor: pointer;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}
strong, b {
  font-weight: 600;
}
::selection {
  background: var(--c-accent);
  color: #fff;
}

/* ---------- 2. CSS 变量（契约第3节 + 辅助变量） ---------- */
:root {
  --c-primary: #1A1A1A;   /* 墨黑主色 */
  --c-accent: #C6A87C;    /* 香槟金点缀 */
  --c-ink: #2A2926;       /* 正文墨色 */
  --c-paper: #F8F6F1;     /* 暖宣纸底色 */
  --c-line: rgba(26, 26, 26, .12); /* 细线 */
  --maxw: 1440px;         /* 内容最大宽度 */
  --sp: 8px;              /* 基础间距单位 */

  --c-muted: #8A867E;
  --c-dark: #141414;
  --font-sans: "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", "HarmonyOS Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Playfair Display", "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --header-h: 64px;
}

/* ---------- 3. 基础排版 ---------- */
html {
  font-size: 16px;
}
body {
  font-family: var(--font-sans);
  color: var(--c-ink);
  background: var(--c-paper);
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1, h2, h3, h4 {
  font-weight: 400;
  line-height: 1.3;
  color: var(--c-primary);
}
h1 { font-size: clamp(2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.75rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); }
p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }
small { font-size: .78rem; }

/* ---------- 4. 布局容器 / 区块 / 栅格 ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 64px);
}
.container--fluid {
  max-width: none;
}
.section {
  padding-block: clamp(80px, 10vw, 140px);
}
.section--tight {
  padding-block: clamp(48px, 6vw, 80px);
}
.grid { display: grid; gap: clamp(16px, 2.5vw, 32px); }
.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)); }

/* ---------- 5. 工具类 ---------- */
.u-center { text-align: center; }
.u-hidden { display: none !important; }
.u-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.u-eyebrow {
  font-size: .72rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--c-accent);
}
.u-line {
  width: 48px; height: 1px; background: var(--c-accent); margin: 24px auto;
}
.u-serif { font-family: var(--font-serif); }

/* ---------- 6. 入场动画 .reveal / .is-visible ----------
   渐进增强：仅当 <html class="js"> 时初始隐藏，JS 未就绪时内容照常可见 */
.reveal {
  transition:
    opacity .8s var(--ease-out),
    transform .8s var(--ease-out);
  transition-delay: var(--delay, 0s);
  will-change: opacity, transform;
}
.js .reveal:not(.is-visible) {
  opacity: 0;
  transform: translateY(30px);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 7. 按钮 .btn 系列 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: 48px;
  padding: 13px 34px;
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--c-primary);
  cursor: pointer;
  transition: background .35s var(--ease-out), color .35s var(--ease-out),
              border-color .35s var(--ease-out), transform .35s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }
.btn--primary {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}
.btn--primary:hover {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #fff;
}
.btn--ghost {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}
.btn--ghost:hover {
  background: currentColor;
  color: var(--c-paper);
}
.btn--sm {
  min-height: 36px;
  padding: 8px 18px;
  font-size: .7rem;
}

/* ---------- 8. 响应式栅格降级 ---------- */
@media (max-width: 1023px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 9. 全局尊重 prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}
