/* ── BASE — variables, reset, typography, shared utilities ── */
:root {
  --rice:        #f5f0e8;
  --cream:       #faf7f2;
  --parchment:   #ede8dc;
  --ink:         #1a1410;
  --ink2:        #2d2520;
  --ink3:        #4a3f35;
  --muted:       #8a7d6e;
  --signal:      #006d6b;
  --signal2:     #00a89e;
  --signal3:     #00d4c8;
  --gold:        #b8860b;
  --gold2:       #d4a017;
  --red-muted:   #8b3a3a;
  --green-muted: #2d6b4a;
  --border:      rgba(26,20,16,0.12);
  --border2:     rgba(26,20,16,0.06);
}

* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'IBM Plex Mono', monospace;
  overflow-x: hidden;
}

/* Grain texture overlay */
body::before {
  content:'';
  position:fixed; inset:0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events:none; z-index:0; opacity:0.4;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width:3px; }
::-webkit-scrollbar-track { background: var(--parchment); }
::-webkit-scrollbar-thumb { background: var(--muted); }

/* ── SHARED BUTTONS ── */
.btn-ink {
  background: var(--ink); color: var(--cream);
  border: none; padding: 1rem 2.2rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem; letter-spacing: 0.15em;
  text-transform: uppercase; cursor: pointer;
  border-radius: 2px; transition: all 0.2s;
  text-decoration: none; display: inline-block;
}
.btn-ink:hover {
  background: var(--signal);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,109,107,0.2);
}
.btn-outline {
  background: transparent; color: var(--ink);
  border: 1px solid var(--border);
  padding: 1rem 2.2rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem; letter-spacing: 0.15em;
  text-transform: uppercase; cursor: pointer;
  border-radius: 2px; transition: all 0.2s;
  text-decoration: none; display: inline-block;
}
.btn-outline:hover { border-color: var(--ink); transform: translateY(-2px); }

/* ── DISCLAIMER ── */
.disclaimer {
  background: rgba(184,134,11,0.08);
  border-top: 1px solid rgba(184,134,11,0.2);
  border-bottom: 1px solid rgba(184,134,11,0.2);
  padding: 0.6rem 4rem;
  font-size: 0.62rem; letter-spacing: 0.08em;
  color: var(--gold); text-align: center;
}

/* ── SECTION BASE ── */
.section {
  padding: 7rem 4rem;
  position: relative;
}
.section-tag {
  font-size: 0.58rem; letter-spacing: 0.28em;
  color: var(--signal); text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 0.8rem;
}
.section-tag::before {
  content:''; width:20px; height:1px; background: var(--signal);
}
.section-heading {
  font-family: 'Noto Serif SC', serif;
  font-size: 3.2rem; font-weight: 200;
  color: var(--ink); line-height: 1.15;
  margin-bottom: 2rem;
}
.section-body {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 0.9rem; line-height: 1.85;
  color: var(--ink3); max-width: 680px;
  margin-bottom: 4rem;
}

/* ── ANIMATIONS ── */
@keyframes revealRight {
  from { opacity:0; transform:translateX(-20px); }
  to   { opacity:1; transform:translateX(0); }
}
@keyframes revealLeft {
  from { opacity:0; transform:translateX(20px); }
  to   { opacity:1; transform:translateX(0); }
}
@keyframes expandWidth {
  from { width:0; }
  to   { width:60px; }
}
@keyframes fadeIn {
  from { opacity:0; }
  to   { opacity:1; }
}
@keyframes scaleIn {
  from { opacity:0; transform:scale(0.96); }
  to   { opacity:1; transform:scale(1); }
}
@keyframes waveBar {
  0%,100% { height:8px; }
  50%      { height:32px; }
}
@keyframes toastIn {
  from { opacity:0; transform:translateX(-50%) translateY(8px); }
  to   { opacity:1; transform:translateX(-50%) translateY(0); }
}

/* ── LOADING VEIL ── */
.loading-veil {
  position: fixed; inset: 0;
  background: rgba(245,240,232,0.92);
  z-index: 150; display: none;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 1.5rem;
}
.loading-veil.on { display: flex; }
.loading-wave { display:flex; gap:4px; align-items:flex-end; height:32px; }
.lw-bar {
  width:3px; background: var(--signal);
  border-radius:1px;
  animation: waveBar 1s ease infinite;
}
.lw-bar:nth-child(2) { animation-delay:0.1s; }
.lw-bar:nth-child(3) { animation-delay:0.2s; }
.lw-bar:nth-child(4) { animation-delay:0.3s; }
.lw-bar:nth-child(5) { animation-delay:0.4s; }
.loading-txt {
  font-size:0.62rem; letter-spacing:0.25em;
  color:var(--signal); text-transform:uppercase;
}
.loading-txt-zh {
  font-family:'Noto Serif SC', serif;
  font-size:0.9rem; color:var(--muted);
}

/* ── TOAST ── */
.toast {
  position:fixed; bottom:2rem; left:50%;
  transform:translateX(-50%);
  background:var(--ink); color:var(--cream);
  padding:0.7rem 1.6rem;
  font-size:0.65rem; letter-spacing:0.1em;
  border-radius:2px; z-index:300;
  animation:toastIn 0.3s ease;
  white-space:nowrap;
}

/* ── RESPONSIVE ── */
@media(max-width:900px) {
  .section { padding:5rem 2rem; }
  .disclaimer { padding:0.6rem 1.5rem; }
}
