/* The brand site's own styles. Everything here is built from /brand.css tokens,
   so this page is also the first consumer of the system it documents. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 160px; }
body { margin: 0; background: var(--jd-bg); color: var(--jd-on-bg); font-family: var(--jd-font-body); font-weight: 500; font-size: var(--jd-body); line-height: var(--jd-leading); }
h1, h2, h3, .display { font-family: var(--jd-font-display); line-height: 1.05; margin: 0; }
p { margin: 0 0 .8em; }
p:last-child { margin-bottom: 0; }
a { color: inherit; }
code, pre { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .86em; }
code { background: var(--jd-fawn-3); color: var(--jd-ink); padding: .1em .35em; border-radius: 6px; overflow-wrap: anywhere; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--jd-highlight); outline-offset: 4px; border-radius: 6px; }

/* A width on an image never stretches it: the height always follows the file's own shape. */
img { height: auto; max-width: 100%; }

/* ---- top bar ---- */
.top { position: sticky; top: 0; z-index: 20; background: var(--jd-bg); border-bottom: 2px solid var(--jd-line); }
.top .in { max-width: 1680px; margin: 0 auto; padding: 10px var(--jd-pad); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brandmark { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brandmark img { width: 54px; height: auto; }
.brandmark b { font-family: var(--jd-font-display); font-weight: 700; font-size: clamp(22px, 1.7vw, 32px); line-height: 1; color: var(--jd-wordmark); }
.brandmark small { display: block; font-family: var(--jd-font-body); font-weight: 800; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--jd-on-bg-2); margin-top: 4px; }
[data-theme="dark"] .lineart { filter: invert(1) sepia(.25) brightness(.97); }
[data-theme="dark"] .card .lineart, [data-theme="dark"] .onlight .lineart { filter: none; }
nav.main { display: flex; gap: 8px; flex-wrap: wrap; }

/* Light, dark, system. One round icon shows the picked mode; hover, focus or a tap fans the other
   two out to either side, each with its name underneath. Room for the right-hand one is kept free. */
#mode { --s: var(--jd-target); --g: 8px; position: relative; flex: none; width: var(--s); height: var(--s); margin-right: calc(var(--s) + var(--g)); }
#mode button { position: absolute; inset: 0; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 3px solid var(--jd-outline); background: var(--jd-bg); color: var(--jd-on-bg); cursor: pointer; transition: transform var(--jd-base), opacity var(--jd-base), background var(--jd-fast); }
#mode button:hover, #mode button:focus-visible { background: color-mix(in srgb, var(--jd-highlight) 28%, var(--jd-bg)); }
#mode .cur { z-index: 2; }
#mode.open .cur { background: var(--jd-outline); color: var(--jd-ink); }
#mode .l, #mode .r { z-index: 1; opacity: 0; pointer-events: none; transform: scale(.6); }
#mode.open .l { opacity: 1; pointer-events: auto; transform: translateX(calc(-100% - var(--g))); }
#mode.open .r { opacity: 1; pointer-events: auto; transform: translateX(calc(100% + var(--g))); }
#mode svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#mode svg .fill { fill: currentColor; stroke: none; }
#mode.open button::after { content: attr(title); position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); padding: 2px 8px; border-radius: var(--jd-radius-pill); background: var(--jd-ink); color: var(--jd-cream); font-family: var(--jd-font-display); font-weight: 600; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; pointer-events: none; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: var(--jd-target); padding: 8px 22px; border-radius: var(--jd-radius-pill); border: 3px solid var(--jd-outline); background: transparent; color: var(--jd-on-bg); font-family: var(--jd-font-display); font-weight: 600; font-size: clamp(15px, 1.05vw, 19px); text-transform: uppercase; letter-spacing: .04em; text-decoration: none; cursor: pointer; line-height: 1.05; transition: background var(--jd-fast), transform var(--jd-fast); }
.pill:hover { background: color-mix(in srgb, var(--jd-highlight) 28%, transparent); }
.pill[aria-current="page"] { background: var(--jd-outline); color: var(--jd-ink); }
.pill.action { background: var(--jd-action); color: var(--jd-on-action); border-color: var(--jd-action); }
.pill.go { background: var(--jd-emphasis); color: var(--jd-on-emphasis); border-color: var(--jd-emphasis); }
.pill.go:hover { background: var(--jd-emphasis-hot); }
.card .pill { color: var(--jd-card-ink); }
.card .pill.go { color: var(--jd-on-emphasis); }

/* ---- page ---- */
main { max-width: 1680px; margin: 0 auto; padding: var(--jd-pad); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--jd-pad); }
/* grid children may shrink, so a long code line scrolls inside its box instead of widening the page */
main > *, .hero > *, .cols2 > *, .cols3 > *, .two-one > *, .tiles > *, .vs > *, .logo-demo > *, .diagrams > * { min-width: 0; }
.hero { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--jd-pad); align-items: center; padding: clamp(8px, 2vw, 40px) 0; }
.hero h1 { font-weight: 700; font-size: clamp(34px, 4.2vw, 84px); }
.hero h1 em { font-style: normal; color: var(--jd-wordmark); }
.hero .lede { font-size: clamp(18px, 1.5vw, 30px); font-weight: 700; margin-top: .6em; max-width: 34em; }
.hero .mascot { justify-self: center; width: min(100%, 420px); }
.stamp { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--jd-on-bg-2); }
.row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 1.2em; }

