/* Brand guidelines template — shared styles.
   Brand colours/fonts are injected as CSS variables from brand.js. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font), Verdana, system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  height: 64px; padding: 0 clamp(16px, 4vw, 48px);
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.topbar__logo { height: 22px; width: auto; flex: none; }
.topbar nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a {
  text-decoration: none; font-size: 14px; white-space: nowrap;
  padding: 6px 12px; border-radius: 999px; color: #555;
  transition: background .15s, color .15s;
}
.topbar nav a:hover { background: var(--panel); color: var(--accent-strong); }
.topbar nav a.is-active { background: var(--panel); color: var(--accent-strong); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px;
  padding: 10px 18px; font-size: 14px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, background .15s, box-shadow .15s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--accent-strong); color: #fff; }
.btn--primary:hover { box-shadow: 0 6px 18px -6px var(--accent-strong); }
.btn--ghost { background: #fff; border-color: rgba(0,0,0,.12); }
.btn--ghost:hover { border-color: var(--accent-strong); color: var(--accent-strong); }
.btn--small { padding: 6px 12px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }
.topbar .btn { flex: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: min(86vh, 760px);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(24px, 5vw, 64px) clamp(16px, 5vw, 72px);
  color: #fff;
  background: var(--accent-strong) var(--hero-image) center / cover no-repeat;
  isolation: isolate;
}
.hero::after { /* subtle grain, as on the PDF cover */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .18; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero__graphic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; opacity: .55; pointer-events: none; }
.hero__top { display: flex; justify-content: space-between; font-size: 14px; opacity: .9; }
.hero h1 {
  font-size: clamp(56px, 11vw, 168px); line-height: .95; font-weight: 400; letter-spacing: -.02em;
  margin: 48px 0;
}
.hero__bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.hero__logo { height: clamp(40px, 6vw, 64px); width: auto; }
.hero__meta { font-size: 14px; opacity: .9; text-align: right; }

