/* ============================================================
   merajinx.com — base styles
   Design tokens + reset + shared typography/layout.
   All pages pull from these tokens; per-page tweaks override
   the CSS variables, never hardcode colors.
   ============================================================ */

/* ---- Design tokens ---------------------------------------- */
:root {
  /* palette — warm "paper + ink" neutral, 东方留白 */
  --paper:        #f4f1ea;   /* background */
  --paper-soft:   #ece7dc;   /* cards / panels */
  --ink:          #1c1a17;   /* primary text */
  --ink-soft:     #4a463f;   /* secondary text */
  --ink-faint:    #8c867a;   /* hints / meta */
  --line:         #d9d3c6;   /* hairlines / borders */
  --accent:       #8a5a3b;   /* warm clay accent */
  --accent-ink:   #ffffff;   /* text on accent */

  /* type */
  --font-serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", serif;
  --font-sans:  "Noto Sans SC", "PingFang SC", -apple-system, "Helvetica Neue", system-ui, sans-serif;

  /* scale */
  --step--1: clamp(0.83rem, 0.8rem + 0.2vw, 0.94rem);
  --step-0:  clamp(1rem, 0.95rem + 0.3vw, 1.13rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.6vw, 1.5rem);
  --step-2:  clamp(1.6rem, 1.4rem + 1.2vw, 2.4rem);
  --step-3:  clamp(2.2rem, 1.8rem + 2.4vw, 3.8rem);

  /* spacing & layout */
  --space:    1rem;
  --gap:      clamp(1.5rem, 1rem + 2vw, 3rem);
  --maxw:     64rem;
  --radius:   10px;
  --ease:     cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Reset ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; line-height: 1.25; margin: 0; }
p { margin: 0; }

/* ---- Layout primitives ------------------------------------ */
.wrap { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }
.stack > * + * { margin-top: var(--space); }

/* ---- Shared bits ------------------------------------------ */
.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--step--1);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.link-underline {
  border-bottom: 1px solid var(--line);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.link-underline:hover { border-color: var(--accent); color: var(--accent); }

.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  padding: 0.7em 1.4em;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.25s var(--ease);
}
.btn:hover { transform: translateY(-2px); background: var(--accent); border-color: var(--accent); }

/* small footer used across pages */
.site-foot {
  border-top: 1px solid var(--line);
  margin-top: var(--gap);
  padding-block: 1.5rem;
  color: var(--ink-faint);
  font-size: var(--step--1);
}

/* ---- Team gate (used by /team pages) ---------------------- */
html:not(.gate-ok) [data-protected] { display: none; }

#gate-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  background: var(--paper);
  padding: var(--space);
}
#gate-form { width: min(100%, 22rem); text-align: center; }
#gate-form h1 { font-size: var(--step-2); margin-block: 0.45em 0.3em; }
#gate-form .gate-hint { color: var(--ink-soft); font-size: var(--step--1); margin-bottom: 1.4rem; }
#gate-input {
  width: 100%; font: inherit; padding: 0.7em 0.9em;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper-soft); color: var(--ink); margin-bottom: 0.9rem;
}
#gate-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
#gate-form .btn { width: 100%; }
.gate-error { color: #b3261e; font-size: var(--step--1); margin-top: 0.9rem; }

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