/* design.de-alwis.com: the site wears the system it documents. Every colour is a token from tokens.css. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-weight: 300; font-size: 16px; line-height: 1.8; }
a { color: var(--ink); text-decoration-color: var(--accent-line); text-underline-offset: 4px; }
a:hover { color: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
code { font-family: var(--font-body); font-size: .88em; font-weight: 400; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xs); padding: 1px 5px; white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 16px; }

/* Top bar */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; align-items: center; gap: 16px; padding: 14px clamp(16px, 4vw, 40px); background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; margin-right: auto; min-width: 0; }
.brand .logo { height: 30px; width: auto; display: block; }
.brand span { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-subtle); font-weight: 400; white-space: nowrap; }
.brand b { font-weight: 400; color: var(--ink); }
.logo--paper, [data-theme="light"] .logo--night { display: none !important; }
[data-theme="light"] .logo--paper { display: block !important; }
.theme, .menu { font: 400 12px var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); background: none; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; cursor: pointer; }
.theme:hover, .menu:hover { border-color: var(--accent-line); }
.theme__paper, [data-theme="light"] .theme__night { display: none; }
[data-theme="light"] .theme__paper { display: inline; }
.menu { display: none; }
.menu span { color: var(--accent); margin-left: 6px; }

/* Layout */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.side { position: sticky; top: 59px; align-self: start; height: calc(100vh - 59px); overflow: auto; padding: 32px 24px 32px clamp(16px, 4vw, 40px); display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line); }
.side a { font-size: 14px; line-height: 1.4; padding: 7px 0; color: var(--text-muted); text-decoration: none; }
.side a:hover { color: var(--ink); }
.side a[aria-current="page"] { color: var(--ink); }
.side a[aria-current="page"]::before { content: "→ "; color: var(--accent); }
.side__meta { margin-top: auto; padding-top: 24px; font-size: 12px; line-height: 1.6; color: var(--text-subtle); }
.side__meta a { font-size: 12px; padding: 0; color: var(--text-muted); }
.main { min-width: 0; padding: 48px clamp(16px, 5vw, 72px) 0; max-width: 900px; }
.main--wide { max-width: 1240px; }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 96px; padding: 20px 0 28px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-subtle); }
.foot a { color: var(--text-muted); }

/* Type */
.eyebrow { margin: 0; font-size: 12px; line-height: 1.6; letter-spacing: .16em; text-transform: uppercase; font-weight: 400; color: var(--text-subtle); }
.ph { padding-bottom: 32px; border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.h1 { margin: 16px 0 0; font-family: var(--font-display); font-weight: 300; font-size: clamp(40px, 5.4vw, 64px); line-height: 1.08; letter-spacing: -.06em; color: var(--ink); text-wrap: balance; }
.h1 em, .hero__h em { font-style: normal; color: var(--text-muted); }
.lead { margin: 20px 0 0; font-size: 17px; line-height: 1.8; color: var(--text); max-width: 62ch; }
.marker { margin: 0 0 24px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-subtle); display: flex; gap: 8px; }
.marker b { font-weight: 400; color: var(--ink); }
.link { display: inline-flex; align-items: center; gap: 28px; padding: 12px 0; font-size: 14px; font-weight: 400; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--accent-line); transition: gap .3s cubic-bezier(.22,.8,.2,1); }
.link span { color: var(--accent); font-size: 18px; line-height: 1; }
.link:hover { gap: 38px; color: var(--accent-soft); }
.prose-p { max-width: 62ch; }

/* Prose (brand book) */
.prose { max-width: 70ch; }
.prose h2 { margin: 56px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-family: var(--font-display); font-weight: 300; font-size: 30px; line-height: 1.2; letter-spacing: -.04em; color: var(--ink); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 36px 0 0; font-family: var(--font-display); font-weight: 400; font-size: 19px; line-height: 1.35; letter-spacing: -.02em; color: var(--ink); }
.prose p, .prose li { color: var(--text); }
.prose p { margin: 14px 0 0; }
.prose ul, .prose ol { margin: 14px 0 0; padding-left: 20px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--text-subtle); }
.prose strong { font-weight: 500; color: var(--ink-strong); }
.prose em { font-style: normal; color: var(--text-muted); }
.prose blockquote { margin: 20px 0 0; padding-left: 18px; border-left: 1px solid var(--line-strong); color: var(--text-muted); }
.src { margin-top: 48px; font-size: 12px; color: var(--text-subtle); }
.tbl { overflow-x: auto; margin: 20px 0 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.6; }
th { text-align: left; font-weight: 400; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-subtle); padding: 0 16px 8px 0; border-bottom: 1px solid var(--line-strong); }
td { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text); }
td:first-child { color: var(--ink); }
.code { margin: 20px 0 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xs); overflow-x: auto; font-size: 13px; line-height: 1.7; }
.code code { background: none; border: 0; padding: 0; white-space: pre; color: var(--text); }

