/* ============================================================================
   jiolab.dev -- one stylesheet, no build step.

   THE DESIGN, IN ONE PARAGRAPH. A dark-portfolio grammar: a hairline rail down
   the left of every page, monospace slash-prefixed navigation, a page title
   set enormous and filled with the section title under it set HOLLOW, entries
   as plain ruled rows, and outlined monospace chips for
   anything that is a tag. The accent is spent on type -- kickers, numerals,
   the current nav item -- and almost never on a fill. Borders are hairlines
   that stay out of the way; the accent is what you are meant to find.

   The palette: near-white and burgundy in light, warm dark grey and burgundy
   in dark. The light ground was a warm cream (#F4F0E9) until 2026-10-06; it
   moved to a neutral near-white because cream is one of the stock looks of
   generated sites.

   HISTORY, because this file has been rewritten three times in a day and the
   comments used to disagree with each other. Everything above the feasibility
   block at the bottom is this design; everything below it is content-layer
   styling that predates it, consumes the tokens and was carried over
   untouched. The two earlier passes (an agency portfolio, then the Frans Hals
   Museum) are gone rather than layered over -- a stylesheet arguing three
   cases at once is how you end up with rules nobody can tell are dead. */

:root {
  color-scheme: light;

  /* Near-white and burgundy. The white carries the faintest rose bias toward
     the accent so it reads as chosen rather than default, and the text
     burgundy is dark enough to set paragraphs in -- #3A151E on #FBFAFA is
     about 15:1 -- so body copy is genuinely burgundy rather than black
     pretending to be. */
  --bg: #FBFAFA;
  --bg-alt: #F1EEEF;
  --text: #3A151E;
  --text-muted: #6E4A52;
  --accent: #7A1B2E;

  /* THE BORDER IS NOT THE ACCENT ANY MORE, and that is the one palette change
     in this pass. The previous design outlined everything in full burgundy,
     which made a page of eighteen cards a page of eighteen burgundy boxes.
     Here the rules are hairlines that barely register and the accent is
     reserved for type -- which is what makes an accent worth having. */
  --border: #E1DBDD;
  --card-bg: transparent;

  /* Kept for the handful of things that really are filled: the header CTA and
     the pinned entry. Burgundy is a figure colour in both themes, so unlike a
     strict inversion these do not swap -- only the ground moves. */
  --surface: #6B1626;
  --on-surface: #FBFAFA;
  --on-surface-accent: #EDC3CB;

  /* Sharp. The reference has no rounded corner anywhere on it, and neither
     does this now -- which is a straight reversal of the previous pass, whose
     radius was the first thing you noticed. */
  --radius: 0;

  --font-display: "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system,
    "Helvetica Neue", Arial, sans-serif;

  /* Monospace is load-bearing here rather than decorative: it carries the
     navigation, every kicker, every tag chip, every date and every ghost
     numeral. It is the voice the design uses for anything that is an index
     rather than a sentence -- and on a site whose subject is software, that
     is a register the content already speaks. */
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, "DejaVu Sans Mono",
    monospace;

  --wrap: 1240px;
  --measure: 68ch;

  /* Where the left rail sits, measured from the viewport edge. Shared by the
     rail itself and by .wrap's padding, so the rail lands on the text's left
     edge rather than near it. */
  --rail: 5.5rem;

  /* Height of the fixed footer, reserved as body padding so page content can
     scroll clear of it. Measured in a real browser at each of the three
     heights the footer's flex row actually takes as it wraps, and padded high
     on purpose: over-reserving leaves a little blank space below the last
     content, under-reserving hides content behind the footer. */
  --footer-h: 81px;

  /* Height of the sticky header. Nothing has to reserve space for it -- a
     sticky element still takes up its own room in flow -- but in-page anchor
     targets use it as scroll-margin so that jumping to one above the current
     position, which is exactly when the bar slides back into view, doesn't
     land it underneath. */
  --header-h: 88px;

  /* Vertical rhythm in two sizes: --space-section is the gap BETWEEN blocks
     (intro to listing, section to next heading), --space-block the gap inside
     one (entry to entry). Paragraph-to-paragraph stays a flat 1rem, the
     tightest thing on the page by design. Both are read by the renderers'
     own inline styles, so the names are load-bearing beyond this file. */
  --space-section: 3.25rem;
  --space-block: 1.25rem;
}

