/* ============================================================
   Jin Mai Bakery · 金麦面包 — "Paper-bag warmth" system
   Palette + type per brief. Tokens may be tweaked at :root.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500;1,9..144,600&family=Inter:wght@400;500;600;700&family=Noto+Serif+TC:wght@500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  /* Brief palette */
  --paper:    #F2E5C4;   /* paper-bag yellow */
  --ink:      #3C2415;   /* deep brown */
  --red:      #C8312C;   /* lucky red (Chinese) */
  --butter:   #F4C868;   /* butter highlight */

  /* Derived warm neutrals */
  --paper-2:  #ECDCB1;
  --paper-3:  #E4CF95;
  --ink-soft: #7A5237;
  --cream:    #FBF3DE;
  --line:     rgba(60,36,21,0.16);

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-cjk:     'Noto Serif TC', 'Fraunces', serif;
  --font-ui:      'Inter', system-ui, sans-serif;
  --font-mono:    'Space Mono', ui-monospace, monospace;

  /* Chinese prominence (tweak) */
  --cjk-scale: 1;
  --cjk-opacity: 1;

  --maxw: 1240px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* warm paper grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  opacity: 0.6;
  background-image: radial-gradient(rgba(60,36,21,0.04) 1px, transparent 1px);
  background-size: 4px 4px;
}
#root { position: relative; z-index: 1; }
::selection { background: var(--red); color: var(--cream); }

.serif { font-family: var(--font-display); }
.mono  { font-family: var(--font-mono); }
.cjk {
  font-family: var(--font-cjk);
  color: var(--red);
  font-size: calc(1em * var(--cjk-scale));
  opacity: var(--cjk-opacity);
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.04; margin: 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 40px; }
a { color: inherit; }

/* readable measure for prose */
.measure { max-width: 70ch; }

/* Buttons */
.btn {
  font-family: var(--font-ui);
  font-weight: 600; font-size: 15px;
  border: none; cursor: pointer;
  padding: 14px 24px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 9px;
  white-space: nowrap; text-decoration: none;
  transition: transform .4s var(--ease), background .3s, color .3s, box-shadow .3s, border-color .3s;
}
.btn-butter { background: var(--butter); color: var(--ink); box-shadow: 0 1px 0 rgba(60,36,21,0.12); }
.btn-butter:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -14px rgba(60,36,21,0.5); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

image-slot { display: block; background: var(--paper-3); }

/* striped placeholder */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg, rgba(60,36,21,0.05) 0 2px, transparent 2px 11px),
    var(--paper-3);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.ph .ph-tag {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft);
  background: rgba(242,229,196,0.82); padding: 6px 11px; border-radius: 4px; text-align: center;
}

/* ---------- responsive nav ---------- */
.nav-burger { display: none; }
.nav-mobile { display: none; }

@media (max-width: 640px) {
  .nav-desktop { display: none !important; }
  .nav-burger  { display: inline-flex !important; }
  .nav-mobile  { display: block; }
}

@media (max-width: 900px) {
  .wrap { padding: 0 28px; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding: 0 20px; }
}
