/* Shared layout for the Corevia and Nexa brand guidelines. Built on nexa.css tokens. */
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { font-size: 16px; }
.bb { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100dvh; }
.bb-nav { position: sticky; top: 0; height: 100dvh; overflow-y: auto; padding: 28px 18px; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 22px; }
.bb-nav .doc { font-size: 12px; color: var(--text-3); margin-top: -12px; padding-left: 35px; }
.bb-nav nav { display: grid; gap: 1px; }
.bb-nav nav a { display: flex; gap: 10px; align-items: baseline; padding: 7px 10px; border-radius: var(--r); font-size: 13.5px; color: var(--text-2); text-decoration: none; }
.bb-nav nav a span { font: 500 11px var(--mono); color: var(--text-3); width: 18px; }
.bb-nav nav a:hover { background: var(--surface-2); color: var(--text); }
.bb-nav nav a.active { background: var(--surface-2); color: var(--text); font-weight: 500; }
.bb-nav nav a.active span { color: var(--accent-ink); }
.bb-nav .switch { margin-top: auto; display: grid; gap: 6px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; }
.bb-nav .switch a { color: var(--text-2); text-decoration: none; display: flex; justify-content: space-between; }
.bb-nav .switch a:hover { color: var(--text); }
.bb-main { min-width: 0; }
.bb-sec { padding: 96px 64px; border-bottom: 1px solid var(--line); max-width: 1120px; }
.bb-sec > .num { font: 500 13px var(--mono); color: var(--accent-ink); }
.bb-sec > h2 { font-size: clamp(32px, 4vw, 46px); letter-spacing: -.035em; line-height: 1.05; margin: 10px 0 14px; }
.bb-sec > .lead { font-size: 18px; color: var(--text-2); max-width: 40em; }
.bb-sec h3 { font-size: 18px; letter-spacing: -.015em; margin: 48px 0 6px; }
.bb-sec h3 + p { color: var(--text-2); font-size: 15px; max-width: 42em; }
.bb-sec p.body { color: var(--text-2); max-width: 42em; margin-top: 10px; }
@media (max-width: 1000px) { .bb { grid-template-columns: minmax(0, 1fr); } .bb-nav { display: none; } .bb-sec { padding: 64px 24px; } }

/* cover */
.cover { min-height: 92dvh; display: grid; align-content: space-between; padding: 40px 64px 56px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; isolation: isolate; }
.cover::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 48px 48px; opacity: .5; mask-image: radial-gradient(ellipse 70% 70% at 70% 40%, #000 10%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse 70% 70% at 70% 40%, #000 10%, transparent 70%); }
.cover .meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-3); }
.cover h1 { font-size: clamp(48px, 8vw, 104px); letter-spacing: -.05em; line-height: .95; }
.cover p { font-size: 20px; color: var(--text-2); max-width: 30em; margin-top: 22px; }
.cover .big-mark { position: absolute; right: -60px; top: 50%; width: min(52vw, 620px); height: auto; transform: translateY(-50%); opacity: .95; z-index: -1; }
.cover .big-mark path { stroke-width: 3.2; }
@media (max-width: 1000px) { .cover { padding: 32px 24px 40px; } .cover .big-mark { opacity: .12; right: -120px; } }