.card { background: var(--jd-card); color: var(--jd-card-ink); border-radius: var(--jd-radius); box-shadow: var(--jd-shadow); padding: var(--jd-pad); }
.card > h2 { font-size: var(--jd-title); font-weight: 700; display: flex; align-items: baseline; gap: .5em; flex-wrap: wrap; }
.card > h2 .n { font-size: .5em; font-weight: 600; color: var(--jd-card-ink-2); letter-spacing: .1em; }
.lede { font-size: var(--jd-lede); font-weight: 700; margin: .5em 0 1em; }
.card h3 { font-size: var(--jd-heading); font-weight: 600; color: var(--jd-card-ink-2); margin: 0 0 .45em; }
.muted { color: var(--jd-card-ink-2); }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--jd-pad); }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--jd-pad); }
.two-one { display: grid; grid-template-columns: 2fr 1fr; gap: var(--jd-pad); align-items: stretch; }
.blk { background: var(--jd-fawn-3); border-radius: var(--jd-radius-control); padding: 1em 1.1em; }
.blk + .blk { margin-top: var(--jd-gap); }
.cols2 > .blk + .blk, .cols3 > .blk + .blk, .two-one > .blk + .blk { margin-top: 0; }

ul.items, ol.items { list-style: none; margin: 0; padding: 0; display: grid; gap: .6em; }
.items li { background: var(--jd-paper); border-radius: 14px; padding: .7em .9em; }
.blk.plain .items li { background: var(--jd-paper); }
.items li b { display: block; font-family: var(--jd-font-display); font-weight: 600; font-size: var(--jd-label); }
ol.items { counter-reset: s; }
ol.items li { position: relative; padding-left: 3em; }
ol.items li::before { counter-increment: s; content: counter(s); position: absolute; left: .7em; top: .7em; width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--jd-caramel); color: var(--jd-ink); font-family: var(--jd-font-display); font-weight: 700; display: grid; place-items: center; font-size: .9em; }
.no .items li, .items li.no { background: var(--jd-emphasis); color: var(--jd-on-emphasis); }
.yes h3::before { content: '✓ '; color: var(--jd-ok); }
.no h3::before { content: '✕ '; color: var(--jd-emphasis); }
.callout { display: flex; align-items: center; gap: .6em; background: var(--jd-emphasis); color: var(--jd-on-emphasis); border-radius: .8em; padding: .7em 1em; font-weight: 800; font-size: 1.05em; line-height: 1.3; margin-top: var(--jd-gap); }
.callout::before { content: '!'; flex: none; width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--jd-emphasis-ring); color: var(--jd-emphasis); display: grid; place-items: center; font-family: var(--jd-font-display); font-weight: 700; }
.spot { box-shadow: 0 0 0 4px var(--jd-highlight), 0 14px 34px rgba(212,155,90,.45); background: var(--jd-highlight-wash) !important; transform: scale(1.02); transition: transform var(--jd-base); }
@media (prefers-reduced-motion: reduce) { .spot { transform: none; } html { scroll-behavior: auto; } }

/* ---- section nav (guidelines) ---- */
.jump { position: sticky; top: 78px; z-index: 10; display: flex; gap: 8px; overflow-x: auto; padding: 8px 0; background: var(--jd-bg); scrollbar-width: none; }
.jump a { flex: none; min-height: 48px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: var(--jd-radius-pill); background: var(--jd-strip); color: var(--jd-strip-ink); border: 2px solid var(--jd-outline); font-family: var(--jd-font-display); font-weight: 600; font-size: clamp(15px, 1vw, 18px); text-decoration: none; white-space: nowrap; }
.jump a.on { background: var(--jd-outline); color: var(--jd-ink); }

