/* always.Pondering.
 *
 * SOURCE FILE. scripts/build-pondering.ts copies this into
 * public/assets/pondering.css — edit it here, never there; public/ is wiped and
 * rewritten on every build.
 *
 * Same rules as the landing page: colour, type and spacing come from
 * /brand/tokens.css, faces from /brand/fonts.css, and no JavaScript at all —
 * the pages are served with script-src 'none'.
 *
 * The workbench is a surface with objects on it. This is the notebook that sits
 * beside it: a single measure of text, quieter, no tiles.
 */

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

:root {
  --measure: 40rem;
  --hairline: #241d30;
  --annotation: #827790;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: var(--space-12) var(--space-6) var(--space-8);
  background: var(--space-base);
  color: var(--text-primary);
  font-family: var(--font-interface);
  font-size: var(--text-16);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}

/* The same work surface as the landing page, so the two read as one place. */
.surface {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--hairline) 1px, transparent 1px),
    linear-gradient(to bottom, var(--hairline) 1px, transparent 1px);
  background-size: 96px 96px;
  opacity: 0.5;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 100%);
}

main,
footer {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
}

main {
  flex: 1;
}

/* ---- Masthead ---------------------------------------------------------- */

.masthead {
  margin-bottom: var(--space-16);
}

.eyebrow {
  margin: 0 0 var(--space-4);
  font-size: var(--text-12);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow a {
  color: var(--annotation);
  text-decoration: none;
}

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

.masthead h1 {
  margin: 0;
  font-size: var(--text-32);
  font-weight: var(--font-weight-medium);
  line-height: var(--leading-tight);
}

.tagline {
  margin: var(--space-3) 0 0;
  color: var(--text-secondary);
}

/* ---- Index ------------------------------------------------------------- */

.posts {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-face {
  display: block;
  padding: var(--space-6) 0;
  border-top: 1px solid var(--hairline);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--motion-standard) var(--ease-standard);
}

.post-face:hover {
  border-color: var(--accent-focus);
}

.post-face:focus-visible {
  outline: var(--focus-ring-width) solid var(--accent-focus);
  outline-offset: var(--focus-ring-offset);
}

.post-face time {
  display: block;
  color: var(--annotation);
  font-size: var(--text-12);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.post-face h2 {
  margin: var(--space-2) 0 0;
  font-size: var(--text-20);
  font-weight: var(--font-weight-medium);
  line-height: var(--leading-heading);
}

.post-face p {
  margin: var(--space-2) 0 0;
  color: var(--text-secondary);
  font-size: var(--text-14);
}

.empty {
  padding-top: var(--space-6);
  border-top: 1px solid var(--hairline);
  color: var(--text-secondary);
}

/* ---- A post ------------------------------------------------------------ */

.entry h1 {
  margin: 0;
  font-size: var(--text-32);
  font-weight: var(--font-weight-medium);
  line-height: var(--leading-tight);
}

.entry-meta {
  margin: var(--space-3) 0 var(--space-12);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--hairline);
  color: var(--annotation);
  font-size: var(--text-12);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.prose {
  color: var(--text-secondary);
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2,
.prose h3 {
  margin: var(--space-12) 0 var(--space-3);
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
  line-height: var(--leading-heading);
}

.prose h2 {
  font-size: var(--text-20);
}

.prose h3 {
  font-size: var(--text-16);
  letter-spacing: 0.02em;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 var(--space-6);
}

.prose li {
  margin-bottom: var(--space-2);
}

.prose a {
  color: var(--accent-focus);
  text-decoration-color: color-mix(in srgb, var(--accent-focus) 45%, transparent);
  text-underline-offset: 0.2em;
}

.prose strong {
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
}

.prose blockquote {
  margin: var(--space-6) 0;
  padding-left: var(--space-6);
  border-left: 2px solid var(--hairline);
  color: var(--annotation);
}

.prose hr {
  margin: var(--space-12) 0;
  border: 0;
  border-top: 1px solid var(--hairline);
}

/* Code keeps the hardware surface colour, so listings read as objects on the
   bench rather than as another panel. */
.prose code {
  padding: 0.15em 0.4em;
  border-radius: var(--radius-control);
  background: var(--space-elevated);
  color: var(--text-primary);
  font-size: 0.9em;
}

.prose pre {
  margin: 0 0 var(--space-6);
  padding: var(--space-4);
  /* Long lines scroll INSIDE the block; the page itself must never scroll
     sideways, which is the failure mode a code block usually causes. */
  overflow-x: auto;
  background: var(--space-elevated);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-panel);
}

.prose pre code {
  padding: 0;
  background: none;
  font-size: var(--text-14);
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-panel);
}

.prose table {
  width: 100%;
  margin-bottom: var(--space-6);
  border-collapse: collapse;
  font-size: var(--text-14);
}

.prose th,
.prose td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--hairline);
  text-align: left;
}

.prose th {
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
}

/* ---- Footer ------------------------------------------------------------ */

footer {
  margin-top: var(--space-16);
  padding-top: var(--space-6);
  border-top: 1px solid var(--hairline);
  font-size: var(--text-14);
}

footer p {
  margin: 0;
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

footer a:hover {
  color: var(--text-primary);
}

/* ---- The always.X construction ----------------------------------------- */

.prefix {
  font-family: var(--font-interface);
  font-weight: var(--font-weight-medium);
}

.dot {
  color: var(--agog-mark);
}

.suffix {
  font-family: var(--font-brand-suffix);
  font-weight: var(--font-weight-medium);
}

@media (min-width: 48rem) {
  body {
    padding: var(--space-16) var(--space-12) var(--space-8);
  }
}
