/* ==========================================================================
   Brand guide — print-ready US Letter sheets. Used on /guide and inlined in
   the standalone brand-guide.html export. Depends only on --brand-* vars.
   ========================================================================== */
.guide { --g-pad: 0.6in; font-family: var(--font-body); color: var(--brand-ink); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.guide *, .guide *::before, .guide *::after { box-sizing: border-box; }
.guide h1, .guide h2, .guide h3, .guide h4, .guide p { margin: 0; }
.guide code { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; font-size: .85em; }
.g-standalone { margin: 0; background: #DCD9D1; }
.guide-main, .g-standalone .guide { padding: 28px 16px 64px; }

.sheet { position: relative; width: 8.5in; min-height: 11in; margin: 0 auto 28px; padding: var(--g-pad); background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.06), 0 24px 60px -24px rgba(0,0,0,.3); display: flex; flex-direction: column; overflow: hidden; }
.g-h, .g-wordmark { font-family: var(--font-heading); font-weight: var(--font-heading-weight); letter-spacing: -.015em; }
.g-b { font-family: var(--font-body); }

.g-head { display: flex; align-items: baseline; gap: 14px; padding-bottom: 14px; margin-bottom: 26px; border-bottom: 2px solid var(--brand-ink); }
.g-head h2 { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 30px; letter-spacing: -.02em; }
.g-num { font: 500 12px 'JetBrains Mono', monospace; color: var(--brand-text-primary); }
.g-lead { font-size: 15px; line-height: 1.6; color: var(--brand-neutral-800); max-width: 60ch; margin-bottom: 22px; }
.g-sub { margin: 26px 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-neutral-700); }
.g-small { font-size: 11px; line-height: 1.55; color: var(--brand-neutral-700); }
.g-foot { display: flex; justify-content: space-between; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--brand-neutral-100); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-neutral-600); }
.g-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }

/* Cover */
.g-cover { background: var(--brand-primary); color: var(--brand-on-primary); padding: 0.7in; }
.g-cover__top { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
.g-cover__main { margin: auto 0; }
.g-wordmark--xl { font-size: 76px; line-height: .95; letter-spacing: -.03em; overflow-wrap: anywhere; }
.g-cover__tag { margin-top: 22px !important; font-size: 20px; opacity: .88; max-width: 30ch; }
.g-cover__bar { display: flex; height: 18px; border-radius: 999px; overflow: hidden; box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-on-primary) 30%, transparent); }
.g-cover__bar span { flex: 1; }

