/* Structural chrome: top bar, section rhythm and footer. */

/* Lets keyboard users bypass the nav (WCAG 2.4.1). Visible on focus only. */
.skip-link{position:absolute;top:-100px;left:12px;z-index:50;background:var(--ink);color:var(--paper);font-family:var(--mono);font-size:13px;padding:10px 16px;transition:top .2s}
.skip-link:focus{top:12px}

nav{position:sticky;top:0;z-index:20;background:var(--nav-bg);backdrop-filter:blur(8px);border-bottom:1px solid var(--line)}
nav .inner{max-width:var(--maxw);margin:0 auto;padding:18px 28px;display:flex;justify-content:space-between;align-items:center}
nav .nm{font-family:var(--serif);font-size:17px;font-weight:500}
nav .lk{display:flex;gap:24px;font-family:var(--mono);font-size:12.5px;color:var(--muted)}
nav .lk a{transition:color .2s} nav .lk a:hover{color:var(--ink)}
@media(max-width:600px){nav .lk a:not(.mail){display:none}}

/* Language switcher. Kept outside .lk on purpose — .lk hides its links under
   600px, and a switcher that disappears on mobile is not a switcher. */
nav .lang{display:flex;align-items:center;gap:7px;font-family:var(--mono);font-size:12px;color:var(--dim)}
nav .lang a{transition:color .2s}
nav .lang a:hover{color:var(--ink)}
nav .lang a[aria-current]{color:var(--ink);font-weight:500}
nav .lang .sep{color:var(--line)}

/* Theme toggle. A real <button>, so Enter and Space work for free and the
   pressed state is announced. Sits beside the language switcher — both are
   page-level controls, not navigation.

   Hidden until theme.js sets data-theme-ready on <html>. Same reasoning as
   the reveal guard: a control that cannot work should not be presented, and
   without JS the page still follows the system preference correctly. */
nav .theme-toggle{display:none}
:root[data-theme-ready] nav .theme-toggle{
  display:inline-flex;align-items:center;justify-content:center;
  width:30px;height:30px;padding:0;margin-left:14px;
  background:none;border:1px solid var(--line);border-radius:4px;
  color:var(--dim);cursor:pointer;
  transition:color .2s,border-color .2s;
}
nav .theme-toggle:hover{color:var(--ink);border-color:var(--muted)}
nav .theme-toggle svg{width:15px;height:15px;display:block}

/* Exactly one icon shows: the sun means "you are in dark, this returns you
   to light". Swapped by [aria-pressed], so the icon can never disagree with
   the state a screen reader is told. */
nav .theme-toggle .i-sun{display:none}
nav .theme-toggle[aria-pressed="true"] .i-sun{display:block}
nav .theme-toggle[aria-pressed="true"] .i-moon{display:none}

section{padding:80px 0}

footer{border-top:1px solid var(--line);padding:26px 0}
footer .wrap{display:flex;justify-content:space-between;flex-wrap:wrap;gap:10px;font-family:var(--mono);font-size:12px;color:var(--dim)}
