/* Nav --------------------------------------------------------------- */
/* A floating pill: the wordmark on the left, the sections in the middle
   and the resume on the right. Below 1024px the sections and the resume
   move into the menu. */
.nav {
  position: sticky;
  top: var(--nav-top);
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  width: calc(100% - 2 * var(--gutter));
  max-width: 1120px;
  height: var(--nav);
  margin: var(--nav-top) auto 0;
  padding: 0 10px 0 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  /* A soft shadow keeps the pill distinct over the light Contact band. */
  box-shadow: 0 12px 32px -16px rgba(0, 0, 0, 0.6);
}

.wordmark {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: "Satoshi", var(--font-sans);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
  white-space: nowrap;
}

/* The dot glows in the reactor's colour. */
.wordmark__dot {
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 15px;
}

/* The section on screen is marked by a soft pill as well as by colour. */
.nav__links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  transition: color 200ms, background-color 200ms;
}

.nav__links a[aria-current="true"] {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

@media (hover: hover) {
  .nav__links a:hover { color: var(--text); }
}

.nav__end {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav .nav__menu {
  display: none;
}

@media (max-width: 1023px) {
  .nav {
    grid-template-columns: 1fr auto;
    padding: 0 8px 0 20px;
  }

  .nav .nav__links,
  .nav .nav__resume {
    display: none;
  }

  .js .nav .nav__menu {
    display: inline-flex;
  }
}

/* How far down the page the reader is: a thin line along the top of the
   screen. index.js sets its scale as the page scrolls. */
.progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 11;
  height: 2px;
  background: rgba(255, 255, 255, 0.55);
  /* Grey on the dark bands, darker grey over the light one. */
  mix-blend-mode: difference;
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* Menu -------------------------------------------------------------- */
/* Below 1024px: the full screen under the nav, with the sections, the
   resume and the email. */
.menu {
  position: fixed;
  inset: 0;
  z-index: 9;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(var(--nav-top) + var(--nav) + 24px) var(--gutter) 40px;
  background: var(--bg);
}

@media (min-width: 1024px) {
  .menu { display: none; }
}

.menu__links {
  max-width: 1120px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

.menu__links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.menu__links a[aria-current="true"] {
  color: var(--text);
}

/* The current section is marked by a dot as well as by colour. */
.menu__links a[aria-current="true"]::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text);
}

.menu__more {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1120px;
  margin: 28px auto 0;
}

/* Bands ------------------------------------------------------------- */
/* Each section is a band of one grey from the ramp, painted edge to edge
   (a filled border-image that reaches 100vw either side, which draws
   outside the box without widening the page), with a faint hairline where
   it meets the band above. It reaches 1px up, so no sub-pixel seam of the
   page shows between two bands. */
.band {
  border-image: linear-gradient(var(--edge) 0 1px, var(--band) 1px) fill 0 / 0 / 1px 100vw 0;
  /* The same grey as a plain background too, under the border-image, so
     contrast tools that ignore border-images still see the true surface. */
  background-color: var(--band);
  color: var(--text);
}

.band--900 { --band: var(--grey-900); }
.band--850 { --band: var(--grey-850); }

/* The finale is inverted: off-white, near-black text and dark pills. Every
   token is redefined, so everything inside follows. */
.band--light {
  color-scheme: light;
  --band: var(--grey-100);
  --bg: var(--grey-100);
  --text: var(--grey-900);
  --text-2: var(--grey-700);
  --muted: var(--grey-650);
  --dim: var(--grey-600);
  --line: hsl(var(--h) 40% 10% / 0.1);
  --line-2: hsl(var(--h) 40% 10% / 0.2);
  --edge: hsl(var(--h) 40% 10% / 0.06);
  --solid-hover: var(--grey-700);
  --accent: hsl(var(--h) 80% 36%);
  --accent-glow: transparent;
  --focus: var(--grey-900);
}

/* Sections ---------------------------------------------------------- */
/* Space lives inside each band. A link to a section lands with its title
   just under the nav rather than at the band's top edge. */
.section {
  --band-pad: clamp(64px, 8vw, 120px);
  width: calc(100% - 2 * var(--gutter));
  max-width: calc(var(--wide) - 48px);
  margin: 0 auto;
  padding-block: var(--band-pad);
  scroll-margin-top: calc(-1 * var(--band-pad));
}

/* The section titles: one word in the italic serif. */
.title {
  font-size: var(--t-title);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.05em;
  text-align: center;
  overflow-wrap: break-word;
}

.title .serif {
  padding-right: 0.04em;
  letter-spacing: -0.02em;
  text-shadow: 0 0 0.3em var(--accent-glow);
}

.title + * {
  margin-top: clamp(40px, 5vw, 72px);
}

/* Pills ------------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: border-color 200ms, background-color 200ms, color 200ms;
}

.pill--solid {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.pill .icon {
  width: 17px;
  height: 17px;
}

@media (hover: hover) {
  .pill:hover { border-color: var(--muted); }
  .pill--solid:hover { border-color: var(--solid-hover); background: var(--solid-hover); }
}

/* Cards ------------------------------------------------------------- */
/* Quiet panels: a gentle vertical gradient a step above the band, a
   hairline border and a lighter top edge, as if lit from above. */
.card {
  position: relative;
  border: 1px solid var(--line);
  border-top-color: rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card-top), var(--card));
  transition: border-color 200ms;
}

@media (hover: hover) {
  a.card:hover { border-color: var(--line-2); }
}

/* Hairline rows ----------------------------------------------------- */
/* A label column beside its value, one row per fact. */
.rows {
  border-top: 1px solid var(--line);
}

.rows > div,
.rows > li {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 8px 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.rows dt.mono {
  padding-top: 4px;
  color: var(--dim);
}

.rows dd {
  color: var(--text-2);
}

@media (max-width: 719px) {
  .rows > div,
  .rows > li {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px 0;
  }
}

/* Footer ------------------------------------------------------------ */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  width: calc(100% - 2 * var(--gutter));
  max-width: calc(var(--wide) - 48px);
  margin: clamp(80px, 9vw, 128px) auto 0;
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--dim);
}

.footer .wordmark {
  min-height: 44px;
  color: var(--muted);
  font-size: 20px;
}

/* On the main page the footer continues the light Contact band, with its
   hairline kept to the content width. */
.footer.band {
  --edge: transparent;
  position: relative;
  margin-top: 0;
  border-top: 0;
}

.footer.band::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--line);
}
