254 lines · 13.6 KBRaw
| 1 | @import "@refs/design-system/styles.css"; |
| 2 | @source "./"; |
| 3 | |
| 4 | .landing ::selection { background: var(--accent-tint); } |
| 5 | |
| 6 | .landing :is(a, button, input):focus-visible { |
| 7 | outline: 2px solid var(--accent-hover); |
| 8 | outline-offset: 4px; |
| 9 | } |
| 10 | |
| 11 | .landing input { caret-color: var(--accent-hover); } |
| 12 | |
| 13 | .landing ::-webkit-scrollbar { height: 6px; } |
| 14 | .landing ::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; } |
| 15 | |
| 16 | .landing-globe { |
| 17 | mask-image: |
| 18 | radial-gradient(ellipse 34% 26% at 50% 30%, rgb(0 0 0 / 0.12), rgb(0 0 0 / 0.55) 65%, #000 100%), |
| 19 | linear-gradient(to bottom, transparent, #000 18%, #000 85%, transparent); |
| 20 | mask-composite: intersect; |
| 21 | } |
| 22 | |
| 23 | @media (max-width: 767px) { |
| 24 | .landing-globe { |
| 25 | mask-image: |
| 26 | radial-gradient(ellipse 70% 30% at 50% 28%, rgb(0 0 0 / 0.1), rgb(0 0 0 / 0.5) 65%, #000 100%), |
| 27 | linear-gradient(to bottom, transparent, #000 15%, #000 88%, transparent); |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | @keyframes landing-pop { |
| 32 | from { opacity: 0; transform: scale(0.6); } |
| 33 | to { opacity: 1; } |
| 34 | } |
| 35 | |
| 36 | @keyframes landing-fade { from { opacity: 0; } } |
| 37 | |
| 38 | @keyframes landing-ping { |
| 39 | 0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--needs) 55%, transparent); } |
| 40 | 100% { box-shadow: 0 0 0 8px transparent; } |
| 41 | } |
| 42 | |
| 43 | .landing .landing-fade { animation: landing-fade 400ms var(--ease-out) both; } |
| 44 | |
| 45 | @media (prefers-reduced-motion: no-preference) { |
| 46 | .landing .landing-pop { animation: landing-pop 360ms var(--ease-out) both; } |
| 47 | .landing .landing-ping { animation: landing-ping 1.4s ease-out infinite; } |
| 48 | } |
| 49 | |
| 50 | @keyframes scroll-reveal { |
| 51 | from { opacity: 0; transform: translateY(32px) scale(0.98); } |
| 52 | to { opacity: 1; transform: none; } |
| 53 | } |
| 54 | |
| 55 | @keyframes scroll-fade { from { opacity: 0; } to { opacity: 1; } } |
| 56 | |
| 57 | @supports (animation-timeline: view()) { |
| 58 | .landing .scroll-reveal { animation: scroll-reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 45%; } |
| 59 | @media (prefers-reduced-motion: reduce) { |
| 60 | .landing .scroll-reveal { animation-name: scroll-fade; } |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | @keyframes record-write { |
| 65 | from { opacity: 0.001; clip-path: inset(0 100% 0 0); filter: blur(2px); } |
| 66 | to { opacity: 1; clip-path: inset(0 0 0 0); filter: blur(0); } |
| 67 | } |
| 68 | |
| 69 | @media (prefers-reduced-motion: no-preference) { |
| 70 | .landing .live-decision { animation: record-write 600ms var(--ease-out) both; } |
| 71 | } |
| 72 | |
| 73 | |
| 74 | @keyframes fanout-in { |
| 75 | from { opacity: 0; transform: translateY(6px); filter: blur(2px); } |
| 76 | to { opacity: 1; transform: none; filter: blur(0); } |
| 77 | } |
| 78 | |
| 79 | @media (prefers-reduced-motion: no-preference) { |
| 80 | .landing .landing-fanout-in { animation: fanout-in 500ms var(--ease-out) both; } |
| 81 | } |
| 82 | |
| 83 | /* |
| 84 | * Code map. One canvas from folders down to code: the level of detail follows the zoom, and labels grow |
| 85 | * as the map shrinks (`--inv` is 1 / scale), so they stay readable at every level. |
| 86 | */ |
| 87 | .code-map { background-image: radial-gradient(var(--hairline) 1px, transparent 1.2px); background-size: 22px 22px; } |
| 88 | .code-map-world { --inv: 1; } |
| 89 | |
| 90 | .code-map-node { border-radius: var(--radius-control); contain: layout style; } |
| 91 | /* Blocks off screen skip layout and paint, so a change of level only draws what the reader can see. */ |
| 92 | .code-map-node:is([data-role="code"], [data-role="file"]) { content-visibility: auto; contain-intrinsic-size: auto 200px; } |
| 93 | .code-map-node[data-role="folder"] { border-radius: var(--radius-sheet); background: color-mix(in oklab, var(--ink) 2%, transparent); box-shadow: inset 0 0 0 1px var(--hairline); } |
| 94 | .code-map-node[data-role="file"] { border-radius: var(--radius-panel); background: var(--ground); box-shadow: var(--elevation-card); } |
| 95 | .code-map-node[data-role="class"] { background: var(--sunken); box-shadow: inset 0 0 0 1px var(--hairline); } |
| 96 | .code-map-node[data-role="code"] { overflow: hidden; cursor: pointer; background: var(--panel); box-shadow: var(--elevation-card); } |
| 97 | .code-map-node[data-role="code"]:hover { box-shadow: 0 0 0 1px var(--line); } |
| 98 | .code-map-node[data-role="folder"] { cursor: zoom-in; } |
| 99 | .code-map-node:is([data-role="file"], [data-role="class"]) { cursor: pointer; } |
| 100 | .code-map-node:is([data-role="file"], [data-role="class"]):hover { box-shadow: 0 0 0 1px var(--line), var(--elevation-card); } |
| 101 | |
| 102 | .code-map-head { position: absolute; inset-inline: 10px; top: 7px; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; pointer-events: none; } |
| 103 | .code-map-node[data-role="folder"] > .code-map-head { inset-inline: 16px; top: 13px; } |
| 104 | .code-map-name { overflow: hidden; text-overflow: ellipsis; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink); letter-spacing: 0; } |
| 105 | .code-map-node[data-role="folder"] > .code-map-head .code-map-name { color: var(--muted); } |
| 106 | .code-map-kind { flex: none; height: 18px; padding: 0 6px; border-radius: var(--radius-chip); background: var(--hover); color: var(--muted); font-size: var(--text-xs); font-weight: 500; line-height: 18px; letter-spacing: 0; } |
| 107 | .code-map-meta { display: none; position: absolute; left: 12px; white-space: nowrap; color: var(--faint); letter-spacing: 0; pointer-events: none; } |
| 108 | .code-map-code { position: absolute; inset-inline: 0; margin: 0; padding: 0 10px; overflow: hidden; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted); white-space: pre; letter-spacing: 0; } |
| 109 | .code-map-code [data-added] { background: var(--success-tint); color: var(--ink); } |
| 110 | |
| 111 | .code-map-diff { --sc: min(var(--inv), 2.5); position: absolute; top: -10px; right: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: var(--radius-chip); background: var(--raised); box-shadow: var(--elevation-control); font: 500 var(--text-xs) var(--font-mono); white-space: nowrap; transform: scale(var(--sc)); transform-origin: 100% 0; pointer-events: none; } |
| 112 | .code-map-node[data-role="file"] > .code-map-diff { --sc: var(--inv); } |
| 113 | .code-map-node[data-role="folder"] > .code-map-diff { display: none; } |
| 114 | .code-map-station { position: absolute; top: -10px; right: -10px; z-index: 3; width: 22px; height: 22px; border-radius: 9999px; background: var(--panel); box-shadow: inset 0 0 0 2px var(--porcelain); color: var(--ink); font: 600 var(--text-xs) / 22px var(--font-sans); text-align: center; font-variant-numeric: tabular-nums; transform: scale(var(--inv)); transform-origin: 100% 0; pointer-events: none; } |
| 115 | .code-map-node[data-active] > .code-map-station { box-shadow: inset 0 0 0 3.5px var(--porcelain); } |
| 116 | .code-map-node[data-traced] { box-shadow: 0 0 0 2px var(--porcelain); } |
| 117 | .code-map-node[data-active], .code-map-node[data-current] { box-shadow: 0 0 0 2px var(--porcelain), 0 0 0 7px color-mix(in oklab, var(--porcelain) 20%, transparent); } |
| 118 | |
| 119 | .code-map[data-level="architecture"] .code-map-node:is([data-role="code"], [data-role="class"]), |
| 120 | .code-map[data-level="architecture"] .code-map-kind, |
| 121 | .code-map[data-level="package"] .code-map-node:not([data-role="code"]) > .code-map-head .code-map-kind, |
| 122 | .code-map:is([data-level="architecture"], [data-level="package"]) .code-map-code { display: none; } |
| 123 | .code-map:is([data-level="architecture"], [data-level="package"]) .code-map-node:is([data-role="folder"], [data-role="file"]) > :is(.code-map-head, .code-map-diff) { display: none; } |
| 124 | .code-map[data-level="architecture"] .code-map-node[data-holds][data-role="file"] { box-shadow: 0 0 0 2px var(--porcelain); } |
| 125 | .code-map[data-level="package"] .code-map-node[data-role="code"] > .code-map-head .code-map-kind { display: none; } |
| 126 | .code-map[data-level="package"] .code-map-node[data-role="code"] > .code-map-head .code-map-name { font-size: calc(var(--text-xs) * min(var(--inv), 2.2)); } |
| 127 | .code-map[data-level="module"] .code-map-code { opacity: 0.3; } |
| 128 | .code-map[data-level="module"] .code-map-node[data-role="code"] > .code-map-head .code-map-name { font-size: calc(var(--text-xs) * min(var(--inv), 1.6)); } |
| 129 | |
| 130 | .code-map-review .code-map-node[data-status="none"] { opacity: 0.35; } |
| 131 | .code-map-review .code-map-node:is([data-role="file"], [data-role="code"]):is([data-status="changed"], [data-status="added"]):not([data-traced], [data-current]) { box-shadow: 0 0 0 1.5px var(--ink), var(--elevation-card); } |
| 132 | .code-map-review .code-map-node[data-role="folder"]:is([data-status="changed"], [data-status="added"]) > .code-map-head .code-map-name { color: var(--ink); } |
| 133 | |
| 134 | /* Zoomed out, blocks are too small for their shadow rings, and painting 1,000 rings made a change of level slow. */ |
| 135 | .code-map:is([data-level="architecture"], [data-level="package"]) .code-map-node:is([data-role="code"], [data-role="file"]) { box-shadow: inset 0 0 0 1px var(--hairline); } |
| 136 | |
| 137 | /* While the map moves to another level, a light sweeps it, after a short wait so a fast move shows nothing. */ |
| 138 | .code-map-settling { opacity: 0; animation: code-map-settling 1ms 150ms forwards; } |
| 139 | @keyframes code-map-settling { to { opacity: 1; } } |
| 140 | |
| 141 | /* A name in a code card that the reader can follow to its definition. */ |
| 142 | .code-map-ref { padding: 0; border: 0; border-radius: 4px; background: none; font: inherit; color: var(--token-dark, inherit); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 0.22em; cursor: pointer; transition: text-decoration-color 150ms ease, background-color 150ms ease; } |
| 143 | :root[data-mode="light"] .code-map-ref { color: var(--token-light, inherit); } |
| 144 | .code-map-ref:hover { background: var(--hover); text-decoration-color: currentColor; } |
| 145 | .code-map-ref[data-next] { background: var(--hover); text-decoration: none; box-shadow: 0 0 0 1.5px var(--porcelain); } |
| 146 | @media (prefers-contrast: more) { .code-map-ref { text-decoration-color: currentColor; } } |
| 147 | |
| 148 | /* Docs headings link to themselves, so a reader can copy the address of a section. */ |
| 149 | .docs-article :is(h2, h3) { scroll-margin-top: 76px; } |
| 150 | .docs-article :is(h2, h3) > a { color: inherit; text-decoration: none; } |
| 151 | .docs-article :is(h2, h3) > a:hover { text-decoration: underline; text-decoration-color: var(--line); } |
| 152 | .docs-article { max-width: 78ch; } |
| 153 | .docs-article table { display: block; overflow-x: auto; } |
| 154 | |
| 155 | /* |
| 156 | * Landing stage. A product scene sits on a grainy ink field with a faint grid, so it reads as a |
| 157 | * picture of the product, not as one more card. Monochrome on purpose: the line inks stay for lines. |
| 158 | */ |
| 159 | .landing-stage { |
| 160 | position: relative; |
| 161 | isolation: isolate; |
| 162 | overflow: hidden; |
| 163 | background: |
| 164 | radial-gradient(110% 80% at 50% 0%, color-mix(in oklab, var(--porcelain) 20%, transparent), transparent 62%), |
| 165 | radial-gradient(70% 60% at 100% 100%, color-mix(in oklab, var(--porcelain) 10%, transparent), transparent 70%), |
| 166 | var(--sunken); |
| 167 | box-shadow: inset 0 0 0 1px var(--hairline); |
| 168 | } |
| 169 | .landing-stage::before { |
| 170 | content: ""; |
| 171 | position: absolute; |
| 172 | inset: 0; |
| 173 | z-index: -1; |
| 174 | pointer-events: none; |
| 175 | background-image: |
| 176 | linear-gradient(var(--hairline) 1px, transparent 1px), |
| 177 | linear-gradient(90deg, var(--hairline) 1px, transparent 1px); |
| 178 | background-size: 32px 32px; |
| 179 | background-position: -1px -1px; |
| 180 | mask-image: radial-gradient(90% 80% at 50% 30%, #000, transparent 85%); |
| 181 | } |
| 182 | .landing-stage::after { |
| 183 | content: ""; |
| 184 | position: absolute; |
| 185 | inset: 0; |
| 186 | z-index: -1; |
| 187 | pointer-events: none; |
| 188 | opacity: 0.22; |
| 189 | mix-blend-mode: overlay; |
| 190 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); |
| 191 | } |
| 192 | .landing-stage > :not(.landing-art) { position: relative; } |
| 193 | |
| 194 | /* Blueprint rails: two hairlines frame the content column, and a cross marks where each section starts. */ |
| 195 | .landing-rails { position: relative; } |
| 196 | @media (min-width: 1100px) { |
| 197 | .landing-rails::before { |
| 198 | content: ""; |
| 199 | position: absolute; |
| 200 | inset: 0 calc(50% - 540px); |
| 201 | pointer-events: none; |
| 202 | box-shadow: inset 1px 0 0 var(--hairline), inset -1px 0 0 var(--hairline); |
| 203 | z-index: 1; |
| 204 | } |
| 205 | .landing-band { position: relative; } |
| 206 | .landing-band::before, |
| 207 | .landing-band::after { |
| 208 | content: ""; |
| 209 | position: absolute; |
| 210 | top: -6px; |
| 211 | width: 13px; |
| 212 | height: 13px; |
| 213 | z-index: 2; |
| 214 | pointer-events: none; |
| 215 | background: |
| 216 | linear-gradient(var(--line), var(--line)) center / 1px 100% no-repeat, |
| 217 | linear-gradient(var(--line), var(--line)) center / 100% 1px no-repeat; |
| 218 | } |
| 219 | .landing-band::before { left: calc(50% - 546px); } |
| 220 | .landing-band::after { right: calc(50% - 546px); } |
| 221 | } |
| 222 | .landing-band { box-shadow: inset 0 1px 0 var(--hairline); } |
| 223 | |
| 224 | /* A grid of cells that share their hairlines, as one table of the product. */ |
| 225 | .landing-cells { display: grid; gap: 1px; background: var(--hairline); border-radius: var(--radius-sheet); overflow: hidden; box-shadow: 0 0 0 1px var(--hairline); } |
| 226 | .landing-cells > * { background: var(--ground); } |
| 227 | |
| 228 | @keyframes landing-caret { 50% { opacity: 0; } } |
| 229 | @media (prefers-reduced-motion: no-preference) { |
| 230 | .landing .landing-caret { animation: landing-caret 1.1s steps(1) infinite; } |
| 231 | } |
| 232 | |
| 233 | /* Generated line art, used as a mask and painted with a token, so one file serves both themes. */ |
| 234 | .landing-art { |
| 235 | position: absolute; |
| 236 | inset: 0; |
| 237 | pointer-events: none; |
| 238 | mask-image: var(--art), linear-gradient(to bottom, transparent 30%, #000 85%); |
| 239 | mask-size: cover, 100% 100%; |
| 240 | mask-position: center bottom, 0 0; |
| 241 | mask-repeat: no-repeat; |
| 242 | mask-composite: intersect; |
| 243 | background: |
| 244 | linear-gradient(100deg, transparent 40%, color-mix(in oklab, var(--ink) 45%, transparent) 50%, transparent 60%) 0 0 / 300% 100% no-repeat, |
| 245 | color-mix(in oklab, var(--porcelain) 20%, transparent); |
| 246 | } |
| 247 | .landing-stage:has(> .landing-art)::before { display: none; } |
| 248 | @keyframes landing-art-sweep { from { background-position: 100% 0, 0 0; } to { background-position: 0% 0, 0 0; } } |
| 249 | @media (prefers-reduced-motion: no-preference) { |
| 250 | .landing .landing-art { animation: landing-art-sweep 7s linear infinite; } |
| 251 | } |
| 252 | @media (prefers-reduced-motion: reduce) { |
| 253 | .landing-art { background: color-mix(in oklab, var(--porcelain) 20%, transparent); } |
| 254 | } |