/* Shared styles for the project page and the demo page.
   Reading text is a serif; navigation, metadata and numbers use the system UI sans. */

:root {
  color-scheme: dark;
  --bg: #121211;
  --text-copy: #d9d4cb;
  --text-heading: #f0ece4;
  --text-secondary: #b3ada3;
  --text-nav: #8f8a81;
  --text-nav-hover: #d9d4cb;
  --surface-subtle: #1b1a18;
  --divider: #3b3936;
  --line-subtle: rgba(217, 212, 203, 0.14);
  --focus-color: #a89bff;

  --font-reading: "Iowan Old Style", "Palatino Linotype", Palatino, "Newsreader", Georgia, serif;
  --font-ui: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --page-pad: clamp(1.25rem, 3.4vw, 3.25rem);
  --content-width: 42rem;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: gray transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-copy);
  font-family: var(--font-reading);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.site-shell {
  min-height: 100vh;
  padding: var(--page-pad);
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--divider);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration-color: var(--text-copy); }
a:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 2px; border-radius: 2px; }

/* ---- type ---- */
.site-title {
  color: var(--text-heading);
  font-family: var(--font-reading);
  font-weight: 600;
  font-size: clamp(2.2rem, 3.5vw, 2.65rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0 0 0.95em;
}
.site-title a { text-decoration: none; }
.site-title a:hover { opacity: 0.72; }

.content-heading {
  color: var(--text-heading);
  font-family: var(--font-reading);
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1.4;
  letter-spacing: -0.02em;
  margin: 3.1rem 0 1.2rem;
}
.content-paragraph { margin: 0 0 1.45rem; }
.content-paragraph:last-child { margin-bottom: 0; }

/* the thin toggle row under the title: label left, options right */
.bio-toggle {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px solid var(--line-subtle);
  color: var(--text-nav);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0.01em;
  margin-bottom: 1.35rem;
  padding-bottom: 0.55rem;
}
.bio-toggle-options { display: flex; gap: 1rem; margin-left: auto; flex-shrink: 0; white-space: nowrap; }
.bio-toggle a, .bio-toggle button {
  color: inherit; text-decoration: none; position: relative; padding-block: 0.2rem;
  background: none; border: 0; font: inherit; cursor: pointer;
}
.bio-toggle a:hover, .bio-toggle button:hover { color: var(--text-nav-hover); }
.bio-toggle .is-current { color: var(--text-copy); }
.bio-toggle .is-current::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -0.62rem; height: 1px; background: var(--text-copy);
}

/* rule-separated rows: text left, metadata right */
.rows { border-top: 1px solid var(--line-subtle); margin-top: 0.85em; }
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.72em 0;
  border-bottom: 1px solid var(--line-subtle);
  color: var(--text-copy);
  text-decoration: none;
}
.row .meta {
  color: var(--text-nav);
  font-family: var(--font-ui);
  font-size: 14px;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
  letter-spacing: 0;
}
.row .meta.mono { font-family: var(--font-mono); font-size: 13px; }
.row .meta a { text-decoration-color: var(--line-subtle); }
.row .meta a:hover { color: var(--text-copy); }
@media (hover: hover) and (pointer: fine) {
  .rows:hover .row { opacity: 0.8; transition: opacity 0.3s ease-in-out; }
  .rows:hover .row:hover { opacity: 1; }
}

/* two-column square-bullet list */
.notes-list { columns: 2; column-gap: 2.5rem; margin: 0.8em 0 0; padding-left: 1.1em; list-style: square; }
.notes-list li { break-inside: avoid; margin-bottom: 0.2rem; padding-left: 0.15em; }
.notes-list li strong { color: var(--text-heading); font-weight: 500; }

/* small notes at the end of the page */
.margin-notes {
  display: flex; flex-direction: column; gap: 0.35rem;
  margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line-subtle);
  color: var(--text-nav); font-family: var(--font-ui); font-size: 13px; line-height: 1.4;
}
.margin-notes a { text-decoration-color: var(--line-subtle); }

code { font-family: var(--font-mono); font-size: 0.86em; }

kbd {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-copy);
  border: 1px solid var(--divider); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px;
}

@media (max-width: 639px) {
  .site-shell { padding: 2.5rem 1.25rem 1.25rem; }
  .site-title { margin-bottom: 0.9em; }
  .notes-list { columns: 1; }
  .row { grid-template-columns: 1fr; gap: 0.15rem; }
  .row .meta { font-size: 13px; white-space: normal; }
}
