/* Inspora light: white page, soft grey tiles, ink text. Static header, plain lists, mono chrome. */

:root {
  --bg: #ffffff;
  --text: #262626;
  --bright: #111111;
  --muted: #6b6b6b;
  --link: #262626;
  --link-hover: #000000;
  --border: #e6e6e6;
  --border-strong: #d4d4d4;
  --ok: #1a7f37;
  --code-bg: #f0f0f0;
  --surface: #f3f3f3;
  --radius: 10px;
  --pad: clamp(1.1rem, 4vw, 2rem);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: clamp(16px, 15.4px + 0.2vw, 17.5px); -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  max-width: 42rem;
  margin: 0 auto;
  padding: 1rem var(--pad) clamp(2.5rem, 6vh, 4rem);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--text); color: #ffffff; }

a { color: var(--link); text-underline-offset: 2px; }
a:visited { color: var(--link); }
a:hover { color: var(--link-hover); }

h1, h2, h3, strong { color: var(--bright); }

/* Skip link: hidden until keyboard focus. */
.skip-link {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(-200%);
  z-index: 100;
  font-size: 0.9rem;
  text-decoration: none;
  background: var(--bright);
  color: var(--bg);
  padding: 0.5rem 0.9rem;
  border-radius: 4px;
}
.skip-link:focus { transform: translateY(0); }

/* Static header: plain row over a rule. */
body > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.2rem 1.25rem;
  padding-bottom: 0.7rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.site-title { font-family: var(--mono); font-size: 0.95rem; font-weight: 650; }
.site-title a { color: var(--bright); text-decoration: none; }

h1 {
  font-size: clamp(1.6rem, 1.32rem + 1.3vw, 2.15rem);
  line-height: 1.2;
  margin-bottom: 0.7rem;
  overflow-wrap: break-word;
  font-weight: 700;
}
.hero { font-size: clamp(1.6rem, 1.32rem + 1.3vw, 2.7rem); }
h2 { font-size: 1.15rem; margin: 2.2rem 0 0.55rem; overflow-wrap: break-word; font-weight: 650; }
h3 { font-size: 1rem; margin: 1.4rem 0 0.3rem; overflow-wrap: break-word; font-weight: 650; }

p, ul, ol { margin-bottom: 0.9rem; overflow-wrap: break-word; }
ul, ol { padding-left: 1.35rem; }
li { margin-bottom: 0.25rem; }

.muted { color: var(--muted); }
.meta { color: var(--muted); }
.small { font-size: 0.9rem; }

ul.plain { list-style: none; padding-left: 0; }
ul.plain li { margin-bottom: 0.85rem; }
ul.plain .meta { display: block; font-size: 0.84rem; color: var(--muted); }

/* Inspora gallery language: rounded tile frames for the project cards, quiet hairlines on ink. */
main.cards article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
}
main.cards article + article { margin-top: 1rem; }
main.cards article > :first-child { margin-top: 0; }
main.cards article > :last-child { margin-bottom: 0; }

/* Category chips: mono pills, Inspora's gallery tags. The source pill holds the link, so it is the inverted one. */
ul.chips {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}
ul.chips li { margin-bottom: 0; }
.chip {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  white-space: nowrap;
}
.chip a { text-decoration: none; color: var(--bg); }
.chip:has(a) { background: var(--text); border-color: var(--text); }
.chip:has(a):hover { background: var(--muted); border-color: var(--muted); }
.breadcrumb, .back-link { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.breadcrumb { overflow-wrap: anywhere; margin-bottom: 1rem; }
.back-link { margin-top: 2rem; }

/* Case-study sections: the site's numbered language, at section level. */
main.case { counter-reset: cs; }
main.case h2 { border-top: 1px solid var(--border); margin-top: 3rem; padding-top: 1.6rem; counter-increment: cs; }
main.case h2::before {
  content: counter(cs, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.3rem;
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--code-bg);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
  overflow-wrap: break-word;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  max-width: 100%;
  font-size: 0.84rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}
pre code { background: none; border: 0; padding: 0; }

.copy-btn {
  font: inherit;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 0 0.45rem;
  margin-left: 0.5rem;
  cursor: pointer;
}
.copy-btn:hover { color: var(--bright); border-color: var(--muted); }
.copy-btn.is-done { color: var(--ok); border-color: var(--border-strong); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}
footer p { margin-bottom: 0.3rem; }

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

/* Numbered nav and list: the geek touch. One home for every nav rule. */
nav { display: flex; flex-wrap: wrap; gap: 1rem; font-family: var(--mono); font-size: 0.85rem; }
nav a { text-decoration: none; padding: 0.45rem 0.35rem; }
nav a, nav a:visited { color: var(--muted); }
nav a:hover, nav a:visited:hover, nav a[aria-current="page"], nav a[data-section] { color: var(--bright); }
nav a:hover, nav a:focus-visible, nav a[aria-current="page"], nav a[data-section] {
  text-decoration: underline;
  text-underline-offset: 4px;
}
nav .n { color: var(--text); font-size: 0.72rem; margin-right: 0.3rem; }

/* Small screens: stop letting flex-wrap decide the header layout by accident.
   Below 480px the title and 4 nav items can't share a row, so stack the header
   on purpose. Up to 719px keep the one-line header but give the nav rows the
   height fingers need. The narrow block must come after this one so its nav
   values win where both apply. */
@media (max-width: 719px) {
  nav { gap: 0.1rem 1rem; }
  nav a { padding: 0.6rem 0.35rem; }
}
@media (max-width: 479px) {
  body > header { display: block; margin-bottom: 1.3rem; }
  nav {
    display: grid;
    margin-top: 0.2rem;
    grid-template-columns: auto auto;
    justify-content: start;
    gap: 0 1.15rem;
  }
  nav a { padding: 0.62rem 0.15rem 0.62rem 0; }
}
/* On touch screens the grey tap flash competes with our own underline marks. */
@media (hover: none) {
  a, nav a, .copy-btn { -webkit-tap-highlight-color: transparent; }
}

ul.numbered { list-style: none; padding-left: 0; counter-reset: work; }
ul.numbered li { position: relative; padding-left: 2.2rem; margin-bottom: 1rem; }
ul.numbered li::before {
  content: counter(work, decimal-leading-zero);
  counter-increment: work;
  position: absolute;
  left: 0;
  top: 0.16em;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

@media print {
  body { max-width: none; padding: 0; color: #000; background: #fff; }
  body > header, footer, .copy-btn, .skip-link { display: none; }
  a { color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.78em; word-break: break-all; }
  code { color: #000; background: none; border: 1px solid #bbb; }
  pre { color: #000; background: none; border: 1px solid #bbb; white-space: pre-wrap; }
  h2, h3 { break-after: avoid; }
}