/* ---------- Sections (PDF-style split layout) ---------- */
.section { display: grid; grid-template-columns: minmax(280px, 30%) 1fr; border-top: 1px solid rgba(0,0,0,.06); }
.section__aside { background: var(--panel); padding: clamp(32px, 5vw, 72px) clamp(16px, 4vw, 56px); }
.section__aside-inner { position: sticky; top: 104px; }
.section__eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #6b6488; margin-bottom: 14px; }
.section h2 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; font-weight: 600; color: var(--accent); margin-bottom: 22px; letter-spacing: -.01em; }
.section__aside p { font-size: 15.5px; font-weight: 400; color: #2a2a2a; max-width: 42ch; }
.section__aside p + p { margin-top: 14px; }
.section__main { padding: clamp(32px, 5vw, 72px) clamp(16px, 4vw, 64px); min-width: 0; }

.lead { font-size: clamp(22px, 2.4vw, 32px); line-height: 1.3; font-weight: 400; color: var(--accent-strong); max-width: 30ch; letter-spacing: -.01em; }
.prose p { max-width: 62ch; color: #333; }
.prose p + p { margin-top: 14px; }
.intro-grid { display: grid; gap: 40px; }

.subhead { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #6b6488; margin: 48px 0 16px; }
.subhead:first-child { margin-top: 0; }

/* ---------- Logo downloads ---------- */
.seg { display: inline-flex; background: #f1f0f6; border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-size: 14px; color: #555; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--accent-strong); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 20px; }
.logo-card { border: 1px solid rgba(0,0,0,.08); border-radius: 14px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.logo-card__stage { aspect-ratio: 16 / 10; display: grid; place-items: center; padding: 14%; }
.logo-card__stage img { max-height: 100%; width: 100%; object-fit: contain; }
.logo-card__stage--light { background: #fff; border-bottom: 1px solid rgba(0,0,0,.06); }
.logo-card__stage--gradient { background: var(--accent-strong) var(--hero-image) center / cover; }
.logo-card__body { padding: 16px; display: grid; gap: 12px; }
.logo-card__title { font-weight: 600; font-size: 15px; }
.logo-card__note { font-size: 13px; color: #666; margin-top: 2px; }
.dl-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dl-row__label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #888; width: 52px; }
.chip {
  border: 1px solid rgba(0,0,0,.12); background: #fff; border-radius: 8px;
  padding: 5px 10px; font-size: 12.5px; font-weight: 600; text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}
.chip:hover { border-color: var(--accent-strong); color: var(--accent-strong); background: #f7f5ff; }
.chip--pending { color: #999; border-style: dashed; cursor: default; }
.chip--pending:hover { color: #999; border-color: rgba(0,0,0,.12); background: #fff; }

.bulk { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* ---------- Clear space ---------- */
.clearspace {
  position: relative; background: #fff; border: 1px solid rgba(0,0,0,.08); border-radius: 14px;
  display: grid; place-items: center; padding: clamp(24px, 5vw, 64px);
}
.cs-box { position: relative; width: min(100%, 560px); }
.cs-zone {
  position: relative; padding: var(--cs-unit);
  outline: 1px dashed rgba(26,0,124,.45); outline-offset: 0;
}
.cs-zone img.cs-logo { width: 100%; outline: 1px dashed rgba(26,0,124,.45); }
.cs-unit { position: absolute; height: var(--cs-unit); width: auto; opacity: .22; filter: saturate(.4); }
.cs-unit--tl { top: 0; left: 0; } .cs-unit--tr { top: 0; right: 0; }
.cs-unit--bl { bottom: 0; left: 0; } .cs-unit--br { bottom: 0; right: 0; }
.cs-legend { display: flex; align-items: center; gap: 10px; margin-top: 20px; font-size: 14px; color: #555; }
.cs-legend img { height: 22px; width: auto; }

/* ---------- Misuse ---------- */
.misuse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.misuse-grid figure { margin: 0; }
.misuse-grid img { width: 100%; aspect-ratio: 365 / 267; object-fit: cover; border: 1px solid #e5e5e5; border-radius: 10px; }
.misuse-grid figcaption { display: flex; gap: 8px; align-items: center; font-size: 14px; margin-top: 10px; color: #333; }
.misuse-grid figcaption::before {
  content: "✕"; display: grid; place-items: center; flex: none;
  width: 20px; height: 20px; border-radius: 50%; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700;
}

/* ---------- Typography ---------- */
.type-hero { font-size: clamp(64px, 11vw, 160px); line-height: 1; letter-spacing: -.03em; color: var(--accent-strong); font-weight: 400; }
.type-hero small { display: block; font-size: 15px; letter-spacing: 0; color: #666; margin-top: 12px; }
.weights { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 8px; }
.weight { border: 1px solid rgba(0,0,0,.08); border-radius: 12px; padding: 18px; }
.weight__glyphs { font-size: 40px; line-height: 1.1; color: var(--accent-strong); }
.weight__name { font-size: 13px; color: #666; margin-top: 8px; display: flex; justify-content: space-between; }
.tester { border: 1px solid rgba(0,0,0,.08); border-radius: 14px; overflow: hidden; }
.tester__controls { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; padding: 12px 16px; background: #f7f6fb; border-bottom: 1px solid rgba(0,0,0,.06); font-size: 13px; }
.tester__controls label { display: flex; gap: 8px; align-items: center; color: #555; }
.tester__controls input[type=range] { accent-color: var(--accent-strong); width: 140px; }
.tester__text { padding: 24px; outline: none; color: var(--ink); line-height: 1.15; min-height: 120px; overflow-wrap: anywhere; }
.font-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; align-items: center; }
.fallback { font-size: 14px; color: #555; }
.fallback b { font-family: Verdana, sans-serif; font-weight: 400; }

/* ---------- Colour ---------- */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.swatch { border-radius: 14px; overflow: hidden; border: 1px solid rgba(0,0,0,.08); background: #fff; }
.swatch__chip { aspect-ratio: 4 / 3; padding: 18px; display: flex; align-items: flex-end; font-size: 22px; font-weight: 600; }
.swatch__values { padding: 6px 8px 10px; }
.val {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; text-align: left; font-size: 14px;
}
.val:hover { background: #f4f2fb; }
.val span:first-child { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #888; width: 44px; flex: none; }
.val span:nth-child(2) { flex: 1; font-variant-numeric: tabular-nums; }
.val .copy { font-size: 12px; color: var(--accent); opacity: 0; transition: opacity .15s; }
.val:hover .copy, .val:focus-visible .copy { opacity: 1; }
.val.copied .copy { opacity: 1; color: #1a7f37; }
.val__group { font-size: 11px; color: #aaa; padding: 8px 10px 0; }

.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.pair { border-radius: 12px; padding: 16px; border: 1px solid rgba(0,0,0,.06); display: flex; flex-direction: column; gap: 14px; }
.pair__aa { font-size: 30px; font-weight: 600; line-height: 1; }
.pair__meta { font-size: 12px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: rgba(255,255,255,.9); color: #1a1a1a; }
.badge--fail { background: #ffe5e5; color: #a1161b; }

/* ---------- In use ---------- */
.inuse-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.inuse-grid figure { margin: 0; border-radius: 14px; overflow: hidden; position: relative; background: #f1f0f6; }
.inuse-grid figcaption { font-size: 13px; color: #666; padding: 10px 2px 0; background: #fff; }
.inuse-grid .span-4 { grid-column: span 4; } .inuse-grid .span-3 { grid-column: span 3; } .inuse-grid .span-2 { grid-column: span 2; }
.sample-note { font-size: 13px; color: #8a5a00; background: #fff6e0; border: 1px solid #f3dfa8; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; }

.mock { container-type: inline-size; width: 100%; height: 100%; }
.mock--social { aspect-ratio: 1; background: var(--accent-strong) var(--hero-image) center / cover; color: #fff; padding: 8cqw; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.mock--social img.lines { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.mock--social h4 { font-size: 9cqw; line-height: 1.05; font-weight: 600; margin: 0; position: relative; max-width: 11ch; }
.mock--social .logo { width: 38cqw; position: relative; }
.mock--web { aspect-ratio: 16 / 10; background: #fff; display: flex; flex-direction: column; }
.mock--web .bar { display: flex; gap: 5px; padding: 2.2cqw 2.6cqw; background: #f1f0f6; }
.mock--web .bar i { width: 1.4cqw; height: 1.4cqw; border-radius: 50%; background: #d4d0e4; }
.mock--web .nav { display: flex; justify-content: space-between; align-items: center; padding: 3cqw 5cqw; }
.mock--web .nav img { width: 16cqw; }
.mock--web .nav span { display: flex; gap: 3cqw; font-size: 1.7cqw; color: #555; }
.mock--web .hero-band { flex: 1; margin: 0 2.6cqw 2.6cqw; border-radius: 1.6cqw; background: var(--accent-strong) var(--hero-image) center / cover; color: #fff; padding: 5cqw; display: flex; flex-direction: column; justify-content: center; gap: 2cqw; }
.mock--web h4 { font-size: 5cqw; line-height: 1.05; font-weight: 600; margin: 0; max-width: 14ch; }
.mock--web .cta { align-self: flex-start; background: #fff; color: var(--accent-strong); font-size: 1.7cqw; font-weight: 600; padding: 1.2cqw 2.4cqw; border-radius: 999px; }
.mock--card { aspect-ratio: 1; background: linear-gradient(160deg, #e9e6f5, #f8f7fc); display: grid; place-items: center; padding: 8cqw; }
.mock--card .cards { position: relative; width: 100%; aspect-ratio: 85 / 55; }
.mock--card .card { position: absolute; inset: 0; border-radius: 2cqw; box-shadow: 0 3cqw 6cqw -2cqw rgba(26,0,124,.35); padding: 7cqw; display: flex; flex-direction: column; justify-content: space-between; }
.mock--card .card--back { background: var(--accent-strong); transform: translate(6%, -14%) rotate(-6deg); display: grid; place-items: center; }
.mock--card .card--back img { width: 55%; }
.mock--card .card--front { background: #fff; transform: translate(-4%, 12%) rotate(3deg); }
.mock--card .card--front img { width: 38%; }
.mock--card .card--front p { font-size: 3cqw; line-height: 1.35; color: #333; }
.mock--card .card--front b { color: var(--accent-strong); font-weight: 600; display: block; font-size: 3.6cqw; }
.mock--banner { aspect-ratio: 4 / 1; background: var(--accent-strong); position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; padding: 0 5cqw; color: #fff; }
.mock--banner img.lines { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; }
.mock--banner .logo { width: 22cqw; position: relative; }
.mock--banner p { position: relative; font-size: 2.4cqw; font-weight: 300; max-width: 30ch; text-align: right; }

/* ---------- Imagery & downloads ---------- */
.assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.asset { border: 1px solid rgba(0,0,0,.08); border-radius: 14px; overflow: hidden; }
.asset__preview { aspect-ratio: 16 / 9; background: var(--accent-strong) center / cover; position: relative; }
.asset__preview img { width: 100%; height: 100%; object-fit: cover; }
.asset__body { padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }

.download-panel { background: var(--accent-strong) var(--hero-image) center / cover; color: #fff; border-radius: 18px; padding: clamp(24px, 4vw, 48px); display: grid; gap: 20px; }
.download-panel h3 { font-size: clamp(24px, 3vw, 36px); font-weight: 600; line-height: 1.1; }
.download-panel p { opacity: .9; max-width: 52ch; }
.download-panel .btn--primary { background: #fff; color: var(--accent-strong); }
.download-panel .btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.download-panel .btn--ghost:hover { border-color: #fff; color: #fff; }

/* ---------- Footer ---------- */
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 32px clamp(16px, 4vw, 56px); font-size: 13px; color: #666; border-top: 1px solid rgba(0,0,0,.06); }
.footer a { color: var(--accent); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: #1a1a1a; color: #fff; font-size: 14px; padding: 10px 16px; border-radius: 10px;
  transition: opacity .2s, transform .2s; pointer-events: none; z-index: 100;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
  .reveal.is-in { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .section { grid-template-columns: 1fr; }
  .section__aside-inner { position: static; }
  .topbar nav { display: none; }
  .topbar { justify-content: space-between; }
  .inuse-grid { grid-template-columns: 1fr 1fr; }
  .inuse-grid .span-4, .inuse-grid .span-3, .inuse-grid .span-2 { grid-column: span 2; }
}
@media (max-width: 480px) {
  .logo-grid, .misuse-grid, .weights, .swatches, .assets { grid-template-columns: 1fr; }
  .topbar .btn span { display: none; }
}

@media print {
  .topbar, .bulk, .dl-row, .tester__controls, .download-panel .btn, .toast { display: none !important; }
  .section { break-inside: avoid; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