/* Home */
.hero { position: relative; overflow: hidden; margin: -48px calc(-1 * clamp(16px, 5vw, 72px)) 0; padding: clamp(80px, 12vw, 160px) clamp(16px, 5vw, 72px) 64px; background: var(--bg); min-height: 520px; display: flex; align-items: flex-end; }
.hero__art { position: absolute; inset: 0 0 0 auto; width: 78%; height: 100%; object-fit: cover; object-position: 70% 40%; -webkit-mask-image: linear-gradient(to right, transparent, #000 40%), linear-gradient(to bottom, #000 70%, transparent); mask-image: linear-gradient(to right, transparent, #000 40%); }
.hero__body { position: relative; max-width: 640px; }
.hero__h { margin: 18px 0 0; font-family: var(--font-display); font-weight: 300; font-size: clamp(44px, 6.4vw, 84px); line-height: 1.06; letter-spacing: -.06em; color: var(--ink); text-wrap: balance; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 28px 0 0; }
.block { margin-top: 72px; }
.block h2 { margin: 48px 0 0; font-family: var(--font-display); font-weight: 300; font-size: 30px; letter-spacing: -.04em; color: var(--ink); }
.block h2:first-child { margin-top: 0; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.cols3 > div { border-top: 1px solid var(--line); padding-top: 14px; }
.cols3 h3 { margin: 10px 0 0; font-family: var(--font-display); font-weight: 400; font-size: 20px; letter-spacing: -.02em; color: var(--ink); }
.cols3 p:not(.eyebrow) { margin: 8px 0 0; font-size: 15px; }

/* Tokens */
.sw { display: inline-block; width: 22px; height: 22px; border-radius: var(--radius-xs); border: 1px solid var(--line); vertical-align: middle; margin-right: 8px; }
code.hex { background: none; border: 0; padding: 0; color: var(--text-muted); font-size: 12px; }
.tokens td:last-child { min-width: 280px; font-size: 13px; }
.spec { padding: 20px 0; border-bottom: 1px solid var(--line); }
.spec__meta { margin: 0; font-size: 12px; color: var(--text-subtle); }
.spec__sample { margin: 10px 0 0; color: var(--ink); overflow-wrap: anywhere; }
.spec__use { margin: 8px 0 0; font-size: 13px; color: var(--text-muted); max-width: 70ch; }

/* Components */
.toc { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; margin-bottom: 32px; font-size: 14px; }
.toc a { color: var(--text-muted); text-decoration: none; }
.toc a:hover { color: var(--ink); }
.toc__g { margin: 0 0 0 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-subtle); }
.toc__g:first-child { margin-left: 0; }
.main--wide > h2 { margin: 64px 0 0; padding-top: 18px; border-top: 1px solid var(--line-strong); font-family: var(--font-display); font-weight: 300; font-size: 30px; letter-spacing: -.04em; color: var(--ink); }
.comp { margin-top: 40px; }
.comp h3 { margin: 0 0 14px; font-family: var(--font-display); font-weight: 400; font-size: 20px; letter-spacing: -.02em; color: var(--ink); }
.comp__stage { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--bg); }
.comp__stage iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; }
.comp__doc { margin-top: 14px; font-size: 15px; }
.comp__doc p:first-child { margin-top: 0; }

/* Assets */
.assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; margin-top: 20px; }
.assets--wide { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.asset { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-xs); overflow: hidden; display: flex; flex-direction: column; }
.asset > a { display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 2; padding: 18px; }
.assets--wide .asset > a { padding: 0; }
.asset img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.assets--wide .asset img { width: 100%; height: 100%; object-fit: cover; }
.asset--night > a { background: #080e10; }
.asset--white > a { background: #ffffff; }
.asset--paper > a { background: #f4f7f6; }
.asset figcaption { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; font-size: 13px; line-height: 1.5; border-top: 1px solid var(--line); }
.asset figcaption b { font-weight: 400; color: var(--ink); overflow-wrap: anywhere; }
.asset figcaption span { color: var(--text-muted); }
.asset figcaption a { margin-top: 6px; font-size: 12px; color: var(--ink); text-decoration: none; }
.ph + h2 { margin-top: 0 !important; border-top: 0 !important; padding-top: 0 !important; }
.main > h2 { margin: 56px 0 0; font-family: var(--font-display); font-weight: 300; font-size: 30px; letter-spacing: -.04em; color: var(--ink); }
.more { margin-top: 24px; }
.more summary { cursor: pointer; font-size: 14px; color: var(--ink); }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu { display: inline-block; }
  .side { display: none; position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 16px; }
  .side.is-open { display: flex; }
  .brand span { display: none; }
  .cols3 { grid-template-columns: minmax(0, 1fr); }
  .hero__art { width: 100%; opacity: .55; }
  .main { padding-top: 32px; }
  .hero { margin-top: -32px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.icon-grid { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.icon-grid li { display: grid; justify-items: center; gap: 10px; padding: 20px 8px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink); min-width: 0; }
.icon-grid svg { width: 32px; height: 32px; display: block; }
.icon-grid code { background: none; border: 0; padding: 0; font-size: 11px; color: var(--text-subtle); white-space: normal; text-align: center; overflow-wrap: anywhere; }
