/* =============================================================================
   PAGES — page-specific styles.
     1. Canvas wireframe (index.html)
     2. Changelog (changelog.html)
     3. Design system reference (design-system.html)
   ========================================================================== */
@layer pages {

/* ── 1. Canvas wireframe ───────────────────────────────────────────────── */
.canvas-area { flex: 1; overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: var(--space-8); background-color: var(--bg); background-image: radial-gradient(circle, var(--dot) 1px, transparent 1px); background-size: 24px 24px; }
.canvas { width: 100%; max-width: var(--content-w); display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-elevated); }
.c-topbar { display: flex; align-items: center; flex-shrink: 0; gap: var(--space-4); height: 52px; padding: 0 var(--space-5); border-bottom: 1px solid var(--border-subtle); }
.c-logo { flex-shrink: 0; width: 22px; height: 22px; border-radius: var(--radius-sm); background: var(--accent); }
.c-sk, .c-sk-dk, .c-lbl, .c-th-ph, .c-td-ph, .c-title-ph, .ck-top, .ck-bot { height: 8px; border-radius: var(--radius-full); background: var(--border); }
.c-sk-dk, .c-title-ph, .ck-bot, .c-th-ph { background: var(--border-hover); }
.c-title-ph { height: 14px; width: 32%; }
.c-sk-btn { flex-shrink: 0; width: 64px; height: 26px; border-radius: var(--radius-control); background: var(--accent); }
.c-body { display: flex; min-height: 380px; }
.c-sidenav { display: flex; flex-direction: column; flex-shrink: 0; gap: 2px; width: 180px; padding: var(--space-3) var(--space-2); border-right: 1px solid var(--border-subtle); background: var(--bg); }
.c-nav-row { display: flex; align-items: center; gap: var(--space-3); height: 30px; padding: 0 var(--space-3); border-radius: var(--radius-md); }
.c-nav-row.sel { background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--border); }
.c-dot { flex-shrink: 0; width: 12px; height: 12px; border-radius: var(--radius-xs); background: var(--border); }
.c-nav-row.sel .c-dot { background: var(--accent); }
.c-lbl { flex: 1; height: 7px; }
.c-nav-row.sel .c-lbl { background: var(--text-muted); }
.c-content { flex: 1; display: flex; flex-direction: column; gap: var(--space-5); padding: var(--space-5); }
.c-cards { display: flex; gap: var(--space-3); }
.c-card { flex: 1; display: flex; flex-direction: column; justify-content: space-between; height: 78px; padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-subtle); }
.c-card.hl { background: var(--accent); border-color: var(--accent); box-shadow: var(--shadow-glow); }
.ck-top { height: 7px; } .ck-bot { height: 14px; }
.c-card.hl .ck-top { background: var(--on-accent); opacity: .35; }
.c-card.hl .ck-bot { background: var(--on-accent); opacity: .8; }
.c-table { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.c-thead { display: flex; align-items: center; height: 36px; padding: 0 var(--space-4); border-bottom: 1px solid var(--border); background: var(--bg); }
.c-th-ph, .c-td-ph { height: 7px; }
.c-trow { display: flex; align-items: center; height: 36px; padding: 0 var(--space-4); border-bottom: 1px solid var(--border-subtle); transition: background-color var(--duration-fast); }
.c-trow:last-child { border-bottom: 0; }
.c-trow:hover { background: var(--accent-subtle); }
.c-trow.sel { background: var(--surface-raised); }
.c-pill-col { display: flex; justify-content: flex-end; flex-shrink: 0; width: 80px; margin-left: auto; }
.c-gap { height: var(--space-3); }
.u-w-88 { width: 88px; } .u-w-58 { width: 58px; } .u-w-42 { width: 42px; }

/* ── 2. Changelog ──────────────────────────────────────────────────────── */
.changelog-main { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: auto; }
.changelog-area { flex: 1; overflow: auto; padding: 72px var(--space-8) 120px; }
.changelog { display: flex; flex-direction: column; max-width: var(--prose-w); margin: 0 auto; }
.cl-header { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: 72px; }
.cl-title { font-size: clamp(var(--text-4xl), 5vw, 48px); font-weight: var(--weight-bold); line-height: 1.08; letter-spacing: var(--tracking-tight-heading); }
.cl-sub { max-width: 560px; margin-top: var(--space-2); font-size: var(--text-lg); line-height: var(--leading-relaxed); color: var(--text-secondary); }
.cl-entry { margin-bottom: 72px; padding-bottom: 72px; border-bottom: 1px solid var(--border-subtle); }
.cl-entry:last-of-type { margin-bottom: 0; padding-bottom: var(--space-2); border-bottom: 0; }
.cl-date { margin-bottom: var(--space-4); font: var(--weight-regular) var(--text-base)/1 var(--font-mono); color: var(--text-muted); }
.cl-entry-title { display: block; margin-bottom: var(--space-6); font-size: var(--text-3xl); font-weight: var(--weight-semibold); line-height: 1.2; letter-spacing: var(--tracking-snug); text-decoration: none; color: var(--text-primary); transition: color var(--duration-fast); }
.cl-entry-title:hover { color: var(--text-secondary); }
.cl-hero { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 16 / 9; margin-bottom: var(--space-7, 28px); padding: var(--space-7, 28px); overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-card); background-color: var(--bg); background-image: radial-gradient(circle, var(--dot) 1px, transparent 1px); background-size: 18px 18px; box-shadow: var(--shadow-subtle); }
.hero-mock { display: flex; flex-direction: column; width: 100%; max-width: 520px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-elevated); }
.hm-bar { display: flex; align-items: center; gap: 5px; height: 22px; padding: 0 10px; border-bottom: 1px solid var(--border-subtle); }
.hm-dot { width: 7px; height: 7px; border-radius: var(--radius-full); background: var(--border-hover); }
.hm-body { display: flex; min-height: 120px; }
.hm-side { display: flex; flex-direction: column; gap: 4px; width: 90px; padding: 8px 6px; border-right: 1px solid var(--border-subtle); background: var(--bg); }
.hm-si { display: flex; align-items: center; gap: 5px; height: 14px; padding: 0 6px; border-radius: var(--radius-xs); }
.hm-si.sel { background: var(--surface-raised); }
.hm-si .d { width: 5px; height: 5px; border-radius: 1.5px; background: var(--border-hover); }
.hm-si .l { flex: 1; height: 3px; border-radius: 2px; background: var(--border); }
.hm-si:nth-child(2) .l { flex: none; width: 60%; } .hm-si:nth-child(3) .l { flex: none; width: 75%; } .hm-si:nth-child(4) .l { flex: none; width: 50%; } .hm-si:nth-child(5) .l { flex: none; width: 65%; }
.hm-si.sel .d, .hm-si.sel .l { background: var(--text-muted); }
.hm-main { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.hm-title { width: 40%; height: 6px; border-radius: 2px; background: var(--border-hover); }
.hm-cards { display: flex; gap: 6px; }
.hm-card { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 3px; height: 30px; padding: 5px 6px; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface); }
.hm-card.hl { background: var(--accent); border-color: var(--accent); }
.hm-card .t { width: 50%; height: 3px; border-radius: 2px; background: var(--border-hover); }
.hm-card .b { width: 35%; height: 5px; border-radius: 2px; background: var(--border); }
.hm-card.hl .t, .hm-card.hl .b { background: var(--on-accent); opacity: .6; }
.hm-table { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; }
.hm-row { height: 11px; border: 1px solid var(--border-subtle); border-radius: var(--radius-xs); background: var(--surface); }
.hm-row.sel { background: var(--surface-raised); border-color: var(--border); }
.cl-body-text { margin-bottom: var(--space-4); font-size: var(--text-lg); line-height: 1.7; color: var(--text-secondary); }
.cl-body-text strong { font-weight: var(--weight-semibold); color: var(--text-primary); }
.cl-body-text a { color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--border-hover); text-underline-offset: 3px; transition: text-decoration-color var(--duration-fast); }
.cl-body-text a:hover { text-decoration-color: currentColor; }
.cl-body-text code { padding: 1px 6px; border: 1px solid var(--border); border-radius: var(--radius-badge); background: var(--surface-raised); color: var(--text-primary); font-size: .88em; }
.cl-authors { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin-top: var(--space-7, 28px); }
.cl-author { display: inline-flex; align-items: center; gap: var(--space-3); font-size: var(--text-md); font-weight: var(--weight-medium); color: var(--text-secondary); text-decoration: none; transition: color var(--duration-fast); }
.cl-author:hover { color: var(--text-primary); }
.cl-author .avatar { border: 0; width: 28px; height: 28px; }
@media (max-width: 640px) {
  .changelog-area { padding: var(--space-8) var(--space-5) 56px; }
  .cl-entry { margin-bottom: 44px; padding-bottom: 44px; }
  .cl-header { margin-bottom: 44px; }
  .cl-entry-title { font-size: var(--text-xl); }
  .cl-sub, .cl-body-text { font-size: var(--text-md); line-height: var(--leading-relaxed); }
  .cl-hero { padding: var(--space-4); }
  .hm-side { display: none; }
  .canvas-area { padding: var(--space-3); }
  .c-sidenav { display: none; }
  .c-cards { flex-wrap: wrap; }
  .c-cards .c-card { min-width: calc(50% - var(--space-3)); }
}
@media (max-width: 900px) { .canvas-area { padding: var(--space-5); } }

