/* Layout for the design system guide page. Values come from tokens.css. */
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--background); color: var(--foreground); font-family: var(--font-body); font-size: 15px; line-height: 22.5px; }
a { color: var(--green-3); }
a:hover { color: var(--green-2); }
:focus-visible { outline: 2px solid var(--green-3); outline-offset: 2px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; background: var(--cream-2); padding: 1px 5px; border-radius: var(--radius-sm); }

.ds-skip { position: absolute; left: -9999px; top: var(--space-2); background: var(--paper); padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill); z-index: 10; }
.ds-skip:focus { left: var(--space-4); }

/* Header */
.ds-top { position: sticky; top: 0; z-index: 5; background: var(--green-header); color: #fff; }
.ds-top-inner { max-width: 1200px; margin: 0 auto; padding: var(--space-3) var(--space-5); display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; }
.ds-brand { display: flex; align-items: center; gap: var(--space-3); color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; }
.ds-brand:hover { color: var(--cream-1); }
.ds-brand img { height: 30px; width: auto; display: block; }
.ds-top nav { display: flex; gap: var(--space-1); flex-wrap: wrap; margin-left: auto; }
.ds-top nav a { color: #fff; text-decoration: none; font-size: 13px; line-height: 20px; font-weight: 400; letter-spacing: 0.13px; padding: 6px var(--space-3); border-radius: var(--radius-pill); }
.ds-top nav a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.ds-top :focus-visible { outline-color: #fff; }

/* Page */
main { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-5) var(--space-16); }
.ds-hero { padding: var(--space-16) 0 var(--space-8); max-width: 760px; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); }
.ds-display { margin: 0; font-family: var(--font-display); font-synthesis: none; font-size: 42px; line-height: 1.05; font-weight: 700; letter-spacing: -0.035em; color: var(--green-2); }
.ds-lede { margin: 0; font-size: 16px; line-height: 24px; color: var(--muted-foreground); max-width: 36rem; }
.ds-version { margin: 0; font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.ds-warn { margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-xl); background: var(--paper); border: 2px solid var(--red-1); color: var(--foreground); font-size: 13px; line-height: 19px; }

.ds-section { padding: var(--space-8) 0; border-top: 1px solid rgba(190, 181, 163, 0.4); }
.ds-h2 { margin: 0 0 var(--space-2); font-family: var(--font-display); font-synthesis: none; font-size: 28px; line-height: 1.05; font-weight: 700; letter-spacing: -0.035em; color: var(--green-2); }
.ds-h3 { margin: var(--space-8) 0 var(--space-2); font-size: 16px; line-height: 18.4px; font-weight: 700; letter-spacing: -0.24px; color: var(--green-2); }
.ds-h2 + .ds-intro, .ds-h3 + .ds-intro { margin-top: 0; }
.ds-intro { margin: 0 0 var(--space-5); max-width: 46rem; color: var(--muted-foreground); }
.ds-note { margin: 0 0 var(--space-5); padding: var(--space-4) var(--space-5); max-width: 46rem; border-radius: var(--radius-2xl); background: var(--gold-soft); border: 1px solid rgba(200, 151, 45, 0.25); color: var(--gold-ink); font-size: 14px; line-height: 21px; }
.ds-note code { background: rgba(255, 255, 255, 0.7); }

.ds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-4); }
.ds-grid-sm { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.ds-label { display: block; font-weight: 700; font-size: 13px; line-height: 18px; color: var(--green-2); }
.ds-value { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 16px; color: var(--muted-foreground); background: none; border: 0; padding: 0; cursor: copy; text-align: left; }
.ds-value:hover { color: var(--green-3); text-decoration: underline; }
.ds-usage { margin: var(--space-1) 0 0; font-size: 12px; line-height: 17px; color: var(--muted-foreground); }

/* Colour */
.ds-group-title { margin: var(--space-5) 0 var(--space-3); font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.99px; text-transform: uppercase; color: var(--green-header); }
.ds-swatch { background: var(--paper); border: 1px solid rgba(190, 181, 163, 0.35); border-radius: var(--radius-2xl); overflow: hidden; }
.ds-swatch-chip { height: 76px; border-bottom: 1px solid rgba(190, 181, 163, 0.35); }
.ds-swatch-body { padding: var(--space-3); }
.ds-swatch-body .ds-value { display: block; }

/* Type */
.ds-fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
.ds-font { padding: var(--space-4); border-radius: var(--radius-2xl); background: var(--paper); border: 1px solid rgba(190, 181, 163, 0.35); }
.ds-type-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--space-5); padding: var(--space-4) 0; border-bottom: 1px solid rgba(190, 181, 163, 0.3); align-items: baseline; }
.ds-type-sample { color: var(--green-2); overflow-wrap: anywhere; }
.ds-type-sample.is-display { font-synthesis: none; }
@media (max-width: 640px) { .ds-type-row { grid-template-columns: 1fr; gap: var(--space-2); } }

