styles.css
docs/assets/styles.css
1@layer reset, tokens, base, layout, components, utilities;23@layer reset {4 *, *::before, *::after { box-sizing: border-box; }5 html { scroll-behavior: smooth; text-size-adjust: 100%; }6 body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }7 ul, ol { margin: 0; padding: 0; }8 img, svg { display: block; max-width: 100%; }9 button, input { font: inherit; }10}1112@layer tokens {13 :root {14 color-scheme: light;15 --canvas: #f3f6fa;16 --paper: #ffffff;17 --paper-raised: #ffffff;18 --ink: #172033;19 --ink-strong: #0c1321;20 --muted: #5d687a;21 --soft: #eef2f7;22 --line: #d9e1eb;23 --line-strong: #bac6d5;24 --accent: #c53c48;25 --accent-strong: #9f2631;26 --accent-soft: #fce8e9;27 --kotlin: #6557d9;28 --kotlin-soft: #eeecff;29 --shared: #167b83;30 --shared-soft: #e2f5f4;31 --code: #111927;32 --code-ink: #e8edf5;33 --code-muted: #9ca9bc;34 --success: #287a52;35 --warning: #98631b;36 --shadow-sm: 0 1px 2px rgb(12 19 33 / 7%);37 --shadow-md: 0 14px 38px rgb(12 19 33 / 10%);38 --radius-sm: 8px;39 --radius-md: 14px;40 --radius-lg: 22px;41 --header-height: 68px;42 --content-width: 1180px;43 --reading-width: 760px;44 --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;45 --font-code: "SFMono-Regular", "Cascadia Code", "Roboto Mono", ui-monospace, monospace;46 }4748 html[data-theme="dark"] {49 color-scheme: dark;50 --canvas: #101722;51 --paper: #171f2c;52 --paper-raised: #1b2533;53 --ink: #e8eef6;54 --ink-strong: #ffffff;55 --muted: #a8b3c3;56 --soft: #202b3a;57 --line: #2d3949;58 --line-strong: #44536a;59 --accent: #ff737c;60 --accent-strong: #ff9299;61 --accent-soft: #3b252d;62 --kotlin: #a295ff;63 --kotlin-soft: #2b2849;64 --shared: #52c9c6;65 --shared-soft: #173c41;66 --code: #0b111b;67 --code-ink: #eef3fb;68 --code-muted: #9aa8bc;69 --success: #66ca96;70 --warning: #e4ad5d;71 --shadow-sm: 0 1px 2px rgb(0 0 0 / 20%);72 --shadow-md: 0 18px 42px rgb(0 0 0 / 28%);73 }74}7576@layer base {77 body {78 min-width: 320px;79 min-height: 100vh;80 background: var(--canvas);81 color: var(--ink);82 font-family: var(--font-body);83 font-size: 16px;84 line-height: 1.68;85 -webkit-font-smoothing: antialiased;86 }8788 a { color: var(--accent-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; }89 a:hover { color: var(--accent); }90 button { color: inherit; }91 ::selection { background: var(--accent); color: #fff; }92 :focus-visible { outline: 3px solid color-mix(in srgb, var(--kotlin) 62%, transparent); outline-offset: 3px; }9394 h1, h2, h3, h4 {95 color: var(--ink-strong);96 font-weight: 750;97 letter-spacing: -0.025em;98 line-height: 1.16;99 text-wrap: balance;100 }101 h1 { font-size: clamp(2.5rem, 6vw, 5.25rem); }102 h2 { font-size: clamp(1.7rem, 3vw, 2.45rem); }103 h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }104 h4 { font-size: 1rem; }105 p { text-wrap: pretty; }106 code, kbd { font-family: var(--font-code); }107 code:not(pre code) {108 border: 1px solid var(--line);109 border-radius: 5px;110 background: var(--soft);111 padding: .1rem .34rem;112 color: var(--ink-strong);113 font-size: .88em;114 }115}116117@layer layout {118 .skip-link {119 position: fixed;120 z-index: 1000;121 top: 10px;122 left: 10px;123 transform: translateY(-160%);124 border-radius: var(--radius-sm);125 background: var(--ink-strong);126 padding: 10px 14px;127 color: var(--paper);128 font-weight: 700;129 }130 .skip-link:focus { transform: translateY(0); }131132 .site-header {133 position: sticky;134 z-index: 100;135 top: 0;136 height: var(--header-height);137 border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);138 background: color-mix(in srgb, var(--canvas) 88%, transparent);139 backdrop-filter: blur(18px) saturate(150%);140 }141 .header-inner {142 display: flex;143 width: min(calc(100% - 32px), var(--content-width));144 height: 100%;145 margin-inline: auto;146 align-items: center;147 gap: 28px;148 }149 .brand {150 display: inline-flex;151 flex: 0 0 auto;152 align-items: center;153 gap: 10px;154 color: var(--ink-strong);155 font-weight: 790;156 letter-spacing: -.02em;157 text-decoration: none;158 }159 .brand img { width: 34px; height: 34px; }160 .brand small { color: var(--muted); font-size: .73rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }161162 .site-nav { display: flex; margin-left: auto; align-items: center; gap: 4px; }163 .site-nav a {164 border-radius: 8px;165 padding: 8px 11px;166 color: var(--muted);167 font-size: .91rem;168 font-weight: 670;169 text-decoration: none;170 white-space: nowrap;171 }172 .site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--soft); color: var(--ink-strong); }173 .header-actions { display: flex; align-items: center; gap: 6px; }174175 .page-shell {176 display: grid;177 grid-template-columns: 190px minmax(0, var(--reading-width)) 190px;178 width: min(calc(100% - 40px), var(--content-width));179 margin: 0 auto;180 gap: 34px;181 align-items: start;182 }183 .page-main { min-width: 0; padding-block: 54px 96px; }184 .side-nav, .on-this-page { position: sticky; top: calc(var(--header-height) + 28px); padding-top: 50px; }185 .side-nav ul, .on-this-page ul { display: grid; gap: 3px; list-style: none; }186 .side-nav .nav-label, .on-this-page .nav-label {187 display: block;188 margin-bottom: 9px;189 color: var(--muted);190 font-size: .72rem;191 font-weight: 800;192 letter-spacing: .11em;193 text-transform: uppercase;194 }195 .side-nav a, .on-this-page a {196 display: block;197 border-left: 2px solid transparent;198 padding: 6px 9px;199 color: var(--muted);200 font-size: .86rem;201 line-height: 1.35;202 text-decoration: none;203 }204 .side-nav a:hover, .side-nav a[aria-current="page"], .on-this-page a.active {205 border-left-color: var(--accent);206 color: var(--ink-strong);207 }208209 .home-main { overflow: hidden; }210 .home-section { width: min(calc(100% - 40px), var(--content-width)); margin-inline: auto; padding-block: 88px; }211 .home-section + .home-section { border-top: 1px solid var(--line); }212213 .site-footer { border-top: 1px solid var(--line); background: var(--paper); }214 .footer-inner {215 display: grid;216 grid-template-columns: 1.25fr .75fr .75fr;217 width: min(calc(100% - 40px), var(--content-width));218 margin-inline: auto;219 gap: 36px;220 padding-block: 48px 58px;221 }222 .footer-inner p { max-width: 48ch; color: var(--muted); font-size: .92rem; }223 .footer-links { display: grid; align-content: start; gap: 7px; }224 .footer-links strong { margin-bottom: 4px; color: var(--ink-strong); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }225 .footer-links a { color: var(--muted); font-size: .91rem; text-decoration: none; }226227 @media (max-width: 1040px) {228 .page-shell { grid-template-columns: 176px minmax(0, 1fr); max-width: 920px; }229 .on-this-page { display: none; }230 }231232 @media (max-width: 990px) {233 .header-inner { gap: 16px; }234 .brand small { display: none; }235 .repo-label { display: none; }236 .site-nav { gap: 2px; }237 .site-nav a { padding: 8px 9px; }238 }239240 @media (max-width: 820px) {241 :root { --header-height: 62px; }242 .header-inner { width: min(calc(100% - 22px), var(--content-width)); gap: 12px; }243 .brand small { display: none; }244 .menu-toggle { display: inline-grid !important; }245 .site-nav {246 position: fixed;247 inset: var(--header-height) 12px auto;248 display: none;249 border: 1px solid var(--line);250 border-radius: var(--radius-md);251 background: var(--paper-raised);252 box-shadow: var(--shadow-md);253 padding: 10px;254 }255 .site-nav.open { display: grid; }256 .site-nav a { padding: 11px 12px; }257 .header-actions { margin-left: auto; }258 .repo-label { display: none; }259 .page-shell { display: block; width: min(calc(100% - 28px), var(--reading-width)); }260 .side-nav { display: none; }261 .page-main { padding-block: 38px 72px; }262 .home-section { width: min(calc(100% - 28px), var(--content-width)); padding-block: 64px; }263 .footer-inner { grid-template-columns: 1fr; width: min(calc(100% - 28px), var(--content-width)); gap: 28px; }264 }265}266267@layer components {268 .icon-button, .menu-toggle {269 display: inline-grid;270 width: 38px;271 height: 38px;272 place-items: center;273 border: 1px solid var(--line);274 border-radius: 9px;275 background: var(--paper);276 box-shadow: var(--shadow-sm);277 cursor: pointer;278 }279 .icon-button:hover, .menu-toggle:hover { border-color: var(--line-strong); background: var(--soft); }280 .icon-button svg, .menu-toggle svg { width: 18px; height: 18px; }281 .menu-toggle { display: none; }282 .repo-link { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .86rem; font-weight: 700; text-decoration: none; }283 .repo-link svg { width: 18px; height: 18px; }284285 .reading-progress { position: fixed; z-index: 120; inset: 0 0 auto; height: 2px; background: transparent; }286 .reading-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--accent), var(--kotlin)); }287288 .hero {289 position: relative;290 width: min(calc(100% - 40px), var(--content-width));291 min-height: calc(92vh - var(--header-height));292 margin-inline: auto;293 display: grid;294 grid-template-columns: minmax(0, 1.02fr) minmax(420px, .98fr);295 align-items: center;296 gap: 64px;297 padding-block: 82px;298 }299 .hero::before {300 content: "";301 position: absolute;302 z-index: -1;303 width: 460px;304 height: 460px;305 top: 9%;306 right: -11%;307 border: 1px solid color-mix(in srgb, var(--kotlin) 32%, transparent);308 border-radius: 50%;309 box-shadow: 0 0 0 78px color-mix(in srgb, var(--kotlin) 5%, transparent), 0 0 0 156px color-mix(in srgb, var(--accent) 3%, transparent);310 }311 .hero-copy { max-width: 680px; }312 .hero h1 { margin-block: 18px 24px; max-width: 12ch; }313 .hero h1 em { color: var(--accent); font-style: normal; }314 .hero-lede { max-width: 59ch; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.24rem); }315 .hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }316 .eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-strong); font-size: .76rem; font-weight: 840; letter-spacing: .12em; text-transform: uppercase; }317 .eyebrow::before { content: ""; width: 24px; height: 2px; background: currentColor; }318 .button {319 display: inline-flex;320 min-height: 44px;321 align-items: center;322 justify-content: center;323 gap: 8px;324 border: 1px solid var(--line-strong);325 border-radius: 10px;326 padding: 9px 15px;327 color: var(--ink-strong);328 font-weight: 760;329 text-decoration: none;330 }331 .button:hover { transform: translateY(-1px); border-color: var(--ink); color: var(--ink-strong); }332 .button.primary { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 22%, transparent); }333 .button.primary:hover { border-color: var(--accent-strong); background: var(--accent-strong); color: #fff; }334 .button svg { width: 18px; height: 18px; }335336 .source-rail {337 position: relative;338 border: 1px solid var(--line);339 border-radius: var(--radius-lg);340 background: var(--paper);341 box-shadow: var(--shadow-md);342 padding: 26px;343 }344 .rail-kicker { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 24px; color: var(--muted); font-family: var(--font-code); font-size: .75rem; }345 .rail-common {346 position: relative;347 z-index: 2;348 border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));349 border-radius: 12px;350 background: var(--accent-soft);351 padding: 17px 18px;352 }353 .rail-node strong, .rail-common strong { display: block; color: var(--ink-strong); font-family: var(--font-code); font-size: .88rem; }354 .rail-node span, .rail-common span { display: block; margin-top: 3px; color: var(--muted); font-size: .78rem; }355 .rail-trunk { width: 2px; height: 46px; margin-inline: auto; background: var(--line-strong); }356 .rail-platforms { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }357 .rail-platforms::before { content: ""; position: absolute; top: -18px; left: 16.66%; right: 16.66%; height: 2px; background: var(--line-strong); }358 .rail-node { position: relative; border: 1px solid var(--line); border-radius: 11px; background: var(--soft); padding: 14px 12px; text-align: center; }359 .rail-node::before { content: ""; position: absolute; width: 2px; height: 18px; left: 50%; bottom: 100%; background: var(--line-strong); }360 .rail-node.ios { border-color: color-mix(in srgb, var(--kotlin) 42%, var(--line)); }361 .rail-node.android { border-color: color-mix(in srgb, var(--shared) 45%, var(--line)); }362 .rail-foot { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 15px; color: var(--muted); font-size: .8rem; }363364 .section-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .7fr); gap: 48px; align-items: end; margin-bottom: 38px; }365 .section-heading h2 { max-width: 15ch; margin-top: 10px; }366 .section-heading p { color: var(--muted); }367 .card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }368 .card {369 position: relative;370 border: 1px solid var(--line);371 border-radius: var(--radius-md);372 background: var(--paper);373 box-shadow: var(--shadow-sm);374 padding: 24px;375 }376 .card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }377 .card .card-number { display: block; margin-bottom: 28px; color: var(--accent); font-family: var(--font-code); font-size: .76rem; font-weight: 780; }378 .card h3 { margin-bottom: 9px; }379 .card p { color: var(--muted); font-size: .94rem; }380 .card a::after { content: ""; position: absolute; inset: 0; }381 .card a { display: inline-block; margin-top: 18px; font-size: .88rem; font-weight: 750; text-decoration: none; }382383 .concept-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }384 .concept-card { border-left: 3px solid var(--kotlin); background: var(--paper); padding: 23px 24px; }385 .concept-card:nth-child(2n) { border-left-color: var(--shared); }386 .concept-card h3 { margin-bottom: 8px; }387 .concept-card p { color: var(--muted); font-size: .93rem; }388 .concept-card code { display: inline-block; margin-top: 14px; }389390 .chapter-header { margin-bottom: 44px; border-bottom: 1px solid var(--line); padding-bottom: 32px; }391 .breadcrumbs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; color: var(--muted); font-size: .82rem; }392 .breadcrumbs a { color: inherit; text-decoration: none; }393 .chapter-header h1 { max-width: 14ch; font-size: clamp(2.35rem, 5vw, 4.25rem); }394 .chapter-header > p { max-width: 62ch; margin-top: 18px; color: var(--muted); font-size: 1.08rem; }395 .chapter-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }396 .pill { border: 1px solid var(--line); border-radius: 999px; background: var(--paper); padding: 4px 9px; color: var(--muted); font-family: var(--font-code); font-size: .72rem; }397398 .doc-section { scroll-margin-top: calc(var(--header-height) + 30px); }399 .doc-section + .doc-section { margin-top: 66px; border-top: 1px solid var(--line); padding-top: 58px; }400 .doc-section h2 { margin-bottom: 18px; }401 .doc-section h3 { margin: 34px 0 12px; scroll-margin-top: calc(var(--header-height) + 24px); }402 .doc-section h4 { margin: 24px 0 8px; }403 .doc-section p + p { margin-top: 14px; }404 .doc-section ul, .doc-section ol { display: grid; gap: 8px; margin: 16px 0 0 1.25rem; }405 .doc-section li::marker { color: var(--accent); font-weight: 800; }406 .doc-section a { font-weight: 620; }407408 .callout { margin-block: 24px; border: 1px solid var(--line); border-left: 4px solid var(--shared); border-radius: 0 var(--radius-md) var(--radius-md) 0; background: var(--shared-soft); padding: 18px 20px; }409 .callout.warning { border-left-color: var(--warning); background: color-mix(in srgb, var(--warning) 10%, var(--paper)); }410 .callout.kotlin { border-left-color: var(--kotlin); background: var(--kotlin-soft); }411 .callout strong { display: block; margin-bottom: 4px; color: var(--ink-strong); }412 .callout p { color: var(--muted); font-size: .94rem; }413414 .code-block { position: relative; margin-block: 22px; border: 1px solid color-mix(in srgb, var(--line) 45%, transparent); border-radius: var(--radius-md); overflow: hidden; background: var(--code); box-shadow: var(--shadow-sm); }415 .code-label { display: flex; min-height: 38px; align-items: center; justify-content: space-between; border-bottom: 1px solid #293446; padding: 7px 12px 7px 15px; color: var(--code-muted); font-family: var(--font-code); font-size: .72rem; }416 pre { overflow-x: auto; padding: 18px 20px 21px; color: var(--code-ink); font-family: var(--font-code); font-size: .82rem; line-height: 1.66; tab-size: 4; }417 pre code { font-family: inherit; }418 .copy-button { border: 1px solid #3b485c; border-radius: 6px; background: #202a3a; padding: 4px 8px; color: #c5d0df; font-family: var(--font-body); font-size: .7rem; cursor: pointer; }419 .copy-button:hover { background: #2b374a; color: #fff; }420 .token-keyword { color: #cf9cff; }421 .token-type { color: #76d7d0; }422 .token-string { color: #f4c879; }423 .token-comment { color: #8290a5; }424425 .file-tree { margin-block: 22px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); padding: 20px; color: var(--muted); font-family: var(--font-code); font-size: .82rem; line-height: 1.75; overflow-x: auto; white-space: pre; }426 .file-tree b { color: var(--ink-strong); }427 .file-tree em { color: var(--accent-strong); font-style: normal; }428429 .flow-diagram { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; margin-block: 28px; }430 .flow-step { position: relative; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); padding: 16px; }431 .flow-step:not(:last-child)::after { content: "→"; position: absolute; left: calc(100% + 7px); top: 50%; translate: 0 -50%; color: var(--line-strong); font-weight: 800; }432 .flow-step small { display: block; margin-bottom: 4px; color: var(--accent); font-family: var(--font-code); font-size: .68rem; font-weight: 800; text-transform: uppercase; }433 .flow-step strong { color: var(--ink-strong); font-size: .88rem; line-height: 1.35; }434435 .comparison { width: 100%; margin-block: 22px; border-collapse: collapse; border: 1px solid var(--line); background: var(--paper); font-size: .88rem; }436 .comparison th, .comparison td { border-bottom: 1px solid var(--line); padding: 12px 14px; text-align: left; vertical-align: top; }437 .comparison th { background: var(--soft); color: var(--ink-strong); font-size: .78rem; letter-spacing: .03em; }438 .comparison td { color: var(--muted); }439 .comparison td:first-child { color: var(--ink-strong); font-family: var(--font-code); font-size: .78rem; }440441 .checklist { display: grid; gap: 9px; margin-top: 18px; list-style: none; }442 .checklist li { position: relative; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); padding: 11px 14px 11px 42px; }443 .checklist li::before { content: "✓"; position: absolute; top: 11px; left: 14px; color: var(--success); font-weight: 900; }444445 .next-page { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 68px; border-top: 1px solid var(--line); padding-top: 26px; }446 .next-page a { display: grid; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); padding: 16px 18px; text-decoration: none; }447 .next-page a:last-child { text-align: right; }448 .next-page small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }449 .next-page strong { margin-top: 3px; color: var(--ink-strong); }450451 @media (max-width: 900px) {452 .hero { min-height: auto; grid-template-columns: 1fr; gap: 50px; padding-block: 78px; }453 .hero-copy { max-width: 720px; }454 .hero h1 { max-width: 13ch; }455 .source-rail { max-width: 620px; }456 .section-heading { grid-template-columns: 1fr; gap: 18px; }457 .section-heading h2 { max-width: 18ch; }458 }459460 @media (max-width: 680px) {461 .hero { width: min(calc(100% - 28px), var(--content-width)); grid-template-columns: minmax(0, 1fr); padding-block: 58px 70px; }462 .hero::before { width: 260px; height: 260px; }463 .hero h1 { font-size: clamp(2.55rem, 14vw, 4.4rem); }464 .source-rail { padding: 18px; }465 .rail-platforms { grid-template-columns: 1fr; gap: 9px; }466 .rail-platforms::before { display: none; }467 .rail-node::before { display: none; }468 .rail-trunk { height: 20px; }469 .card-grid, .concept-grid { grid-template-columns: 1fr; }470 .flow-diagram { grid-template-columns: 1fr; gap: 10px; }471 .flow-step:not(:last-child)::after { content: "↓"; left: 50%; top: calc(100% + 3px); translate: -50% 0; }472 .comparison { display: block; overflow-x: auto; }473 .next-page { grid-template-columns: 1fr; }474 .next-page a:last-child { text-align: left; }475 }476}477478@layer utilities {479 .sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }480 .muted { color: var(--muted); }481 .mono { font-family: var(--font-code); }482 .nowrap { white-space: nowrap; }483}484485@media (prefers-reduced-motion: reduce) {486 *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }487}488489@media print {490 .site-header, .side-nav, .on-this-page, .site-footer, .reading-progress, .copy-button { display: none !important; }491 body { background: #fff; color: #111; }492 .page-shell { display: block; width: 100%; }493 .page-main { padding: 0; }494 .code-block, .card, .callout { break-inside: avoid; box-shadow: none; }495}496