/* Theory of Theories — bespoke site styles (hand-built, no framework). */

:root {
  --bg:        #ffffff;
  --bg-soft:   #fafafa;
  --ink:       #16161a;
  --ink-2:     #3f3f46;
  --muted:     #6b7280;
  --faint:     #9aa0aa;
  --line:      #ececef;
  --line-2:    #f4f4f6;
  --accent:    #4f46e5;   /* indigo */
  --accent-deep:#3f37c9;
  --accent-soft:#eef0fe;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --measure: 44rem;
}

* { box-sizing: border-box; }
html { overflow-y: scroll; scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 2px; }
::selection { background: var(--accent-soft); }

/* ── header ── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: baseline; gap: 28px;
  padding: 18px 32px;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font: 650 15px/1 var(--sans);
  text-transform: uppercase;
  letter-spacing: .16em;              /* tracked caps = masthead/logo feel */
  color: var(--ink);
}
.brand:hover { color: var(--ink); text-decoration: none; }
/* "of" connector — active: lowercase italic purple (breaks the caps run) */
.brand .of {
  text-transform: lowercase;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--accent);               /* the one spot of purple */
  padding: 0 .04em;
}
/* Alt treatment — all-caps "OF": smaller, raised, purple underline.
   Swap this in (and comment out the rule above) to use it.
.brand .of {
  position: relative;
  top: -0.24em;
  color: var(--ink);
  font-size: 0.78em;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
*/
.site-nav { margin-left: auto; display: flex; gap: 22px; align-items: baseline; }
.site-nav a {
  position: relative;
  color: var(--muted); font: 500 14.5px/1 var(--sans); letter-spacing: -.01em;
}
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav a.active { color: var(--ink); }
.site-nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 2px; background: var(--accent); border-radius: 2px;
}

/* ── layout ── */
main { flex: 1 0 auto; width: 100%; max-width: var(--measure); margin: 0 auto; padding: 64px 28px 88px; }
main.wide { max-width: 60rem; }

.eyebrow {
  font: 600 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px;
}
h1.display {
  font: 600 clamp(34px, 6vw, 52px)/1.08 var(--sans);
  letter-spacing: -.03em; margin: 0 0 18px;
}
.lede { font-size: 20px; line-height: 1.55; color: var(--ink-2); margin: 0 0 8px; max-width: 36rem; }