/* ---- swatches ---- */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5em, 1fr)); gap: .8em; }
.sw { border-radius: var(--jd-radius-control); overflow: hidden; background: var(--jd-paper); border: 2px solid var(--jd-line); text-align: left; padding: 0; font: inherit; color: var(--jd-ink); cursor: pointer; display: flex; flex-direction: column; }
.sw i { display: block; height: 4.6em; border-bottom: 2px solid var(--jd-line); }
.sw span { padding: .55em .7em .7em; display: block; }
.sw b { font-family: var(--jd-font-display); font-weight: 600; font-size: var(--jd-label); display: block; line-height: 1.1; }
.sw code { background: none; padding: 0; font-weight: 700; }
.sw small { display: block; font-size: .8em; line-height: 1.3; color: var(--jd-ink-2); margin-top: .3em; }
.sw.star { border-color: var(--jd-caramel); box-shadow: 0 0 0 2px var(--jd-caramel); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-family: var(--jd-font-display); font-weight: 600; color: var(--jd-card-ink-2); padding: .4em .6em; border-bottom: 2px solid var(--jd-line); white-space: nowrap; }
td { padding: .5em .6em; border-bottom: 1px solid var(--jd-line); vertical-align: middle; }
.tablewrap { overflow-x: auto; }
.chip { display: inline-flex; align-items: center; min-height: 2em; padding: .15em .7em; border-radius: var(--jd-radius-pill); font-family: var(--jd-font-display); font-weight: 600; font-size: .9em; white-space: nowrap; }
.g-AAA, .g-AA { background: var(--jd-ok-wash); color: var(--jd-ok-ink); }
.g-AA-large { background: var(--jd-amber); color: var(--jd-ink); }
.g-decoration { background: var(--jd-emphasis); color: var(--jd-on-emphasis); }
#contrast small.use { display: none; }
.sample { display: inline-block; padding: .25em .7em; border-radius: 10px; font-weight: 700; white-space: nowrap; }

/* ---- type specimen + layout diagrams ---- */
.blk:has(> .spec) { display: flex; flex-direction: column; }
.spec { display: grid; gap: .7em; flex: 1; align-content: space-evenly; }
.spec > div { display: grid; grid-template-columns: 9em 1fr; gap: 1em; align-items: baseline; border-bottom: 1px solid var(--jd-line); padding-bottom: .6em; }
.spec small { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--jd-ink-2); }
.spec .t-title { font-family: var(--jd-font-display); font-weight: 700; font-size: var(--jd-title); line-height: 1.05; }
.spec .t-lede { font-size: var(--jd-lede); font-weight: 700; }
.spec .t-heading { font-family: var(--jd-font-display); font-weight: 600; font-size: var(--jd-heading); color: var(--jd-ink-2); }
.spec .t-label { font-family: var(--jd-font-display); font-weight: 600; font-size: var(--jd-label); }
.diagrams { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1em; }
.dg { background: var(--jd-paper); border: 2px solid var(--jd-line); border-radius: 14px; padding: .7em; }
.dg .box { display: grid; gap: 6px; height: 6.5em; margin-bottom: .6em; }
.dg .box i { background: var(--jd-fawn-2); border-radius: 8px; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--jd-ink); }
.dg .box i.ph { background: var(--jd-caramel); }
.dg b { font-family: var(--jd-font-display); font-weight: 600; display: block; }
.dg small { font-size: .82em; line-height: 1.3; display: block; color: var(--jd-ink-2); }