/* Overview */
.g-cols { display: grid; grid-template-columns: 1fr 1.1fr; gap: 32px; }
.g-toc { list-style: none; padding: 0; margin: 0; counter-reset: t; }
.g-toc li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--brand-neutral-100); font-size: 13px; }
.g-toc li span:last-child { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--brand-neutral-600); }
.g-wm-grid { display: grid; gap: 10px; }
.g-wm { position: relative; display: grid; place-items: center; height: 118px; padding: 16px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); text-align: center; }
.g-wm .g-wordmark { font-size: 28px; line-height: 1; }
.g-wm small { position: absolute; left: 12px; bottom: 8px; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
.g-rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.g-rules h4 { margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.g-rules p { font-size: 12px; line-height: 1.55; color: var(--brand-neutral-800); }

/* Color */
.g-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.g-swatch__fill { display: flex; align-items: flex-end; height: 2.2in; padding: 12px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.g-values { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; margin: 12px 0 8px; font-size: 10.5px; }
.g-values dt { font-weight: 700; color: var(--brand-neutral-600); }
.g-values dd { margin: 0; font-family: 'JetBrains Mono', monospace; font-size: 10px; }
.g-ratio { display: flex; height: 52px; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); margin-bottom: 10px; }
.g-ratio span { display: flex; align-items: center; padding: 0 12px; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; }

/* Scales */
.g-scales { display: grid; gap: 16px; }
.g-scale__name { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; }
.g-scale__row { display: grid; grid-template-columns: repeat(11, 1fr); border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.g-scale__chip { display: flex; flex-direction: column; justify-content: flex-end; height: 74px; padding: 6px 5px; font-size: 9px; line-height: 1.3; }
.g-scale__chip b { font-weight: 700; }
.g-scale__chip i { font-style: normal; font-family: 'JetBrains Mono', monospace; font-size: 7.5px; opacity: .85; }
.g-status { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.g-status div { display: flex; flex-direction: column; gap: 6px; font-size: 11px; }
.g-status span { display: flex; align-items: flex-end; height: 58px; padding: 8px 10px; border-radius: 8px; font-weight: 700; }

/* Accessibility */
.g-pairs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.g-pair { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.g-pair__aa { font-size: 22px; font-weight: 700; line-height: 1.1; }
.g-pair__lbl { font-size: 10px; font-weight: 600; }
.g-pair__r { font: 500 9.5px 'JetBrains Mono', monospace; opacity: .9; }
.g-pairs--avoid .g-pair { position: relative; }
.g-pairs--avoid .g-pair::after { content: '✕'; position: absolute; top: 8px; right: 10px; font-size: 12px; color: #B3261E; background: #fff; border-radius: 50%; width: 18px; height: 18px; display: grid; place-items: center; font-weight: 700; }
.g-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.g-table th { text-align: left; padding: 8px 10px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-neutral-700); border-bottom: 1.5px solid var(--brand-ink); }
.g-table td { padding: 9px 10px; border-bottom: 1px solid var(--brand-neutral-100); vertical-align: middle; }
.g-table--scale td:nth-child(2) { color: var(--brand-ink); max-width: 3.4in; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-table--scale td:nth-child(3), .g-table--scale td:nth-child(4) { font-family: 'JetBrains Mono', monospace; font-size: 10px; white-space: nowrap; }
.g-table--scale .g-h { font-family: var(--font-heading); font-weight: var(--font-heading-weight); }

/* Typography */
.g-type { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.g-type__face { display: flex; flex-direction: column; padding: 18px; border-radius: 10px; background: var(--brand-surface); }
.g-type__face small { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-neutral-700); }
.g-type__big { font-size: 96px; line-height: 1; margin: 6px 0 8px; color: var(--brand-text-primary); }
.g-type__chars { font-size: 15px; line-height: 1.5; letter-spacing: .02em; }

/* In use */
.g-use { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.g-use__hero { padding: 28px; border-radius: 12px; background: var(--brand-surface); }
.g-use__hero h3 { margin: 12px 0 10px; font-size: 30px; line-height: 1.05; }
.g-use__hero p { font-size: 13px; line-height: 1.6; color: var(--brand-neutral-800); }
.g-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; background: var(--brand-accent); color: var(--brand-on-accent); font-size: 10px; font-weight: 700; }
.g-btns { display: flex; gap: 8px; margin-top: 18px; }
.g-btn { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.g-btn--p { background: var(--brand-primary); color: var(--brand-on-primary); }
.g-btn--o { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--brand-ink) 25%, transparent); }
.g-use__cards { display: flex; flex-direction: column; gap: 12px; }
.g-bcard { position: relative; aspect-ratio: 3.5 / 2; border-radius: 8px; padding: 18px; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 10px 24px -14px rgba(0,0,0,.4); overflow: hidden; }
.g-bcard--front { display: flex; align-items: flex-end; background: var(--brand-primary); color: var(--brand-on-primary); }
.g-bcard--front .g-wordmark { font-size: 22px; line-height: 1; }
.g-bcard--back { display: flex; flex-direction: column; background: #fff; font-size: 10px; color: var(--brand-neutral-700); box-shadow: inset 0 0 0 1px var(--brand-neutral-100), 0 10px 24px -14px rgba(0,0,0,.4); }
.g-bcard--back b { font-size: 15px; color: var(--brand-ink); }
.g-bcard__c { margin-top: auto; }
.g-bcard--back i { position: absolute; right: 0; top: 0; bottom: 0; width: 10px; background: linear-gradient(var(--brand-primary) 0 50%, var(--brand-secondary) 0 80%, var(--brand-accent) 0); }

/* Reference */
.g-ref { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.g-ref h4 { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.g-ref h4:not(:first-child) { margin-top: 22px; }
.g-ref__list { list-style: none; padding: 0; margin: 0; }
.g-ref__list li { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--brand-neutral-100); font-size: 12.5px; }
.g-ref__list code { margin-left: auto; font-size: 11px; }
.g-end { margin: auto 0 0; padding: 36px; border-radius: 12px; background: var(--brand-ink); color: #fff; text-align: center; }
.g-end .g-wordmark { font-size: 34px; }
.g-end .g-small { margin-top: 8px; color: rgba(255,255,255,.65); }

/* Narrow screens: sheets become fluid cards */
@media screen and (max-width: 880px) {
  .sheet { width: 100%; min-height: 0; --g-pad: 22px; margin-bottom: 18px; border-radius: 10px; }
  .g-cover { min-height: 70vh; padding: 28px; }
  .g-wordmark--xl { font-size: 44px; }
  .g-cols, .g-use, .g-ref, .g-type { grid-template-columns: 1fr; }
  .g-swatches, .g-pairs, .g-status { grid-template-columns: repeat(2, 1fr); }
  .g-rules { grid-template-columns: 1fr; }
  .g-scale__chip { height: 54px; } .g-scale__chip i { display: none; }
  .g-table--scale td:nth-child(4), .g-table--scale th:nth-child(4) { display: none; }
}

@page { size: letter; margin: 0; }
@media print {
  html, body { background: #fff !important; }
  .no-print, .site-header, .site-footer, .ad, .toast { display: none !important; }
  .guide-main, .g-standalone .guide { padding: 0 !important; }
  .sheet { width: 8.5in; height: 11in; min-height: 0; margin: 0; box-shadow: none; border-radius: 0; break-after: page; page-break-after: always; }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
}
