/* ============================================================
   Ian Aman Official: shared chrome
   Nav, footer, buttons and the base for pages built on the
   tokens. Every selector starts with .ia- so this file can sit
   beside the older stylesheets (the assessment uses .btn and
   .eyebrow of its own) without touching them.
   ============================================================ */

/* ---------- base, for pages that opt in with body.ia-page ---------- */
.ia-page {
  margin: 0;
  background: var(--ia-bg);
  color: var(--ia-text);
  font-family: var(--ia-font-body);
  font-size: var(--ia-fs-body);
  font-weight: 400;
  line-height: var(--ia-lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
/* The resets sit inside :where() so they carry no specificity: any class on
   the page can set its own margin or padding without a fight. */
:where(.ia-page) *, :where(.ia-page) *::before, :where(.ia-page) *::after { box-sizing: border-box; }
:where(.ia-page) :where(h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote) { margin: 0; padding: 0; }
:where(.ia-page) :where(ul, ol) { list-style: none; }
:where(.ia-page) :where(img, picture, svg) { display: block; max-width: 100%; }
:where(.ia-page) :where(img) { height: auto; }
:where(.ia-page) :where(a) { color: inherit; }
.ia-page ::selection { background: var(--ia-ember); color: var(--ia-bone); }
.ia-page :focus-visible { outline: 3px solid var(--ia-focus); outline-offset: 3px; border-radius: 4px; }
html:has(.ia-page) { scroll-behavior: smooth; scroll-padding-top: calc(var(--ia-nav-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html:has(.ia-page) { scroll-behavior: auto; } }

/* Film grain: one fixed layer, no animation. */
.ia-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.ia-page > * { position: relative; z-index: 1; }

.ia-wrap { width: 100%; max-width: var(--ia-max); margin-inline: auto; padding-inline: var(--ia-pad); }
.ia-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.ia-ember { color: var(--ia-accent); }

/* Bebas label with an Ember tick. Large enough to read, never tiny caps. */
.ia-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--ia-font-display);
  font-size: var(--ia-fs-label);
  letter-spacing: 0.09em;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--ia-text);
}
.ia-eyebrow::before { content: ""; flex: none; width: 2.25rem; height: 3px; background: var(--ia-accent); }

/* Source labels: the lighter Smoke tint, because Smoke itself fails AA at this size. */
.ia-cite { font-size: var(--ia-fs-small); line-height: 1.45; color: var(--ia-text-muted); }
.ia-cite a { color: inherit; text-decoration: underline; text-decoration-color: var(--ia-line-strong); text-underline-offset: 3px; }
.ia-cite a:hover { color: var(--ia-text); text-decoration-color: var(--ia-accent); }

/* ---------- buttons ----------
   Ember carries labels only at large sizes: Bone on Ember is 4.17:1,
   which passes AA for large text and fails for small. */
.ia-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 56px;
  padding: 0.62rem 1.7rem 0.5rem;
  border: 2px solid var(--ia-accent);
  border-radius: 6px;
  background: var(--ia-accent);
  color: var(--ia-on-accent);
  font-family: var(--ia-font-display);
  font-size: 1.625rem;
  font-weight: 400;
  letter-spacing: 0.045em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: transform var(--ia-dur-fast) var(--ia-ease), box-shadow var(--ia-dur-fast) var(--ia-ease), background-color var(--ia-dur-fast) linear;
}
.ia-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 34px -10px var(--ia-ember-glow); }
.ia-btn:active { transform: translateY(0); }
.ia-btn--sm { min-height: 48px; padding: 0.5rem 1.2rem 0.4rem; font-size: 1.5rem; }
.ia-btn--ghost { background: transparent; border-color: var(--ia-text); color: var(--ia-text); }
.ia-btn--ghost:hover { background: var(--ia-text); color: var(--ia-bg); box-shadow: none; }
.ia-btn[disabled] { opacity: 0.6; cursor: progress; transform: none; }