@media (max-width: 900px) {
  :root {
    /* The rail is a desktop conceit. On a phone it would eat a fifth of the
       screen to draw a line, so it collapses to an ordinary gutter and the
       rail rule below stops drawing. */
    --rail: 1.25rem;
  }
}

@media (max-width: 700px) {
  :root {
    /* The footer line and its two switches stop fitting on one row just
       under 690px (JIO-4211 put the mode switch there). */
    --footer-h: 115px;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 100px;
    --space-section: 2.4rem;
  }
}

@media (max-width: 480px) {
  :root {
    --footer-h: 160px;
    --header-h: 128px;
  }
}

/* OS says dark and the visitor has not explicitly pinned light. This is also
   the only thing that gives no-JS clients dark mode at all, since without JS
   nothing ever sets data-theme. The two dark blocks are deliberate duplicates
   -- plain CSS has no way to share a declaration list -- so keep them in
   sync. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1D1B1C;
    --bg-alt: #262223;
    --text: #EDE6DF;
    --text-muted: #A79C99;

    /* A dusty rose rather than the burgundy itself: #7A1B2E on #1D1B1C is
       about 1.6:1, because burgundy is a dark colour and a dark ground gives
       it nothing to push against. The burgundy is still here -- it is
       --surface below, which has off-white on top of it. */
    --accent: #D4808F;
    --border: #35302F;
    --card-bg: transparent;
    --surface: #7A1B2E;
    --on-surface: #F7F2EB;
    --on-surface-accent: #EDC3CB;
  }
}

/* Visitor explicitly picked dark -- wins regardless of what the OS wants. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1D1B1C;
  --bg-alt: #262223;
  --text: #EDE6DF;
  --text-muted: #A79C99;
  --accent: #D4808F;
  --border: #35302F;
  --card-bg: transparent;
  --surface: #7A1B2E;
  --on-surface: #F7F2EB;
  --on-surface-accent: #EDC3CB;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  line-height: 1.62;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--footer-h);
}

/* THE LEFT RAIL. One fixed hairline running the full height of the viewport,
   landing exactly on the text's left edge because both read --rail. It does
   nothing except tell you where the page begins, which on a site of long
   single-column prose is more than it sounds -- it gives every page a spine.
   Fixed rather than absolute so it does not end where the content does.
   pointer-events: none because a decorative line should not be able to eat a
   click on whatever is beside it. */
body::before {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  left: var(--rail);
  width: 1px;
  background: var(--border);
  pointer-events: none;
  z-index: 1;
}

/* The rotated strapline down the right edge. Purely decorative, hidden from
   assistive tech by being generated content with nothing to announce, and
   dropped entirely below 1100px where there is no margin to put it in. */
body::after {
  content: "JIOLAB \00B7  GAMES & APPS \00B7  BUILT BY AGENTS";
  position: fixed;
  right: 1.4rem;
  top: 50%;
  transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.34em;
  color: var(--text-muted);
  opacity: 0.55;
  pointer-events: none;
  z-index: 1;
}

@media (max-width: 1100px) {
  body::after {
    display: none;
  }
}

@media (max-width: 900px) {
  body::before {
    display: none;
  }
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.5rem 0 calc(var(--rail) + 1.5rem);
  width: 100%;
}

/* ============================================================================
   HEADER
   ========================================================================= */

header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1.1rem 0;
  transition: transform 0.2s ease;
}

header.site[data-nav-hidden="true"] {
  transform: translateY(-100%);
}

@media (prefers-reduced-motion: reduce) {
  header.site {
    transition: none;
  }
}