/* Spacing, radius, shadow */
.ds-list { display: flex; flex-direction: column; gap: var(--space-2); }
.ds-space { display: grid; grid-template-columns: 90px 70px minmax(0, 1fr); gap: var(--space-3); align-items: center; }
.ds-space-bar { height: 16px; background: var(--green-3); border-radius: 2px; }
.ds-space .ds-usage { grid-column: 1 / -1; margin: 0 0 var(--space-2); }
.ds-shape { height: 88px; background: var(--mint); border: 1px solid rgba(36, 79, 69, 0.25); margin-bottom: var(--space-3); }
.ds-shadow-box { height: 88px; background: var(--paper); border-radius: var(--radius-2xl); margin-bottom: var(--space-3); }
#ds-shadow { padding: var(--space-3); }

/* Components */
.ds-comp { margin-top: var(--space-8); }
.ds-comp-head { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.ds-comp-head h3 { margin: 0; }
.ds-comp-desc { margin: var(--space-2) 0 var(--space-3); max-width: 46rem; color: var(--muted-foreground); font-size: 14px; line-height: 21px; }
.ds-stage { padding: var(--space-5); border-radius: var(--radius-2xl); background: var(--background); border: 1px dashed rgba(118, 129, 125, 0.35); display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }
.ds-stage.is-block { display: block; }
.ds-stage.is-green { background: var(--green-header); color: #fff; }
.ds-stage .ir-row { grid-auto-columns: minmax(170px, 185px); }
.ds-stage > .ir-pcard { width: 185px; }
.ds-stage > .ir-scard { width: 260px; }
.ds-stage .ir-search { width: 100%; max-width: 640px; }
.ds-code { margin: var(--space-3) 0 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-xl); background: var(--green-2); color: var(--cream-1); font-size: 12px; line-height: 18px; overflow-x: auto; }
.ds-code code { background: none; padding: 0; color: inherit; font-size: inherit; }

/* Assets */
.ds-assets { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ds-assets.is-photo { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.ds-asset { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius-2xl); background: var(--paper); border: 1px solid rgba(190, 181, 163, 0.35); text-decoration: none; color: var(--foreground); font-size: 12px; line-height: 16px; overflow-wrap: anywhere; }
.ds-asset:hover { border-color: rgba(36, 79, 69, 0.45); color: var(--green-3); }
.ds-asset img { width: 100%; height: 110px; object-fit: contain; display: block; }
.ds-assets.is-photo .ds-asset img { height: 150px; object-fit: cover; border-radius: var(--radius-xl); background: var(--sand); }
.ds-asset.is-dark { background: var(--green-header); color: #fff; }
.ds-assets.is-icon .ds-asset img { height: 32px; }

/* Rules and files */
.ds-rules ul, .ds-files { margin: 0; padding-left: 1.2em; max-width: 52rem; display: flex; flex-direction: column; gap: var(--space-2); }
.ds-files { margin-bottom: var(--space-5); }

.ds-foot { max-width: 1200px; margin: 0 auto; padding: var(--space-8) var(--space-5); display: flex; align-items: center; gap: var(--space-3); color: var(--muted-foreground); font-size: 12px; border-top: 1px solid rgba(190, 181, 163, 0.4); }
.ds-foot img { height: 22px; width: auto; }

.ds-toast { position: fixed; bottom: var(--space-5); left: 50%; transform: translateX(-50%); background: var(--green-2); color: var(--cream-1); padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill); font-size: 13px; box-shadow: var(--shadow-float); }

@media (max-width: 640px) {
  .ds-hero { padding-top: var(--space-8); }
  .ds-display { font-size: 28px; }
  .ds-top { position: static; }
  .ds-top nav { margin-left: 0; }
  html { scroll-padding-top: 0; }
}
