/* TranquilOS — Design Token System
   Museum-grade. Layer 0 primitives → Layer 1 semantics.
   Light theme on :root, dark theme on [data-theme="dark"]. */

/* ============================================
   Layer 0 — Primitives
   ============================================ */
:root {
  --font-sans: "Avenir Next", "Alibaba PuHuiTi", "PingFang SC", "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Iowan Old Style", "Baskerville", "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", "Times New Roman", serif;
  --font-mono: "SF Mono", "Cascadia Code", "JetBrains Mono", "Fira Code", ui-monospace, monospace;
}

/* ============================================
   Layer 1 — Semantic Tokens
   ============================================ */

/* --- Color: Light theme (default) --- */
:root {
  --color-bg:            #F2F3F0;
  --color-surface-1:     #EAECE8;
  --color-surface-2:     #E1E4DF;
  --color-border-1:      rgba(22,25,23,.08);
  --color-border-2:      rgba(22,25,23,.16);
  --color-text-1:        #161917;
  --color-text-2:        #5F6561;
  --color-text-3:        #68706B;
  --color-accent:        #2949B8;
  --color-accent-bright: #19358F;
  --color-accent-soft:   rgba(41,73,184,.08);
  --color-ok:            #39765B;
  color-scheme: light;
}

/* --- Color: Dark theme --- */
[data-theme="dark"] {
  --color-bg:            #11110F;
  --color-surface-1:     #171714;
  --color-surface-2:     #1E1E1A;
  --color-border-1:      rgba(237,233,223,.08);
  --color-border-2:      rgba(237,233,223,.16);
  --color-text-1:        #EDE9DF;
  --color-text-2:        #AAA69D;
  --color-text-3:        #817E76;
  --color-accent:        #6F89F2;
  --color-accent-bright: #A8B7FF;
  --color-accent-soft:   rgba(111,137,242,.11);
  --color-ok:            #76A887;
  color-scheme: dark;
}

/* --- Typography scale (major third: 1.25) --- */
:root {
  --text-xs:     0.6875rem;   /* 11px */
  --text-sm:     0.8125rem;   /* 13px */
  --text-base:   0.9375rem;   /* 15px */
  --text-md:     1rem;        /* 16px */
  --text-lg:     1.125rem;    /* 18px */
  --text-xl:     1.25rem;     /* 20px */
  --text-2xl:    1.5rem;      /* 24px */
  --text-3xl:    1.875rem;    /* 30px */
  --text-4xl:    2.25rem;     /* 36px */
  --text-5xl:    2.75rem;     /* 44px */
  --text-6xl:    3.375rem;    /* 54px */
  --text-7xl:    4.25rem;     /* 68px */

  --leading-tight:   1.15;
  --leading-snug:    1.35;
  --leading-normal:  1.6;
  --leading-relaxed: 1.8;
  --leading-loose:   2.0;

  --tracking-tight:  -0.03em;
  --tracking-normal: -0.01em;
  --tracking-wide:   0.05em;
  --tracking-ultra:  0.14em;

  --weight-normal:  400;
  --weight-medium:  500;
  --weight-semi:    580;
  --weight-bold:    620;
  --weight-heavy:   650;
}

/* --- Spacing (4px grid) --- */
:root {
  --space-0:   0;
  --space-1:   0.25rem;
  --space-2:   0.5rem;
  --space-3:   0.75rem;
  --space-4:   1rem;
  --space-5:   1.25rem;
  --space-6:   1.5rem;
  --space-7:   2rem;
  --space-8:   2.5rem;
  --space-9:   3rem;
  --space-10:  3.5rem;
  --space-11:  4rem;
  --space-12:  5rem;
  --space-13:  6rem;
  --space-section: clamp(3rem, 4vw, 4.5rem);
}

/* --- Layout --- */
:root {
  --wrap-width:     78rem;
  --content-width:  48rem;
  --header-height:  3.5rem;
  --sidebar-width:  180px;
}

/* --- Animation --- */
:root {
  --duration-instant:  80ms;
  --duration-fast:    150ms;
  --duration-normal:  250ms;
  --duration-slow:    400ms;

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}
