/* Shared styles for subpages (integration guides, legal).
   Tokens, nav, buttons and footer mirror the inline <style> in /index.html;
   keep the two in sync. Theme: <html data-theme="light|dark">, set before paint
   by the inline <head> script and toggled by /js/site.js. */

@font-face {
  font-family: 'OmniSignage';
  src: url('/assets/fonts/OmniSignage.ttf') format('truetype');
  font-weight: normal; font-style: normal; font-display: block;
}

/* ---------- Tokens (same as homepage) ---------- */
:root {
  color-scheme: light;
  --bg: #F6F5F2; --bg-2: #EFEDE9;
  --surface: #FFFFFF; --surface-2: #F8F7F5; --surface-3: #F1EFEB;
  --ink: #1A1816; --ink-2: #57524C; --ink-3: #6B655E;
  --line: rgb(26 22 18 / .08); --line-2: rgb(26 22 18 / .14);
  --accent: #C63F17; --accent-hover: #AE3510; --accent-ink: #FFFFFF;
  --accent-text: #B83A14; --accent-soft: rgb(198 63 23 / .09);
  --glow: rgb(226 98 50 / .20);
  --ok: #157A3F; --warn: #9A5B00; --bad: #B42318;
  --tint: 48 30 14;
  --ring: 0 0 0 1px rgb(var(--tint) / .07);
  --sh-1: var(--ring), 0 1px 2px rgb(var(--tint) / .05), 0 2px 6px -2px rgb(var(--tint) / .06);
  --sh-2: var(--ring), 0 1px 2px rgb(var(--tint) / .04), 0 6px 14px -6px rgb(var(--tint) / .10), 0 22px 40px -18px rgb(var(--tint) / .14);
  --hi: inset 0 1px 0 rgb(255 255 255 / .9);
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --pixel: 'OmniSignage', var(--mono);
  --scr: #15120F; --scr-ink: #F5EDE3;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E0D0C; --bg-2: #131211;
  --surface: #1A1917; --surface-2: #201E1C; --surface-3: #262422;
  --ink: #F3F1EE; --ink-2: #B3ADA5; --ink-3: #948E86;
  --line: rgb(255 246 236 / .08); --line-2: rgb(255 246 236 / .14);
  --accent: #FF6B3D; --accent-hover: #FF825A; --accent-ink: #1C0A03;
  --accent-text: #FF8A63; --accent-soft: rgb(255 107 61 / .12);
  --glow: rgb(255 107 61 / .16);
  --ok: #4ADE80; --warn: #FBBF24; --bad: #F87171;
  --tint: 0 0 0;
  --ring: 0 0 0 1px rgb(255 246 236 / .08);
  --sh-1: var(--ring), 0 1px 2px rgb(0 0 0 / .4), 0 2px 6px -2px rgb(0 0 0 / .4);
  --sh-2: var(--ring), 0 1px 2px rgb(0 0 0 / .4), 0 8px 18px -8px rgb(0 0 0 / .6), 0 24px 44px -20px rgb(0 0 0 / .7);
  --hi: inset 0 1px 0 rgb(255 255 255 / .05);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  font-family: var(--font); font-size: 16px; line-height: 1.6;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; font-feature-settings: "ss01";
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip { position: fixed; left: 16px; top: 12px; z-index: 100; padding: 10px 16px; border-radius: var(--r-sm); background: var(--ink); color: var(--bg); font-weight: 600; transform: translateY(-160%); transition: transform .2s var(--ease); }
.skip:focus { transform: none; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.wrap { width: min(1200px, 100% - 48px); margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  --h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--h); padding: 0 20px; border: 0; border-radius: 12px; cursor: pointer;
  font: 600 15px/1 var(--font); letter-spacing: -.01em; white-space: nowrap;
  transition-property: transform, background-color, box-shadow, color; transition-duration: .16s, .2s, .2s, .2s; transition-timing-function: var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.96); }
