/*
 * Stylesheet for jarvisclark.com (Hybrid C — Wayfinder Windowed Bento).
 *
 * Uses native CSS light-dark() with :root { color-scheme: light dark } so the
 * page tracks the OS light/dark preference automatically even with JS disabled,
 * while [data-theme] lets the user override it manually.
 */

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

:root {
  color-scheme: light dark;

  --mat: light-dark(#efe8dc, #1a1917);
  --paper: light-dark(#fcfaf5, #252320);
  --tint: light-dark(#f3ede2, #2d2a26);
  --edge: light-dark(#575045, #11100e);
  --line: light-dark(#d6cdbd, #423d35);
  --ink: light-dark(#221f1a, #f3eee4);
  --muted: light-dark(#585147, #c2baac);
  --shadow: light-dark(rgba(55, 48, 38, 0.14), rgba(0, 0, 0, 0.45));
  --link: light-dark(#0b4a8c, #8cc4ff);
  --focus: light-dark(#0b4a8c, #ffd35c);

  /* Tab accents & high-contrast ink pairings */
  --tab-citrus-bg: #f7c331;
  --tab-citrus-ink: #231a02;
  --tab-blue-bg: light-dark(#526176, #3c485a);
  --tab-blue-ink: #ffffff;
  --tab-apricot-bg: #f7882f;
  --tab-apricot-ink: #1f1102;
  --tab-sage-bg: #6ba368;
  --tab-sage-ink: #0e220f;

  /* Semiotic icon accents calibrated for light and dark surfaces */
  --ic-blue: light-dark(#445973, #9bb8d8);
  --ic-apricot: light-dark(#b54b05, #f7a048);
  --ic-sage: light-dark(#326b3b, #87c88d);
  --ic-coral: light-dark(#b53d2e, #ee8674);
  --ic-plum: light-dark(#724785, #c4a3d4);

  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--mat);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

/* Keep the inline SVG symbol sprite out of layout and screen-reader flow without inline styles. */
.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Skip link stays hidden until keyboard focus arrives. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--tab-citrus-bg);
  color: var(--tab-citrus-ink);
  padding: 10px 16px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--edge);
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

.page-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 18px 40px;
}

/* Utility Top Bar */
.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 18px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.prism-pill {
  width: 22px;
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    #d95f4c 0% 16.6%,
    #f7882f 16.6% 33.3%,
    #f7c331 33.3% 50%,
    #5ea067 50% 66.6%,
    #526176 66.6% 83.3%,
    #956ca8 83.3% 100%
  );
  flex-shrink: 0;
}

.topbar-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ctrl-btn,
.ctrl-link {
  appearance: none;
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--edge);
  border-radius: 6px;
  padding: 6px 11px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.ctrl-btn:hover,
.ctrl-link:hover {
  background: var(--tint);
}

.ctrl-btn[aria-pressed="true"] {
  background: var(--tab-citrus-bg);
  color: var(--tab-citrus-ink);
}

/* 12-Column Asymmetric Wayfinder Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.win {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.win-about { grid-column: span 7; }
.win-contact { grid-column: span 5; }
.win-tools { grid-column: span 5; }
.win-oss { grid-column: span 7; }

@media (max-width: 760px) {
  .win-about,
  .win-contact,
  .win-tools,
  .win-oss {
    grid-column: span 12;
  }
}

.win-tab {
  align-self: flex-start;
  padding: 4px 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1.5px solid var(--edge);
  border-bottom: 0;
  margin: 0;
}

.tab-citrus { background: var(--tab-citrus-bg); color: var(--tab-citrus-ink); }
.tab-blue { background: var(--tab-blue-bg); color: var(--tab-blue-ink); }
.tab-apricot { background: var(--tab-apricot-bg); color: var(--tab-apricot-ink); }
.tab-sage { background: var(--tab-sage-bg); color: var(--tab-sage-ink); }

.win-card {
  flex: 1;
  background: var(--paper);
  border: 1.5px solid var(--edge);
  padding: 16px 18px;
  box-shadow: 3px 3px 0 var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.about-title {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 28px);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.about-bio {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
  max-width: 56ch;
}

.rb-rule {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    #d95f4c 0% 16.6%,
    #f7882f 16.6% 33.3%,
    #f7c331 33.3% 50%,
    #5ea067 50% 66.6%,
    #526176 66.6% 83.3%,
    #956ca8 83.3% 100%
  );
}

.win-about .rb-rule {
  margin: 10px 0 12px;
}

/* Interactive Rows inside Contact & Open Source Windows */
.row-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.row-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  background: var(--tint);
  border-radius: 6px;
  text-decoration: none;
  transition: border-color 0.14s ease, transform 0.14s ease;
}

.row-link:hover,
.row-link:focus-visible {
  border-color: var(--tab-apricot-bg);
  transform: translateY(-1px);
}

.row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.row-title {
  font-size: 14px;
  font-weight: 700;
}

.row-sub {
  font-size: 12.5px;
  color: var(--muted);
}

.row-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

/* Semiotic Icon Tints */
.ic { flex-shrink: 0; }
.ic-blue { color: var(--ic-blue); }
.ic-apricot { color: var(--ic-apricot); }
.ic-sage { color: var(--ic-sage); }
.ic-coral { color: var(--ic-coral); }
.ic-plum { color: var(--ic-plum); }

/* Tools Window */
.tool-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.tool-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 750;
}

.tool-desc {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

.tool-cta {
  display: inline-block;
  align-self: flex-start;
  font-weight: 750;
  font-size: 14px;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

/* Live Hydrant-Style Open Source Status Bar */
.oss-status {
  padding: 8px 0 0;
  border-top: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

/* Footer */
.site-footer {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  font-size: 12.5px;
  color: var(--muted);
}

.site-footer a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =========================================================
   LOW-VISION & SCREEN-READER MODE (?view=accessible)
   AND DEDICATED PLAIN PAGE (docs/accessible.html)
   ========================================================= */
:root[data-a11y-mode="accessible"] body,
body.plain-accessible {
  background: light-dark(#fffdf7, #121210);
  color: light-dark(#111111, #fdfbf5);
  font-size: 1.1875rem;
  line-height: 1.7;
  letter-spacing: 0.015em;
}

:root[data-a11y-mode="accessible"] .page-shell,
body.plain-accessible .page-shell {
  max-width: 62ch;
  padding: 24px 18px 48px;
}

:root[data-a11y-mode="accessible"] .bento-grid {
  display: block;
}

:root[data-a11y-mode="accessible"] .win {
  margin-bottom: 24px;
}

:root[data-a11y-mode="accessible"] .win-card {
  background: transparent;
  border: 0;
  border-top: 2px solid currentColor;
  padding: 12px 0 0;
  box-shadow: none;
}

:root[data-a11y-mode="accessible"] .win-tab {
  background: transparent;
  color: inherit;
  border: 0;
  padding: 0 0 4px;
  font-size: 0.95rem;
}

:root[data-a11y-mode="accessible"] .prism-pill,
:root[data-a11y-mode="accessible"] .rb-rule,
:root[data-a11y-mode="accessible"] .ic {
  display: none;
}

:root[data-a11y-mode="accessible"] .about-bio,
:root[data-a11y-mode="accessible"] .row-sub,
:root[data-a11y-mode="accessible"] .row-tag,
:root[data-a11y-mode="accessible"] .tool-desc,
:root[data-a11y-mode="accessible"] .oss-status,
:root[data-a11y-mode="accessible"] .site-footer {
  color: inherit;
  font-size: 1rem;
}

:root[data-a11y-mode="accessible"] .row-link {
  display: block;
  background: transparent;
  border: 1.5px solid currentColor;
  padding: 12px 14px;
}

:root[data-a11y-mode="accessible"] a,
body.plain-accessible a {
  color: light-dark(#0b4a8c, #ffd35c);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
  font-weight: 700;
}

.plain-accessible h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin: 0 0 10px;
}

.plain-accessible h2 {
  font-size: 1.25rem;
  margin: 26px 0 10px;
  border-bottom: 2px solid currentColor;
  padding-bottom: 4px;
}

.plain-accessible ul {
  padding-left: 22px;
  margin: 8px 0 0;
}

.plain-accessible li {
  margin-bottom: 12px;
}

.plain-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid currentColor;
  font-size: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  .row-link {
    transition: none;
  }
  .row-link:hover,
  .row-link:focus-visible {
    transform: none;
  }
}

@media (forced-colors: active) {
  .win-card,
  .win-tab,
  .row-link,
  .ctrl-btn,
  .ctrl-link {
    border: 1px solid CanvasText;
    box-shadow: none;
  }
  a:focus-visible,
  button:focus-visible {
    outline: 3px solid Highlight;
  }
}


/* =========================================================
   CONTENT PAGES, DOCUMENTATION, ARTICLES, AND CODE BLOCKS
   ========================================================= */
.content-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.breadcrumbs a {
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.breadcrumbs a:hover {
  color: var(--link);
  border-bottom-color: var(--link);
}

.content-title {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.content-lead {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 16px;
}

.content-prose h2 {
  margin: 22px 0 8px;
  font-size: 18px;
  line-height: 1.3;
}

.content-prose h3 {
  margin: 18px 0 6px;
  font-size: 15px;
}

.content-prose p,
.content-prose ul,
.content-prose ol {
  margin: 0 0 12px;
}

.content-prose ul,
.content-prose ol {
  padding-left: 22px;
}

.content-prose a {
  color: var(--link);
  text-underline-offset: 2px;
}

.content-prose code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--tint);
  padding: 1px 5px;
  border-radius: 3px;
}

.content-actions {
  margin-top: 18px;
}

.oss-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 760px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
}

.docs-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.docs-nav-link {
  display: block;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--tint);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.docs-nav-link.is-active {
  border-color: var(--edge);
  background: var(--paper);
  box-shadow: 2px 2px 0 var(--shadow);
}

.pager-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
}

.pager-nav a {
  color: var(--link);
  text-decoration: none;
}

.pager-nav a:hover {
  text-decoration: underline;
}

.plain-kicker {
  font-size: 0.95rem;
  margin: 0 0 8px;
}

:root[data-a11y-mode="accessible"] .docs-layout {
  display: block;
}

:root[data-a11y-mode="accessible"] .docs-sidebar {
  margin-bottom: 20px;
}


/* Syntax highlighting (highlight.js class tokens, zero inline styles) */
.code-block {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 5px;
  background: var(--tint);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
}

.content-prose .code-block code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}

.hljs-comment,
.hljs-quote {
  color: var(--muted);
  font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-subst {
  color: light-dark(#8b2635, #ff9e8a);
  font-weight: 700;
}

.hljs-string,
.hljs-doctag,
.hljs-attr {
  color: light-dark(#245c36, #87c88d);
}

.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable {
  color: light-dark(#9a4800, #f7a048);
}

.hljs-title,
.hljs-section,
.hljs-function {
  color: light-dark(#0b4a8c, #8cc4ff);
  font-weight: 700;
}

/* Inline SVG figures & accessible diagram prose */
.svg-figure {
  margin: 16px 0;
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: 5px;
  background: var(--tint);
}

.svg-figure svg {
  display: block;
  width: 100%;
  height: auto;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
}

.svg-caption {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.a11y-diagram {
  margin: 16px 0;
  padding: 12px 14px;
  border-left: 3px solid currentColor;
}