/* ── 3. Design system reference ────────────────────────────────────────── */
.docs { flex: 1; min-height: 0; overflow: auto; scroll-padding-top: var(--space-16); }
.docs__wrap { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--space-10); max-width: 1180px; margin: 0 auto; padding: 0 var(--space-6); }
.docs__toc { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; gap: 1px; padding: var(--space-10) 0; }
.docs__toc a { padding: var(--space-1-5) var(--space-3); border-radius: var(--radius-md); color: var(--text-muted); font-size: var(--text-base); text-decoration: none; transition: color var(--duration-base), background-color var(--duration-base); }
.docs__toc a:hover { color: var(--text-primary); background: var(--accent-subtle); }
.docs__main { min-width: 0; padding-bottom: 96px; }
.docs__hero { padding: var(--space-16) 0 var(--space-8); }
.docs__hero h1 { max-width: 16ch; margin-top: var(--space-4); font-size: clamp(var(--text-4xl), 5vw, 56px); font-weight: var(--weight-bold); line-height: 1.08; }
.docs__hero p { max-width: 560px; margin-top: var(--space-4); font-size: var(--text-md); line-height: var(--leading-relaxed); color: var(--text-secondary); }
.ds-section { padding: var(--space-10) 0 var(--space-4); border-top: 1px solid var(--border-subtle); }
.ds-section:first-of-type { border-top: 0; }
.ds-section > h2 { margin-top: var(--space-1-5); font-size: var(--text-3xl); }
.ds-section > p { max-width: 560px; margin-top: var(--space-1-5); font-size: var(--text-base); color: var(--text-secondary); }
.ds-block { margin-top: var(--space-8); }
.ds-block > h3 { margin-bottom: var(--space-3); font: var(--weight-regular) var(--text-xs)/1 var(--font-mono); text-transform: uppercase; letter-spacing: var(--tracking-eyebrow); color: var(--text-muted); }
.ds-stage { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-6); border: 1px solid var(--border); border-radius: var(--radius-card); background-color: var(--bg); background-image: radial-gradient(circle, var(--dot) 1px, transparent 1px); background-size: 24px 24px; }
.ds-stage--col { flex-direction: column; align-items: stretch; }
.ds-stage--plain { background-image: none; background-color: var(--surface); }
.ds-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.ds-swatches { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.ds-swatch { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.ds-swatch i { display: block; height: 56px; border-bottom: 1px solid var(--border); background: var(--sw); }
.ds-swatch div { padding: var(--space-2-5) var(--space-3); }
.ds-swatch b { display: block; font-size: var(--text-sm); font-weight: var(--weight-medium); }
.ds-swatch span { font: var(--weight-regular) var(--text-2xs)/1.6 var(--font-mono); color: var(--text-muted); }
.ds-type > div { display: flex; align-items: baseline; gap: var(--space-6); padding: var(--space-3) 0; border-top: 1px solid var(--border-subtle); }
.ds-type > div > span { flex: none; width: 150px; font: var(--weight-regular) var(--text-2xs)/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.ds-scale { display: grid; gap: var(--space-1-5); }
.ds-scale > div { display: flex; align-items: center; gap: var(--space-4); }
.ds-scale span { flex: none; width: 110px; font: var(--weight-regular) var(--text-2xs)/1.4 var(--font-mono); color: var(--text-muted); }
.ds-scale i { display: block; height: var(--space-3); border-radius: var(--radius-2xs); background: var(--accent); }
.ds-radii { display: flex; flex-wrap: wrap; gap: var(--space-5); }
.ds-radii div { text-align: center; font: var(--weight-regular) var(--text-2xs)/1.6 var(--font-mono); color: var(--text-muted); }
.ds-radii i { display: block; width: 88px; height: 88px; margin-bottom: var(--space-2); border: 1px solid var(--border-hover); background: var(--surface); }
.ds-shadows { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: var(--space-6); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--bg); }
.ds-shadows div { display: grid; place-items: center; height: 88px; border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--sh); font: var(--weight-regular) var(--text-2xs)/1 var(--font-mono); color: var(--text-muted); }
.ds-motion { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ds-track { position: relative; height: 28px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg); }
.ds-track i { position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: var(--radius-sm); background: var(--accent); transition: left 1s var(--ease-soft); }
.ds-motion > div:hover .ds-track i { left: calc(100% - 22px); }
.ds-tune { display: grid; gap: var(--space-3); max-width: 560px; padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.ds-tune__row { display: grid; grid-template-columns: 90px 1fr 120px; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
.ds-tune__row b { font-weight: var(--weight-medium); }
.ds-tune > .btn { justify-self: start; }
.ds-tune__row code { font-size: var(--text-2xs); color: var(--text-muted); }
.ds-note { margin-top: var(--space-3); font-size: var(--text-sm); line-height: var(--leading-relaxed); color: var(--text-muted); }
.ds-note code, .ds-code { padding: 1px 6px; border: 1px solid var(--border-subtle); border-radius: var(--radius-badge); background: var(--surface-raised); font-size: var(--text-xs); color: var(--text-secondary); }
.ds-layout { display: grid; gap: var(--space-2); grid-template: 28px 120px 20px / 56px 1fr 72px; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--bg); font: var(--weight-regular) var(--text-2xs)/1 var(--font-mono); color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.ds-layout > div { display: grid; place-items: center; border: 1px dashed var(--border-hover); border-radius: var(--radius-md); background: var(--surface); }
.ds-layout__bar { grid-column: 1 / -1; } .ds-layout__foot { grid-column: 1 / -1; }
@media (max-width: 900px) {
  .docs__wrap { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 var(--space-4); }
  .docs__toc { display: none; }
  .ds-tune__row { grid-template-columns: 1fr; gap: var(--space-1); }
  .ds-type > div { flex-direction: column; gap: var(--space-1); }
}
}

/* ── generated: design-system token specimens (one rule per token) ───── */
@layer pages {
.sw-bg { --sw: var(--bg); }
.sw-surface { --sw: var(--surface); }
.sw-surface-raised { --sw: var(--surface-raised); }
.sw-surface-hover { --sw: var(--surface-hover); }
.sw-border { --sw: var(--border); }
.sw-border-hover { --sw: var(--border-hover); }
.sw-border-subtle { --sw: var(--border-subtle); }
.sw-text-primary { --sw: var(--text-primary); }
.sw-text-secondary { --sw: var(--text-secondary); }
.sw-text-muted { --sw: var(--text-muted); }
.sw-text-subtle { --sw: var(--text-subtle); }
.sw-accent { --sw: var(--accent); }
.sw-on-accent { --sw: var(--on-accent); }
.sw-accent-subtle { --sw: var(--accent-subtle); }
.sw-focus-ring { --sw: var(--focus-ring); }
.sw-success { --sw: var(--success); }
.sw-warning { --sw: var(--warning); }
.sw-danger { --sw: var(--danger); }
.sw-info { --sw: var(--info); }
.sw-violet { --sw: var(--violet); }
.ds-sp-1 { width: var(--space-1); }
.ds-sp-2 { width: var(--space-2); }
.ds-sp-3 { width: var(--space-3); }
.ds-sp-4 { width: var(--space-4); }
.ds-sp-6 { width: var(--space-6); }
.ds-sp-8 { width: var(--space-8); }
.ds-sp-12 { width: var(--space-12); }
.ds-sp-16 { width: var(--space-16); }
.ds-t-2xs { font-size: var(--text-2xs); }
.ds-t-xs { font-size: var(--text-xs); }
.ds-t-sm { font-size: var(--text-sm); }
.ds-t-base { font-size: var(--text-base); }
.ds-t-md { font-size: var(--text-md); }
.ds-t-lg { font-size: var(--text-lg); }
.ds-t-xl { font-size: var(--text-xl); }
.ds-t-2xl { font-size: var(--text-2xl); }
.ds-t-3xl { font-size: var(--text-3xl); }
.ds-t-4xl { font-size: var(--text-4xl); }
.ds-t-5xl { font-size: var(--text-5xl); }
.ds-r-2xs { border-radius: var(--radius-2xs); }
.ds-r-xs { border-radius: var(--radius-xs); }
.ds-r-sm { border-radius: var(--radius-sm); }
.ds-r-md { border-radius: var(--radius-md); }
.ds-r-lg { border-radius: var(--radius-lg); }
.ds-r-xl { border-radius: var(--radius-xl); }
.ds-r-2xl { border-radius: var(--radius-2xl); }
.ds-r-3xl { border-radius: var(--radius-3xl); }
.ds-r-full { border-radius: var(--radius-full); }
.ds-sh-subtle { --sh: var(--shadow-subtle); }
.ds-sh-elevated { --sh: var(--shadow-elevated); }
.ds-sh-glow { --sh: var(--shadow-glow); }
.ds-sh-modal { --sh: var(--shadow-modal); }
.ds-sh-dock { --sh: var(--shadow-dock); }
.p-25 { --value: 25%; } .p-60 { --value: 60%; } .p-85 { --value: 85%; }
}
@layer pages {
.ds-d-instant { transition-duration: var(--duration-instant); } .ds-d-fast { transition-duration: var(--duration-fast); }
.ds-d-base { transition-duration: var(--duration-base); } .ds-d-slow { transition-duration: var(--duration-slow); }
.ds-code-block { margin: 0; overflow-x: auto; font-size: var(--text-xs); line-height: var(--leading-relaxed); color: var(--text-secondary); white-space: pre; }
}
