/* dreamlab shared styles (externalised, audit 2026-11-02). */
    html.fonts-loading body { opacity: 0; }
    html body { transition: opacity 0.3s ease; }
    * { margin: 0; padding: 0; box-sizing: border-box; }
    html { scroll-behavior: smooth; }

    /* Even out heading line breaks — no lonely orphan words. */
    h1, h2, h3, h4 { text-wrap: balance; }
    /* A single long word ("photobiomodulation") must never widen the phone viewport. */
    h1 { overflow-wrap: anywhere; }

    body {
      font-family: var(--sans);
      background: var(--bg);
      color: var(--text);
      overflow-x: hidden;
      -webkit-font-smoothing: antialiased;
    }

    /* Default page frame (J, 2026-10-29): the pre-Eleventy pages carried
       body { padding: 4rem 2rem 6rem }; the refactor made body shared and most
       pages lost their gutter. Every page keeps >=16px at phone width. A page
       that sets its own .container padding overrides this (its styles come later). */
    .container { padding: 4rem 2rem 6rem; }

    body::after {
      content: '';
      position: fixed;
      inset: 0;
      pointer-events: none;
      z-index: 9999;
      opacity: 0.035;
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
      background-repeat: repeat;
      background-size: 200px;
    }

    /* Persistent header nav + the sticky top stack (J approved 2026-10-24). */
    .top-stack { position: sticky; top: 0; z-index: 100; }
    .site-nav {
      border-bottom: 1px solid rgba(74, 70, 64, 0.15);
      background: rgba(10, 10, 9, 0.92);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
    }
    .banner-short { display: none; }
    .banner-x {
      position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
      background: none; border: 0; color: inherit; font-size: 1.1rem; line-height: 1;
      min-width: 44px; min-height: 44px; cursor: pointer; opacity: 0.7;
    }
    .top-stack > div:first-child { position: relative; }
    .top-stack.banner-off > div:first-child { display: none; }

    .site-nav nav {
      display: flex;
      justify-content: center;
      flex-wrap: wrap;
      gap: 0 1.1rem;
      padding: 0.2rem 1rem;
      font-family: var(--sans);
      font-size: 0.72rem;
      font-weight: 400;
      letter-spacing: 0.16em;
      text-transform: lowercase;
    }
    /* Audit 2026-11-02: header under 110px on a phone - short banner, one menu row. */
    @media (max-width: 640px) {
      .banner-long { display: none; }
      .banner-short { display: inline; }
      .top-stack > div:first-child { padding: 0.55rem 2.6rem 0.55rem 1rem; font-size: 0.76rem; line-height: 1.4; }
      .site-nav nav {
        flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start;
        gap: 0; padding: 0.1rem 0.4rem; -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
      }
      /* fade on the right so a clipped item reads as "there is more", not "missing" */
      .site-nav { position: relative; }
      .site-nav::after {
        content: ''; position: absolute; top: 0; bottom: 0; right: 0; width: 18px;
        pointer-events: none;
        background: linear-gradient(to right, rgba(10,10,9,0), rgba(10,10,9,0.95));
      }
      .site-nav nav::-webkit-scrollbar { display: none; }
      .site-nav a { white-space: nowrap; padding: 0 0.42rem; font-size: 0.66rem; letter-spacing: 0.1em; }
    }
    .site-nav a {
      color: var(--text-dim); text-decoration: none; transition: color 0.3s;
      /* audit 2026-11-02: 44px thumb floor on the menu links */
      display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px;
    }
    .site-nav a:hover { color: var(--accent); }
    /* J 2026-11-02: the first menu item is a ← home link, same colour as the rest. */
    .site-nav a.nav-home { font-size: 1rem; letter-spacing: 0; padding: 0 12px; }
    .site-nav a.nav-ask {
      color: var(--accent);
      border: 1px solid var(--accent-dim);
      padding: 0.15rem 0.6rem;
      border-radius: 3px;
    }
    .site-nav a.nav-ask:hover { background: rgba(138, 117, 96, 0.12); }

    /* Page titles: first letter capitalised, the rest stays lowercase (J, 2026-10-29).
       One rule for every page; the wordmark and the atlas title keep their own case. */
    h1:not(.hero-name):not(.atlas-title)::first-letter { text-transform: uppercase; }

    /* access line (partials/access-line.njk) */
    .access-line {
      display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0.3rem 0.7rem;
      max-width: 1120px; margin: 0 auto; padding: 1rem 1.5rem 1.6rem;
      font-family: var(--sans); font-size: 0.6rem; letter-spacing: 0.22em; text-transform: uppercase;
      color: var(--text-faint);
    }
    .access-line .al-dot { color: var(--accent-dim); }
    .access-line .al-viewer { color: var(--text-dim); }
    .access-line .al-link { display: inline-block; padding: 0.5rem 0; color: var(--text-faint); text-decoration: none; border-bottom: 1px solid transparent; transition: color 0.3s, border-color 0.3s; }
    .access-line .al-link:hover { color: var(--accent); border-color: var(--accent-dim); }

    /* footer mini-index (partials/footer-nav.njk) */
    .site-index {
      display: grid;
      grid-template-columns: repeat(6, minmax(0, 1fr)); /* one row on desktop (J) */
      gap: 1.6rem 1rem;
      max-width: 1120px;
      margin: 3.5rem auto 1.5rem;
      padding: 2.5rem 1.5rem 0;
      border-top: 1px solid rgba(74, 70, 64, 0.15);
      font-family: var(--sans);
      text-transform: lowercase;
      text-align: left;
    }
    .site-index-col ul { list-style: none; margin: 0.55rem 0 0; padding: 0; }
    .site-index-col li { margin: 0; }
    .site-index a { text-decoration: none; transition: color 0.3s; }
    .site-index-head { display: block; font-size: 0.72rem; letter-spacing: 0.16em; color: var(--text-dim); }
    .site-index-col li a { display: inline-block; padding: 0.22rem 0; font-size: 0.68rem; letter-spacing: 0.08em; color: var(--text-faint); overflow-wrap: anywhere; }
    .site-index a:hover { color: var(--accent); }
    .book-cta p a { white-space: nowrap; color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-dim); transition: color 0.3s; }
    .book-cta p a:hover { color: var(--text); }
    .site-index-all { font-style: italic; }
    @media (max-width: 900px) { .site-index { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
    @media (max-width: 520px) { .site-index { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

    /* Accessibility (dreamlab-8): visible keyboard focus, skip link, reduced motion. */
    :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
    .skip-link { position: absolute; left: -9999px; top: 0; z-index: 1000; background: var(--bg); color: var(--text); padding: .7rem 1rem; font-family: var(--sans); font-size: .8rem; text-decoration: none; }
    .skip-link:focus { left: .5rem; top: .5rem; }
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
    }

    .reveal {
      opacity: 0;
      transform: translateY(30px);
      transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
                  transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .reveal.visible {
      opacity: 1;
      transform: translateY(0);
    }