header.site nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

/* Letterspaced caps, no badge and no box. The reference sets its wordmark as
   a widely tracked line of capitals beside a small mark, and tracking at this
   size does the work a logo would. */
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  text-decoration: none;
  color: var(--text);
}

.wordmark span {
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

/* The slash is generated, not typed. It is the reference's clearest single
   tell -- /home /work /about -- and putting it in a pseudo-element means the
   nav markup on all 231 pages stays a plain list of links and the convention
   lives in exactly one place. */
.links a {
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.links a::before {
  content: "/";
  opacity: 0.55;
  margin-right: 0.1em;
}

.links a:hover {
  color: var(--text);
}

.links a[aria-current="page"] {
  color: var(--accent);
}

.links a[aria-current="page"]::before {
  opacity: 1;
}

/* Segmented, sharp, monospace -- a control. It sits in the footer beside the
   theme switch (JIO-4211). */
.mode-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  padding: 2px;
}

.mode-switch-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  line-height: 1.2;
}

.mode-switch-btn:hover {
  color: var(--text);
}

.mode-switch-btn.active {
  background: var(--accent);
  color: var(--bg);
}

/* ============================================================================
   PAGE HEAD
   ========================================================================= */

main {
  flex: 1;
  padding: var(--space-section) 0 4rem;
  position: relative;
  z-index: 2;
}

/* /KICKER. Monospace, accent, slash-prefixed, widely tracked -- the label
   above every section title on the reference. The slash is generated for the
   same reason the nav's is: the templates emit a plain <p class="kicker">
   and the convention is defined once. */
.kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--accent);
  margin: 0 0 1.1rem;
}

.kicker::before {
  content: "/";
  margin-right: 0.15em;
}

/* The page title, filled and set as large as the page can carry. No slab
   behind it any more -- that was the museum pass, and this reference builds
   its hierarchy out of scale and weight on a flat ground instead. */
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5.6vw, 4.1rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0 0 1.2rem;
  text-wrap: balance;
}

h1 .status {
  vertical-align: 0.7em;
}

/* THE HOLLOW HEADING, and this is the design's signature. The reference sets
   every section title as two words -- one filled, one drawn in outline only --
   and that duet is what the whole page hangs off. We cannot split a heading
   in two without touching every template, so the duet runs vertically
   instead: the page title above is filled, and every section heading under it
   is hollow.

   @supports rather than a bare declaration: text-stroke is prefixed
   everywhere and a browser without it would render `color: transparent` as an
   invisible heading, which is a considerably worse page than one whose
   headings are merely solid. The fallback outside the block is a normal
   filled heading in the accent. */
h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.2vw, 2.4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  color: var(--accent);
  margin: var(--space-section) 0 1.1rem;
}

/* 1.6px, not 1px. The reference draws its hollow type in bright yellow on
   near-black, where a hairline stroke is already high contrast; burgundy on
   off-white is a far narrower gap and a 1px outline at this size came out as
   a suggestion of a heading rather than a heading. Stroke width does not
   scale with font-size, so this is tuned to the clamp's middle rather than
   to its ends. */
@supports (-webkit-text-stroke: 1px currentColor) {
  h2 {
    color: transparent;
    -webkit-text-stroke: 1.6px var(--accent);
  }

  /* An anchored heading fills back in. :target is the one moment a hollow
     heading is being looked AT rather than scanned past, and hollow type is
     the wrong thing to hand someone who just followed a link to it. */
  h2:target {
    color: var(--accent);
    -webkit-text-stroke: 0;
  }
}

/* Sub-headings stay solid. Three levels of hierarchy do not need three
   treatments, and a hollow h3 at 1.1rem is unreadable rather than stylish. */
h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  margin: var(--space-block) 0 0.4rem;
}

.tagline {
  color: var(--text-muted);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  max-width: 58ch;
  margin: 0 0 var(--space-section);
}

p {
  margin: 0 0 1rem;
}

