input.css 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /* Tailwind CSS v4 entry point (compiled by Trunk's `tailwind-css` pipeline).
  2. *
  3. * This token layer is the single source of truth for the UI theme:
  4. * typography scale, the 4px spacing grid, one accent family, semantic
  5. * danger/success pairs, and dark-friendly surface/ink tokens. Wave 4
  6. * components consume these tokens only - no ad-hoc hex values. */
  7. @import "tailwindcss";
  8. /* Explicit sources keep content detection deterministic regardless of the
  9. * working directory Trunk invokes the Tailwind CLI from. */
  10. @source "../index.html";
  11. @source "../src";
  12. /* ------------------------------------------------------------------ */
  13. /* Semantic surface tokens: dark is the product default. Light is an */
  14. /* explicit `:root[data-theme="light"]` override; there is deliberately */
  15. /* no `prefers-color-scheme` query - `bootstrap.js` writes the data */
  16. /* attribute from localStorage (default `dark`) before the app mounts. */
  17. /* ------------------------------------------------------------------ */
  18. :root {
  19. color-scheme: dark;
  20. --ui-canvas: oklch(0.165 0.012 255);
  21. --ui-raised: oklch(0.205 0.014 255);
  22. --ui-sunken: oklch(0.14 0.011 255);
  23. --ui-ink: oklch(0.955 0.004 255);
  24. --ui-ink-muted: oklch(0.705 0.014 255);
  25. --ui-line: oklch(0.3 0.014 255);
  26. --ui-line-strong: oklch(0.4 0.016 255);
  27. --ui-accent-ink: oklch(0.8 0.1 210);
  28. /* Dark action pair: dark ink on a bright accent stays high-contrast. */
  29. --ui-btn-bg: oklch(0.845 0.09 210);
  30. --ui-btn-bg-hover: oklch(0.9 0.065 210);
  31. --ui-btn-ink: oklch(0.24 0.045 210);
  32. /* Status colors: every pair is used with a glyph and text, never alone. */
  33. --ui-danger: oklch(0.808 0.114 19.6);
  34. --ui-danger-surface: oklch(0.258 0.092 26);
  35. --ui-danger-line: oklch(0.396 0.141 25.7);
  36. --ui-success: oklch(0.871 0.15 154.4);
  37. --ui-success-surface: oklch(0.266 0.065 152.9);
  38. --ui-success-line: oklch(0.448 0.119 151.3);
  39. --ui-accent-soft: oklch(0.24 0.045 210);
  40. --ui-accent-soft-ink: oklch(0.9 0.065 210);
  41. --ui-focus: oklch(0.845 0.09 210);
  42. }
  43. /* Light override: the only writer is the header `ThemeToggle` (and the
  44. * pre-mount init in `bootstrap.js`). Higher specificity than `:root`. */
  45. :root[data-theme="light"] {
  46. color-scheme: light;
  47. --ui-canvas: oklch(0.981 0.004 255);
  48. --ui-raised: oklch(1 0 0);
  49. --ui-sunken: oklch(0.955 0.005 255);
  50. --ui-ink: oklch(0.235 0.02 255);
  51. --ui-ink-muted: oklch(0.5 0.018 255);
  52. --ui-line: oklch(0.905 0.006 255);
  53. --ui-line-strong: oklch(0.835 0.009 255);
  54. --ui-accent-ink: oklch(0.47 0.105 210);
  55. /* Action pair: white on accent-700 clears AA (5.3:1); hover darkens. */
  56. --ui-btn-bg: oklch(0.47 0.105 210);
  57. --ui-btn-bg-hover: oklch(0.4 0.085 210);
  58. --ui-btn-ink: oklch(1 0 0);
  59. --ui-danger: oklch(0.505 0.17 27.5);
  60. --ui-danger-surface: oklch(0.971 0.013 17.4);
  61. --ui-danger-line: oklch(0.885 0.062 18.3);
  62. --ui-success: oklch(0.527 0.154 150);
  63. --ui-success-surface: oklch(0.982 0.018 155.8);
  64. --ui-success-line: oklch(0.925 0.084 156);
  65. --ui-accent-soft: oklch(0.972 0.018 210);
  66. --ui-accent-soft-ink: oklch(0.47 0.105 210);
  67. --ui-focus: oklch(0.47 0.105 210);
  68. }
  69. /* `inline` keeps utilities pointing at the live custom properties, so the
  70. * `data-theme` override above wins without a rebuild or a `.dark` class. */
  71. @theme inline {
  72. --color-canvas: var(--ui-canvas);
  73. --color-raised: var(--ui-raised);
  74. --color-sunken: var(--ui-sunken);
  75. --color-ink: var(--ui-ink);
  76. --color-muted: var(--ui-ink-muted);
  77. --color-line: var(--ui-line);
  78. --color-line-strong: var(--ui-line-strong);
  79. --color-accent-ink: var(--ui-accent-ink);
  80. --color-accent-soft: var(--ui-accent-soft);
  81. --color-accent-soft-ink: var(--ui-accent-soft-ink);
  82. --color-btn: var(--ui-btn-bg);
  83. --color-btn-hover: var(--ui-btn-bg-hover);
  84. --color-btn-ink: var(--ui-btn-ink);
  85. --color-danger: var(--ui-danger);
  86. --color-danger-surface: var(--ui-danger-surface);
  87. --color-danger-line: var(--ui-danger-line);
  88. --color-success: var(--ui-success);
  89. --color-success-surface: var(--ui-success-surface);
  90. --color-success-line: var(--ui-success-line);
  91. }
  92. @theme {
  93. /* Spacing: explicit 4px grid (Tailwind's default, pinned here on purpose). */
  94. --spacing: 0.25rem;
  95. /* Type: system-native stacks only - no CDN fonts (CSP-friendly, offline-safe). */
  96. --font-sans: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  97. --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  98. /* Typography scale beyond Tailwind's defaults. */
  99. --text-display: 2.75rem;
  100. --text-display--line-height: 1.08;
  101. --text-display--letter-spacing: -0.03em;
  102. --text-title: 1.625rem;
  103. --text-title--line-height: 1.2;
  104. --text-title--letter-spacing: -0.02em;
  105. /* One accent family: signal cyan. */
  106. --color-accent-50: oklch(0.972 0.018 210);
  107. --color-accent-100: oklch(0.945 0.038 210);
  108. --color-accent-200: oklch(0.9 0.065 210);
  109. --color-accent-300: oklch(0.845 0.09 210);
  110. --color-accent-400: oklch(0.775 0.115 210);
  111. --color-accent-500: oklch(0.7 0.13 210);
  112. --color-accent-600: oklch(0.6 0.125 210);
  113. --color-accent-700: oklch(0.47 0.105 210);
  114. --color-accent-800: oklch(0.4 0.085 210);
  115. --color-accent-900: oklch(0.33 0.065 210);
  116. --color-accent-950: oklch(0.24 0.045 210);
  117. /* Shape and elevation. */
  118. --radius-card: 0.875rem;
  119. --shadow-card:
  120. 0 1px 2px oklch(0.2 0.02 255 / 0.06),
  121. 0 12px 32px -16px oklch(0.2 0.02 255 / 0.22);
  122. }
  123. @layer base {
  124. html {
  125. -webkit-text-size-adjust: 100%;
  126. }
  127. @media (prefers-reduced-motion: no-preference) {
  128. html {
  129. scroll-behavior: smooth;
  130. }
  131. }
  132. body {
  133. background-color: var(--color-canvas);
  134. color: var(--color-ink);
  135. font-family: var(--font-sans);
  136. -webkit-font-smoothing: antialiased;
  137. text-rendering: optimizeLegibility;
  138. }
  139. :focus-visible {
  140. outline: 2px solid var(--ui-focus);
  141. outline-offset: 2px;
  142. }
  143. ::selection {
  144. background-color: var(--color-accent-800);
  145. color: var(--color-accent-50);
  146. }
  147. :root[data-theme="light"] ::selection {
  148. background-color: var(--color-accent-200);
  149. color: var(--color-accent-950);
  150. }
  151. }