/* Philosophy of Everything: cream paper for reading, deep teal and amber for marks. */
:root {
  --paper: #f1ece0;
  --paper-2: #e8e0cc;
  --ink: #1e2a28;
  --ink-soft: #56625e;
  --heading: #123432;
  --link: #1a4d49;
  --amber: #e2a048;
  --amber-ink: #94601a;
  --line: rgba(18, 52, 50, 0.14);
  --line-strong: rgba(18, 52, 50, 0.32);
  --head-bg: #0d2a28;
  --head-ink: #efe3c8;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d2a28;
    --paper-2: #123432;
    --ink: #e6dcc3;
    --ink-soft: #a9a491;
    --heading: #efe3c8;
    --link: #efe3c8;
    --amber-ink: #e2a048;
    --line: rgba(239, 227, 200, 0.13);
    --line-strong: rgba(239, 227, 200, 0.3);
    --head-bg: #092120;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img, video, iframe, svg { max-width: 100%; }
a { color: var(--link); text-decoration-color: var(--amber); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px; }

/* Header */
.site-head { background: var(--head-bg); color: var(--head-ink); }
.bar {
  max-width: 60rem; margin: 0 auto; padding: 0.9rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--head-ink); text-decoration: none; font-size: 1.05rem; font-weight: 500; letter-spacing: 0.01em; }
.brand img { flex: none; width: 48px; height: 48px; }
@media (max-width: 600px) { .brand img { width: 42px; height: 42px; } }
.brand span { white-space: nowrap; }
.home .brand { visibility: hidden; }   /* the hero carries the big mark on the home page */
.site-head nav { display: flex; gap: 1.2rem; font-family: var(--sans); font-size: 0.85rem; letter-spacing: 0.04em; }
.site-head nav a { color: var(--head-ink); opacity: 0.8; text-decoration: none; }
.site-head nav a:hover { opacity: 1; text-decoration: underline; text-decoration-color: var(--amber); }
@media (max-width: 420px) { .site-head nav a[href="/"] { display: none; } }
.hero {
  max-width: 60rem; margin: 0 auto; padding: 2rem 1rem 3rem;
  display: flex; flex-direction: column; align-items: center; gap: 1.2rem; text-align: center;
}
/* the enso beside the title on wide screens, above it on phones; never under the text */
.hero-mark { width: clamp(120px, 30vw, 150px); height: auto; flex: none; margin: -0.8rem; }
.hero h1 { margin: 0; font-weight: 400; font-size: clamp(2.5rem, 9vw, 4.4rem); line-height: 1.05; letter-spacing: -0.01em; }
.hero p { margin: 1rem 0 0; font-style: italic; font-size: clamp(1.15rem, 3.4vw, 1.4rem); opacity: 0.85; }
.hero p::before { content: ""; display: block; width: 2.5rem; height: 2px; background: var(--amber); margin: 0 auto 1rem; }
@media (min-width: 760px) {
  .hero { flex-direction: row; justify-content: center; gap: 1.6rem; text-align: left; padding: 3rem 1rem 3.6rem; }
  .hero-mark { width: clamp(150px, 15vw, 180px); margin: -1rem; }
  .hero h1 { font-size: clamp(2.6rem, 5.2vw, 3.7rem); white-space: nowrap; }
  .hero p::before { margin: 0 0 1rem; }
}

main { padding: 0 1rem; }

