/* ─────────────────────────────────────────
   Next Digital — Global stylesheet
   Loaded on all pages except homepage
   (homepage uses home.css)
───────────────────────────────────────── */

:root {
  --nd-accent:        oklch(60% 0.24 200);
  --nd-bg:            oklch(8% 0.04 210);
  --nd-chrome:        oklch(97% 0.003 215);
  --nd-chrome-border: oklch(89% 0.004 215);
  --nd-text:          oklch(91% 0.007 215);
  --nd-text-mid:      oklch(76% 0.022 215);
  --nd-text-dim:      oklch(55% 0.05 210);
  --nd-border:        oklch(100% 0 0 / 0.07);
  --nd-bezel-gap:     18px;
  --nd-bezel-r:       20px;
  --nd-header-h:      80px;
}

@property --nd-beam-a {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Global body ── */
body.nd-site {
  background: var(--nd-chrome);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  color: var(--nd-text);
}

/* ── Skip link ── */
.nd-skip-link {
  position: absolute; top: -100%; left: 8px; z-index: 100000;
  background: oklch(97% 0 0); color: oklch(10% 0 0);
  padding: 6px 14px; font-size: 14px; font-family: 'DM Sans', sans-serif;
  border-radius: 4px; text-decoration: none;
}
.nd-skip-link:focus { top: 8px; }

/* ════════════════════════════════════
   HEADER CHROME
════════════════════════════════════ */

.nd-header-chrome {
  position: fixed; top: 0; left: 0; right: 0;
  height: fit-content; z-index: 9999; background: transparent;
}
.admin-bar .nd-header-chrome { top: 32px; }

.nd-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 44px 8px; min-height: var(--nd-header-h);
}

