/* Client brand guide — themed per client through CSS variables set in guide.js */
:root {
  --bg: #FFFFFF;
  --h-weight: 400;
  --ink: #18181A;
  --accent: #1F3A5F;
  --on-accent: #FFFFFF;
  --font-h: ui-serif, Georgia, "Times New Roman", serif;
  --font-b: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --surface: color-mix(in srgb, var(--bg) 93%, var(--ink));
  --surface-2: color-mix(in srgb, var(--bg) 86%, var(--ink));
  --muted: color-mix(in srgb, var(--ink) 62%, var(--bg));
  --line: color-mix(in srgb, var(--ink) 13%, transparent);
  --radius: 14px;
  --nav-w: 248px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-lift: 0 18px 40px -18px color-mix(in srgb, var(--ink) 35%, transparent), 0 4px 12px -6px color-mix(in srgb, var(--ink) 14%, transparent);
  color-scheme: light;
}
:root[data-mode="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
html { font-synthesis: none; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-b); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-h); font-weight: var(--h-weight); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
.ico { display: inline-flex; width: 1.05em; height: 1.05em; flex: none; }
.ico svg { width: 100%; height: 100%; }

#app.loading { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 28px 22px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 24px; background: var(--bg); }
.side-brand { display: flex; align-items: center; gap: 10px; min-height: 40px; text-decoration: none; }
.side-brand img { height: 36px; width: auto; max-width: 170px; object-fit: contain; object-position: left center; }
.side-brand span { font-family: var(--font-h); font-size: 18px; font-weight: var(--h-weight); }
.side nav { display: flex; flex-direction: column; gap: 2px; position: relative; }
.side nav a { text-decoration: none; padding: 7px 10px; border-radius: 8px; font-size: 14px; color: var(--muted); display: flex; gap: 10px; align-items: baseline; transition: color 0.4s var(--ease); position: relative; z-index: 1; }
.side nav a .num { font-variant-numeric: tabular-nums; font-size: 11px; opacity: 0.7; width: 16px; }
.side nav a:hover { color: var(--ink); }
.side nav a.active { color: var(--ink); }
.side nav a .num { transition: opacity 0.4s var(--ease); }
.side nav a.active .num { opacity: 1; }
.nav-mark { position: absolute; left: 0; right: 0; top: 0; border-radius: 8px; background: var(--surface-2); transition: transform 0.6s var(--ease), height 0.6s var(--ease), opacity 0.4s; pointer-events: none; opacity: 0; }
.nav-mark::before { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 2px; border-radius: 2px; background: var(--accent); }
.side nav:not(:has(.nav-mark)) a.active { background: var(--surface-2); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.side-meta { font-size: 12px; color: var(--muted); }

main { min-width: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 64px); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-size: 14px; font-weight: 500; text-decoration: none; transition: background 0.35s var(--ease), border-color 0.35s var(--ease), color 0.35s var(--ease), transform 0.35s var(--ease), box-shadow 0.35s var(--ease); white-space: nowrap; }
.btn:hover { background: var(--surface); border-color: color-mix(in srgb, var(--ink) 25%, transparent); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); transition-duration: 0.1s; }
.btn.primary:hover { box-shadow: 0 10px 24px -12px var(--accent); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn.small { padding: 6px 11px; font-size: 12.5px; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- Hero ---------- */
.hero { padding: clamp(48px, 9vw, 112px) 0 clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--line); position: relative; }
.hero.has-cover { color: #fff; border: 0; padding-top: clamp(120px, 22vw, 260px); background: #111 center/cover no-repeat; }
.hero.has-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.72), rgba(0,0,0,0.1) 70%); }
.hero > .wrap { position: relative; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600; color: var(--muted); margin-bottom: 18px; }
.has-cover .eyebrow { color: rgba(255,255,255,0.8); }
.hero h1 { font-size: clamp(40px, 7vw, 88px); line-height: 1; letter-spacing: -0.025em; }
.hero .tagline { font-size: clamp(18px, 2.2vw, 24px); margin-top: 16px; max-width: 720px; color: var(--muted); font-family: var(--font-h); }
.has-cover .tagline { color: rgba(255,255,255,0.88); }
.hero .intro { max-width: 680px; margin-top: 24px; font-size: 17px; }
.hero-logo { margin-top: 44px; border-radius: var(--radius); padding: clamp(32px, 6vw, 72px); display: grid; place-items: center; border: 1px solid var(--line); }
.hero-logo img { max-height: 160px; max-width: min(520px, 100%); object-fit: contain; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* ---------- Sections ---------- */
section.block { padding: clamp(56px, 8vw, 96px) 0; border-bottom: 1px solid var(--line); }
.sec-head { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 40px; }
.sec-num { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.sec-head h2 { font-size: clamp(32px, 4.5vw, 52px); letter-spacing: -0.02em; }
.sec-intro { max-width: 720px; color: var(--muted); font-size: 17px; }
h3.sub { font-size: 22px; margin: 48px 0 18px; }
h3.sub:first-child { margin-top: 0; }
.label { font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.prose { max-width: 720px; font-size: 17px; }
.prose a { text-underline-offset: 3px; }

.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.card { background: var(--surface); border-radius: var(--radius); padding: 24px; }
.card h4 { font-size: 19px; margin-bottom: 8px; }
.card.outline { background: transparent; border: 1px solid var(--line); }

.statement { font-family: var(--font-h); font-size: clamp(24px, 3.4vw, 38px); line-height: 1.25; letter-spacing: -0.01em; max-width: 900px; padding-left: 24px; border-left: 3px solid var(--accent); margin: 8px 0; }

/* Voice */
.traits { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.traits-row { display: grid; grid-template-columns: 1fr 1fr; }
.traits-row > div { padding: 14px 20px; border-top: 1px solid var(--line); }
.traits-row > div + div { border-left: 1px solid var(--line); color: var(--muted); }
.traits-row.head > div { border-top: 0; background: var(--surface); font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 999px; background: var(--surface); font-size: 14px; }
.chip.no { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink) 40%, transparent); color: var(--muted); }
.copyblock { position: relative; background: var(--surface); border-radius: var(--radius); padding: 22px 24px; padding-right: 64px; }
.copyblock .copy-btn { position: absolute; top: 14px; right: 14px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.dodont { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dodont > div { border-radius: 10px; padding: 14px 16px; background: var(--bg); font-size: 15px; }
.tag-do, .tag-dont { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.tag-do { color: #1E7B4A; }
.tag-dont { color: #B3261E; }
:root[data-mode="dark"] .tag-do { color: #6FD39C; }
:root[data-mode="dark"] .tag-dont { color: #FF8A80; }
ul.list { margin: 0; padding-left: 1.1em; }
ul.list li { margin: 4px 0; }

/* Logos */
.logo-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.logo-stage { aspect-ratio: 16 / 10; display: grid; place-items: center; padding: 12%; position: relative; }
.logo-stage img { max-height: 100%; max-width: 100%; object-fit: contain; }
.stage-light { background: #FFFFFF; }
.stage-dark { background: #141414; }
.stage-checker { background-color: #fff; background-image: linear-gradient(45deg, #e9e9e9 25%, transparent 25%), linear-gradient(-45deg, #e9e9e9 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e9e9e9 75%), linear-gradient(-45deg, transparent 75%, #e9e9e9 75%); background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0; }
.stage-toggle { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.logo-card:hover .stage-toggle, .stage-toggle:focus-within { opacity: 1; }
.stage-toggle button { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(128,128,128,0.5); cursor: pointer; padding: 0; }
.logo-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.logo-body h4 { font-size: 19px; }
.use { font-size: 14.5px; color: var(--muted); }
.files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.fbtn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); text-decoration: none; font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; cursor: pointer; }
.fbtn:hover { background: var(--surface-2); }
.fbtn small { font-weight: 400; color: var(--muted); letter-spacing: 0; }
.fav-sizes { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.fav-sizes figure { margin: 0; display: grid; justify-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.fav-sizes img { image-rendering: auto; border-radius: 4px; }
pre.code { margin: 0; background: var(--surface-2); padding: 14px 16px; border-radius: 10px; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-all; }
.misuse .stage { aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: var(--surface); display: grid; place-items: center; margin-bottom: 12px; position: relative; }
.misuse .stage img { width: 100%; height: 100%; object-fit: contain; }
.misuse .x { position: absolute; top: 10px; left: 10px; width: 26px; height: 26px; border-radius: 50%; background: #B3261E; color: #fff; display: grid; place-items: center; padding: 5px; }
.misuse p { font-size: 15px; display: flex; gap: 8px; }

/* Colors */
.swatch { border-radius: var(--radius); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.swatch-chip { aspect-ratio: 5 / 3; padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; border: 0; text-align: left; width: 100%; }
.swatch-chip .nm { font-family: var(--font-h); font-size: 22px; font-weight: var(--h-weight); }
.swatch-chip .hint { font-size: 12px; opacity: 0.75; display: flex; align-items: center; gap: 6px; }
.swatch-vals { padding: 8px 10px 12px; }
.val { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 12px; border: 0; background: none; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; text-align: left; }
.val:hover { background: var(--surface-2); }
.val b { font-size: 11px; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; width: 64px; flex: none; }
.val code { font: 13.5px ui-monospace, SFMono-Regular, Menlo, monospace; flex: 1; }
.val .ico { opacity: 0; transition: opacity 0.15s; }
.val:hover .ico, .val:focus-visible .ico { opacity: 0.7; }
.swatch-usage { padding: 0 20px 16px; font-size: 14px; color: var(--muted); }
.contrast { display: flex; gap: 6px; padding: 0 20px 18px; flex-wrap: wrap; }
.cbadge { font-size: 11.5px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); display: inline-flex; gap: 6px; align-items: center; }
.cbadge i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 1px solid rgba(128,128,128,0.4); }
.cbadge.fail { opacity: 0.55; }
.proportion { display: flex; height: 72px; border-radius: var(--radius); overflow: hidden; margin-top: 8px; }
.proportion div { display: flex; align-items: flex-end; padding: 10px 12px; font-size: 12px; font-weight: 600; min-width: 0; overflow: hidden; white-space: nowrap; }
.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pair { border-radius: 12px; padding: 16px; aspect-ratio: 3/2; display: flex; flex-direction: column; justify-content: space-between; }
.pair .aa { font-family: var(--font-h); font-size: 28px; font-weight: var(--h-weight); line-height: 1; }
.pair small { font-size: 11.5px; opacity: 0.85; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }

/* Typography */
.font-card { border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 4vw, 36px); display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: clamp(20px, 4vw, 44px); }
.font-card + .font-card { margin-top: 18px; }
.font-aa { font-size: clamp(88px, 12vw, 140px); line-height: 0.9; letter-spacing: -0.03em; }
.font-meta h4 { font-size: 26px; margin-bottom: 4px; }
.font-role { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.font-sample { font-size: 22px; line-height: 1.35; margin-bottom: 16px; }
.charset { font-size: 15px; color: var(--muted); letter-spacing: 0.04em; word-break: break-all; margin-bottom: 16px; }
.weights { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 16px; font-size: 18px; }
.weights span small { font-size: 11px; color: var(--muted); margin-left: 4px; font-family: var(--font-b); font-weight: 400; }
.scale-row { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 18px 0; border-top: 1px solid var(--line); align-items: baseline; }
.scale-row .spec { font-size: 12px; color: var(--muted); line-height: 1.5; }
.scale-row .spec b { color: var(--ink); font-weight: 600; display: block; font-size: 13px; }
.scale-row .sample { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Photography & galleries */
.masonry { columns: 3 280px; column-gap: 16px; }
.masonry figure { break-inside: avoid; margin: 0 0 16px; }
.masonry img, .gal img { border-radius: 10px; cursor: zoom-in; width: 100%; background: var(--surface); }
figcaption { font-size: 13.5px; color: var(--muted); margin-top: 8px; display: flex; justify-content: space-between; gap: 10px; }
.gal figure { margin: 0; }
.gal img { aspect-ratio: 4/3; object-fit: cover; }
.lib-links { display: flex; flex-wrap: wrap; gap: 10px; }
.lightbox { position: fixed; inset: 0; background: rgba(10,10,10,0.92); z-index: 50; display: grid; place-items: center; padding: 4vw; cursor: zoom-out; }
.lightbox img { max-height: 88vh; max-width: 92vw; object-fit: contain; border-radius: 6px; }
.lightbox .cap { position: fixed; bottom: 18px; left: 0; right: 0; text-align: center; color: #ddd; font-size: 14px; }

/* Graphics / downloads */
.asset-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.asset-card .thumb { aspect-ratio: 4/3; background: var(--surface); display: grid; place-items: center; overflow: hidden; }
.asset-card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.asset-card .thumb.cover img { object-fit: cover; }
.asset-card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.dl-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 20px 0; border-top: 1px solid var(--line); }
.dl-row:last-child { border-bottom: 1px solid var(--line); }
.dl-row h4 { font-size: 18px; margin-bottom: 4px; }
.dl-row p { color: var(--muted); font-size: 14.5px; }

/* Contact */
.person { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.person h4 { font-size: 20px; }
.person .role { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.person a { display: block; font-size: 15px; text-underline-offset: 3px; margin-top: 2px; }

footer.credit { padding: 40px 0 56px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@font-face { font-family: "SCL Kumbh Sans"; src: url("/assets/brand/KumbhSans-Variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
footer.credit .scl { font-family: "SCL Kumbh Sans", ui-sans-serif, system-ui, sans-serif; }
footer.credit .scl a { color: #BF5DEE; font-weight: 600; text-decoration: none; }
footer.credit .scl a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Lock screen */
.lock { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.lock form { width: 100%; max-width: 380px; text-align: center; display: grid; gap: 14px; }
.lock h1 { font-size: 34px; }
.lock p { color: var(--muted); }
.lock input { width: 100%; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
.lock .err { color: #B3261E; font-size: 14px; min-height: 1.4em; }
.notfound { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; }
.notfound h1 { font-size: 40px; margin-bottom: 10px; }
.notfound p { color: var(--muted); }

.preview-bar { position: sticky; top: 0; z-index: 30; background: #FFD54A; color: #1b1b1b; font-size: 13px; padding: 8px 16px; text-align: center; }
.preview-bar a { font-weight: 600; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 60; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Mobile */
.mobile-top { display: none; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 40; transform: translateX(-100%); transition: transform 0.25s, visibility 0.25s; visibility: hidden; }
  .side.open { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0,0,0,0.2); }
  .mobile-top { display: flex; position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 16px; align-items: center; justify-content: space-between; gap: 12px; }
  .mobile-top .side-brand img { height: 28px; }
  .swatch-chip { aspect-ratio: 5 / 2; }
  .font-card { grid-template-columns: 1fr; }
  .scale-row { grid-template-columns: 1fr; gap: 6px; }
  .dodont { grid-template-columns: 1fr; }
  .wrap { padding: 0 16px; }
}
@media (max-width: 520px) {
  .traits-row > div { padding: 12px 14px; font-size: 15px; }
  .dl-row { grid-template-columns: 1fr; }
}

@media print {
  .side, .mobile-top, .hero-actions, .tools, .stage-toggle, .preview-bar, .files, .lib-links { display: none !important; }
  .layout { display: block; }
  section.block { break-inside: avoid-page; padding: 32px 0; }
}


/* ================= Motion ================= */
/* Only active when JS has run and the viewer hasn't asked for reduced motion. */

/* Page entrance: hero parts rise in, nav settles in from the side */
.motion .enter { opacity: 0; transform: translateY(18px); filter: blur(6px); }
.motion.entered .enter { opacity: 1; transform: none; filter: none; transition: opacity 1.1s var(--ease) var(--d, 0ms), transform 1.2s var(--ease) var(--d, 0ms), filter 1s var(--ease) var(--d, 0ms); }
.motion .enter-side nav, .motion .enter-side .side-brand, .motion .enter-side .side-foot { opacity: 0; transform: translateX(-10px); }
.motion.entered .enter-side nav, .motion.entered .enter-side .side-brand, .motion.entered .enter-side .side-foot { opacity: 1; transform: none; transition: opacity 0.9s var(--ease) 0.25s, transform 1s var(--ease) 0.25s; }
.motion.entered .enter-side nav { transition-delay: 0.4s; }
.motion.entered .enter-side .side-foot { transition-delay: 0.55s; }
.motion .hero.has-cover { background-size: 108%; transition: background-size 2.4s var(--ease); }
.motion.entered .hero.has-cover { background-size: 100%; }
.motion .hero-logo img { transform: scale(0.97); transition: transform 1.6s var(--ease) 0.5s; }
.motion.entered .hero-logo img { transform: none; }

/* Reveal on scroll */
.motion .rv { opacity: 0; transform: translateY(28px); }
.motion .rv.in { opacity: 1; transform: none; transition: opacity 1s var(--ease) var(--d, 0ms), transform 1.1s var(--ease) var(--d, 0ms); }
.motion .sec-head .rv { transform: translateY(16px); }
/* Proportion bar sweeps in from the left */
.motion .proportion.rv { transform: none; clip-path: inset(0 100% 0 0 round var(--radius)); }
.motion .proportion.rv.in { clip-path: inset(0 0 0 0 round var(--radius)); transition: opacity 0.6s var(--ease) var(--d, 0ms), clip-path 1.4s var(--ease) calc(var(--d, 0ms) + 0.1s); }
/* Swatch colour wipes up into the chip */
.motion .swatch.rv .swatch-chip { clip-path: inset(100% 0 0 0); }
.motion .swatch.rv.in .swatch-chip { clip-path: inset(0 0 0 0); transition: clip-path 1.1s var(--ease) calc(var(--d, 0ms) + 0.12s), transform 0.6s var(--ease), box-shadow 0.6s var(--ease); }

/* Images fade from soft to sharp once loaded */
.img-wait { opacity: 0; }
.img-wait.img-in { opacity: 1; transition: opacity 0.9s var(--ease); }
.motion .img-wait { filter: blur(8px); transform: scale(1.015); }
.motion .img-wait.img-in { filter: none; transform: none; transition: opacity 0.9s var(--ease), filter 1s var(--ease), transform 1.2s var(--ease); }

/* Hover: quiet lift, never bouncy */
.swatch, .asset-card, .person, .font-card, .logo-card, .card, .pair { transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease), border-color 0.6s var(--ease); }
@media (hover: hover) {
  .swatch:hover, .asset-card:hover, .logo-card:hover, .person:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
  .pair:hover { transform: translateY(-3px); }
  .font-card:hover { border-color: color-mix(in srgb, var(--ink) 24%, transparent); }
}
.swatch-chip { transition: filter 0.5s var(--ease); }
.swatch-chip .hint { transition: opacity 0.4s var(--ease), transform 0.5s var(--ease); }
@media (hover: hover) { .swatch-chip .hint { opacity: 0.55; transform: translateY(3px); } .swatch-chip:hover .hint, .swatch-chip:focus-visible .hint, .swatch-chip.copied .hint { opacity: 0.95; transform: none; } }
.asset-card .thumb img, .gal img, .masonry img { transition: transform 1.2s var(--ease), opacity 0.9s var(--ease), filter 1s var(--ease); }
@media (hover: hover) { .asset-card:hover .thumb img, .gal figure:hover img, .masonry figure:hover img { transform: scale(1.03); } }
.masonry figure, .gal figure { overflow: hidden; border-radius: 10px; }
.val { transition: background 0.35s var(--ease); }
.val .ico { transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); transform: translateX(-4px); }
.val:hover .ico, .val:focus-visible .ico { transform: none; }
.fbtn, .icon-btn { transition: background 0.35s var(--ease), border-color 0.35s var(--ease), transform 0.35s var(--ease); }
.fbtn:hover { transform: translateY(-1px); }
.person a, .prose a, .lib-links a { text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); transition: text-decoration-color 0.4s var(--ease); text-underline-offset: 3px; }
.person a:hover, .prose a:hover { text-decoration-color: currentColor; }

/* Copy confirmation */
.copied { animation: copied-pulse 0.7s var(--ease); }
.val.copied { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.val.copied code { color: var(--ink); }
@keyframes copied-pulse { 0% { transform: scale(1); } 30% { transform: scale(0.975); } 100% { transform: scale(1); } }
.swatch-chip.copied { animation: none; }
.swatch-chip.copied .hint .ico { animation: tick 0.5s var(--ease); }
@keyframes tick { from { transform: scale(0.4) rotate(-20deg); opacity: 0; } }

/* Toast: glide and settle */
#toast { transition: opacity 0.45s var(--ease), transform 0.6s var(--ease); transform: translate(-50%, 16px) scale(0.96); box-shadow: 0 16px 40px -16px rgba(0,0,0,0.4); }
#toast.show { transform: translate(-50%, 0) scale(1); }

/* Lightbox: soft fade, image settles in */
.lightbox { animation: lb-in 0.5s var(--ease) both; backdrop-filter: blur(6px); }
.lightbox img { animation: lb-img 0.7s var(--ease) both; }
.lightbox .cap { animation: lb-in 0.6s var(--ease) 0.15s both; }
.lightbox.closing { animation: lb-out 0.35s var(--ease-soft) both; }
.lightbox.closing img { animation: lb-img-out 0.35s var(--ease-soft) both; }
@keyframes lb-in { from { opacity: 0; } }
@keyframes lb-out { to { opacity: 0; } }
@keyframes lb-img { from { opacity: 0; transform: scale(0.95) translateY(10px); } }
@keyframes lb-img-out { to { opacity: 0; transform: scale(0.97); } }

/* Logo background toggle and stage colour changes fade rather than snap */
.logo-stage, .stage { transition: background-color 0.6s var(--ease); }

/* Lock screen and not-found arrive gently */
.lock form > *, .notfound > * { animation: rise 0.9s var(--ease) both; }
.lock form > *:nth-child(2) { animation-delay: 0.08s; }
.lock form > *:nth-child(3) { animation-delay: 0.16s; }
.lock form > *:nth-child(n+4) { animation-delay: 0.24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.lock input { transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease); }
.lock input:focus { outline: none; border-color: color-mix(in srgb, var(--ink) 35%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }

/* Loading state fades out */
#app.loading .spinner { animation: spin 0.9s linear infinite, lb-in 0.6s var(--ease) 0.2s both; }

/* Mobile drawer: eased slide with a soft scrim */
.scrim { display: none; }
@media (max-width: 900px) {
  .side { transition: transform 0.6s var(--ease), visibility 0.6s, box-shadow 0.6s var(--ease); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: color-mix(in srgb, var(--ink) 30%, transparent); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity 0.5s var(--ease), visibility 0.5s; }
  .side.open + .scrim { opacity: 1; visibility: visible; transition: opacity 0.5s var(--ease), visibility 0s; }
  .side.open { box-shadow: 0 0 60px rgba(0,0,0,0.18); }
  .mobile-top { transition: box-shadow 0.4s var(--ease); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; transition-delay: 0ms !important; }
  .swatch:hover, .asset-card:hover, .logo-card:hover, .person:hover, .pair:hover, .btn:hover, .fbtn:hover { transform: none; }
  .asset-card:hover .thumb img, .gal figure:hover img, .masonry figure:hover img { transform: none; }
}