/* Running prose only -- direct children of the page column. Everything that
   is not a paragraph (listings, figures, diagrams, the stat strip on
   /architecture) is free to use the full --wrap, which is the point of having
   widened it. :not([class]) is load-bearing: /architecture's stat strip, the
   /definitions tile list and the feasibility breakdowns are all <ul> and all
   direct children of .wrap, and capping them at 68ch squeezes them into two
   thirds of the column they are meant to span. Every one of those carries a
   class; every prose list does not. */
main > .wrap > p,
main > .wrap > ul:not([class]),
main > .wrap > ol:not([class]),
main > .wrap > blockquote {
  max-width: var(--measure);
}

/* The kicker is a <p>, so the measure above caught it and wrapped a
   nine-word eyebrow onto two lines. It is a label, not prose. */
main > .wrap > .kicker {
  max-width: none;
}

main > .wrap > .tagline {
  max-width: 58ch;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ============================================================================
   ENTRY LIST
   ============================================================================
   The reference's work-history pattern: a row per entry, the title and its
   meta, and the date pushed to the right edge. The rows used to open with an
   outlined "01", "02" ghost numeral; it went on 2026-10-06, because a list of
   projects or posts is not a sequence and the number told the reader nothing. It replaces the previous pass's three-up card
   grid, which came from a museum and needed photographs to work -- of our
   eighteen projects seven have a screenshot and of twenty-four posts none do,
   so a grid of image cards was a grid of empty boxes.

   A row also scales the way the content does: a long post title has somewhere
   to go, which in a fixed-height card it did not. */
.card-grid {
  display: flex;
  flex-direction: column;
  margin: 0 0 var(--space-section);
  border-top: 1px solid var(--border);
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 1.6rem 1rem 1.7rem 0;
  margin: 0;
  min-width: 0;
  transition: background-color 0.16s ease;
}

.card:hover {
  background: var(--bg-alt);
}

@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none;
  }
}

.card h3 {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin: 0 0 0.45rem;
}

.card h3 a {
  color: var(--text);
  text-decoration: none;
}

.card h3 a:hover,
.card h3 a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Monospace, uppercase, tracked: the same voice as the nav above it, because
   a date and an index are the same kind of information. */
.card .meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text-muted);
  margin: 0 0 0.55rem;
}

/* The date reads before the title, as it does on the reference. .card-date
   rather than .meta, because /projects uses .meta for a stack of links and
   hoisting those above a project's name puts three links where the reader is
   looking for what the thing is called. */
.card .card-date {
  order: -1;
}

.card > p {
  font-size: 0.94rem;
  color: var(--text-muted);
  margin: 0 0 0.6rem;
  max-width: 78ch;
}

.card p:last-child {
  margin-bottom: 0;
}

.card > ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 78ch;
}

/* The featured entry is the one filled thing in the list. On a page whose
   every other row is a hairline and some type, a solid burgundy panel is the
   strongest signal available without spending a second colour. */
.card-pinned {
  background: var(--surface);
  color: var(--on-surface);
  border-bottom-color: var(--surface);
  padding-left: 1.4rem;
  padding-right: 1.4rem;
}

.card-pinned:hover {
  background: var(--surface);
}

.card-pinned h3,
.card-pinned h3 a {
  color: var(--on-surface-accent);
}

.card-pinned h3 a:hover {
  color: var(--on-surface);
}

.card-pinned .meta,
.card-pinned > p,
.card-pinned > ul {
  color: inherit;
  opacity: 0.85;
}

/* ============================================================================
   ANYTHING FILLED WITH --surface CARRIES ITS OWN LINK COLOUR
   ============================================================================
   --accent is a burgundy that sits ON the page ground; inside a burgundy
   panel it is invisible. --on-surface-accent is the panel's own accent and is
   correct in both themes, which --bg (what this used to be) is not: --bg is
   whatever the page behind the panel happens to be, and on dark that is dark
   grey text on burgundy. */
.card-pinned a,
.mode-note a,
footer.site a {
  color: var(--on-surface-accent);
}

