/* ziaz.eu base: design tokens, focus, header, buttons. Shared by the home page
   and every case-studies page (which keep their own article styles).
   Palette follows docs/design-system/tokens.css: graphite chrome, moss-petrol
   as the quiet accent, the Ziaz moss green only for small brand marks.
   Dark is the default theme (PO, 2026-09-14); [data-theme] is set before
   first paint by the inline script in each page's <head>. */

/* A local Arial tuned to Inter's metrics, so the swap to Inter moves nothing. */
@font-face {
  font-family: "Inter Fallback"; src: local("Arial");
  ascent-override: 90.44%; descent-override: 22.52%; line-gap-override: 0%; size-adjust: 107.12%;
}

:root {
  color-scheme: light;
  --bg:        #F5F5F7;
  --bg-raised: #FFFFFF;
  --bg-sunk:   #ECECEF;
  --ink:       #1D1D1F;
  --ink-2:     #55555B;   /* secondary text, 7.1:1 on --bg */
  --ink-3:     #6E6E73;   /* tertiary, captions */
  --line:      #D2D2D7;
  --line-soft: #E3E3E8;
  --action:    #1D1D1F;
  --action-ink:#FFFFFF;
  --accent:    #31596B;   /* moss petrol: links, focus */
  --brand:     #3F6E52;   /* Ziaz moss green: small marks only */
  --brand-soft:rgba(63,110,82,.10);
  --live:      #1E7A55;
  --live-soft: #E5F4EC;
  --ok:        #1E7A55;
  --part:      #8A5A12;
  --none:      #6E6E73;
  --shadow:    0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --radius:    14px;
  --radius-lg: 20px;
  --maxw:      1160px;
  --gutter:    24px;
  --font: "Inter", "Inter Fallback", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:#0F1214; --bg-raised:#171B1F; --bg-sunk:#0B0D0F;
    --ink:#F5F5F7; --ink-2:#B4BBC2; --ink-3:#8F979F;
    --line:#2A3138; --line-soft:#20262B;
    --action:#F5F5F7; --action-ink:#111315;
    --accent:#8DB6C9; --brand:#8AB89A; --brand-soft:rgba(138,184,154,.12);
    --live:#5CC795; --live-soft:#15302A;
    --ok:#5CC795; --part:#E0B060; --none:#8F979F;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:#0F1214; --bg-raised:#171B1F; --bg-sunk:#0B0D0F;
  --ink:#F5F5F7; --ink-2:#B4BBC2; --ink-3:#8F979F;
  --line:#2A3138; --line-soft:#20262B;
  --action:#F5F5F7; --action-ink:#111315;
  --accent:#8DB6C9; --brand:#8AB89A; --brand-soft:rgba(138,184,154,.12);
  --live:#5CC795; --live-soft:#15302A;
  --ok:#5CC795; --part:#E0B060; --none:#8F979F;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.skip { position:absolute; left:16px; top:-48px; z-index:200; background:var(--action); color:var(--action-ink); padding:10px 14px; border-radius:10px; text-decoration:none; }
.skip:focus { top: 12px; }

/* ── Header ─────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.hdr { width: 100%; max-width: 1208px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 650; font-size: 18px; letter-spacing: -0.02em; }
.logo img { width: 30px; height: 30px; object-fit: contain; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav-list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-list a { display: block; padding: 8px 12px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-size: 14.5px; font-weight: 500; }
.nav-list a:hover { color: var(--ink); background: var(--bg-sunk); }
.nav-list a[aria-current="page"] { color: var(--ink); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink);
  cursor: pointer; font: inherit; padding: 0;
}
.icon-btn:hover { background: var(--bg-sunk); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-light { display: block; }
:root[data-theme="dark"] .theme-icon-dark { display: none; }
.menu-btn { display: none; }

@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  .nav-list {
    position: fixed; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
    display: none;
  }
  .nav-list.open { display: flex; }
  .nav-list a { padding: 14px 4px; border-radius: 0; border-bottom: 1px solid var(--line-soft); font-size: 16px; }
  .nav-list li:last-child a { border-bottom: 0; }
}

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border-radius: 999px; font: inherit; font-size: 15px; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--action); color: var(--action-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--action) 86%, var(--bg)); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--ink-3); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 14px; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.link-arrow:hover { border-color: var(--ink); }
.link-arrow span[aria-hidden] { transition: transform .15s ease; }
.link-arrow:hover span[aria-hidden] { transform: translateX(3px); }

/* What's new links stay hidden until a story is published (assets/stories.js).
   !important because .btn and the nav items set their own display. */
[data-whats-new-link][hidden] { display: none !important; }
