/* ==========================================================================
   DeviseDream Design System Tokens
   Minimal B1 Typography System (only 7 canonical styles across 4 scale steps:
   60px / 36px / 16px / 14px) + landing-page-design Part B
   ========================================================================== */

/* Plan A+ (100% self-hosted SIL OFL 1.1 static WOFF2 slices under /assets/fonts/):
   - Display (600): Fraunces (SOFT 50) + LXGW ZhenKai (霞鹜臻楷)
   - UI / Titles (500): Plus Jakarta Sans + LXGW WenKai Medium (霞鹜文楷 Medium)
   - CTA Buttons (600): Plus Jakarta Sans + LXGW ZhenKai (霞鹜臻楷)
   - Body / Captions (400): Plus Jakarta Sans + LXGW WenKai (霞鹜文楷 Regular) */

:root {
  --font-display: 'Fraunces', 'LXGW ZhenKai', 'LXGW WenKai Medium', Georgia, serif;
  --font-ui: 'Plus Jakarta Sans', 'LXGW WenKai Medium', 'LXGW WenKai', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-cta: 'Plus Jakarta Sans', 'LXGW ZhenKai', 'LXGW WenKai Medium', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-sans: 'Plus Jakarta Sans', 'LXGW WenKai', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;

  /* Flat sunlit lifestyle paper palette (B4: zero CSS background gradients) */
  --bg-canvas: #FBF7EE;
  --bg-linen: #F3ECE0;
  --bg-surface: #FFFFFF;
  --bg-nav-glass: rgba(251, 247, 238, 0.76);
  --bg-mobile-menu: rgba(251, 247, 238, 0.96);

  /* Ink */
  --ink-primary: #211E1A;
  --ink-hero-body: #2F2923;
  --ink-secondary: #5F584F;
  --ink-muted: #847C70;
  --ink-inverse: #FBF7EE;

  /* Quiet organic accents (flat, calm, unhurried) */
  --accent-ink: #24201C;
  --accent-ink-hover: #3B352E;
  --accent-warm: #E9DFCD;
  --accent-dot: #D97A54;
  --accent-sage-soft: #E8F2EB;
  --accent-sage: #2D6A4F;
  --accent-error: #B84232;
  --accent-error-soft: #FBECE9;

  /* Borders (B4: all around or none) */
  --border-subtle: #E7DEC9;
  --border-glass: rgba(255, 255, 255, 0.65);

  /* B2 Spacing scale (only these 13 values) */
  --space-0: 0px;
  --space-25: 2px;
  --space-50: 4px;
  --space-75: 8px;
  --space-100: 12px;
  --space-200: 16px;
  --space-300: 24px;
  --space-400: 32px;
  --space-500: 40px;
  --space-600: 48px;
  --space-700: 64px;
  --space-800: 80px;
  --space-900: 96px;

  /* B3 Tailwind corner radii */
  --radius-sm: 2px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-3xl: 24px;
  --radius-full: 9999px;

  /* B7 Motion */
  --ease-base: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-hover: 300ms;
  --dur-layout: 500ms;
  --dur-reveal: 700ms;

  /* Soft elevation */
  --shadow-float: 0 8px 28px rgba(33, 30, 26, 0.08);
  --shadow-sheet: 0 12px 36px rgba(33, 30, 26, 0.05);
}

/* ==========================================================================
   B1 Minimal Named Text Styles
   Strictly 4 scale steps: 60px (Hero) · 36px (Section) · 16px (Base) · 14px (Small)
   ========================================================================== */

/* 1. Hero Display — Heading 1 (text-6xl: 60px, Semibold) */
.heading-1 {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 50;
  font-synthesis-weight: none;
  font-size: 3.75rem;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* 2. Section & Tagline Heading — Heading 3 (text-4xl: 36px, Semibold) */
.heading-3 {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 50;
  font-synthesis-weight: none;
  font-size: 2.25rem;
  line-height: 1.16;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

/* 3. Item Title, Label & Nav — Title 3 (text-base: 16 / 24, Medium) */
.title-3 {
  font-family: var(--font-ui);
  font-synthesis-weight: none;
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 500;
}

/* 4. Running Copy & Inputs — Body 3 (text-base: 16px, Regular) */
.body-3 {
  font-size: 1rem;
  line-height: 1.56;
  font-weight: 400;
  text-wrap: pretty;
}

/* 5. Primary CTA Buttons — Button-md (text-base: 16 / 24, Semibold) */
.button-md {
  font-family: var(--font-cta);
  font-synthesis-weight: none;
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 600;
}

/* 6. Compact UI Buttons — Button-sm (text-sm: 14 / 20, Semibold) */
.button-sm {
  font-family: var(--font-cta);
  font-synthesis-weight: none;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
}

/* 7. Metadata, Notes, Calendar & Footer — Caption 2 (text-sm: 14 / 20, Regular) */
.caption-2 {
  font-size: 0.875rem;
  line-height: 1.45;
  font-weight: 400;
}

/* Chinese-specific breathing rhythm (uses <html lang="zh-CN"> toggled by app.js) */
:lang(zh) .heading-1 {
  line-height: 1.2;
  letter-spacing: 0.01em;
}

:lang(zh) .heading-3 {
  line-height: 1.32;
  letter-spacing: 0.005em;
}

:lang(zh) .body-3 {
  line-height: 1.68;
}

:lang(zh) .caption-2 {
  line-height: 1.5;
}

/* Standard Tailwind width breakpoints snapping strictly to B1 scale steps:
   Desktop (>= 1024px): Heading 1 (60px)
   Tablet (768px - 1023px): Heading 3 (36px)
   Mobile (<= 767px): Heading 4 (30px) */
@media (max-width: 1023px) {
  .heading-1 {
    font-size: 2.25rem;  /* Heading 3 / text-4xl: 36px */
    line-height: 1.16;
  }
  :lang(zh) .heading-1 {
    line-height: 1.25;
  }
}

@media (max-width: 767px) {
  .heading-1 {
    font-size: 1.875rem; /* Heading 4 / text-3xl: 30px */
    line-height: 1.2;
  }
  :lang(zh) .heading-1 {
    line-height: 1.28;
  }
  .heading-3 {
    font-size: 1.5rem;   /* Heading 5 / text-2xl: 24px */
    line-height: 1.28;
  }
  :lang(zh) .heading-3 {
    line-height: 1.36;
  }
}
