/* ==========================================================================
   layout.css  -  page frame: background canvas, nav, hero, blocks, footer
   ========================================================================== */

/* Glowing-neuron canvas, drawn by assets/js/core/neuron-bg.js */
#neuron-bg {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; opacity: 0.45;
}
.page { position: relative; z-index: 1; }

.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }
.prose { max-width: 66ch; }

/* ----- Navigation ----- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 3.5rem;
}
.nav__brand {
  font-family: var(--font-display); font-weight: 800; font-size: 1.1rem;
  color: #fff; text-decoration: none; letter-spacing: -0.02em;
}
.nav__links { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav__links li { margin: 0; }
.nav__links a {
  display: block; padding: 0.5rem 0.8rem; border-radius: 999px;
  font-family: var(--font-display); font-weight: 500; font-size: var(--step--1);
  color: var(--muted); text-decoration: none;
}
.nav__links a:hover { color: #fff; }
.nav__links a[aria-current="page"] {
  color: #000; background: var(--accent);
  box-shadow: 0 0 18px -2px var(--accent);
}
.nav__toggle {
  display: none; background: none; color: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 0.4rem 0.75rem; font: 500 var(--step--1) var(--font-display);
}
@media (max-width: 760px) {
  .nav__toggle { display: block; }
  .nav__links { display: none; width: 100%; flex-direction: column; padding-bottom: 0.75rem; }
  .nav__links.is-open { display: flex; }
  .nav__bar { flex-wrap: wrap; }
}

/* ----- Hero (home) ----- */
.hero-banner { position: relative; }
.hero-banner img {
  display: block;
  width: 100%;
  max-width: 1600px;   /* stops it getting huge on very wide screens */
  height: auto;        /* show the full image, no cropping */
  margin: 0 auto;
}
/* Optional soft fade at the bottom, for banners with a solid black background */
.hero-banner--fade img {
  -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 80%, transparent 100%);
}
.hero { padding: 0.5rem 0 3.5rem; }
.hero__role { font-family: var(--font-display); font-size: var(--step-1); font-weight: 500; color: var(--muted); margin: 0.4rem 0 1.4rem; }
.hero__lede { font-size: var(--step-1); line-height: 1.5; max-width: 38em; color: var(--text); }
.hero__affil { color: var(--muted); font-size: var(--step--1); margin-top: 1.5rem; }

/* The five trace colors from the banner draw in once on load */
.traces { display: grid; gap: 5px; margin: 1.2rem 0 1.6rem; max-width: 520px; }
.traces span {
  height: 3px; border-radius: 3px; transform-origin: left; transform: scaleX(0);
  animation: trace 1.1s cubic-bezier(.2,.7,.2,1) forwards;
  box-shadow: 0 0 12px currentColor;
}
.traces span:nth-child(1) { background: var(--cyan);   color: var(--cyan);   animation-delay: .1s; }
.traces span:nth-child(2) { background: var(--blue);   color: var(--blue);   animation-delay: .22s; }
.traces span:nth-child(3) { background: var(--violet); color: var(--violet); animation-delay: .34s; }
.traces span:nth-child(4) { background: var(--orange); color: var(--orange); animation-delay: .46s; }
.traces span:nth-child(5) { background: var(--yellow); color: var(--yellow); animation-delay: .58s; }
@keyframes trace { to { transform: scaleX(1); } }

/* ----- Hero (inner pages) ----- */
.page-hero { padding: 3.5rem 0 2rem; }
.page-hero h1 { font-size: clamp(2.25rem, 5.5vw, 3.9rem); max-width: 16em; }
.page-hero__sub { font-size: var(--step-1); color: var(--muted); max-width: 40em; line-height: 1.5; }
.page-hero__rule {
  height: 3px; width: 140px; margin: 0 0 1.4rem; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 16px var(--accent);
}

/* ----- Content blocks ----- */
.block { padding: 3rem 0; }
.block + .block { border-top: 1px solid var(--line); }
.block__head { margin-bottom: 1.6rem; }
.block__head p { color: var(--muted); max-width: 52ch; margin: 0; }

.split { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
.split--even { grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .split, .split--even { grid-template-columns: minmax(0, 1fr); } }
code { overflow-wrap: anywhere; }

/* ----- Footer ----- */
.footer { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; margin-top: 2rem; color: var(--muted); font-size: var(--step--1); }
.footer__row { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: baseline; }
.footer a { color: var(--muted); }
.footer a:hover { color: #fff; }
.footer__links { display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* Profile photo under the name (home page) */
.hero__photo {
  display: block;
  width: 168px; height: 168px;
  object-fit: cover; object-position: center top;
  border-radius: 50%;
  margin: 1.2rem 0 1.4rem;
  box-shadow: 0 0 0 2px #1de9f0, 0 0 30px -4px #1de9f0;
}