.card-pinned .status {
  border-color: currentColor;
  color: inherit;
}

/* ============================================================================
   CHIPS, BUTTONS, NOTICES
   ========================================================================= */

/* The reference tags every case with a row of these: a thin outlined
   rectangle holding two tracked monospace words. Sharp, quiet, and never
   filled -- except .status-live below, which is the one state worth finding. */
.status {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  margin-left: 0.5rem;
  vertical-align: middle;
  line-height: 1.3;
}

/* A dot, not a fill -- the reference's "AVAILABLE FOR WORK" marker. It says
   "this is running right now" in a way a coloured rectangle does not, and it
   leaves the chip itself looking like every other chip, which is the point:
   the dot is the information. */
.status-live {
  border-color: var(--accent);
  color: var(--accent);
}

.status-live::before {
  content: "";
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  border-radius: 50%;
  background: currentColor;
  margin-right: 0.5em;
  vertical-align: 0.08em;
}

.status-in-progress {
  border-color: var(--text-muted);
  color: var(--text-muted);
}

.status-pinned {
  border-color: var(--text-muted);
  color: var(--text-muted);
}

/* Dashed, not solid: the one chip whose subject is no longer there. Same
   colour as in-progress so it does not shout -- the note next to it carries
   the information, the chip only flags that there is one to read. */
.status-abandoned {
  border-style: dashed;
  border-color: var(--text-muted);
  color: var(--text-muted);
}

/* Why it stopped. Rendered under the tagline on both the card and the page,
   as prose rather than as a .meta line, because the reason is a sentence a
   reader is meant to take in, not a label. The page variant keeps the
   tagline's measure and takes over its bottom gap. */
.abandoned-note {
  font-size: 0.94rem;
  color: var(--text-muted);
  border-left: 2px dashed var(--border);
  padding-left: 0.85rem;
  margin: 0 0 0.75rem;
}

.abandoned-note-page {
  max-width: 58ch;
  margin: calc(-1 * var(--space-section) + 1rem) 0 var(--space-section);
}

/* "READ CASE ->" with the arrow in its own ring. The ring is a pseudo-element
   so the markup stays a plain <a>; it is the reference's one piece of
   ornament and it earns its place by marking exactly one link per page as the
   way out of it. */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  text-decoration: none;
  color: var(--accent);
}

