/* willhackforsushi.com — single self-hosted stylesheet.
   Theme-aware (light/dark via prefers-color-scheme), WCAG 2.2 AA contrast targets,
   reduced-motion aware. No external fonts, CDNs, or trackers. */

:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --surface-2: #eceef1;
  --text: #16191d;
  --text-muted: #4b535c;
  --border: #d5d9de;
  --accent: #b5451f;          /* salmon/nori-adjacent; ~5.3:1 on white */
  --accent-text: #ffffff;
  --link: #0a4fa0;            /* ~6.4:1 on white */
  --focus: #0a4fa0;
  --maxw: 68rem;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #161b22;
    --surface-2: #21262d;
    --text: #e6edf3;
    --text-muted: #a7b1bc;
    --border: #30363d;
    --accent: #e8663d;        /* ~5.9:1 on #0d1117 */
    --accent-text: #0d1117;
    --link: #6cb0ff;          /* ~7:1 on #0d1117 */
    --focus: #6cb0ff;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

a { color: var(--link); }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

img { max-width: 100%; height: auto; }

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-text);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* Header / nav */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.9rem;
  flex-wrap: wrap;
}
.site-header__brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text);
}
.site-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-nav a { text-decoration: none; color: var(--text-muted); }
.site-nav a:hover { color: var(--text); text-decoration: underline; }

main { padding-block: clamp(1.5rem, 5vw, 3.5rem); }

/* Hero */
.hero { max-width: 52rem; }
.hero__eyebrow {
  text-transform: lowercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
}
.hero__name { font-size: clamp(2rem, 6vw, 3rem); line-height: 1.1; margin: 0 0 0.5rem; }
.hero__tagline { font-size: clamp(1.1rem, 3vw, 1.4rem); color: var(--accent); margin: 0 0 1rem; font-style: italic; }
.hero__positioning { color: var(--text-muted); margin: 0 0 1.25rem; }
.hero__lede { font-size: 1.075rem; }
.hero__cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }

.btn {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.btn:hover { border-color: var(--text-muted); text-decoration: none; }
.btn--primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn--primary:hover { filter: brightness(1.05); }

.section-heading { font-size: 1.35rem; margin: 2.75rem 0 1rem; }

/* Profiles */
.profiles__list,
.featured__grid,
.library-nav__list { list-style: none; padding: 0; margin: 0; }

.profiles__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.75rem;
}
.profile-link {
  display: flex;
  flex-direction: column;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
}
.profile-link:hover { border-color: var(--accent); text-decoration: none; }
.profile-link__label { font-weight: 700; }
.profile-link__handle { color: var(--text-muted); font-size: 0.9rem; }

/* Featured repos */
.featured__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.repo-card { padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.repo-card__name { font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.repo-card__desc { color: var(--text-muted); margin: 0.4rem 0 0; font-size: 0.95rem; }

/* Library nav */
.library-nav__list { display: grid; gap: 0.5rem; }
.library-nav__list li { padding-left: 0; }
.library-nav__list a { font-weight: 600; }
.muted { color: var(--text-muted); }

/* Prose pages (About, Privacy, article bodies) */
.prose { max-width: 44rem; }
.prose h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); line-height: 1.15; margin: 0 0 1rem; }
.prose h2 { font-size: 1.3rem; margin: 2rem 0 0.5rem; }
.prose p { margin: 0 0 1rem; }
.prose ul { padding-left: 1.25rem; }
.profiles__list--about { margin-top: 1rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 3rem;
  padding-block: 1.5rem;
  color: var(--text-muted);
}
.site-footer__tagline { font-style: italic; margin: 0 0 0.5rem; }
.site-footer__links { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.site-footer__links a { color: var(--text-muted); }
.site-footer__legal { font-size: 0.85rem; margin: 0; }

/* ---- Resource catalog ---- */
.breadcrumb { font-size: 0.9rem; color: var(--text-muted); margin: 0 0 0.75rem; }
.breadcrumb a { color: var(--link); }

.filters {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 1.5rem 0;
}
.filters__searchrow { display: flex; flex-direction: column; gap: 0.35rem; }
.filters__label { font-weight: 600; }
.filters__search {
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}
.filters__group { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.filters__group legend { font-weight: 600; margin-right: 0.5rem; padding: 0; float: left; }

.chip {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.chip:hover { border-color: var(--text-muted); }
.chip[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.results-count { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 1rem; }

.rcard-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
@media (min-width: 44rem) {
  .rcard-list { grid-template-columns: repeat(2, 1fr); }
}
.rcard {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rcard[hidden] { display: none; }
.rcard__head { display: flex; justify-content: space-between; align-items: start; gap: 0.5rem; }
.rcard__title { font-size: 1.05rem; margin: 0; line-height: 1.3; }
.rcard__title a { text-decoration: none; }
.rcard__title a:hover { text-decoration: underline; }
.rcard__meta { display: flex; flex-wrap: wrap; gap: 0.6rem; font-size: 0.85rem; color: var(--text-muted); margin: 0; }
.rcard__desc { margin: 0; font-size: 0.95rem; }
.rcard__tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0; margin: 0; }
.rcard__tags li { font-size: 0.75rem; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 0.1rem 0.5rem; }
.rcard__actions { display: flex; align-items: center; gap: 1rem; margin: 0.25rem 0 0; }
.rcard__detail { font-size: 0.9rem; }

.badge {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-muted);
  white-space: nowrap;
}
.badge--tool { background: #1f6f43; color: #fff; }
.badge--presentation { background: #274b8f; color: #fff; }
.badge--paper { background: #6b3fa0; color: #fff; }
.badge--status { background: var(--surface-2); color: var(--text-muted); }

.btn--sm { padding: 0.35rem 0.7rem; font-size: 0.85rem; }

.no-results { color: var(--text-muted); padding: 1rem 0; }

/* ---- Detail page ---- */
.detail { max-width: 48rem; }
.detail__head { margin-bottom: 1rem; }
.detail__head h1 { margin: 0.5rem 0 0.4rem; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.detail__meta { display: flex; flex-wrap: wrap; gap: 0.75rem; color: var(--text-muted); margin: 0; }
.detail__abstract { font-size: 1.075rem; }
.asset-list, .detail__tags { list-style: none; padding: 0; }
.asset-list li { padding: 0.4rem 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }
.detail__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.detail__tags a { font-size: 0.85rem; border: 1px solid var(--border); border-radius: 999px; padding: 0.15rem 0.6rem; text-decoration: none; }
.detail__back { margin-top: 2rem; }
.callout {
  border-left: 4px solid var(--accent);
  background: var(--surface);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.callout--historical { border-left-color: var(--text-muted); font-size: 0.95rem; }

/* ---- Articles ---- */
.article__meta { display: flex; align-items: center; gap: 0.75rem; color: var(--text-muted); font-size: 0.9rem; margin: 0 0 0.5rem; }
.article figure { margin: 1.5rem 0; }
.article figure img { border: 1px solid var(--border); border-radius: 6px; }
.article figcaption { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.35rem; }
.article pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}
.article :not(pre) > code {
  background: var(--surface-2);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.9em;
}
.article blockquote {
  margin: 1rem 0;
  padding: 0.25rem 1rem;
  border-left: 3px solid var(--border);
  color: var(--text-muted);
}
.writing-list { list-style: none; padding: 0; }
.writing-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; justify-content: space-between; }
.writing-list a { font-weight: 600; }

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