/* jayclark.ai
   Terminal console language: near-black surface ramp, hairline rules, zero
   radius, zero shadows, a monospace field with a sans display accent, a header
   that stays dark in both schemes, and one neon wordmark as the sole ornament.

   Reading translation: chrome runs at console density, body prose runs at
   reading size on a centered 39rem measure with generous leading. */

:root {
  color-scheme: dark;
  --bg:#0d1015; --panel:#151922; --raised:#1b202b; --soft:#202633; --border:#2b3342;
  --fg:#edf0f5; --muted:#9ba6b7; --accent:#79aaff; --link:#8db8ff;
  --ok:#4ecb7c; --warn:#e8b04f; --bad:#f07167; --idle:#8993a3;
  --shadow:none;
  --fs-metric:.9rem; --fs-title:.8rem; --fs-label:.72rem; --fs-caption:.65rem;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --display:"Avenir Next","Avenir","Segoe UI",sans-serif;
  --wordmark:"Helvetica Neue Condensed Black","Arial Narrow","Arial Black","Helvetica Neue",sans-serif;
}
/* Light scheme. Keep both blocks identical. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg:#f4f6f9; --panel:#fff; --raised:#f8f9fb; --soft:#eef1f5; --border:#d8dee8;
    --fg:#17202c; --muted:#5f6b7b; --accent:#2563d9; --link:#1756c1;
    --ok:#187b43; --warn:#94600e; --bad:#bd3730; --idle:#667180;
    --shadow:none;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg:#f4f6f9; --panel:#fff; --raised:#f8f9fb; --soft:#eef1f5; --border:#d8dee8;
  --fg:#17202c; --muted:#5f6b7b; --accent:#2563d9; --link:#1756c1;
  --ok:#187b43; --warn:#94600e; --bad:#bd3730; --idle:#667180;
  --shadow:none;
}

/* ---- base ---- */

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 110%; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  font-family: var(--mono);
  font-size: .8125rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  color: var(--fg);
  background: var(--bg);
}

img, svg { max-width: 100%; }
::selection { background: var(--soft); }
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 3px;
  border-radius: 0;
}

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

.skip {
  position: absolute; left: -999px; top: .8rem; z-index: 40;
  padding: .4rem .8rem;
  background: var(--raised);
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: .06em;
  text-decoration: none;
}
.skip:focus { left: .8rem; }

.sheet { max-width: 62rem; margin: 0 auto; padding: 0 1.25rem 2.25rem; }

/* ---- header: dark in both schemes, sticky, full bleed ---- */

.masthead {
  --fg:#f7f8ff; --muted:#a6b0c0; --raised:#1b202b; --soft:#202633; --border:#2b3342;
  position: sticky; top: 0; z-index: 10;
  margin: 0 calc(50% - 50vw) 2.2rem;
  padding: .6rem calc(50vw - 50%);
  background: #0d1015;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
  color: var(--fg);
}
.site-name {
  font-family: var(--wordmark);
  font-style: italic;
  font-weight: 950;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #fff;
  text-decoration: none;
  -webkit-text-stroke: .24px #fff;
  text-shadow: 0 0 .45px #fff, 0 0 1.5px #fff, 0 0 4px rgba(255,255,255,.98),
    0 0 9px rgba(225,235,255,.72), 0 0 24px rgba(130,160,255,.34);
}
.site-name:hover { text-decoration: none; }
.masthead nav { display: flex; gap: 1.2rem; align-items: center; }
.masthead nav a {
  font-family: var(--display);
  font-weight: 600;
  font-size: .9rem;
  color: var(--muted);
}
.masthead nav a:hover { color: var(--fg); text-decoration: none; }
.mode {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--fs-caption);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .18rem .55rem;
  cursor: pointer;
}
.mode:hover { border-color: var(--accent); color: var(--accent); }

/* ---- headings: the sans display accent against the mono field ---- */

.rule-head, .prose h1, .prose h2, .prose h3 { font-family: var(--display); font-weight: 600; }
h1.rule-head, .prose h1 { font-size: 1.35rem; line-height: 1.2; letter-spacing: -.01em; margin: 0 0 1rem; }
.prose h2 {
  font-size: 1.05rem;
  margin: 2.4rem 0 .9rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--border);
}
.prose h3 { font-size: .95rem; margin: 1.8rem 0 .7rem; color: var(--muted); }

/* ---- prose ---- */

.prose { max-width: 39rem; font-size: .95rem; line-height: 1.7; }
.page-prose { margin-inline: auto; }
.prose p { margin: 0 0 1.1rem; }
.essay .prose h1 + p { color: var(--muted); }
.prose ul, .prose ol { margin: 0 0 1.1rem; padding-left: 1.4rem; }
.prose li { margin: .4rem 0; }
.prose li::marker { color: var(--muted); }
.prose hr { border: 0; height: 1px; background: var(--border); margin: 2.2rem 0; }
.prose [id] { scroll-margin-top: 3.8rem; }
.prose a { text-decoration: underline dotted; text-underline-offset: .25em; }
.prose a:hover { text-decoration: underline solid; }