.btn-accent, .btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), 0 0 0 1px rgb(120 30 4 / .25), 0 1px 2px rgb(120 30 4 / .2), 0 8px 18px -8px rgb(198 63 23 / .6); }
.btn-accent:hover, .btn-primary:hover { background: var(--accent-hover); }
.btn-quiet, .btn-outline { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1), var(--hi); }
.btn-quiet:hover, .btn-outline:hover { background: var(--surface-2); }
:root[data-theme="dark"] .btn-quiet, :root[data-theme="dark"] .btn-outline { background: var(--surface-3); }
.btn-sm { --h: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.icon-btn {
  position: relative; width: 40px; height: 40px; display: grid; place-items: center; flex: none;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .16s var(--ease);
}
.icon-btn:hover { background: rgb(var(--tint) / .05); color: var(--ink); }
:root[data-theme="dark"] .icon-btn:hover { background: rgb(255 255 255 / .06); }
.icon-btn:active { transform: scale(.96); }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 84%, transparent); -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px); box-shadow: 0 1px 0 transparent; transition: box-shadow .25s var(--ease); }
.nav.stuck { box-shadow: 0 1px 0 var(--line); }
.nav-in { display: flex; align-items: center; gap: 6px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; font-family: var(--pixel); font-size: 20px; letter-spacing: .03em; color: var(--ink); line-height: 1; padding: 8px 4px 8px 0; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 7px); gap: 2px; }
.brand-mark i { width: 7px; height: 7px; border-radius: 2px; background: var(--ink); }
.brand-mark i:last-child { background: var(--accent); }
.nav-links { display: flex; gap: 2px; margin-right: 8px; }
.nav-links a { padding: 9px 12px; border-radius: 9px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); transition: color .2s var(--ease), background-color .2s var(--ease); }
.nav-links a:hover { color: var(--ink); background: rgb(var(--tint) / .05); }
:root[data-theme="dark"] .nav-links a:hover { background: rgb(255 255 255 / .06); }
.nav-links a[aria-current="page"], .mnav a[aria-current="page"] { color: var(--ink); }
.theme-btn .i { position: absolute; transition: opacity .3s var(--ease), transform .3s var(--ease), filter .3s var(--ease); }
.theme-btn .sun, :root[data-theme="dark"] .theme-btn .moon { opacity: 0; transform: scale(.25); filter: blur(4px); }
:root[data-theme="dark"] .theme-btn .sun { opacity: 1; transform: none; filter: none; }
.menu-btn { display: none; }
.mnav { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); box-shadow: var(--sh-2); padding: 8px 16px 16px; }
.mnav a { display: flex; align-items: center; min-height: 48px; padding: 0 4px; font-weight: 500; border-bottom: 1px solid var(--line); }
.mnav a:last-child { border-bottom: 0; }

/* ---------- Article ---------- */
.article { width: min(70ch, 100% - 48px); margin-inline: auto; padding: clamp(32px, 5vw, 64px) 0 clamp(72px, 9vw, 120px); font-size: 17px; line-height: 1.7; color: var(--ink-2); }
.article h1 { font-size: clamp(34px, 4.6vw, 52px); line-height: 1.04; letter-spacing: -.04em; font-weight: 600; color: var(--ink); text-wrap: balance; margin-bottom: 20px; }
.article h2 { font-size: clamp(24px, 2.6vw, 30px); line-height: 1.15; letter-spacing: -.028em; font-weight: 600; color: var(--ink); text-wrap: balance; margin: 56px 0 14px; }
.article h3 { font-size: 19px; line-height: 1.35; letter-spacing: -.015em; font-weight: 600; color: var(--ink); margin: 32px 0 8px; }
.article .lead { font-size: clamp(18px, 1.6vw, 20px); line-height: 1.55; margin-bottom: 36px; }
.article .updated { margin: -4px 0 40px; font: 500 13px/1.4 var(--mono); color: var(--ink-3); }
.article p { margin-bottom: 18px; text-wrap: pretty; }
.article ul, .article ol { margin: 0 0 20px 1.3em; }
.article li { margin-bottom: 8px; padding-left: 4px; }
.article li::marker { color: var(--ink-3); }
.article strong, .article b, .article em { color: var(--ink); }
.article strong, .article b { font-weight: 600; }
.article a:not(.btn) { color: var(--accent-text); font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-color .2s var(--ease); }
.article a:not(.btn):hover { text-decoration-color: currentColor; }
.article code { padding: .12em .4em; border-radius: 6px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line); font: 500 .86em/1.4 var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.article pre { margin: 20px 0 24px; padding: 16px 18px; border-radius: var(--r-md); background: var(--scr); color: var(--scr-ink); box-shadow: inset 0 0 0 1px rgb(255 246 236 / .06), var(--sh-1); overflow-x: auto; }
.article pre code { padding: 0; background: none; box-shadow: none; color: inherit; font-size: 13.5px; line-height: 1.6; overflow-wrap: normal; }
.article blockquote { margin: 24px 0; padding: 14px 20px; border-left: 3px solid var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--accent-soft); color: var(--ink); }
.article blockquote p:last-child { margin-bottom: 0; }
.article hr { margin: 48px 0; border: 0; height: 1px; background: var(--line-2); }

