/* ── JetBrains Mono, self-hosted (no third-party requests, GDPR-clean) ───── */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;
  --bg:          #fbfbfa;
  --fg:          #1a1a19;
  --muted:       #70706c;
  --rule:        #e6e6e0;
  --chip-border: #dcdcd6;
  --chip-fg:     #6b756c;
  --faint:       #a3a39c;
  --faint-text:  #73736e;
  --row-hover:   #f1f1ee;
  --selection:   #dfe7e3;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo,
          Consolas, 'Liberation Mono', monospace;
}

/* System preference — skipped when the visitor has forced light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:          #0e1013;
    --fg:          #e8eaec;
    --muted:       #7c8288;
    --rule:        #21262c;
    --chip-border: #2a3038;
    --chip-fg:     #8a978f;
    --faint:       #5a616a;
    --faint-text:  #787d85;
    --row-hover:   #161a1f;
    --selection:   #1e3a33;
  }
}

/* Explicit choice always wins, in both directions */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:          #0e1013;
  --fg:          #e8eaec;
  --muted:       #7c8288;
  --rule:        #21262c;
  --chip-border: #2a3038;
  --chip-fg:     #8a978f;
  --faint:       #5a616a;
  --faint-text:  #787d85;
  --row-hover:   #161a1f;
  --selection:   #1e3a33;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--selection); }

:where(a):focus-visible,
:where(button):focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 10px 14px;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--chip-border);
  text-decoration: none;
  font-size: 12px;
}
.skip:focus { left: 12px; top: 12px; z-index: 10; }

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ── Identity row ────────────────────────────────────────────────────────── */
.id {
  display: flex;
  align-items: center;
  gap: 16px;
}

.id__avatar {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--row-hover);
  /* Keeps the circle readable in dark mode, where the hooded half of the
     portrait sits almost exactly on the page background. */
  box-shadow: 0 0 0 1px var(--rule);
}

.id__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.id__name {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
}

.id__role { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.3; }

.id__meta { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ── Chips: status + theme switch ────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--chip-border);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: .1em;
  color: var(--chip-fg);
  white-space: nowrap;
}

/* Progressive enhancement: only shown once theme.js has run */
.chip--btn { display: none; }
.js .chip--btn {
  display: inline-flex;
  background: none;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.js .chip--btn:hover { color: var(--fg); border-color: var(--faint); }

.chip__icon { display: none; }
:root[data-theme-pref="auto"]  .chip__icon--auto,
:root[data-theme-pref="light"] .chip__icon--light,
:root[data-theme-pref="dark"]  .chip__icon--dark { display: block; }

/* ── Tagline ─────────────────────────────────────────────────────────────── */
.tagline {
  margin: 0;
  font-size: clamp(20px, 5.6vw, 26px);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -.01em;
  text-wrap: balance;
}

/* ── Link rows ───────────────────────────────────────────────────────────── */
.links { list-style: none; margin: 0; padding: 0; }
.links > li { border-top: 1px solid var(--rule); }
.links > li:last-child { border-bottom: 1px solid var(--rule); }

.link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 12px;
  margin-inline: -10px;
  /* The mockup lets rows use the browser default rather than the body's 1.5,
     which sets a 51px row pitch. Matching it keeps the vertical rhythm. */
  line-height: 1.3;
  border-radius: 3px;
  color: inherit;
  text-decoration: none;
  transition: background-color .15s ease;
}
.link:hover, .link:focus-visible { background: var(--row-hover); }

.link__label { overflow-wrap: anywhere; }

.link__arrow {
  flex: none;
  color: var(--faint);
  transition: color .15s ease, transform .15s ease;
}
.link:hover .link__arrow,
.link:focus-visible .link__arrow {
  color: var(--fg);
  transform: translate(2px, -2px);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.foot {
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--faint-text);
}
.foot a { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── Motion / responsive ─────────────────────────────────────────────────── */
@media (max-width: 560px) {
  body { padding: 40px 20px; align-items: flex-start; }
  .card { gap: 32px; }
  .id { flex-wrap: wrap; }
  .id__meta { margin-left: 0; width: 100%; }
  .link { padding: 15px 12px; }
}

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

@media print {
  body { background: #fff; color: #000; display: block; padding: 24px; }
  .chip--btn, .skip { display: none !important; }
  .link { padding: 10px 0; margin: 0; }
}
