/*
 * NiraMind ecosystem layer, shared by work / study / atlas / tech.niramind.com.
 * The brand bar (emblem + Cinzel wordmark + sister sites) and the footer. Each site supplies its
 * own theme through these custom properties:
 *   --nm-fg       text colour          --nm-muted   secondary text
 *   --nm-line     hairlines            --nm-bar-bg  brand bar background (once scrolled)
 *   --nm-accent   current-page marker
 *   --nm-word-1 / --nm-word-2  the wordmark's two tones (gold / silver on dark sites)
 */
:root {
  --nm-gold: #d8b46a;
  --nm-gold-deep: #a8803e;
  --nm-silver: #e8eef6;
  --nm-gutter: clamp(1rem, 4vw, 2.5rem);
  --nm-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100svh; overflow-x: clip; -webkit-font-smoothing: antialiased; }
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--nm-accent, var(--nm-gold)); outline-offset: 3px; border-radius: 6px; }
.nm-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Brand bar ─────────────────────────────────────────────────────────── */
.nm-bar {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: max(0.7rem, env(safe-area-inset-top)) max(var(--nm-gutter), env(safe-area-inset-right)) 0.7rem max(var(--nm-gutter), env(safe-area-inset-left));
  color: var(--nm-fg); transition: background-color 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}
.nm-bar.is-scrolled { background: var(--nm-bar-bg); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 1px 0 var(--nm-line); }
.nm-brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; min-width: 0; }
.nm-brand img { width: 2rem; height: 2rem; border-radius: 50%; box-shadow: 0 0 0 1px rgb(216 180 106 / 0.55); }
.nm-word { font-family: "Cinzel", Georgia, serif; font-weight: 600; font-size: 1.02rem; letter-spacing: 0.14em; white-space: nowrap;
  background: linear-gradient(100deg, var(--nm-word-1, var(--nm-gold)) 0 46%, var(--nm-word-2, var(--nm-silver)) 54% 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nm-site { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--nm-muted); padding-inline-start: 0.6rem; border-inline-start: 1px solid var(--nm-line); white-space: nowrap; }
.nm-sites { display: flex; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.nm-sites a { display: block; padding: 0.4rem 0.7rem; border-radius: 999px; font-size: 0.82rem; text-decoration: none; color: var(--nm-muted); transition: color 0.2s, background-color 0.2s; }
.nm-sites a:hover { color: var(--nm-fg); background: color-mix(in srgb, var(--nm-fg) 8%, transparent); }
.nm-sites a[aria-current="page"] { color: var(--nm-fg); box-shadow: inset 0 0 0 1px var(--nm-accent, var(--nm-gold)); }
/* Phones: the menu takes its own row under the brand (each site's menu is short). */
@media (max-width: 40rem) {
  .nm-bar { flex-wrap: wrap; row-gap: 0.35rem; }
  .nm-bar nav { width: 100%; }
  .nm-sites { justify-content: center; }
  .nm-sites a { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
}
@media (max-width: 22rem) { .nm-site { display: none; } }

/* ── Footer ────────────────────────────────────────────────────────────── */
.nm-footer { display: grid; justify-items: center; gap: 0.9rem; padding: 3rem var(--nm-gutter) max(2.5rem, env(safe-area-inset-bottom)); text-align: center; color: var(--nm-muted); font-size: 0.86rem; border-top: 1px solid var(--nm-line); }
.nm-footer .nm-brand img { width: 2.4rem; height: 2.4rem; }
.nm-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1.1rem; }
.nm-footer nav a { text-decoration: none; }
.nm-footer nav a:hover { color: var(--nm-fg); text-decoration: underline; text-underline-offset: 0.25em; }
.nm-footer p { margin: 0; }

/* Scroll reveal: hidden only when JS runs (nm.js adds .js before paint). */
.js .reveal { opacity: 0; transform: translate3d(0, 22px, 0); transition: opacity 0.9s var(--nm-ease) var(--d, 0ms), transform 1s var(--nm-ease) var(--d, 0ms); }
.js .reveal.is-in { opacity: 1; transform: none; }
.d1 { --d: 80ms; } .d2 { --d: 160ms; } .d3 { --d: 240ms; } .d4 { --d: 320ms; } .d5 { --d: 400ms; } .d6 { --d: 480ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0ms !important; }
}
