/* base.css — reset, typography, masthead, nav, overlay shell, footer */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--prose);
  font-size: var(--step-0);
  line-height: 1.55;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden; /* belt — no accidental horizontal scroll on mobile */
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--amber); color: #1a1408; }

.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--amber); color: #140f02; padding: .5rem .9rem; font-family: var(--mono); font-size: .8rem;
}
.skip:focus { left: .5rem; top: .5rem; }

/* focus — always visible */
:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 1px;
}

/* ---------- masthead (compact sticky bar — identity lives in the ⓘ panel) ---------- */
.masthead {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: .5rem .9rem; flex-wrap: nowrap;
  max-width: 100vw;
  padding: .5rem var(--pad);
  border-bottom: 1px solid var(--line);
  background: rgba(10,10,12,.86);
  backdrop-filter: blur(10px);
}
.brand { display: inline-flex; align-items: baseline; gap: .45ch; flex-shrink: 0; }
.brand .mark {
  font-family: var(--mono); color: var(--glow);
  font-size: .8em; letter-spacing: -.18em; transform: translateY(-.04em);
}
.brand-name {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.2rem, 1.05rem + .7vw, 1.6rem); line-height: 1; letter-spacing: .01em;
}
.ink-teal  { color: var(--teal);  font-style: italic; }
.ink-amber { color: var(--amber); font-style: italic; }

/* ---------- top nav ---------- */
.topnav {
  display: flex; flex-wrap: nowrap; gap: .05rem;
  margin-left: auto; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
}
.topnav::-webkit-scrollbar { display: none; }
.navlink {
  position: relative; flex-shrink: 0;
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: .05em;
  text-transform: lowercase;
  color: var(--dim);
  padding: .45rem .65rem;
  border-bottom: 2px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.navlink:hover { color: var(--text); }
.navlink.is-active { color: var(--text); border-bottom-color: var(--glow); }
.soon {
  font-size: .55em; vertical-align: super; margin-left: .3ch;
  color: var(--fainter); letter-spacing: .1em;
}
.iconbtn {
  flex-shrink: 0; width: 1.85rem; height: 1.85rem;
  display: grid; place-items: center;
  font-size: 1rem; color: var(--dim);
  border: 1px solid var(--line); border-radius: 999px;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.iconbtn:hover { color: var(--text); border-color: var(--glow); }

/* ---------- overlay (modals) ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: var(--pad); }
.overlay[hidden] { display: none; }
.overlay-scrim { position: absolute; inset: 0; background: rgba(4,4,6,.78); backdrop-filter: blur(2px); }
.overlay-card {
  position: relative;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 660px; width: 100%;
  max-height: 86dvh; overflow: auto;
  padding: clamp(1.3rem, 1rem + 2vw, 2.4rem);
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
}
.ov-close {
  position: sticky; top: 0; float: right;
  font-family: var(--mono); font-size: .72rem; color: var(--faint);
  border: 1px solid var(--line); padding: .25rem .55rem; border-radius: var(--radius);
}
.ov-close:hover { color: var(--text); border-color: var(--dim); }

/* ---------- footer ---------- */
.footsig {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 1rem var(--pad);
  display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; justify-content: space-between;
  font-family: var(--mono); font-size: var(--step--1); color: var(--faint);
}
.footsig .dim { color: var(--fainter); }
.footsig b { color: var(--dim); font-weight: 500; }

.dim { color: var(--dim); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
