/* IW header v2 — canonical: https://theintelliwise.com/assets/header/
   Copy this file into each Intelliwise site. Do not load it cross-origin at
   runtime: a local, render-blocking copy avoids layout shift on GitHub Pages
   and on Jekyll. Visual design matches the live apex homepage header. */

header.iw-top,
header.iw-top * { box-sizing: border-box; }

header.iw-top {
  /* em sizes are relative to this 16px, so the bar stays 3.6em even if the
     host page changes the root font size. */
  font-size: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--iw-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--iw-rule);
  --iw-bg: #f6f5f2;
  --iw-ink: #1d1d1f;
  --iw-muted: #6e6e73;
  --iw-rule: rgba(29, 29, 31, .12);
  --iw-accent: #2f3f3a;
  --iw-accent-soft: #e7ebe8;
  --iw-amber: #b45309;
  --iw-amber-soft: #fdf0dc;
  color: var(--iw-ink);
}

@media (prefers-color-scheme: dark) {
  header.iw-top {
    --iw-bg: #1d1d1f;
    --iw-ink: #f5f5f7;
    --iw-muted: #a1a1a6;
    --iw-rule: rgba(245, 245, 247, .12);
    --iw-accent: #d5ddd8;
    --iw-accent-soft: #2a2f2d;
    --iw-amber: #f0a45a;
    --iw-amber-soft: #35291a;
  }
}

/* Site theme toggles (games, explorer) override the OS preference. */
html[data-theme="dark"] header.iw-top,
:root[data-theme="dark"] header.iw-top {
  --iw-bg: #1d1d1f;
  --iw-ink: #f5f5f7;
  --iw-muted: #a1a1a6;
  --iw-rule: rgba(245, 245, 247, .12);
  --iw-accent: #d5ddd8;
  --iw-accent-soft: #2a2f2d;
  --iw-amber: #f0a45a;
  --iw-amber-soft: #35291a;
}

html[data-theme="light"] header.iw-top,
:root[data-theme="light"] header.iw-top {
  --iw-bg: #f6f5f2;
  --iw-ink: #1d1d1f;
  --iw-muted: #6e6e73;
  --iw-rule: rgba(29, 29, 31, .12);
  --iw-accent: #2f3f3a;
  --iw-accent-soft: #e7ebe8;
  --iw-amber: #b45309;
  --iw-amber-soft: #fdf0dc;
}

header.iw-top .iw-wrap {
  width: min(68em, 100% - 2.5em);
  margin-inline: auto;
}

header.iw-top .iw-bar {
  display: flex;
  align-items: center;
  gap: 1em;
  height: 3.6em;
}

header.iw-top .iw-brand {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--iw-ink);
  font-size: 1em;
}

header.iw-top .iw-brand svg {
  width: 1.7em;
  height: 1.7em;
  flex: none;
}

header.iw-top .iw-nav {
  margin-left: auto;
  display: flex;
  gap: .2em;
  align-items: center;
}

header.iw-top .iw-nav a {
  padding: .45em .75em;
  border-radius: 999px;
  text-decoration: none;
  font-size: .92em;
  color: var(--iw-muted);
  font-weight: 500;
}

header.iw-top .iw-nav a:hover,
header.iw-top .iw-nav a.iw-on,
header.iw-top .iw-nav a[aria-current="page"] {
  color: var(--iw-ink);
  background: var(--iw-accent-soft);
}

header.iw-top .iw-soon::after {
  content: "soon";
  margin-left: .4em;
  font-size: .65em;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--iw-amber-soft);
  color: var(--iw-amber);
  padding: .1em .4em;
  border-radius: 999px;
  font-weight: 700;
}

header.iw-top .iw-menu-btn {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--iw-rule);
  border-radius: 10px;
  padding: .4em .7em;
  color: var(--iw-ink);
  font: inherit;
  font-size: .9em;
  cursor: pointer;
}

header.iw-top .iw-menu-btn:hover {
  background: var(--iw-accent-soft);
}

@media (max-width: 820px) {
  header.iw-top .iw-menu-btn { display: block; }
  header.iw-top .iw-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 3.6em;
    flex-direction: column;
    align-items: stretch;
    background: var(--iw-bg);
    border-bottom: 1px solid var(--iw-rule);
    padding: .6em 1.25em 1em;
  }
  header.iw-top .iw-nav.iw-open { display: flex; }
  header.iw-top .iw-nav a { padding: .7em .5em; font-size: 1em; }
}

@media (prefers-reduced-motion: reduce) {
  header.iw-top * { transition: none !important; }
}