.arrow-link::after {
  content: "\2197";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.85rem;
  letter-spacing: 0;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.arrow-link:hover::after,
.arrow-link:focus-visible::after {
  background: var(--accent);
  color: var(--bg);
}

@media (prefers-reduced-motion: reduce) {
  .arrow-link::after {
    transition: none;
  }
}

/* A notice: a pale fill inside a hairline. It used to carry a thick accent
   rail down its left edge, removed 2026-10-06 as a stock generated-site look;
   the fill alone sets it apart on a page that fills almost nothing. */
.mode-note {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 1.1rem 1.35rem;
  margin: 0 0 var(--space-section);
  max-width: var(--measure);
  font-size: 0.93rem;
  color: var(--text-muted);
}

.mode-note strong {
  color: var(--text);
}

.mode-note a {
  color: var(--accent);
}

/* ============================================================================
   DEFINITIONS
   ========================================================================= */

a.def-link {
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

/* The category index as a row of slash-prefixed tiles. Same slash as the nav
   and the kicker, so all three read as one convention rather than three
   coincidences. */
.def-toc {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0;
  list-style: none;
  margin: 0 0 var(--space-section);
  padding: 0;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.def-toc li {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.def-toc a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 1rem 1.15rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-decoration: none;
  color: var(--text);
  transition: background-color 0.16s ease, color 0.16s ease;
}

/* The slash hugs the label and the arrow is pushed to the far edge by its own
   auto margin. space-between was doing that job before and could not tell the
   difference between the two, so it spread all three evenly and left the
   slash stranded a centimetre from the word it belongs to. */
.def-toc a::before {
  content: "/";
  color: var(--accent);
}

.def-toc a::after {
  content: "\2192";
  color: var(--accent);
  margin-left: auto;
  padding-left: 1rem;
}

.def-toc a:hover,
.def-toc a:focus-visible {
  background: var(--bg-alt);
  color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .def-toc a {
    transition: none;
  }
}

.def-entry {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

.def-entry:last-child {
  border-bottom: none;
}

.def-entry h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  text-transform: none;
}

.def-entry p {
  margin: 0;
  color: var(--text-muted);
  max-width: var(--measure);
}

.def-external {
  margin-top: 0.6rem;
}

.def-shot {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  border: 1px solid var(--border);
  margin-bottom: 0.4rem;
}

.def-external > a:last-child {
  font-size: 0.85rem;
}

.def-entry:target {
  background: var(--bg-alt);
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  margin-left: -0.75rem;
  margin-right: -0.75rem;
}

/* ============================================================================
   CONTENT MODE
   ========================================================================= */

/* data-mode lives on <html>, set by mode-toggle.js, defaulting to "technical"
   in the static markup for no-JS clients. */
[data-mode="technical"] .simple-only {
  display: none;
}

[data-mode="simple"] .tech-only {
  display: none;
}

/* ============================================================================
   CALENDAR
   ============================================================================
   The month grid under the /blog header -- see public/blog-calendar.js, which
   is also require()d by scripts/render-blog.js so the same builder produces
   the server-rendered month and the client-side one. */
.calendar {
  border: 1px solid var(--border);
  padding: 1rem 1.25rem 1.25rem;
  margin: 0 0 var(--space-section);
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.cal-month {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.cal-nav {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}

.cal-nav:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

/* Disabled at the ends of the archive rather than hidden, so the control does
   not shift position as you page through months. */
.cal-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.cal-nav:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* No cell rules. They were drawn as 1px gaps over a --border background --
   the hairlines being the grid showing through -- which breaks on any week
   the renderer does not pad out: a month ending on a Monday emits no trailing
   cells, so five columns of that row had nothing to cover the rule colour and
   came out as a solid tan block. Padding every week would fix the symptom;
   not drawing cell rules at all fixes the cause, and is closer to the
   reference, whose tables are type on a flat ground with no grid at all. A
   day with a post is marked by the accent and by weight, which is enough. */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.cal-weekday {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 0.45rem 0;
}

/* 1px grid gaps over a --border background: the hairlines between cells are
   the grid showing through, which is how the reference draws its tables too.
   Every cell therefore needs an opaque fill of its own. */
.cal-day {
  display: block;
  padding: 0.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Only days that actually have a post are links. They are marked by the
   accent and by weight, not by a fill: in a month with posts on 22 of 31
   days, filling them makes a barcode and stops marking anything. */
a.cal-day {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

a.cal-day:hover {
  background: var(--accent);
  color: var(--bg);
}

a.cal-day:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* A ring rather than a fill, so today reads as a marker even on a day that is
   also a post link and already carries the accent. */
.cal-today {
  box-shadow: inset 0 0 0 1px var(--text-muted);
}

a.cal-today {
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* ============================================================================
   FOOTER
   ========================================================================= */

/* Pinned to the viewport bottom so it stays visible while the page scrolls.
   Being fixed takes it out of flow, so body carries a matching padding-bottom
   (--footer-h, near the top of this file) to let the last of the content
   scroll clear of it. The two are hand-kept in sync: if this rule's padding
   or font-size changes, remeasure and update --footer-h. It also needs an
   opaque background, since content now scrolls underneath it. */
footer.site {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 1.1rem 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

footer.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

/* The footer is NOT a --surface panel here -- it is the page ground with a
   hairline over it -- so its links take the page accent, not the panel one.
   This overrides the `.card-pinned a, .mode-note a, footer.site a` group
   above, and has to come after it. */
footer.site a {
  color: var(--accent);
}

/* A live dot in the footer, matching .status-live's: the reference closes
   every page with one. */
footer.site .wrap > div:first-child::before {
  content: "";
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.7em;
  vertical-align: 0.1em;
}

/* The footer's two switches, content mode then theme, kept together on the
   right of the footer row (JIO-4211 moved the mode switch here from the
   header). They wrap under the footer line as one group on narrow screens. */
.footer-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Light/dark theme switch -- sun = light, moon = dark. Same sharp segmented
   shape as the content-mode switch beside it, so the two read as one family
   despite controlling unrelated things. See public/theme-toggle.js. */
.theme-switch {
  display: inline-flex;
  flex: none;
  border: 1px solid var(--border);
  padding: 2px;
}

.theme-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  line-height: 0;
}

.theme-switch-btn:hover {
  color: var(--text);
}

.theme-switch-btn.active {
  background: var(--accent);
  color: var(--bg);
}

/* Shared YouTube room ------------------------------------------------------ */
.watch-page::before,
.watch-page::after {
  display: none;
}

.watch-page main {
  padding-top: 1.8rem;
}

.watch-page main > .wrap,
.watch-page header.site .wrap,
.watch-page footer.site .wrap {
  max-width: none;
  padding-left: clamp(1.25rem, 3vw, 3rem);
  padding-right: clamp(1.25rem, 3vw, 3rem);
}

.watch-page .watch-intro,
.watch-page .watch-add {
  max-width: 78rem;
}

.watch-intro {
  max-width: 62ch;
  color: var(--text-muted);
  margin-bottom: 2.25rem;
}

.watch-add {
  max-width: 860px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0 1.1rem;
  margin-bottom: 1.25rem;
}

.watch-add label,
.watch-status,
.watch-card-footer {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.watch-add label {
  display: block;
  color: var(--text-muted);
  margin-bottom: 0.55rem;
}

.watch-add-row {
  display: flex;
  gap: 0.7rem;
}

.watch-add input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg-alt);
  color: var(--text);
  font: inherit;
  padding: 0.75rem 0.85rem;
}

.watch-add button,
.watch-remove {
  border: 1px solid var(--accent);
  border-radius: 0;
  background: var(--accent);
  color: var(--bg);
  font: inherit;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  padding: 0.7rem 1rem;
}

.watch-add button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.watch-add input:focus-visible,
.watch-add button:focus-visible,
.watch-remove:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.form-message {
  min-height: 1.2em;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 0.65rem 0 0;
}

.form-message[data-error="true"] { color: var(--accent); }

.watch-status {
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.status-dot {
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.55em;
}

.watch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 640px), 640px));
  gap: 1.4rem;
  justify-content: start;
}

.watch-card {
  min-width: 0;
  width: min(640px, 100%);
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}

.watch-player {
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.watch-player iframe {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.watch-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0.75rem;
  color: var(--text-muted);
}

.watch-remove {
  background: transparent;
  color: var(--accent);
  padding: 0.35rem 0.55rem;
}

.watch-remove:hover { background: var(--accent); color: var(--bg); }

.watch-empty {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  padding-top: 1.25rem;
}

.watch-empty[hidden] { display: none; }

@media (max-width: 560px) {
  .watch-add-row { flex-direction: column; }
  .watch-add button { width: 100%; }
  .watch-grid { grid-template-columns: 1fr; }
}

.theme-switch-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Feasibility breakdown on a backlog project's detail page -- see
   website/scripts/render-projects.js's renderFeasibilitySection(). The score
   itself is just an <h3>; everything below it is the working behind that
   number, so it's styled as one continuous block rather than three unrelated
   lists.

   scroll-margin-top with a var() fallback, not a bare var(): /projects links
   here with a #feasibility fragment, and the site header is sticky, so an
   anchored heading would otherwise land underneath it. The 0px fallback keeps
   this rule valid on its own if --header-h isn't defined -- without it the
   whole declaration would be invalid at computed-value time. */
#feasibility {
  scroll-margin-top: calc(var(--header-h, 0px) + 1.5rem);
}

.feasibility-rubric {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: -0.35rem 0 1rem;
}

/* Un-bulleted and indented by the effect pill instead: the pill is doing the
   job a bullet would, and a marker as well as a label reads as noise. */
.factors,
.improvements {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}

.factors li,
.improvements li {
  padding: 0;
  margin-bottom: 0.9rem;
}

.factors li:last-child,
.improvements li:last-child {
  margin-bottom: 0;
}

/* "Helps" / "Holds it back" as words, colored as reinforcement only -- see
   FACTOR_EFFECT_LABELS in render-projects.js for why the direction is never
   carried by colour alone. */
.factor-effect {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  margin-right: 0.4rem;
  vertical-align: 0.08em;
  white-space: nowrap;
}

/* Page background, not --card-bg: cards are transparent, which left the
   word invisible on the pill. */
.factor-up {
  background: var(--accent);
  color: var(--bg);
}

.factor-down {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* Detail on its own line: the pill + label is the scannable part, so the
   sentence explaining it shouldn't have to be read to find the next one. */
.factor-detail,
.improve-detail {
  display: block;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.improve-target {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

/* "How to use it" on a live project's detail page -- see
   website/scripts/render-projects.js's renderHowToUseSection().

   Same scroll-margin-top reason as #feasibility above: /projects links here
   with a #how-to-use fragment and the header is sticky, so without this the
   heading lands underneath it. Same var() fallback, same reason. */
#how-to-use {
  scroll-margin-top: calc(var(--header-h, 0px) + 1.5rem);
}

/* Numbered, unlike .factors/.improvements: for some projects the order is
   real (permissions before the first run, install before opening a thread),
   so the marker is carrying information here rather than being noise. The
   accent-coloured number is what a reader scanning for "where do I start"
   lands on. */
.howto-steps {
  padding: 0;
  margin: 0 0 1.25rem;
  list-style: none;
  counter-reset: howto;
}

.howto-steps li {
  counter-increment: howto;
  position: relative;
  border-left: 2px solid var(--border);
  padding: 0 0 0 2.4rem;
  margin-bottom: 0.9rem;
}

.howto-steps li::before {
  content: counter(howto);
  position: absolute;
  left: 0.9rem;
  top: 0;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  /* 0.85rem x 1.882 = the same 1.6rem line box the 1rem label gets from
     body's line-height, so the number sits on the label's baseline instead
     of riding above it. */
  line-height: 1.882;
}

.howto-steps li:last-child {
  margin-bottom: 0;
}

/* Detail on its own line, matching .factor-detail: the bold label is the
   scannable part, so finding the next step shouldn't mean reading the
   sentence under this one. */
.howto-detail {
  display: block;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* The limit -- what it won't do, what it needs first, what it excludes.
   Set apart from the steps rather than appended as another one, because it
   isn't something you do. */
.howto-note {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* The roadmap -- the capabilities a project still owes, in order.

   A DELIVERED ENTRY STAYS ON THE LIST rather than disappearing, so the reader
   sees the shape of the whole thing and where it has got to. It is greyed and
   labelled rather than struck through: a strikethrough reads as cancelled,
   which is the opposite of what a shipped milestone means. */
.roadmap {
  padding: 0;
  margin: 0 0 1.25rem;
  list-style: none;
}

.roadmap-item {
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
  border-left: 2px solid var(--border);
  padding: 0 0 0 0.9rem;
  margin-bottom: 0.9rem;
}

/* Square and mono, matching the status badge: a hard little rectangle of type
   is a label, not a control. */
.roadmap-state {
  flex: 0 0 auto;
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}

.roadmap-done .roadmap-state {
  border-color: var(--accent);
  color: var(--accent);
}

.roadmap-done .roadmap-body {
  color: var(--text-muted);
}

.roadmap-body {
  display: block;
}

.roadmap-target {
  margin-left: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

h4 {
  font-size: 0.95rem;
  margin: 0 0 0.6rem;
}