h1 { font: 600 34px/1.15 var(--sans); letter-spacing: -.025em; margin: 0 0 16px; }
h2 { font: 600 23px/1.25 var(--sans); letter-spacing: -.018em; margin: 44px 0 14px; }
h3 { font: 600 18px/1.3 var(--sans); letter-spacing: -.01em; margin: 30px 0 10px; }
p { margin: 0 0 18px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
code { font: 14px var(--mono); background: var(--bg-soft); padding: 1px 5px; border-radius: 4px; color: var(--accent-deep); }
blockquote { margin: 22px 0; padding-left: 18px; border-left: 3px solid var(--line); color: var(--ink-2); }

/* ── home: section cards ── */
.cards { display: grid; gap: 14px; margin: 32px 0; }
.card {
  display: block; padding: 20px 22px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: #d9d9e3; text-decoration: none; transform: translateY(-1px); }
.card .card-title { font: 600 17px/1.2 var(--sans); color: var(--ink); letter-spacing: -.01em; }
.card .card-sub { color: var(--muted); font-size: 14.5px; margin-top: 5px; }
.card .pill {
  float: right; font: 600 11px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); background: var(--bg-soft); border: 1px solid var(--line);
  padding: 4px 8px; border-radius: 999px;
}

/* ── project list ── */
.links { list-style: none; padding: 0; margin: 18px 0; }
.links li { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.links li:last-child { border-bottom: 0; }
.links .name { font-weight: 600; color: var(--ink); }
.links .desc { color: var(--muted); }

/* ── logbook list ── */
.log-list { list-style: none; padding: 0; margin: 24px 0; }
.log-item { padding: 18px 0; border-bottom: 1px solid var(--line); }
.log-item:last-child { border-bottom: 0; }
.log-item .log-date { font: 500 13px/1 var(--mono); color: var(--faint); letter-spacing: .02em; }
.log-item .log-title { font: 600 19px/1.3 var(--sans); letter-spacing: -.015em; margin: 6px 0 4px; }
.log-item .log-desc { color: var(--ink-2); }
.empty-note { color: var(--muted); font-style: italic; }
.lede > p, .empty-note > p { margin: 0; color: inherit; font: inherit; }

.about-intro { text-align: justify; }
.section-label:first-child { margin-top: 0; }
.section-label {
  margin: 40px 0 20px;
  font: 700 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
}

/* ── home intro ── */
.home-intro { max-width: 40rem; text-align: justify; margin-top: 7vh; }
.home-intro p:first-child { font: 600 clamp(23px, 3.6vw, 28px)/1.25 var(--sans); letter-spacing: -.02em; color: var(--ink); text-align: left; margin: 0 0 26px; }
.home-intro p:last-child { text-align: right; }

/* ── home letter ── */
.letter { font: 400 19px/1.72 var(--serif); color: var(--ink-2); max-width: 36rem; margin: 6px 0 0; }
.letter p { margin: 0 0 1.15em; }
.letter em { font-style: italic; }
.letter p:last-child { margin-top: 1.6em; color: var(--ink); }

/* ── logbook list ── */
.post-list { margin-top: 8px; }
.post-link {
  display: grid; grid-template-columns: 7rem 1fr; gap: 2px 20px;
  padding: 16px 4px; border-top: 1px solid var(--line);
  text-decoration: none; color: inherit;
}
.post-link:last-child { border-bottom: 1px solid var(--line); }
.post-link:hover .post-link-title { color: var(--accent); }
.post-link-date { font: 13px/1.7 var(--mono); color: var(--faint); white-space: nowrap; }
.post-link-title { font-weight: 600; color: var(--ink); }
.post-link-desc { grid-column: 2; color: var(--muted); font-size: 15px; }

/* ── single post ── */
article.post .post-title { margin-bottom: 4px; }
article.post .post-date { font: 13px var(--mono); color: var(--faint); margin: 0 0 28px; }

/* ── footer ── */
.site-footer {
  margin-top: auto; border-top: 1px solid var(--line);
  padding: 11px 32px; text-align: center;
  color: var(--faint); font-size: 13px;
}
.site-footer .sep { display: inline-block; width: 1.6em; }

@media (max-width: 640px) {
  .site-header { padding: 14px 18px; gap: 16px; }
  .site-nav { gap: 16px; }
  main { padding: 44px 20px 64px; }
}

/* ── About: 2×2 showcase of the other sites (real home-page screenshots) ── */
.site-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 26px 0 8px; }
.site-card {
  display: block; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: var(--bg); transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.site-card:hover { border-color: #d9d9e3; transform: translateY(-2px); box-shadow: 0 8px 28px rgba(20,20,30,.07); text-decoration: none; }
.site-card img { width: 100%; aspect-ratio: 1280 / 760; object-fit: cover; object-position: top center; display: block; border-bottom: 1px solid var(--line); }
.site-card.wide { grid-column: 1 / -1; }
.site-card.wide img { aspect-ratio: 1280 / 560; }
.site-card.wide.feature-tall img { aspect-ratio: 1265 / 620; }
.site-card.contain img { object-fit: contain; object-position: center; background: var(--bg); }
.site-card .meta { display: flex; align-items: baseline; gap: 8px; padding: 13px 16px; }
.site-card .name { font: 600 15.5px/1 var(--sans); color: var(--ink); letter-spacing: -.01em; }
.site-card .url { margin-left: auto; font: 12.5px var(--mono); color: var(--faint); }
@media (max-width: 640px) { .site-grid { grid-template-columns: 1fr; } }
