/* ============================================================
   Interactive Logic — shared stylesheet

   Load order: linked BEFORE each page's inline <style>, so
   page-local rules continue to win on specificity ties.

   Tokens are namespaced --il-* because the un-namespaced
   names (--white, --accent, --black, --rule, --mid, --light)
   still exist on the unmigrated pages with CONFLICTING values.

   Sections:
     1. Tokens
     2. Reset
     3. Shared chrome (nav, footer)   — Phase 2
     4. Shared primitives             — Phase 3B-0
     5. Responsive
   ============================================================ */

:root {
  /* --- Brand palette (canonical, four colours) ------------- */
  --il-surface:       #fafaf8;  /* warm white */
  --il-stone:         #f5f2ed;  /* stone      */
  --il-graphite:      #2E2E2E;  /* graphite   */
  --il-gold:          #A9852B;  /* gold — the only brand gold.
                                 * Decorative use only on small
                                 * text: rules, borders, arrows,
                                 * underlines, large display
                                 * accents. Small text that cannot
                                 * meet AA on this gold uses
                                 * --il-text-mid or --il-graphite.
                                 * Do not introduce a second gold. */

  /* --- Functional supporting neutrals ---------------------- *
   * Not brand colours. --il-text-mid is the muted body/label
   * grey and is aligned to the approved homepage master.
   * 4.89:1 on warm white, 4.58:1 on stone — both pass AA.    */
  --il-text-mid:      #6F6E69;

  /* --- Structure ------------------------------------------- */
  --il-rule:          #e5e0d8;
  --il-hairline:      1px;

  /* --- Footer (the single dark surface in the system) ------ *
   * --il-footer-copy nudged #9a938e -> #9b948f so it clears
   * 4.5:1 on graphite (was 4.49:1).                          */
  --il-footer-bg:     var(--il-graphite);
  --il-footer-link:   #b0a9a4;
  --il-footer-copy:   #9b948f;

  /* --- Type ------------------------------------------------ *
   * --il-font-body is the family sans and drives all shared
   * chrome and primitives. The display faces are exceptions,
   * applied page-locally only where they are earned:
   *   Bebas Neue          hero headlines only
   *   DM Serif Display    italic/display accents, big figures
   *   Barlow Condensed    LeadSense only      (not tokenised)
   *   Playfair/Source Serif  article only     (not tokenised) */
  --il-font-body:     'Schibsted Grotesk', system-ui, sans-serif;
  --il-font-display:  'Bebas Neue', sans-serif;
  --il-font-accent:   'DM Serif Display', serif;

  /* --- Section rhythm -------------------------------------- */
  --il-section-pad-y: 112px;
  --il-section-pad-x: 48px;
}

/* ------------------------------------------------------------
   Reset. These two rules are byte-identical (same three
   declarations, no internal conflicts) in all 8 pages today,
   so this block is a duplicate and cannot alter rendering.

   Deliberately NOT extended to *::before / *::after: seven
   pages scope the reset to pseudo-elements, index.html does
   not. Adding pseudos here would change index. Left alone.
   ------------------------------------------------------------ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* ------------------------------------------------------------
   Shared primitives live in section 4 and are OPT-IN: a page
   gets them only by using an .il-* class. Nothing here styles
   bare elements.

   Do NOT add rules for body, nav, footer, .hero, .tool-card,
   .section-title, .btn-primary or .btn-outline. Each of those
   names still exists on 3-7 unmigrated pages with different
   declarations, and in some cases different markup. Un-
   namespaced rules here would reach into all of them at once.
   ------------------------------------------------------------ */

/* ============================================================
   3. SHARED CHROME
   ============================================================ */

.il-skip {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--il-surface);
  color: var(--il-graphite);
  border: 1px solid var(--il-rule);
  font-family: var(--il-font-body);
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}

.il-skip:focus {
  transform: translateY(0);
}

.il-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 48px;
  background: var(--il-surface);
  border-bottom: 1px solid var(--il-rule);
  color: var(--il-graphite);
  font-family: var(--il-font-body);
  font-size: 14px;
  line-height: 1.2;
}

.il-nav__logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.il-nav__logo img {
  display: block;
  width: auto;
  height: 36px;
}