.ia-link { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 700; text-decoration: underline; text-decoration-color: var(--ia-accent); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.ia-link:hover { text-decoration-color: var(--ia-text); }
.ia-arrow { width: 1.15em; height: 1.15em; flex: none; transition: transform var(--ia-dur-fast) var(--ia-ease); }
.ia-link:hover .ia-arrow { transform: translateX(4px); }
.ia-chair-icon { width: 3rem; height: 3rem; flex: none; color: var(--ia-text); }

/* ---------- page transitions ----------
   A short cross fade when moving between pages on this site. Browsers that do
   not support it simply load the next page as usual.

   The rule that switches the fade on, "@view-transition { navigation: auto }",
   is NOT here. It is written into each page's own head (scripts/templates/
   chrome.mjs). The browser decides whether a page takes part before a linked
   stylesheet is certain to have arrived. When this file came even a fraction of
   a second late, which is every visit on a real connection, the fade was
   called off and an error was left in the console. Found on 18 November 2026:
   tools/smoke.mjs now serves this file late on purpose and checks the fade
   still runs. Only the timing lives here. */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 260ms; }
}

/* ---------- skip link ---------- */
/* The menu and the footer also sit on two older pages (the assessment and the
   podcast) that do not opt in with body.ia-page. So they carry the focus ring
   and the selection colour themselves, and look the same there to someone
   moving through them with a keyboard. */
.ia-skip:focus-visible, .ia-nav :focus-visible, .ia-footer :focus-visible { outline: 3px solid var(--ia-focus); outline-offset: 3px; border-radius: 4px; }
.ia-nav ::selection, .ia-footer ::selection { background: var(--ia-ember); color: var(--ia-bone); }

.ia-skip { position: fixed; left: 1rem; top: -5rem; z-index: 200; padding: 0.8rem 1.1rem; background: var(--ia-bone); color: var(--ia-midnight); font-weight: 700; border-radius: 6px; text-decoration: none; }
.ia-skip:focus { top: 1rem; }