/* Breadcrumb */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 28px; font: 500 13px/1.4 var(--mono); color: var(--ink-3); }
.article .breadcrumb a { color: var(--ink-2); font-weight: 500; text-decoration: none; transition: color .2s var(--ease); }
.article .breadcrumb a:hover { color: var(--accent-text); }
.breadcrumb span:last-child { color: var(--ink); }

/* Tables (legal tables and .compare-table) */
.compare-table-wrap { width: 100%; overflow-x: auto; margin: 24px 0; -webkit-overflow-scrolling: touch; }
.article table { width: 100%; margin: 16px 0 28px; border-collapse: separate; border-spacing: 0; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--sh-1); overflow: hidden; font-size: 15px; line-height: 1.5; }
.article th, .article td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: break-word; }
.article tr:last-child > td { border-bottom: 0; }
.article th { background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: 14px; }
.compare-table { min-width: 640px; }
.compare-table td:first-child { color: var(--ink); }
.compare-table .yes { color: var(--ok); font-weight: 600; }
.compare-table .no { color: var(--bad); }
.compare-table .partial { color: var(--warn); }

/* Related links block */
.related { margin: 48px 0 32px; padding: 24px 28px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1), var(--hi); }
.article .related h2 { margin: 0 0 10px; font: 500 13px/1.3 var(--mono); letter-spacing: .01em; color: var(--ink-3); }
.article .related ul { margin: 0; list-style: none; }
.article .related li { display: flex; align-items: baseline; gap: 12px; margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
.article .related li:last-child { border-bottom: 0; }
.related li::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); transform: translateY(-2px); }

/* CTA card */
.cta { position: relative; margin: 32px 0 0; padding: clamp(32px, 5vw, 52px) clamp(22px, 4vw, 48px); border-radius: 28px; background: var(--surface); box-shadow: var(--sh-2); text-align: center; overflow: hidden; isolation: isolate; }
.cta::before { content: ""; position: absolute; left: 15%; top: -60%; width: 70%; height: 160%; z-index: -1; background: radial-gradient(closest-side, var(--glow), transparent); pointer-events: none; }
.article .cta h2 { margin: 0 0 10px; font-size: clamp(26px, 3vw, 34px); }
.article .cta p { margin: 0 auto 24px; max-width: 46ch; }

/* ---------- Footer (same as homepage) ---------- */
.foot { padding: 64px 0 32px; box-shadow: 0 -1px 0 var(--line); }
.foot-grid { display: grid; grid-template-columns: 2fr repeat(3, minmax(0, 1fr)); gap: 40px 24px; }
.foot-brand p { margin-top: 14px; max-width: 34ch; color: var(--ink-2); font-size: 15px; }
.foot-h { font: 500 12.5px/1.3 var(--mono); color: var(--ink-3); margin-bottom: 10px; }
.foot nav a { display: flex; align-items: center; min-height: 36px; color: var(--ink-2); font-size: 15px; transition: color .2s; }
.foot nav a:hover { color: var(--ink); }
.foot-bottom { margin-top: 48px; padding-top: 22px; box-shadow: 0 -1px 0 var(--line); color: var(--ink-3); font-size: 14px; }
.foot-bottom a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.foot-bottom a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .menu-btn { display: grid; }
}
@media (max-width: 860px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .wrap { width: calc(100% - 32px); }
  .btn-sm { --h: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .nav-in { height: 64px; gap: 2px; }
  .brand { font-size: 18px; }
  .nav-cta { margin-left: 4px; padding: 0 12px; }
  .article { width: calc(100% - 32px); font-size: 16.5px; }
  .article h2 { margin-top: 44px; }
  .article th, .article td { padding: 10px 12px; font-size: 14px; }
  .related { padding: 20px; }
  .cta .btn { width: 100%; }
  .foot { padding-top: 48px; }
}
@media (max-width: 380px) {
  .brand-text { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
