/* ==========================================================
   YU XIN — base: tokens, reset, typography
   Palette: Morandi low-saturation on warm charcoal
   ========================================================== */
:root {
  --bg: #1d1b19;
  --bg-elev: #262321;
  --bg-soft: #2f2b28;
  --line: rgba(236, 230, 223, 0.12);

  --text: #ece6df;        /* 14.6:1 on --bg */
  --text-muted: #b9afa5;  /* 8.1:1 on --bg  */

  --sand: #d8c3a5;
  --sage: #9fb3a1;
  --rose: #c9a29b;
  --slate: #8fa0b3;
  --clay: #b89b7a;

  --on-accent: #1d1b19;   /* on --sand: 10.4:1 */

  --font: "Inter", "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.375rem;
  --fs-xl: clamp(1.75rem, 4vw, 2.75rem);
  --fs-2xl: clamp(2.5rem, 7vw, 5.25rem);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6.5rem;

  --radius: 22px;
  --radius-sm: 12px;
  --container: 1180px;
  --tabbar-h: 72px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.65;
  overflow-x: hidden;
  padding-bottom: calc(var(--tabbar-h) + 32px);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--sand); text-decoration: none; transition: color 0.25s var(--ease); }
a:hover { color: var(--text); }

:focus-visible { outline: 2px solid var(--sand); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3, h4 { margin: 0 0 var(--space-2); line-height: 1.12; font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: var(--fs-2xl); font-weight: 300; letter-spacing: -0.035em; }
h1 strong { font-weight: 700; }
h2 { font-size: var(--fs-xl); font-weight: 400; }
h3 { font-size: var(--fs-lg); }
p { margin: 0 0 var(--space-2); color: var(--text-muted); }

.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sand);
  margin-bottom: var(--space-2);
}

.mono { font-family: var(--mono); font-size: 0.9em; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }

.skip-link {
  position: absolute; left: 1rem; top: -60px; z-index: 200;
  background: var(--sand); color: var(--on-accent);
  padding: 0.6rem 1rem; border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