.il-nav__links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.il-nav__links a,
.il-nav__cta {
  color: var(--il-text-mid);
  font-family: var(--il-font-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}

/* Gold is 3.31:1 on warm white, so it cannot carry small text.
   The label goes graphite and the gold moves to the underline. */
.il-nav__links a:hover,
.il-nav__links a.active,
.il-nav__links a[aria-current="page"] {
  color: var(--il-graphite);
  text-decoration: underline;
  text-decoration-color: var(--il-gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

.il-nav__cta {
  flex-shrink: 0;
  padding: 10px 20px;
  color: var(--il-graphite);
  background: transparent;
  border: 1px solid var(--il-graphite);
}

.il-nav__cta:hover,
.il-nav__cta.active,
.il-nav__cta[aria-current="page"] {
  color: var(--il-graphite);
  border-color: var(--il-gold);
}

.il-nav__toggle {
  display: none;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 8px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: var(--il-graphite);
  background: transparent;
  border: 1px solid var(--il-rule);
  cursor: pointer;
}

.il-nav__toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.il-nav__toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.il-nav__toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.il-nav__toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.il-nav__menu {
  position: relative;
  z-index: 99;
  display: none;
  padding: 12px 24px 24px;
  background: var(--il-surface);
  border-bottom: 1px solid var(--il-rule);
  font-family: var(--il-font-body);
  transition: opacity 0.2s ease;
}

.il-nav__menu[hidden] {
  display: none;
}

.il-nav__menu a {
  display: block;
  padding: 13px 0;
  color: var(--il-text-mid);
  border-bottom: 1px solid var(--il-rule);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.il-nav__menu a:hover,
.il-nav__menu a.active,
.il-nav__menu a[aria-current="page"] {
  color: var(--il-graphite);
  text-decoration: underline;
  text-decoration-color: var(--il-gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

.il-nav__menu-cta {
  margin-top: 12px;
  text-align: center;
  color: var(--il-graphite);
  border: 1px solid var(--il-graphite);
}

.il-nav--dark {
  background: #0a0a0a;
  border-bottom-color: rgba(255, 255, 255, 0.08);
  color: var(--il-surface);
}

.il-nav--dark .il-nav__links a {
  color: rgba(255, 255, 255, 0.72);
}

/* On the dark nav gold clears 6.72:1, so the dark modifier keeps
   its original colour-only treatment and drops the underline. */
.il-nav--dark .il-nav__links a:hover,
.il-nav--dark .il-nav__links a.active,
.il-nav--dark .il-nav__links a[aria-current="page"] {
  color: var(--il-surface);
  text-decoration: none;
}

.il-nav--dark .il-nav__cta {
  color: var(--il-surface);
  border-color: rgba(255, 255, 255, 0.5);
}

.il-nav--dark .il-nav__cta:hover,
.il-nav--dark .il-nav__cta.active,
.il-nav--dark .il-nav__cta[aria-current="page"] {
  color: var(--il-gold);
  border-color: var(--il-gold);
}

.il-nav--dark .il-nav__toggle {
  color: var(--il-surface);
  border-color: rgba(255, 255, 255, 0.2);
}

.il-nav--dark + .il-nav__menu {
  background: #0a0a0a;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.il-nav--dark + .il-nav__menu a {
  color: rgba(255, 255, 255, 0.72);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.il-nav--dark + .il-nav__menu a:hover,
.il-nav--dark + .il-nav__menu a.active,
.il-nav--dark + .il-nav__menu a[aria-current="page"] {
  color: var(--il-surface);
  text-decoration: none;
}

.il-nav--dark + .il-nav__menu .il-nav__menu-cta {
  color: var(--il-surface);
  border-color: rgba(255, 255, 255, 0.5);
}

.il-footer {
  padding: 44px 48px 32px;
  background: var(--il-footer-bg);
  color: var(--il-footer-link);
  font-family: var(--il-font-body);
  font-size: 13px;
  line-height: 1.5;
}

.il-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 28px;
}

.il-footer__logo {
  display: inline-flex;
  align-items: center;
}

.il-footer__logo img {
  display: block;
  width: auto;
  height: 32px;
}

.il-footer__links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.il-footer__links a {
  color: var(--il-footer-link);
  text-decoration: none;
  transition: color 0.2s ease;
}

.il-footer__links a:hover,
.il-footer__links a.active,
.il-footer__links a[aria-current="page"] {
  color: var(--il-surface);
}

.il-footer__copy {
  width: 100%;
  margin: 0;
  padding-top: 24px;
  color: var(--il-footer-copy);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.il-skip:focus-visible,
.il-nav a:focus-visible,
.il-nav button:focus-visible,
.il-nav__menu a:focus-visible,
.il-footer a:focus-visible,
.il-btn:focus-visible,
.breadcrumb a:focus-visible,
.article-body a:focus-visible {
  outline: 2px solid var(--il-graphite);
  outline-offset: 2px;
}

.il-nav--dark a:focus-visible,
.il-nav--dark button:focus-visible,
.il-footer a:focus-visible {
  outline-color: var(--il-surface);
}

/* ============================================================
   4. SHARED PRIMITIVES

   Promoted from the approved homepage master. All opt-in: a
   page picks these up only by adding the class. Values are
   taken verbatim from index.html so adoption is a no-op there.

   Deliberately NOT promoted, because implementations still
   diverge across pages: hero layouts, card grids and their
   column definitions, section padding as a class, page
   subnavs, filters, and the article/product type systems.
   ============================================================ */

/* Eyebrow — small uppercase label above a heading.
   Gold cannot carry 12px text (2.82:1 on warm white), so the
   text is the muted grey and the gold is the 26px rule. */
.il-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--il-text-mid);
  font-family: var(--il-font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.il-eyebrow::before {
  content: '';
  display: inline-block;
  flex-shrink: 0;
  width: 26px;
  height: var(--il-hairline);
  background: var(--il-gold);
}

/* Section heading — family sans, never a display face. */
.il-section-title {
  margin-bottom: 32px;
  color: var(--il-graphite);
  font-family: var(--il-font-body);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* Buttons — square geometry, uppercase, no radius, no shadow.
   This is the deliberate divergence from Strata26's rounded
   sentence-case button. */
.il-btn {
  display: inline-block;
  padding: 14px 28px;
  border: var(--il-hairline) solid var(--il-graphite);
  font-family: var(--il-font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.il-btn--primary {
  background: var(--il-graphite);
  color: var(--il-surface);
}

.il-btn--primary:hover {
  background: transparent;
  color: var(--il-graphite);
}

.il-btn--secondary {
  background: transparent;
  color: var(--il-graphite);
  border-color: var(--il-rule);
}

/* Text stays graphite; the gold does the work on the border. */
.il-btn--secondary:hover {
  color: var(--il-graphite);
  border-color: var(--il-gold);
}

/* Surfaces + hairline rule */
.il-surface--warm  { background: var(--il-surface); }
.il-surface--stone { background: var(--il-stone); }

.il-rule {
  border: 0;
  border-top: var(--il-hairline) solid var(--il-rule);
}

/* Scroll-reveal. Driven by the observer in assets/site.js. */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1200px) {
  .il-nav {
    padding: 0 32px;
    gap: 24px;
  }

  .il-nav__logo img {
    height: 30px;
  }

  .il-nav__links {
    gap: 20px;
  }

  .il-nav__cta {
    padding: 10px 16px;
  }
}

@media (max-width: 1024px) {
  .il-nav {
    height: 64px;
    padding: 0 24px;
    gap: 16px;
  }

  .il-nav__logo img {
    height: 28px;
  }

  .il-nav__links,
  .il-nav__cta {
    display: none;
  }

  .il-nav__toggle {
    display: flex;
  }

  .il-nav__menu:not([hidden]) {
    display: block;
  }
}

@media (max-width: 430px) {
  .il-nav__logo img {
    height: 24px;
  }
}

@media (max-width: 768px) {
  .il-footer {
    padding: 36px 24px 28px;
  }

  .il-footer__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .il-footer__links {
    gap: 16px 24px;
  }
}

/* Section rhythm tokens track the master's 900px step-down.
   Nothing consumes these until a page opts in. */
@media (max-width: 900px) {
  :root {
    --il-section-pad-y: 72px;
    --il-section-pad-x: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .il-skip,
  .il-nav__links a,
  .il-nav__cta,
  .il-nav__toggle span,
  .il-nav__menu,
  .il-footer__links a,
  .il-btn {
    transition: none;
  }

  .fade-up,
  .fade-up.visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
