:root {
  --ink: #15130f;
  --paper: #f3efe6;
  --paper-2: #eae4d6;
  --line: #15130f;
  --muted: #6b6457;
  --accent: #8a1b1b;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ece7db;
    --paper: #14130f;
    --paper-2: #1d1b15;
    --line: #ece7db;
    --muted: #8c8472;
    --accent: #d98a8a;
  }
}

* { 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: 19px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- Escher tessellation strip --- */
.tess {
  height: 46px;
  width: 100%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='46' viewBox='0 0 60 46'><g fill='none' stroke='%2315130f' stroke-width='1'><path d='M0 23 L15 0 L30 23 L15 46 Z'/><path d='M30 23 L45 0 L60 23 L45 46 Z'/><path d='M15 0 L45 0 M15 46 L45 46'/></g></svg>");
  background-repeat: repeat-x;
  opacity: 0.5;
}
@media (prefers-color-scheme: dark) {
  .tess { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='46' viewBox='0 0 60 46'><g fill='none' stroke='%23ece7db' stroke-width='1'><path d='M0 23 L15 0 L30 23 L15 46 Z'/><path d='M30 23 L45 0 L60 23 L45 46 Z'/><path d='M15 0 L45 0 M15 46 L45 46'/></g></svg>"); }
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 28px;
}

/* --- Masthead --- */
header.site {
  text-align: center;
  padding: 64px 0 30px;
}

.mark {
  width: 92px;
  height: 92px;
  margin: 0 auto 26px;
  display: block;
}

h1.title {
  font-size: 44px;
  letter-spacing: 0.16em;
  font-weight: 600;
  margin: 0;
  text-transform: uppercase;
}

.subtitle {
  color: var(--muted);
  font-style: italic;
  margin: 12px 0 0;
  font-size: 18px;
}

.rule {
  border: none;
  border-top: 1px solid var(--line);
  opacity: 0.35;
  margin: 40px 0;
}

/* --- Index list --- */
.posts { list-style: none; padding: 0; margin: 8px 0 60px; }
.posts li { padding: 26px 0; border-bottom: 1px solid rgba(107,100,87,0.28); }
.posts li:first-child { border-top: 1px solid rgba(107,100,87,0.28); }
.posts a { text-decoration: none; color: var(--ink); }
.posts a:hover h2 { color: var(--accent); }
.posts h2 { font-size: 26px; margin: 0 0 6px; font-weight: 600; }
.posts .dek { color: var(--muted); margin: 0; font-style: italic; }
.posts .meta { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; margin: 0 0 8px; }

/* --- Article --- */
article { padding-bottom: 60px; }
article .meta { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; text-align: center; }
article h1 { font-size: 36px; line-height: 1.2; text-align: center; margin: 14px 0 8px; font-weight: 600; }
article .dek { text-align: center; color: var(--muted); font-style: italic; font-size: 20px; margin: 0 auto 36px; max-width: 32ch; }
article h2 { font-size: 25px; margin: 44px 0 10px; font-weight: 600; }
article p { margin: 0 0 20px; }
article blockquote {
  margin: 30px 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--accent);
  font-style: italic;
  color: var(--ink);
}
article em.term { font-style: italic; }
article .lede { font-size: 22px; line-height: 1.55; }
article ol, article ul { padding-left: 1.3em; margin: 0 0 22px; }
article li { margin: 0 0 10px; }
article hr.drop {
  border: none;
  text-align: center;
  margin: 40px 0;
  color: var(--muted);
}
article hr.drop::before { content: "\221E"; font-size: 22px; }

a.back { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
a.back:hover { color: var(--accent); }

footer.site { text-align: center; padding: 40px 0 70px; color: var(--muted); font-size: 14px; }
footer.site .mono { font-family: var(--mono); letter-spacing: 0.08em; }

/* --- constant motion --- */

/* tessellation banner drifts sideways like a frieze (tile is 60px wide) */
@keyframes drift { from { background-position: 0 0; } to { background-position: 60px 0; } }
.tess { animation: drift 7s linear infinite; }

/* the nested squares rotate via SVG <animateTransform> in index.html — it
   rotates around the exact user-space center (50,50) identically in every
   browser, with none of transform-box/transform-origin's inconsistency. */
.mark { overflow: visible; }

@media (prefers-reduced-motion: reduce) {
  .tess { animation: none; }
}