/* Home list */
.list { max-width: 60rem; margin: 0 auto; padding: 2.5rem 0 3rem; display: grid; gap: 2.5rem; }
.card-link { display: grid; gap: 1rem; color: inherit; text-decoration: none; }
.cover, .post-cover {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line); background: var(--paper-2);
}
.meta { margin: 0; font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.card h2 { margin: 0.35rem 0 0.4rem; font-weight: 500; font-size: 1.5rem; line-height: 1.2; color: var(--heading); }
.card-link:hover h2 { text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.excerpt { margin: 0; color: var(--ink-soft); font-size: 1.05rem; line-height: 1.55; }
.card + .card { border-top: 1px solid var(--line); padding-top: 2.5rem; }
@media (min-width: 720px) {
  .list { padding-top: 3.5rem; gap: 3rem; }
  .card + .card { padding-top: 3rem; }
  .card:first-child h2 { font-size: 2.1rem; }
  .card:not(:first-child) .card-link { grid-template-columns: 2fr 3fr; gap: 2rem; align-items: center; }
}

/* Post */
.post { max-width: 65ch; margin: 0 auto; padding: 2.5rem 0 1rem; }
.post-head h1 { margin: 0.5rem 0 0; font-weight: 500; font-size: clamp(2rem, 6.5vw, 2.9rem); line-height: 1.1; letter-spacing: -0.01em; color: var(--heading); }
.lede { margin: 1rem 0 0; font-size: 1.25rem; line-height: 1.5; font-style: italic; color: var(--ink-soft); }
.post-cover { margin: 2rem 0 1.5rem; }
.prose h2 { margin: 2.6rem 0 0.6rem; font-weight: 500; font-size: 1.6rem; line-height: 1.25; color: var(--heading); }
.prose h3 { margin: 2rem 0 0.4rem; font-weight: 600; font-size: 1.25rem; color: var(--heading); }
.prose p, .prose ul, .prose ol { margin: 1.1rem 0; }
.prose li { margin: 0.3rem 0; }
.prose blockquote {
  margin: 2.2rem 0; padding: 0.2rem 0 0.2rem 1.2rem; border-left: 3px solid var(--amber);
  font-size: 1.35rem; line-height: 1.45; font-style: italic; color: var(--heading);
}
.prose blockquote p { margin: 0; }
.prose hr { border: 0; width: 2.5rem; height: 2px; background: var(--amber); margin: 3rem auto; }
.prose img { height: auto; border-radius: 8px; }
.prose code { font-size: 0.9em; background: var(--paper-2); padding: 0.1em 0.3em; border-radius: 4px; }

/* Video: portrait Shorts, centred and capped */
.videoFigure { margin: 2.5rem 0; }
.videoFigure iframe, .videoFigure video {
  display: block; width: 100%; max-width: 340px; height: auto; aspect-ratio: 9 / 16; margin: 0 auto;
  border: 0; border-radius: 14px; background: #000;
}
figcaption { margin-top: 0.7rem; font-size: 0.95rem; font-style: italic; color: var(--ink-soft); text-align: center; }

.watch { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }
.pill {
  font-family: var(--sans); font-size: 0.88rem; text-decoration: none; color: var(--heading);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.5rem 1rem;
}
.pill:hover { border-color: var(--amber); background: var(--paper-2); }
.tags { margin: 2.5rem 0 0; font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.05em; color: var(--ink-soft); }

.next { max-width: 65ch; margin: 1.5rem auto 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.next a { display: inline-block; margin-top: 0.3rem; font-size: 1.4rem; line-height: 1.3; color: var(--heading); }

/* Rich blocks used inside posts */
.callout { margin: 2.2rem 0; padding: 1.2rem 1.4rem; border-radius: 10px; background: rgba(226, 160, 72, 0.12); border-left: 3px solid var(--amber); }
.callout p { margin: 0; }
.statRow { display: grid; gap: 1rem; margin: 2.2rem 0; }
@media (min-width: 620px) { .statRow { grid-template-columns: 1fr 1fr; } }
.statCell { display: flex; flex-direction: column; gap: 0.4rem; padding: 1.2rem 1.3rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); }
.statNum { font-size: 1.35rem; font-weight: 600; color: var(--heading); }
.statNum.accent { color: var(--amber-ink); }
.statCap { font-size: 0.98rem; line-height: 1.5; color: var(--ink-soft); }

.diagram { margin: 2.5rem 0; overflow-x: auto; overscroll-behavior-x: contain; }
.diagram svg { display: block; width: 100%; min-width: 480px; height: auto; }
.diagram .d-panel { fill: var(--paper-2); stroke: var(--line); }
.diagram .d-label { font-family: var(--sans); font-size: 12px; letter-spacing: 0.16em; fill: var(--ink-soft); }
.diagram .d-tiny, .diagram .d-caption { font-family: var(--sans); font-size: 12px; fill: var(--ink-soft); }
.diagram .d-caption { font-style: italic; }
.diagram .accent { fill: var(--amber-ink); }
.diagram .d-rule { stroke: var(--amber); stroke-dasharray: 5 5; }
.diagram .d-node circle { fill: var(--ink-soft); }
.diagram .d-deep text { font-family: var(--serif); font-size: 17px; font-style: italic; fill: var(--heading); }
.diagram .d-source { fill: rgba(226, 160, 72, 0.25); stroke: var(--amber); stroke-width: 1.5; }
.diagram .d-source.muted { fill: none; stroke: var(--line-strong); }
.diagram .d-ray { stroke: var(--amber); stroke-width: 1.2; }
.diagram .d-ray.muted { stroke: var(--line-strong); }
.diagram .d-leaf text { font-family: var(--serif); font-size: 15px; fill: var(--ink); }
.diagram .d-bucket { fill: var(--paper); stroke: var(--line-strong); }
.diagram .d-dead line { stroke: var(--line-strong); stroke-dasharray: 3 6; }

/* Footer */
.site-foot { background: var(--head-bg); color: var(--head-ink); padding: 2.5rem 1rem 3rem; text-align: center; }
.site-foot a { color: var(--head-ink); }
.follow { margin: 0 0 0.6rem; font-style: italic; opacity: 0.8; }
.channels { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.6rem; font-size: 1.15rem; }
.site-foot .small { margin: 1.6rem 0 0; font-family: var(--sans); font-size: 0.8rem; opacity: 0.6; }
.prose .channels { justify-content: flex-start; margin-top: 1.5rem; }

/* share row under each post */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 2.5rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.share .meta { flex-basis: 100%; margin-bottom: 0.2rem; }
button.pill { font: inherit; cursor: pointer; background: none; color: var(--heading); }
.share .pill { font-family: var(--sans); font-size: 0.82rem; }
