:root {
  --ink: #16181d; --dim: #525966; --bg: #ffffff; --panel: #f6f7f9;
  --accent: #0b5fff; --accent-ink: #ffffff; --line: #e5e7eb;
  --radius: 10px; --maxw: 66rem;
  /* background art: the same scene morning and night; see tools/make-backgrounds.py */
  --bg-image: url("/backgrounds/morning.webp");
  /* denser at the top, where the hero text sits over the art; lighter lower
     down, where the content sits on panels anyway */
  --bg-scrim: linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.74));
}
/* Dark values apply when the OS asks for them (unless pinned light),
   or when the toggle pins dark. One block, two selectors. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --ink: #e8eaed; --dim: #9aa0a6; --bg: #101216; --panel: #181b21;
          --accent: #7aa2ff; --accent-ink: #0b1020; --line: #262b33;
          --bg-image: url("/backgrounds/night.webp");
          --bg-scrim: linear-gradient(rgba(8, 10, 14, 0.84), rgba(8, 10, 14, 0.52));
          color-scheme: dark; }
}
:root[data-theme="dark"] { --ink: #e8eaed; --dim: #9aa0a6; --bg: #101216; --panel: #181b21;
          --accent: #7aa2ff; --accent-ink: #0b1020; --line: #262b33;
          --bg-image: url("/backgrounds/night.webp");
          --bg-scrim: linear-gradient(rgba(8, 10, 14, 0.84), rgba(8, 10, 14, 0.52)); }
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }

/* Background art: a fixed layer behind everything, so the content scrolls over
   it. The solid --bg stays as the fallback colour and as the surface colour of
   panels. The scrim on top keeps text over the art readable; it is dropped
   entirely for readers who ask for more contrast or print. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  /* a touch of blur keeps text over the art calm (and softens a busy photo) */
  filter: blur(1.5px) saturate(0.95);
  background-image: var(--bg-scrim), var(--bg-image);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}
@media (prefers-contrast: more) { body::before { background-image: var(--bg-scrim); } }
@media print { body::before { display: none; } }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.65 -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  text-rendering: optimizeLegibility;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 2.4rem; margin: 1.2rem 0 0.6rem; }
h2 { font-size: 1.5rem; margin-top: 2.4rem; }
img { max-width: 100%; }

/* header */
.site-header { border-bottom: 1px solid var(--line); position: sticky; top: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 1.25rem; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--ink); letter-spacing: 0.01em; }
.site-header nav a { margin-left: 1.1rem; color: var(--dim); font-weight: 500; }
.site-header nav a:hover { color: var(--ink); text-decoration: none; }

/* hero */
.hero { padding: 4rem 0 2.5rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 1rem; max-width: 100%; }
.hero .lede { font-size: 1.2rem; color: var(--dim); max-width: 100%; }
.cta { display: flex; gap: 0.8rem; margin-top: 1.6rem; flex-wrap: wrap; }
.btn { display: inline-block; padding: 0.65rem 1.15rem; border-radius: var(--radius);
  font-weight: 600; border: 1px solid var(--line); color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn:hover { text-decoration: none; filter: brightness(1.05); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.card { background: color-mix(in srgb, var(--panel) 86%, transparent);
  backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; }
.card h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.card p { margin: 0.2rem 0; color: var(--dim); font-size: 0.95rem; }

/* testimonials: the quote carries the card; the attribution sits apart,
   below a hairline, name first */
.testimonial { display: flex; flex-direction: column; margin: 0; }
.testimonial blockquote { margin: 0 0 1rem; padding: 0; border: 0; }
.testimonial blockquote p { margin: 0; color: var(--ink); font-size: 1rem; }
.testimonial figcaption { margin-top: auto; padding-top: 0.85rem; border-top: 1px solid var(--line);
  color: var(--dim); font-size: 0.9rem; }
.testimonial .who { color: var(--ink); font-weight: 600; }

/* post list */
.post-list { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
/* rows are panels, like the cards: over the background art, links need a
   stable surface to keep their contrast */
.post-list li { background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(6px); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.85rem 1rem; }
.post-list a { font-weight: 600; font-size: 1.08rem; }
.post-list .meta { margin-left: 0.6rem; }
.meta { color: var(--dim); font-size: 0.9rem; }
.badge { display: inline-block; margin-left: 0.5rem; padding: 0.05rem 0.5rem; border-radius: 999px;
  border: 1px solid var(--line); font-size: 0.78rem; color: var(--dim); }

/* posts */
.post { padding-bottom: 2rem; }
.post pre { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.9rem 1rem; overflow-x: auto; font-size: 0.92rem; }
.post code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.92em; }
.post :not(pre) > code { background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: 0.05rem 0.35rem; }
blockquote { border-left: 3px solid var(--accent); margin: 1.2rem 0; padding: 0.2rem 0 0.2rem 1rem; color: var(--dim); }
table { border-collapse: collapse; }
th, td { border: 1px solid var(--line); padding: 0.4rem 0.7rem; }

/* figures */
.app-embed { margin: 1.4rem 0; }
.app-embed figcaption { color: var(--dim); font-size: 0.9rem; text-align: center; margin-top: 0.4rem; }
.tenant-shell { margin: 1rem 0 2rem; }
.tenant-frame { width: 100%; height: 60vh; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); }
.tenant-note { color: var(--dim); font-size: 0.85rem; text-align: right; }

/* footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 4rem; padding: 1.4rem 0 2.4rem; color: var(--dim); font-size: 0.92rem; }

/* giallo line structure */
.giallo-l { display: inline-block; min-height: 1lh; width: 100%; }
.giallo-ln { display: inline-block; user-select: none; margin-right: 0.4em; padding: 0.4em; min-width: 3ch; text-align: right; opacity: 0.8; }

/* wasm demo widget */
.wasm-demo { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.9rem 1.1rem; margin: 1.2rem 0; }
.wasm-demo input { font: inherit; padding: 0.25rem 0.5rem; width: 5rem; }
.wasm-demo button { font: inherit; padding: 0.3rem 0.8rem; margin-left: 0.4rem; cursor: pointer; }
.wasm-demo p { margin: 0.6rem 0 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.92rem; }

/* theme toggle */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; margin-left: 0.9rem; padding: 0; cursor: pointer;
  background: transparent; color: var(--dim); border: 1px solid var(--line);
  border-radius: 999px; }
.theme-toggle:hover { color: var(--ink); }
.theme-toggle svg { width: 1rem; height: 1rem; display: block; }
.theme-toggle .icon-sun, .theme-toggle .icon-auto { display: none; }
.theme-toggle[data-mode="light"] .icon-sun { display: block; }
.theme-toggle[data-mode="light"] .icon-moon { display: none; }
.theme-toggle[data-mode="dark"] .icon-moon { display: block; }
.theme-toggle[data-mode="dark"] .icon-sun { display: none; }
.theme-toggle[data-mode="auto"] .icon-auto { display: block; }
.theme-toggle[data-mode="auto"] .icon-moon { display: none; }

/* Posts are framed the same way whether the body is native markdown or a tenant
   in an iframe: same border, radius, 24px padding and 688px text column. */
.post-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
}
.post-body { max-width: 688px; margin: 0 auto; }