.vs { display: grid; grid-template-columns: 1fr 1fr; gap: .8em; }
.vs > div { border-radius: 14px; padding: .8em 1em; background: var(--jd-paper); border: 2px solid var(--jd-line); }
.vs > div.good { border-color: var(--jd-ok); }
.vs small { display: block; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .3em; color: var(--jd-ink-2); }
.vs .good small { color: var(--jd-ok-ink); }
.logo-demo { display: grid; grid-template-columns: 1fr 1fr; gap: .8em; }
.logo-demo > div { border-radius: var(--jd-radius-control); padding: 1.2em; display: grid; place-items: center; gap: .6em; text-align: center; font-weight: 700; }
.logo-demo img { width: min(70%, 240px); }
.logo-demo .l { background: var(--jd-cream); color: var(--jd-ink); border: 2px solid var(--jd-line); }
.logo-demo .d { background: var(--jd-chocolate); color: var(--jd-cream); }
.logo-demo .d img { filter: invert(1) sepia(.25) brightness(.97); }
.wordmarks { display: grid; gap: .6em; }
.wordmarks div { border-radius: 14px; padding: .6em 1em; font-family: var(--jd-font-display); font-weight: 700; font-size: clamp(26px, 2.4vw, 46px); line-height: 1.1; }
.wordmarks .l { background: var(--jd-cream); color: var(--jd-ink); border: 2px solid var(--jd-line); }
.wordmarks .d { background: var(--jd-chocolate); color: var(--jd-fawn); }

pre.copy { position: relative; margin: 0; background: var(--jd-chocolate); color: var(--jd-cream); border-radius: 14px; padding: 1em 1em 1em 1em; overflow-x: auto; white-space: pre; line-height: 1.5; }
.copybtn { float: right; margin: -0.2em -0.2em .4em 1em; min-height: 40px; padding: 0 14px; border-radius: var(--jd-radius-pill); border: 0; background: var(--jd-action); color: var(--jd-on-action); font-family: var(--jd-font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 14px; cursor: pointer; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--jd-pad); }
a.tile { text-decoration: none; display: flex; flex-direction: column; gap: .5em; transition: transform var(--jd-fast), box-shadow var(--jd-fast); }
a.tile:hover, a.tile:focus-visible { transform: translateY(-4px); box-shadow: 0 0 0 3px var(--jd-highlight), var(--jd-shadow); }
a.tile h2 { font-size: 1.6em; font-weight: 700; }
a.tile .more { margin-top: auto; font-family: var(--jd-font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--jd-emphasis); }

footer { max-width: 1680px; margin: 0 auto; padding: 0 var(--jd-pad) 48px; color: var(--jd-on-bg-2); font-size: .85em; }
#toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--jd-ink); color: var(--jd-cream); padding: .6em 1.1em; border-radius: var(--jd-radius-pill); font-weight: 800; opacity: 0; pointer-events: none; transition: opacity var(--jd-base); z-index: 50; border: 2px solid var(--jd-caramel); }
#toast.on { opacity: 1; }

/* ---- phones: one column, section buttons at the thumb ---- */
@media (max-width: 700px) {
  html { scroll-padding-top: 76px; }
  .top .in { padding: 8px var(--jd-pad); gap: 8px; }
  .brandmark img { width: 40px; }
  .brandmark small { display: none; }
  nav.main { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  nav.main .pill { flex: none; min-height: 44px; padding: 6px 14px; font-size: 14px; border-width: 2px; }
  #mode { --s: 44px; --g: 6px; margin-right: 0; }
  #mode button { border-width: 2px; }
  #mode.open .cur { transform: translateX(calc(-100% - var(--g))); }
  #mode.open .l { transform: translateX(calc(-200% - 2 * var(--g))); }
  #mode.open .r { transform: none; }
  #mode svg { width: 22px; height: 22px; }
  .hero, .cols2, .cols3, .two-one, .vs, .logo-demo, .tiles { grid-template-columns: minmax(0, 1fr) !important; }
  .hero .mascot { width: 62%; order: -1; }
  .diagrams { grid-template-columns: 1fr 1fr; }
  .swatches { grid-template-columns: 1fr 1fr; gap: .6em; }
  .sw i { height: 3.4em; }
  .spec > div { grid-template-columns: 1fr; gap: .1em; }
  .jump { position: fixed; top: auto; bottom: 0; left: 0; right: 0; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border-top: 2px solid var(--jd-line); }
  body.has-jump { padding-bottom: 76px; }
  .card > h2 { display: block; }
  #contrast th:nth-child(2), #contrast td:nth-child(2) { display: none; }
  #contrast small.use { display: block; margin-top: .3em; font-size: .85em; line-height: 1.3; color: var(--jd-ink-2); }
  #contrast td { padding: .5em .3em; }
  .sample { white-space: normal; }
}
@media (min-width: 701px) and (max-width: 1100px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .diagrams { grid-template-columns: 1fr 1fr; }
  .cols3 { grid-template-columns: 1fr; }
}
