:root {
  --bg: #f6f4ef;
  --bg-alt: #ecE8df;
  --surface: #ffffff;
  --text: #1c1f22;
  --muted: #5a6168;
  --line: #d9d4c8;
  --accent: #1f5f8b;
  --accent-ink: #ffffff;
  --signal: #c2410c;
  --ph-bg: #fff3c4;
  --ph-text: #6b4e00;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
/* Dark: the device's setting unless the visitor picked Light, or the
   visitor picked Dark (theme.js puts data-theme on <html>). Keep the two
   copies identical. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171a;
    --bg-alt: #1a1e22;
    --surface: #20252a;
    --text: #e8e6e1;
    --muted: #a3aab1;
    --line: #333a41;
    --accent: #6cb4e4;
    --accent-ink: #0d1114;
    --signal: #fb923c;
    --ph-bg: #3d3313;
    --ph-text: #ffd866;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14171a;
  --bg-alt: #1a1e22;
  --surface: #20252a;
  --text: #e8e6e1;
  --muted: #a3aab1;
  --line: #333a41;
  --accent: #6cb4e4;
  --accent-ink: #0d1114;
  --signal: #fb923c;
  --ph-bg: #3d3313;
  --ph-text: #ffd866;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
}
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: 1.7rem; letter-spacing: -.01em; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.center { text-align: center; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

.draft-banner {
  background: var(--ph-bg); color: var(--ph-text);
  text-align: center; font-size: .9rem; padding: 8px 16px;
}
.ph { background: var(--ph-bg); color: var(--ph-text); border-radius: 4px; padding: 0 .3em; font-family: var(--mono); font-size: .88em; }
p.ph { display: inline-block; padding: .3em .6em; }
.small { font-size: .8rem; }
.tag {
  font: 600 .7rem/1 var(--mono); text-transform: uppercase; letter-spacing: .06em;
  background: var(--ph-bg); color: var(--ph-text); padding: .35em .6em; border-radius: 999px;
  vertical-align: middle; margin-left: .4em;
}

.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; }
.brand-mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink); font: 700 .85rem/1 var(--mono);
}
nav { display: flex; gap: 18px; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
nav a:hover { color: var(--text); }
.header-end { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface);
  color: var(--text); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle[hidden] { display: none; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun, .theme-toggle .icon-moon { display: none; }
:root[data-theme-choice="light"] .theme-toggle .icon-system,
:root[data-theme-choice="dark"] .theme-toggle .icon-system { display: none; }
:root[data-theme-choice="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme-choice="dark"] .theme-toggle .icon-moon { display: block; }
@media (max-width: 640px) {
  .site-header { position: static; }
  nav { gap: 12px; padding-bottom: 10px; }
}

.hero { padding: 64px 0 56px; }
.hero-inner { display: grid; grid-template-columns: 1fr 260px; gap: 48px; align-items: center; }
.eyebrow { font: 600 .8rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--signal); margin-bottom: .8em; }
h1 { font-size: clamp(2.4rem, 7vw, 3.8rem); letter-spacing: -.02em; margin-bottom: .2em; }
.headline { font-size: 1.1rem; color: var(--muted); font-weight: 500; }
.lede { font-size: 1.15rem; max-width: 36em; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 8px; }
.btn {
  display: inline-block; padding: 10px 20px; border-radius: 999px; text-decoration: none;
  border: 1.5px solid var(--accent); color: var(--accent); font-weight: 600;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn:hover { filter: brightness(1.08); }
.photo { margin: 0; text-align: center; }
.photo-ph {
  aspect-ratio: 1; border-radius: 50%; border: 2px dashed var(--line);
  display: grid; place-items: center; background: var(--surface);
  font: 700 3rem/1 var(--mono); color: var(--muted);
}
.photo figcaption { margin-top: 10px; display: inline-block; }
.photo img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 2px solid var(--line); }
@media (max-width: 760px) {
  .hero { padding: 40px 0; }
  .hero-inner { grid-template-columns: 1fr; gap: 28px; }
  .photo { order: -1; max-width: 160px; }
}

.section { padding: 64px 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (max-width: 640px) { .section { padding: 44px 0; } }

.grid { display: grid; gap: 16px; }
.creds { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card p:last-child { margin: 0; }
.card .verify { margin-top: 14px; font-size: .92rem; }
.card .verify a { font-weight: 600; }
.card .verify a::after { content: " \2197"; }
.card .verify span { display: block; color: var(--muted); font-size: .85rem; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.plain li:last-child { border-bottom: 0; }
.plain li span { color: var(--muted); font-size: .92rem; text-align: right; }
.sub { margin-top: 36px; font-size: 1.1rem; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; font-size: .92rem; }

.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 0 0 22px 20px; position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--accent);
}
.timeline .when { font: 600 .85rem/1.6 var(--mono); color: var(--muted); }
.timeline h3 { margin: 0 0 .2em; font-size: 1rem; }
.timeline .org { display: block; font-weight: 400; color: var(--muted); font-size: .92rem; margin-top: 2px; }
.timeline p { margin: .3em 0 0; font-size: .95rem; }
@media (max-width: 560px) {
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .plain li { flex-direction: column; gap: 0; }
  .plain li span { text-align: left; }
}

.tiles { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tile {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; text-decoration: none; color: var(--text);
  transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--accent); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .tile, .tile:hover { transition: none; transform: none; } }
.tile-k { font: 600 .72rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--signal); margin-bottom: .6em; }
.tile p { color: var(--muted); font-size: .95rem; flex: 1; }
.tile-url { font: .85rem/1 var(--mono); color: var(--accent); }

.contact-line { font-size: 1.4rem; font-weight: 600; margin-bottom: .3em; }

.site-footer { padding: 28px 0; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer-inner p { margin: 0; }

.prose { padding: 56px 0; }
.prose h1 { font-size: 2.2rem; }

/* Articles carousel: a native horizontal scroller (swipe, trackpad, Shift+wheel,
   or arrow keys once focused). /carousel.js adds previous/next buttons in
   every browser; without it the scroller still works. */
.section-lede { color: var(--muted); max-width: 44em; }
.carousel {
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  scroll-padding-inline: 2px; padding: 4px 2px 14px; margin: 0 -2px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.carousel:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius); }
.carousel-track { list-style: none; margin: 0; padding: 0; display: flex; gap: 16px; }
.article-card { flex: 0 0 min(300px, 82%); scroll-snap-align: start; display: flex; }
.article-card a {
  display: flex; flex-direction: column; width: 100%; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); text-decoration: none; transition: border-color .15s;
}
.article-card a:hover { border-color: var(--accent); }
.article-card a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.article-card img, .article-noimg {
  display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover;
  background: var(--bg-alt); border-bottom: 1px solid var(--line);
}
.article-noimg { display: grid; place-items: center; font: 700 1rem/1 var(--mono); color: var(--muted); }
.article-site { font: 600 .72rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--signal); padding: 14px 18px 0; }
.article-title { font-weight: 700; line-height: 1.3; padding: 6px 18px 0; }
.article-excerpt { color: var(--muted); font-size: .92rem; line-height: 1.5; padding: 8px 18px 18px; }
.carousel-more { color: var(--muted); font-size: .9rem; margin: 10px 0 0; }
@media (prefers-reduced-motion: no-preference) { .carousel { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) { .article-card a { transition: none; } }

.carousel-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; }
.carousel-foot .carousel-more { margin: 0; }
.carousel-nav { display: flex; gap: 8px; flex: none; }
.carousel-nav[hidden] { display: none; }
.carousel-btn {
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  border: 1.5px solid var(--accent); background: var(--surface); color: var(--accent);
  font: 700 1.1rem/1 var(--font);
}
.carousel-btn:disabled { opacity: .35; cursor: default; }
.carousel-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Back to top. Shown once the page has scrolled, using a scroll-driven
   animation (no script). Browsers without it show the link all the time. */
.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 6;
  padding: 9px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .9rem;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 10px rgb(0 0 0 / .18);
}
.to-top:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
@supports (animation-timeline: scroll()) {
  .to-top { animation: to-top-in linear both; animation-timeline: scroll(root); animation-range: 0 480px; }
  @keyframes to-top-in {
    0% { opacity: 0; visibility: hidden; transform: translateY(12px); }
    60% { opacity: 0; visibility: hidden; transform: translateY(12px); }
    100% { opacity: 1; visibility: visible; transform: none; }
  }
  @media (prefers-reduced-motion: reduce) {
    @keyframes to-top-in {
      0%, 99% { opacity: 0; visibility: hidden; }
      100% { opacity: 1; visibility: visible; }
    }
  }
}
@media print { .to-top { display: none; } }
