/* =========================================================================
   base.css — Reset + base element styling + theme wiring
   ========================================================================= */

/* ---- Minimal modern reset ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;   /* stop the off-screen mobile menu from causing sideways scroll;
                         `clip` (not `hidden`) so it doesn't break the sticky header */
}
body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--page-bg);
  color: var(--page-fg);
  transition: background var(--transition);
}
img, picture, svg, video { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
h1, h2, h3, h4 { font-weight: 500; line-height: var(--lh-snug); }

/* ---- Page themes --------------------------------------------------------
   Applied on <body>. Each sets the default page background, foreground and
   the nav colors. Individual <section>s can override with .bg-* utilities.  */
body.theme-home {
  --page-bg: var(--c-black);
  --page-fg: var(--on-dark);
  --nav-fg:  var(--c-white);
  --nav-bg:  transparent;
  --nav-scrolled-bg: rgba(0, 0, 0, 0.7);
}
body.theme-info {
  --page-bg: var(--c-black);
  --page-fg: var(--on-dark);
  --nav-fg:  var(--c-white);
  --nav-bg:  var(--c-black);              /* persistent black bar */
  --nav-scrolled-bg: rgba(0, 0, 0, 0.92);
}
body.theme-project {
  --page-bg: var(--c-black);
  --page-fg: var(--on-dark);
  --nav-fg:  var(--c-white);
  --nav-bg:  transparent;
  --nav-scrolled-bg: rgba(0, 0, 0, 0.92);   /* solid over the cream sections */
}

/* ---- Section background utilities --------------------------------------- */
.bg-black { background: var(--c-black); color: var(--on-dark); }
.bg-light { background: var(--c-cream); color: var(--on-light); }
.bg-taupe { background: var(--c-taupe); color: var(--on-dark); }

/* ---- Base typographic helpers ------------------------------------------ */
.font-serif   { font-family: var(--font-serif); }
.font-display { font-family: var(--font-display); }
.font-sans    { font-family: var(--font-sans); }

p { max-width: 68ch; }
.lead { font-size: var(--fs-lead); }

/* Links inside body copy */
.prose a,
a.link {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: opacity var(--transition);
}
.prose a:hover,
a.link:hover { opacity: 0.6; }

/* ---- Accessibility ------------------------------------------------------ */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible {
  outline: 2px solid var(--c-lilac);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
