/* 桌面與板材的 token。第 1 層數值來自 _config.yml 的 appearance,template 使用者只改那裡。
   設計與數值的來源:docs/redesign/SLAB.md */

@font-face {
  font-family: "Mrs Saint Delafield";
  font-display: block;
  src: url("/assets/fonts/mrs-saint-delafield-latin.woff2") format("woff2");
}

/* ── 第 1 層:原始值 ── */
:root {
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC", system-ui, sans-serif;
  --font-display: "Iowan Old Style", Charter, Georgia, "Songti TC", "Noto Serif CJK TC", "PMingLiU", serif;
  --font-sign: "Mrs Saint Delafield";
  --font-code: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  --t-xs: 0.78rem; --t-sm: 0.875rem; --t-md: 1rem; --t-lg: 1.2rem; --t-xl: 1.5rem; --t-2xl: 2.1rem;

  --th-card: 4px;   /* 一般板的厚度;精選 7px、按鍵 2px */
  --th-feature: 7px;
  --th-key: 2px;
}

/* ── 第 2 層:語意 token(晝) ──
   配色:和田三造《配色事典》#249(Hay's Russet + Ecru + Olive Ocher + Dark Medici Blue)
   夜:#113 Vandyke Brown 的皮革棕;比較樣本 docs/redesign/mockups/palette.html */
:root {
  --desk:         #e9dfcb;                 /* 桌面:Ecru 奶油 */
  --desk-2:       #ddd1b9;                 /* 刻進桌面的凹槽 */
  --face:         #f7f0e1;                 /* 板材表面 */
  --face-sig:   #efdcd6;                 /* 精選卡、按下的鍵 */
  --edge:         #a8574a;                 /* 訊號側面:Russet */
  --edge-deep:    #793327;
  --edge-n:       #cdb999;                 /* 平常的側面、櫃子 */
  --edge-n-deep:  #a8957a;
  --shelf:        #c2ae8f;                 /* 書架層板 */
  --paper:        #f0e6cf;                 /* 書口 */
  --paper-deep:   #d6c6a6;
  --ink:          #2a1f19;
  --ink-2:        #4a3d35;
  --ink-3:        #5c4f45;                 /* 文字一律接近黑色,層次靠字級與粗細 */
  --accent:       #793327;                 /* 當成文字用的訊號色 */
  --line:         rgb(42 31 25 / 0.14);
  --spec:         rgb(255 255 255 / 0.9);  /* 上緣反光 */
  --sheen:        rgb(255 255 255 / 0.5);  /* 跟著游標的光澤 */
  --drop-near:    rgb(60 40 25 / 0.24);
  --drop-far:     rgb(60 40 25 / 0.2);
  --unlit:        #0c0806;                 /* 夜間開場的暗幕 */
  --lamp:         #e6bc8a;                 /* 夜間檯燈 */
  --rule:         #bcc9cb;
  --redline:      #a2402f;
  --sticky:       #ecd791;
  --tag-1: #c55347; --tag-2: #547076; --tag-3: #d6b43e; --tag-4: #5f7f4f;  /* 標籤:色相與深淺都拉開,依出現次數分配 */
  --tag-5: #8a5a78; --tag-6: #97acc8; --tag-7: #793327; --tag-8: #c27544;
  color-scheme: light;
}

/* ── 第 2 層:語意 token(夜) ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --desk: #221812; --desk-2: #1a120d;
    --face: #30241b; --face-sig: #3d2a1f;
    --edge: #a8623c; --edge-deep: #6e3a22;
    --edge-n: #4b3827; --edge-n-deep: #3a2b1f;
    --paper: #cdbb9c; --paper-deep: #9a8668;
    --shelf: var(--face);
    --ink: #f0e3cc; --ink-2: #c9b8a0; --ink-3: #a8957d;
    --accent: #e3a07c; --line: rgb(240 227 204 / 0.08);
    --spec: rgb(255 230 200 / 0.22); --sheen: rgb(255 210 150 / 0.3);
    --drop-near: rgb(0 0 0 / 0.55); --drop-far: rgb(0 0 0 / 0.6); --unlit: #0c0806; --lamp: #e6bc8a;
    --rule: #3e3a33; --redline: #e08a74; --sticky: #c9a95a;
    --tag-1: #e07a68; --tag-2: #7fa3b3; --tag-3: #e0c25a; --tag-4: #8fae78;
    --tag-5: #b88aa6; --tag-6: #b4c6de; --tag-7: #b8584a; --tag-8: #e09a62;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --desk: #221812; --desk-2: #1a120d;
  --face: #30241b; --face-sig: #3d2a1f;
  --edge: #a8623c; --edge-deep: #6e3a22;
  --edge-n: #4b3827; --edge-n-deep: #3a2b1f;
  --paper: #cdbb9c; --paper-deep: #9a8668;
  --shelf: var(--face);
  --ink: #f0e3cc; --ink-2: #c9b8a0; --ink-3: #a8957d;
  --accent: #e3a07c; --line: rgb(240 227 204 / 0.08);
  --spec: rgb(255 230 200 / 0.22); --sheen: rgb(255 210 150 / 0.3);
  --drop-near: rgb(0 0 0 / 0.55); --drop-far: rgb(0 0 0 / 0.6); --unlit: #0c0806; --lamp: #e6bc8a;
  --rule: #3e3a33; --redline: #e08a74; --sticky: #c9a95a;
  --tag-1: #e07a68; --tag-2: #7fa3b3; --tag-3: #e0c25a; --tag-4: #8fae78;
  --tag-5: #b88aa6; --tag-6: #b4c6de; --tag-7: #b8584a; --tag-8: #e09a62;
  color-scheme: dark;
}