/* ---------- nav ---------- */
.ia-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--ia-nav-h);
  font-family: var(--ia-font-body);
  font-size: var(--ia-fs-body);     /* its own size and leading, so the bar measures the same on the two older */
  line-height: var(--ia-lh-body);   /* pages, whose body text is set smaller and tighter */
  background: rgba(14, 14, 14, 0.88);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--ia-line);
  color: var(--ia-bone);
}
.ia-nav *, .ia-nav *::before, .ia-nav *::after { box-sizing: border-box; }
.ia-nav__inner { display: flex; align-items: center; gap: 1.5rem; height: 100%; max-width: 1320px; margin-inline: auto; padding-inline: var(--ia-pad); }
.ia-nav__brand { flex: none; display: block; text-decoration: none; }
.ia-nav__brand img { display: block; width: auto; height: 30px; }
.ia-nav__links { display: none; align-items: center; gap: clamp(1rem, 2vw, 1.9rem); margin-left: auto; }
.ia-nav__links a { position: relative; padding: 0.4rem 0; font-size: 1rem; font-weight: 600; color: var(--ia-bone-soft); text-decoration: none; transition: color var(--ia-dur-fast) linear; }
.ia-nav__links a:hover, .ia-nav__links a[aria-current="page"] { color: var(--ia-bone); }
.ia-nav__links a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 3px; background: var(--ia-ember); }
/* 24px, not smaller: Bone on Ember only passes AA as large text. */
.ia-nav .ia-btn--sm { min-height: 44px; font-size: 1.5rem; padding: 0.4rem 0.95rem 0.28rem; }
.ia-nav__cta { display: none; margin-left: 0.25rem; }
.ia-nav__toggle { display: inline-flex; align-items: center; gap: 0.7rem; margin-left: auto; min-height: 44px; padding: 0 0.25rem; border: 0; background: none; color: var(--ia-bone); font-family: var(--ia-font-display); font-size: 1.375rem; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
.ia-nav__toggle-bars { display: grid; gap: 7px; width: 26px; }
.ia-nav__toggle-bars i { display: block; height: 2px; background: currentColor; transition: transform var(--ia-dur-fast) var(--ia-ease); }
.ia-nav__toggle[aria-expanded="true"] .ia-nav__toggle-bars i:first-child { transform: translateY(4.5px) rotate(45deg); }
.ia-nav__toggle[aria-expanded="true"] .ia-nav__toggle-bars i:last-child { transform: translateY(-4.5px) rotate(-45deg); }

/* backdrop-filter on .ia-nav makes it the containing block for its children,
   so the menu hangs below the bar rather than using position: fixed. */
.ia-menu { position: absolute; top: var(--ia-nav-h); left: 0; right: 0; height: calc(100vh - var(--ia-nav-h)); height: calc(100dvh - var(--ia-nav-h)); display: flex; flex-direction: column; gap: 2rem; padding: 2rem var(--ia-pad) 2.5rem; background: var(--ia-midnight); overflow-y: auto; }
.ia-menu[hidden] { display: none; }
.ia-menu nav { display: grid; }
.ia-menu nav a { padding: 0.55rem 0; border-bottom: 1px solid var(--ia-line); font-family: var(--ia-font-display); font-size: 2.5rem; letter-spacing: 0.02em; line-height: 1.1; text-transform: uppercase; text-decoration: none; color: var(--ia-bone); }
.ia-menu nav a[aria-current="page"] { color: var(--ia-ember); }

@media (min-width: 1000px) {
  .ia-nav__links { display: flex; }
  .ia-nav__cta { display: inline-flex; }
  .ia-nav__toggle, .ia-menu { display: none !important; }
}

/* ---------- footer ---------- */
.ia-footer { border-top: 1px solid var(--ia-line); background: var(--ia-midnight); color: var(--ia-bone); font-family: var(--ia-font-body); font-size: var(--ia-fs-body); line-height: 1.55; }
.ia-footer *, .ia-footer *::before, .ia-footer *::after { box-sizing: border-box; }
.ia-footer__grid { display: grid; gap: 2.75rem; max-width: var(--ia-max); margin-inline: auto; padding: clamp(3rem, 7vw, 5rem) var(--ia-pad) 2.5rem; }
.ia-footer__brand img { width: auto; height: 56px; }
.ia-footer__tag { margin: 1.1rem 0 1.4rem; font-family: var(--ia-font-voice); font-style: italic; font-size: 1.35rem; }
.ia-footer__social { display: flex; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.ia-footer__social a { display: grid; place-items: center; text-decoration: none; width: 46px; height: 46px; border: 1px solid var(--ia-line-strong); border-radius: 50%; color: var(--ia-bone); transition: background-color var(--ia-dur-fast) linear, color var(--ia-dur-fast) linear; }
.ia-footer__social a:hover { background: var(--ia-bone); color: var(--ia-midnight); }
.ia-footer__social svg { width: 20px; height: 20px; }
.ia-footer__h { margin: 0 0 0.9rem; font-family: var(--ia-font-display); font-size: 1.5rem; font-weight: 400; letter-spacing: 0.05em; line-height: 1.1; text-transform: uppercase; }
.ia-footer__nav { display: grid; align-content: start; gap: 0.15rem; }
.ia-footer__nav a { padding: 0.3rem 0; color: var(--ia-bone-soft); text-decoration: none; }
.ia-footer__nav a:hover { color: var(--ia-bone); text-decoration: underline; text-decoration-color: var(--ia-ember); text-underline-offset: 4px; }
.ia-footer__challenge p { margin: 0 0 1.1rem; color: var(--ia-bone-soft); max-width: 34ch; }
.ia-challenge { display: grid; gap: 0.7rem; max-width: 26rem; }
.ia-challenge input[type="email"] { min-height: 52px; padding: 0 1rem; border: 2px solid var(--ia-line-strong); border-radius: 6px; background: transparent; color: var(--ia-bone); font: inherit; }
.ia-challenge input[type="email"]::placeholder { color: var(--ia-smoke-text); }
.ia-challenge input[type="email"]:focus-visible { border-color: var(--ia-bone); outline-offset: 2px; }
.ia-challenge__ok { margin: 0; font-weight: 700; color: var(--ia-bone); }
.ia-footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; max-width: var(--ia-max); margin-inline: auto; padding: 1.4rem var(--ia-pad) 2rem; border-top: 1px solid var(--ia-line); font-size: var(--ia-fs-small); color: var(--ia-smoke-text); }
@media (min-width: 820px) {
  .ia-footer__grid { grid-template-columns: 1.1fr 0.7fr 1.2fr; gap: 3rem; }
}

/* ---------- consent notice (only rendered when analytics is configured) ---------- */
.ia-consent { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 150; display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.4rem; max-width: 44rem; margin-inline: auto; padding: 1.1rem 1.3rem; border: 1px solid var(--ia-line-strong); border-radius: var(--ia-radius-sm); background: var(--ia-raised); color: var(--ia-bone); font-family: var(--ia-font-body); font-size: 1rem; line-height: 1.5; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.9); }
.ia-consent p { flex: 1 1 16rem; margin: 0; }
.ia-consent__actions { display: flex; gap: 0.6rem; }
.ia-consent[hidden] { display: none; }