.nd-nav-logo {
  font-size: 13px; font-weight: 600; letter-spacing: 1.8px; text-transform: uppercase;
  color: oklch(15% 0.015 215); text-decoration: none;
  display: flex; align-items: center; gap: 10px;
}
.nd-nav-logo-img {
  height: 42px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.nd-nav-links {
  display: flex; align-items: center; gap: 4px;
  list-style: none; margin: 0; padding: 0;
}
.nd-nav-links > li { margin: 0; position: relative; }

.nd-nav-links a {
  font-size: 13px; font-weight: 400; color: oklch(42% 0.03 215);
  text-decoration: none; padding: 7px 14px; border-radius: 8px;
  transition: color 0.18s, background 0.18s; display: block; white-space: nowrap;
}
.nd-nav-links a:hover { color: oklch(15% 0.02 215); background: oklch(0% 0 0 / 0.05); }
.nd-nav-links .menu-item-has-children > a::after { content: ' ›'; opacity: 0.4; font-size: 11px; }

/* ── Dropdown ── */
.nd-nav-links .sub-menu {
  display: none;
  position: absolute; top: 100%; left: 0;
  min-width: 190px; padding-top: 6px;
  list-style: none; margin: 0; z-index: 10001;
}
.nd-nav-links .sub-menu li { position: static; }
.nd-nav-links .sub-menu-inner {
  background: var(--nd-chrome); border: 1px solid var(--nd-chrome-border);
  border-radius: 10px; padding: 6px;
  box-shadow: 0 8px 24px oklch(0% 0 0 / 0.10);
}
.nd-nav-links .sub-menu a {
  font-size: 13px; color: oklch(32% 0.02 215); padding: 7px 12px; border-radius: 6px;
}
.nd-nav-links .sub-menu a:hover { color: oklch(12% 0.02 215); background: oklch(0% 0 0 / 0.05); }

/* ════════════════════════════════════
   UNIFIED BUTTONS
════════════════════════════════════ */

.nd-nav-cta,
.nd-btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: oklch(10% 0.035 215);
  border: 1px solid oklch(100% 0 0 / 0.12);
  color: oklch(88% 0.006 215);
  padding: 10px 22px; border-radius: 10px;
  font-size: 13px; font-weight: 400;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer; text-decoration: none;
  position: relative; isolation: isolate;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.nd-nav-cta:hover,
.nd-btn-primary:hover {
  border-color: oklch(100% 0 0 / 0.22);
  background: oklch(13% 0.04 215);
  color: oklch(96% 0.004 215);
}

.nd-nav-cta::before,
.nd-btn-primary::before {
  content: '';
  position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: conic-gradient(
    from var(--nd-beam-a),
    transparent 0%, transparent 62%,
    oklch(85% 0.14 192 / 0.5) 76%,
    oklch(97% 0.03 200 / 1)   82%,
    oklch(85% 0.14 192 / 0.5) 88%,
    transparent 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.55;
  animation: nd-beam-spin 2.2s linear infinite;
  pointer-events: none;
}
.nd-nav-cta:hover::before,
.nd-btn-primary:hover::before { opacity: 1; }

@keyframes nd-beam-spin { to { --nd-beam-a: 360deg; } }

/* ════════════════════════════════════
   SITE WRAP — dark bezel for all pages
════════════════════════════════════ */

.nd-site-wrap {
  margin: calc(var(--nd-header-h) + var(--nd-bezel-gap)) var(--nd-bezel-gap) var(--nd-bezel-gap);
  background:
    radial-gradient(ellipse 90% 50% at 50% 0%,   oklch(22% 0.18 210 / 0.85) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 88% 68%,  oklch(18% 0.16 190 / 0.45) 0%, transparent 60%),
    radial-gradient(ellipse 50% 38% at 12% 58%,  oklch(14% 0.14 165 / 0.40) 0%, transparent 55%),
    oklch(8% 0.04 210);
  border-radius: var(--nd-bezel-r);
  min-height: calc(100vh - var(--nd-header-h) - 2 * var(--nd-bezel-gap));
  overflow: hidden;
  color: var(--nd-text);
  font-family: 'DM Sans', sans-serif;
}
.admin-bar .nd-site-wrap {
  margin-top: calc(var(--nd-header-h) + var(--nd-bezel-gap));
}

.nd-site-wrap main {
  padding: 64px 48px;
  max-width: 1100px;
  margin: 0 auto;
}

/* ── Entry typography ── */
.nd-site-wrap .entry-title,
.nd-site-wrap h1, .nd-site-wrap h2, .nd-site-wrap h3 {
  color: var(--nd-text); font-family: 'DM Sans', sans-serif; font-weight: 400;
}
.nd-site-wrap h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.15; margin: 0 0 24px; }
.nd-site-wrap p { color: var(--nd-text-dim); line-height: 1.75; margin: 0 0 16px; }
.nd-site-wrap a:not(.nd-nav-cta):not(.nd-btn-primary) {
  color: var(--nd-accent); text-decoration: underline;
}

/* ════════════════════════════════════
   PAGE TRANSITION — blur content only
════════════════════════════════════ */

.nd-site-wrap {
  clip-path: inset(0 round var(--nd-bezel-r));
}
/* Blur applied to children only — wrapper keeps its solid dark background
   sharp so the white bezel never bleeds through the soft edges of the blur. */
.nd-site-wrap > * {
  transition: filter 0.42s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.nd-site-wrap.nd-content-out > * {
  filter: blur(22px);
}

/* ── Main rich footer (full black, shared between home + inner pages) ── */
.nd-footer-main {
  background: #000;
  color: oklch(72% 0.04 210);
  padding: 96px 48px 36px;
  margin-top: 80px;
}
.nd-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 64px;
  max-width: 1320px;
  margin: 0 auto;
}
.nd-footer-brand { display: flex; flex-direction: column; gap: 20px; }
.nd-footer-logo  { display: inline-flex; }
.nd-footer-logo img { height: 38px; width: auto; display: block; }
.nd-footer-addr {
  font-size: 13px; line-height: 1.7;
  color: oklch(70% 0.04 210);
  font-style: normal;
}
.nd-footer-contact {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.nd-footer-contact a {
  font-size: 13px; color: oklch(82% 0.03 210);
  text-decoration: none; transition: color 0.18s;
  font-family: 'DM Mono', monospace;
}
.nd-footer-contact a:hover { color: var(--nd-accent); }

.nd-footer-h {
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 2px;
  color: oklch(95% 0.005 215);
  margin: 0 0 24px;
  font-family: 'DM Mono', monospace;
}
.nd-footer-menu {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 11px;
}
.nd-footer-menu li { margin: 0; }
.nd-footer-menu a {
  font-size: 13.5px; color: oklch(70% 0.04 210);
  text-decoration: none; transition: color 0.18s;
}
.nd-footer-menu a:hover { color: oklch(95% 0.005 215); }

.nd-footer-social {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 12px;
}
.nd-footer-social a {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid oklch(100% 0 0 / 0.10);
  border-radius: 10px;
  color: oklch(78% 0.03 210);
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s;
}
.nd-footer-social a:hover {
  border-color: oklch(60% 0.24 200 / 0.45);
  color: oklch(95% 0.005 215);
  background: oklch(60% 0.24 200 / 0.10);
  transform: translateY(-2px);
}
.nd-footer-social svg { width: 18px; height: 18px; }

.nd-footer-bottom {
  border-top: 1px solid oklch(100% 0 0 / 0.06);
  padding-top: 28px; margin-top: 64px;
  max-width: 1320px;
  margin-left: auto; margin-right: auto;
  font-size: 11px; font-family: 'DM Mono', monospace;
  color: oklch(50% 0.04 210);
  text-align: center;
}
.nd-footer-bottom p { margin: 0; }

@media (max-width: 900px) {
  .nd-footer-main  { padding: 64px 28px 28px; }
  .nd-footer-grid  { grid-template-columns: 1fr 1fr; gap: 44px; }
  .nd-footer-brand { grid-column: 1 / -1; }
}

/* ════════════════════════════════════
   BURGER BUTTON
════════════════════════════════════ */

.nd-nav-burger {
  display: none;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  background: transparent; border: 0;
  cursor: pointer; padding: 0;
  position: relative; z-index: 10001;
  flex-direction: column; gap: 5px;
}
.nd-burger-bar {
  display: block; width: 22px; height: 2px;
  background: oklch(15% 0.015 215);
  border-radius: 2px;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.2s, background 0.2s;
}
.nd-nav-open .nd-nav-burger .nd-burger-bar:nth-child(1) {
  transform: translateY(3.5px) rotate(45deg);
}
.nd-nav-open .nd-nav-burger .nd-burger-bar:nth-child(2) {
  transform: translateY(-3.5px) rotate(-45deg);
}

body.nd-menu-open { overflow: hidden; }

/* ════════════════════════════════════
   MOBILE LAYOUT
════════════════════════════════════ */

@media (max-width: 768px) {
  :root {
    --nd-bezel-gap: 8px;
    --nd-bezel-r:   14px;
    --nd-header-h:  58px;
  }

  .nd-nav { padding: 12px 16px 6px; min-height: var(--nd-header-h); }
  .nd-nav-logo-img { height: 32px; }
  .nd-nav-burger { display: flex; }

  /* Hide desktop nav items by default; the burger reveals them as an overlay */
  .nd-nav-links,
  .nd-nav-cta { display: none; }

  /* Mobile menu — slides down as a full-width panel below the header */
  .nd-nav.nd-nav-open .nd-nav-links {
    display: flex; flex-direction: column; align-items: stretch;
    gap: 4px;
    position: fixed;
    top: var(--nd-header-h);
    left: 0; right: 0;
    bottom: 0;
    background: var(--nd-chrome);
    border-top: 1px solid var(--nd-chrome-border);
    padding: 26px 22px 22px;
    z-index: 9998;
    overflow-y: auto;
  }
  .admin-bar .nd-nav.nd-nav-open .nd-nav-links { top: calc(var(--nd-header-h) + 32px); }

  .nd-nav.nd-nav-open .nd-nav-links a {
    font-size: 16px;
    color: oklch(20% 0.02 215);
    padding: 12px 8px;
    border-radius: 8px;
    display: block;
  }
  .nd-nav.nd-nav-open .nd-nav-links li { width: 100%; }

  /* Submenu — collapsed by default on mobile, expands on tap of parent */
  .nd-nav.nd-nav-open .nd-nav-links .sub-menu {
    display: none;
    position: static;
    padding: 0 0 0 12px;
    margin: 4px 0 8px;
  }
  .nd-nav.nd-nav-open .nd-nav-links .sub-menu-inner {
    background: transparent; border: 0; box-shadow: none; padding: 0;
  }
  .nd-nav.nd-nav-open .nd-nav-links .sub-menu a {
    font-size: 14px; padding: 8px;
  }
  .nd-nav.nd-nav-open .nd-nav-links .menu-item-has-children.nd-mobile-sub-open > .sub-menu {
    display: block;
  }

  /* CTA shown as a primary button at the bottom of the panel */
  .nd-nav.nd-nav-open .nd-nav-cta {
    display: inline-flex;
    position: fixed;
    left: 22px; right: 22px;
    bottom: calc(var(--nd-bezel-gap) + 18px);
    justify-content: center;
    z-index: 9999;
  }

  /* Inner pages — site wrap padding */
  .nd-site-wrap main { padding: 36px 22px; }
  .nd-site-wrap h1   { font-size: clamp(24px, 6vw, 36px); }
}

@media (max-width: 480px) {
  :root {
    --nd-bezel-gap: 6px;
    --nd-bezel-r:   10px;
    --nd-header-h:  54px;
  }
  .nd-nav-logo-img { height: 28px; }
  .nd-nav { padding: 10px 14px 4px; }
}