/* generic blocks */
.grid { display: grid; gap: 16px; margin-top: 24px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } }
.tile { border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); padding: 24px; }
.tile h4 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.tile p { font-size: 14px; color: var(--text-2); }
.tile .k { font: 500 11.5px var(--mono); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; display: block; }
.stage-box { display: grid; place-items: center; min-height: 220px; border-radius: var(--r-xl); border: 1px solid var(--line); background: var(--surface); position: relative; overflow: hidden; }
.stage-box.dark { background: #0c0a09; border-color: #0c0a09; color: #fafaf9; }
.stage-box.ember { background: #ff5b14; border-color: #ff5b14; }
.stage-box.paper { background: var(--bg); }
.stage-box .cap { position: absolute; left: 14px; bottom: 12px; font-size: 12px; color: var(--text-3); }
.stage-box.dark .cap { color: #9a928c; }
.stage-box.ember .cap { color: #1a0a02; opacity: .7; }

/* logo lockups */
.lockup { display: inline-flex; align-items: center; gap: 14px; font-weight: 650; letter-spacing: -.045em; line-height: 1; }
.lockup .logo-mark { width: 56px; height: 56px; }
.lockup.lg { font-size: 44px; }
.stage-box.dark .lockup .logo-mark, .stage-box.dark .logo-mark { color: #fafaf9; }
.stage-box.ember .logo-mark { color: #0c0a09; }
.stage-box.ember .logo-mark .core { fill: #fafaf9; }
.mono .logo-mark .core { fill: currentColor; }
.app-icon { width: 96px; height: 96px; border-radius: 22px; background: #0c0a09; display: grid; place-items: center; box-shadow: var(--shadow-lg); }
.app-icon .logo-mark { width: 56px; height: 56px; color: #fafaf9; }

/* construction */
.construct svg { width: 100%; max-width: 420px; height: auto; }
.construct .grid-l { stroke: var(--line); stroke-width: .05; }
.construct .guide { stroke: var(--info); stroke-width: .08; stroke-dasharray: .4 .3; fill: none; }
.construct .lbl { font: 600 1px var(--mono); fill: var(--info); }

/* misuse */
.dont { position: relative; }
.dont .stage-box { min-height: 150px; }
.dont .x { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--danger); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.dont p { font-size: 13px; color: var(--text-2); margin-top: 10px; }
.do .x { background: var(--ok); }

/* colour */
.swatch { border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.swatch .chip { height: 140px; padding: 14px; display: flex; align-items: flex-end; font-size: 12px; font-weight: 500; }
.swatch .info { padding: 14px 16px; display: grid; gap: 3px; font-size: 12.5px; }
.swatch .info b { font-size: 14.5px; font-weight: 600; }
.swatch .info code { background: none; border: 0; padding: 0; font-size: 12px; color: var(--text-2); }
.swatch .info span { color: var(--text-3); }
.ratio { display: flex; height: 56px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); margin-top: 24px; }
.ratio div { display: flex; align-items: flex-end; padding: 8px 10px; font-size: 11.5px; font-weight: 500; }
.pairs { width: 100%; border-collapse: collapse; margin-top: 24px; font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.pairs th, .pairs td { padding: 12px 16px; text-align: left; border-top: 1px solid var(--line); }
.pairs thead th { border-top: 0; background: var(--surface-2); font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.pairs .demo { display: inline-flex; padding: 4px 10px; border-radius: 6px; font-weight: 600; font-size: 13px; }
.pass { color: var(--ok); font-weight: 500; } .fail { color: var(--danger); font-weight: 500; }

/* type */
.specimen { font-size: clamp(72px, 12vw, 160px); font-weight: 650; letter-spacing: -.05em; line-height: .9; }
.scale { margin-top: 24px; border-top: 1px solid var(--line); }
.scale > div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line); }
.scale small { font: 500 12px var(--mono); color: var(--text-3); line-height: 1.6; }
.scale p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) { .scale > div { grid-template-columns: minmax(0, 1fr); gap: 4px; } }

/* do / don't copy tables */
.dd { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 14.5px; }
.dd th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--text-3); padding: 0 16px 10px 0; }
.dd td { padding: 14px 16px 14px 0; border-top: 1px solid var(--line); vertical-align: top; }
.dd td:first-child { width: 50%; }
.dd .yes::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.dd .no::before { content: "✕ "; color: var(--danger); font-weight: 700; }
.dd .no { color: var(--text-2); }

/* icons, motion, misc */
.icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 24px; }
.icons div { display: grid; justify-items: center; gap: 8px; padding: 18px 8px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); font: 500 10.5px var(--mono); color: var(--text-3); }
.icons .icon { width: 24px; height: 24px; color: var(--text); }
.tokens { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 20px; }
.tokens td { padding: 12px 16px 12px 0; border-top: 1px solid var(--line); }
.tokens td:first-child { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); width: 32%; }
.motion-demo { display: flex; align-items: center; gap: 12px; }
.ball { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); animation: slide 2.4s var(--ease) infinite alternate; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(180px); } }
.track { width: 200px; height: 2px; background: var(--line); position: relative; }
.track .ball { position: absolute; top: -6px; left: 0; }
.quote-big { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.2; letter-spacing: -.025em; font-weight: 600; max-width: 22em; margin-top: 28px; }
.quote-big span { color: var(--text-3); }
.download { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); text-decoration: none; color: inherit; transition: border-color .2s, transform .2s var(--ease); }
.download:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.download .thumb { width: 48px; height: 48px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.download .thumb img { width: 30px; height: 30px; }
.download b { display: block; font-size: 14px; } .download span { font-size: 12.5px; color: var(--text-3); }
.bb-foot { padding: 40px 64px 64px; font-size: 13px; color: var(--text-3); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
@media (max-width: 1000px) { .bb-foot { padding: 32px 24px 48px; } }
.reveal-on .bb-sec > * { animation: rise .7s var(--ease) both; }
/* ---------- PDF / print: A4 landscape, one chapter per page ---------- */
.pdf-btn { display: inline-flex; align-items: center; gap: 8px; }
@media print {
  @page { size: A4 landscape; margin: 14mm 16mm 16mm; }
  html, body { background: #fff !important; scroll-behavior: auto; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .bb { display: block; min-height: 0; }
  .bb-nav, .no-print, .bb-foot .link { display: none !important; }
  .cover { min-height: 0; height: 176mm; padding: 4mm 0 0; border: 0; break-after: page; }
  .cover .big-mark { width: 118mm; right: -6mm; }
  .cover h1 { font-size: 96px; }
  .bb-sec { padding: 0 0 6mm; border: 0; max-width: none; break-before: page; }
  .bb-sec > h2 { break-after: avoid; }
  .bb-sec h3 { break-after: avoid; margin-top: 22px; }
  .tile, .stage-box, .swatch, .download, .dont > *, .do > *, tr, .scale > div, .specimen, figure, .quote-big, .motion-demo, .construct { break-inside: avoid; }
  .bb-foot { padding: 10mm 0 0; }
  a { text-decoration: none; }
  .reveal-on .bb-sec > * { animation: none; }
  /* PDF viewers render soft shadows, masks and blurs as grey boxes: draw flat instead */
  *, *::before, *::after { box-shadow: none !important; filter: none !important; text-shadow: none !important; }
  .cover::before { display: none; }
  .cover .big-mark { opacity: 1; }
  .app-icon { outline: 1px solid var(--line); }
}
.bb-nav .pdf-btn { justify-content: center; }
