/* tesserawm.org. The palette is Tessera's own defaults: the example
   config's background (#232635), the focused border (#c792ea), the
   unfocused tab fill (#2b2e36) and the tab marks' colors. Gaps and
   borders are its default metrics (inner gap 6, border 1) at 2x. */
:root {
  color-scheme: dark;
  --bg: #232635;
  --tile: #292d3e;
  --line: #3b4058;
  --tab: #2b2e36;
  --focus: #c792ea;
  --ink: #e6e9f4;
  --muted: #a6accd;
  --link: #89ddff;
  --code: #1f2230;
  --green: #c3e88d;
  --gap: 12px;
  --border: 2px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Cantarell, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 56px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--sans);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: var(--border) solid var(--focus); outline-offset: 3px; }

code, kbd, pre { font-family: var(--mono); font-size: 0.9em; font-variant-ligatures: none; }
code { color: var(--green); }
kbd {
  padding: 0.05em 0.4em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: var(--tab);
  white-space: nowrap;
}

/* The nav is Tessera's tab strip: equal tabs across the width, the
   selected one filled with the focus color, each with its app mark. */
.strip {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  gap: 2px;
  padding: var(--gap) var(--gap) 0;
  background: var(--bg);
}
.tab {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-width: 0;
  padding: 0.45em 0.6em;
  background: var(--tab);
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab:hover { color: var(--ink); }
.tab.selected { background: var(--focus); color: var(--bg); font-weight: 600; }
.mark {
  flex: none;
  width: 0.55em;
  height: 0.55em;
  background: var(--mark);
}
.ma { --mark: #82aaff; } .mb { --mark: #c3e88d; } .mc { --mark: #ffcb6b; }
.md { --mark: #89ddff; } .me { --mark: #f78c6c; }
.tab.selected .mark { background: var(--bg); }

/* A workspace is a grid of tiles with Tessera's gaps. */
.workspace {
  display: grid;
  gap: var(--gap);
  padding: var(--gap);
}
.tile {
  margin: 0;
  border: var(--border) solid var(--line);
  background: var(--tile);
}
.tile.focused { border-color: var(--focus); }

.hero { grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); align-items: stretch; }
.intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
}
.intro h1 {
  margin: 0;
  font-size: clamp(2.75rem, 7vw, 5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.lede {
  margin: 0.75rem 0 1.25rem;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  line-height: 1.3;
  color: var(--ink);
}
.intro p { max-width: 38em; }
.links { display: flex; flex-wrap: wrap; gap: 0.5em 1.5em; margin-bottom: 0; }

.shot { display: flex; flex-direction: column; overflow: hidden; }
.shot img { display: block; width: 100%; height: auto; background: var(--bg); }
.hero .shot { justify-content: center; background: var(--bg); }
figcaption {
  padding: 0.75rem 1rem 0.9rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery .heading {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.6rem 1rem;
  font-size: 1.125rem;
}

/* The reading sections: one column, a measure under 80 characters. */
.column {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 0;
}
h2 { font-size: 1.75rem; line-height: 1.2; letter-spacing: -0.01em; margin: 1rem 0 0.75rem; }
h3 { font-size: 1.2rem; line-height: 1.3; margin: 2rem 0 0.5rem; }
.column ul { padding-left: 1.2em; }
.column li { margin: 0.4em 0; }
.column li::marker { color: var(--focus); }
pre {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  background: var(--code);
  border-left: var(--border) solid var(--focus);
  line-height: 1.5;
}
pre code { color: var(--ink); font-size: 0.875rem; }
pre .c { color: #828ab0; }   /* 4.67:1 on --code, over AA's 4.5 */

.foot {
  margin-top: 3rem;
  padding-bottom: 3rem;
  border-top: var(--border) solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}
.foot p:last-child { display: flex; gap: 1.5em; }

.lost { max-width: 36rem; margin: 18vh auto 0; padding: 0 1.25rem; }
.lost h1 { font-size: 3rem; line-height: 1; margin: 0 0 1rem; letter-spacing: -0.03em; }

@media (max-width: 860px) {
  .hero, .gallery { grid-template-columns: minmax(0, 1fr); }
  .tab { font-size: 0.8125rem; padding: 0.45em 0.3em; }
}
@media (max-width: 520px) {
  .strip { padding-inline: 8px; }
  .mark { display: none; }
  .tab { flex: 1 1 auto; padding-inline: 0.35em; }
}
@media (max-width: 360px) {
  .tab { font-size: 0.75rem; padding-inline: 0.25em; }
}