/* field notes: a left rule, muted */
.prose blockquote {
  margin: 1.5rem 0;
  padding: .1rem 0 .1rem 1rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
  font-size: .88rem;
}
.prose blockquote strong { color: var(--fg); }

/* code */
.prose code {
  background: var(--raised);
  border: 1px solid var(--border);
  padding: .06em .3em;
  font-size: .88em;
}
.prose pre {
  margin: 1.5rem 0;
  padding: .8rem .95rem;
  background: var(--raised);
  border: 1px solid var(--border);
  overflow-x: auto;
  font-size: .78rem;
  line-height: 1.5;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: 1em; }

/* tables: rules, not boxes */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; max-width: 100%; }
.prose table {
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: .82rem;
  line-height: 1.5;
  min-width: 640px;
  width: 100%;
}
.prose th, .prose td {
  text-align: left;
  padding: .4rem .6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.prose th {
  color: var(--muted);
  font-weight: 650;
  font-size: .69rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.prose tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover { background: var(--raised); }

/* ---- stamps: outline, uppercase, tilted ---- */

.stamp {
  display: inline-block;
  padding: .08rem .45rem;
  border-radius: 0;
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  border: 1.5px solid currentColor;
  background: transparent;
  white-space: nowrap;
  transform: rotate(-2deg);
  color: var(--ok);
}
.stamp-bad { color: var(--bad); }
.stamp-idle { color: var(--idle); border-style: dashed; transform: none; }

/* ---- essay page ---- */

.essay-head {
  display: flex; justify-content: flex-end; align-items: center;
  max-width: 55.5rem;
  margin: 0 auto 1.6rem;
}

.essay-layout {
  display: grid;
  grid-template-columns: minmax(0, 39rem) 14rem;
  gap: 2.5rem;
  align-items: start;
  max-width: 55.5rem;
  margin: 0 auto;
}
.toc {
  position: sticky; top: 3.6rem;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: .7rem .8rem;
}
.toc-title, .toc-inline summary {
  display: block;
  font-size: var(--fs-caption);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.toc-title { border-bottom: 1px solid var(--border); padding-bottom: .4rem; margin-bottom: .5rem; }
.toc ol, .toc-inline ol { list-style: none; margin: 0; padding: 0; font-size: var(--fs-label); line-height: 1.45; }
.toc li, .toc-inline li { margin: .38rem 0; }
.toc a { color: var(--muted); }
.toc a:hover { color: var(--fg); text-decoration: none; }

.toc-inline { display: none; }

/* ---- home ---- */

.intro { max-width: 39rem; margin: 0 auto 2.6rem; }
.intro p { font-size: .95rem; line-height: 1.7; margin: 0; }

h1.rule-head { max-width: 39rem; margin: 0 auto 1.1rem; }
.sheet-index { list-style: none; margin: 0 auto; padding: 0; max-width: 39rem; }
.sheet-index li {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: .8rem .9rem;
  margin: 0 0 .75rem;
}
.index-line {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; flex-wrap: wrap;
}
.index-line a { font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
.index-date {
  font-size: .75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.sheet-index p { margin: .4rem 0 0; font-size: .82rem; line-height: 1.55; color: var(--muted); }

/* ---- 404 ---- */

.notfound { max-width: 39rem; margin-inline: auto; }
.notfound .stamp { margin-bottom: 1.2rem; }

/* ---- responsive: every override tightens, never loosens ---- */

@media (max-width: 1100px) {
  .essay-layout { display: block; }
  .toc { display: none; }
  .essay-head { max-width: 39rem; }
  .prose { margin-inline: auto; }
  .toc-inline {
    display: block;
    margin: 0 auto 1.5rem;
    max-width: 39rem;
    background: var(--panel);
    border: 1px solid var(--border);
    padding: .6rem .8rem;
  }
  .toc-inline summary { cursor: pointer; list-style: none; }
  .toc-inline summary::-webkit-details-marker { display: none; }
  .toc-inline summary::before {
    content: "\25B8";
    display: inline-block;
    margin-right: .5rem;
    color: var(--muted);
    transition: transform .12s ease;
  }
  .toc-inline[open] summary::before { transform: rotate(90deg); }
  .toc-inline ol { margin-top: .55rem; }
}

@media (max-width: 800px) {
  .sheet { padding: 0 1rem 1.4rem; }
  .masthead { padding-top: .5rem; padding-bottom: .5rem; margin-bottom: 1.3rem; }
  h1.rule-head, .prose h1 { font-size: 1.22rem; }
  .prose h2 { margin: 2rem 0 .8rem; }
  .prose pre { padding: .7rem .8rem; }
}

@media (max-width: 520px) {
  .sheet { padding: 0 .8rem 1.2rem; }
  .prose { font-size: .9rem; }
  h1.rule-head, .prose h1 { font-size: 1.12rem; }
  .site-name { font-size: 1.02rem; }
  .prose pre { font-size: .74rem; padding: .6rem .7rem; }
  .prose table { font-size: .78rem; }
  .sheet-index li { padding: .7rem .75rem; }
}
