/* Scholarly press: off-white page and warm charcoal dark mode, Newsreader for text,
   brick-red links that echo the skyline's brick, section names set as labels in the margin.
   The skyline is red brick with cream trim, slate roofs, and sage trees. */

:root {
  --bg: #fbfaf7;
  --fg: #1b1b1b;
  --fg-soft: #5d5952;
  --accent: #9b2f1f;
  --rule: rgba(27, 27, 27, 0.14);
  --rule-strong: rgba(27, 27, 27, 0.5);

  /* skyline: red brick, cream stone trim, slate roofs and glass, sage trees */
  --b-ink: #241b17;
  --w-1: #b35d43; --w-2: #7c3527;
  --roof: #3d4249;
  --g-1: #c4cdd3; --g-2: #8b9aa5;
  --dp-1: #1b1d22; --dp-2: #2e353f;
  --cr-1: #fbf6ea; --cr-2: #e9dfca; --cr-3: #cbbda1;
  --brick-line: rgba(255, 238, 222, 0.22);
  --seam-line: rgba(255, 238, 222, 0.14);
  --leaf: #8ea583; --leaf-sh: rgba(28, 44, 24, 0.35); --leaf-hl: rgba(255, 255, 240, 0.3);

  --font-title: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-text: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1b19;
    --fg: #ece6da;
    --fg-soft: #b1a999;
    --accent: #e8907a;
    --rule: rgba(236, 230, 218, 0.2);
    --rule-strong: rgba(236, 230, 218, 0.45);
    --b-ink: #110c0a;
    --w-1: #9b4f3a; --w-2: #6a2f23;
    --roof: #2b2f35;
    --g-1: #aeb8bf; --g-2: #76848f;
    --dp-1: #0e1013; --dp-2: #232931;
    --cr-1: #e9e1d0; --cr-2: #cdc2ac; --cr-3: #a69a82;
    --brick-line: rgba(255, 238, 222, 0.17);
    --seam-line: rgba(255, 238, 222, 0.12);
    --leaf: #74896b; --leaf-sh: rgba(8, 16, 6, 0.4); --leaf-hl: rgba(255, 255, 240, 0.2);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #1c1b19;
  --fg: #ece6da;
  --fg-soft: #b1a999;
  --accent: #e8907a;
  --rule: rgba(236, 230, 218, 0.2);
  --rule-strong: rgba(236, 230, 218, 0.45);
  --b-ink: #110c0a;
  --w-1: #9b4f3a; --w-2: #6a2f23;
  --roof: #2b2f35;
  --g-1: #aeb8bf; --g-2: #76848f;
  --dp-1: #0e1013; --dp-2: #232931;
  --cr-1: #e9e1d0; --cr-2: #cdc2ac; --cr-3: #a69a82;
  --brick-line: rgba(255, 238, 222, 0.17);
  --seam-line: rgba(255, 238, 222, 0.12);
  --leaf: #74896b; --leaf-sh: rgba(8, 16, 6, 0.4); --leaf-hl: rgba(255, 255, 240, 0.2);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-optical-sizing: auto;
  font-size: 1.1875rem;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  transition: background-color 0.2s, color 0.2s;
}

::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}
a:hover { text-decoration-color: var(--accent); }

.label {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-variant-numeric: lining-nums;
}

/* ---------- header ---------- */

.site-header { max-width: 72rem; margin: 0 auto; padding: 1.25rem 1.25rem 0; }

.masthead { position: relative; }

.site-title {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  margin: 0;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.025em;
  z-index: 1;
}
.site-title a { color: var(--fg); text-decoration: none; }

.skyline { display: block; width: 100%; height: auto; }
@media (min-width: 721px) { .masthead { padding-top: 1.15rem; } }

.skyline .o { fill: none; stroke: var(--b-ink); stroke-width: 1.15; stroke-linejoin: round; }
.skyline .o2 { stroke: var(--b-ink); stroke-width: 0.7; stroke-linejoin: round; }
.skyline .o3 { stroke: var(--b-ink); stroke-width: 0.45; }
.skyline .nf { fill: none; }
.skyline .coping { fill: none; stroke: var(--cr-2); stroke-width: 2.6; stroke-linejoin: round; }
.skyline .cr { fill: var(--cr-1); }
.skyline .cr2 { fill: var(--cr-2); }
.skyline .gl { fill: var(--dp-2); }
.skyline .ink { fill: var(--b-ink); }
.skyline .d { fill: none; stroke: var(--b-ink); stroke-width: 0.55; stroke-linecap: round; }
.skyline .dl { fill: none; stroke: var(--b-ink); stroke-width: 0.35; opacity: 0.6; }
.skyline .sh { fill: none; stroke: #000; stroke-width: 0.9; opacity: 0.12; }
.skyline .fl { stroke: var(--b-ink); stroke-width: 0.3; opacity: 0.35; }
.skyline .fin { stroke: var(--cr-1); stroke-width: 0.5; opacity: 0.55; }
.skyline .hl { fill: none; stroke: var(--cr-1); stroke-width: 0.8; opacity: 0.45; }
.skyline .refl { fill: none; stroke: #fff; stroke-width: 2.4; opacity: 0.14; stroke-linecap: round; }
.skyline .bk { fill: none; stroke: var(--brick-line); stroke-width: 0.35; }
.skyline .sm { fill: none; stroke: var(--seam-line); stroke-width: 0.5; }
.skyline .w1 { stop-color: var(--w-1); } .skyline .w2 { stop-color: var(--w-2); }
.skyline .g1 { stop-color: var(--g-1); } .skyline .g2 { stop-color: var(--g-2); }
.skyline .dp1 { stop-color: var(--dp-1); } .skyline .dp2 { stop-color: var(--dp-2); }
.skyline .c1 { stop-color: var(--cr-1); } .skyline .c2 { stop-color: var(--cr-2); } .skyline .c3 { stop-color: var(--cr-3); }
.skyline .trunk { fill: var(--b-ink); }
.skyline .crown-o circle { fill: var(--b-ink); stroke: var(--b-ink); stroke-width: 2.2; }
.skyline .crown circle { fill: var(--leaf); }
.skyline .crown-sh { fill: var(--leaf-sh); }
.skyline .crown-hl { fill: var(--leaf-hl); }
.skyline .ground { fill: none; stroke: var(--fg); stroke-width: 1.4; stroke-linecap: round; }
.skyline .path { fill: none; stroke: var(--fg-soft); stroke-width: 1.1; stroke-dasharray: 2 5; stroke-linecap: round; }
.skyline .plane { fill: var(--fg); }
.skyline .pencil { fill: none; stroke: var(--fg-soft); stroke-width: 0.85; stroke-linecap: round; stroke-linejoin: round; }
.skyline .pencil2 { fill: none; stroke: var(--fg-soft); stroke-width: 0.4; opacity: 0.5; }
.skyline .node { fill: var(--bg); stroke: var(--fg-soft); stroke-width: 0.9; }

.theme-toggle {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--fg-soft);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 50%;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--fg); border-color: var(--fg-soft); }
.theme-toggle span { display: none; }
:root:not([data-theme]) .theme-toggle .t-system,
:root[data-theme="light"] .theme-toggle .t-light,
:root[data-theme="dark"] .theme-toggle .t-dark { display: inline; }

/* ---------- body ---------- */

main { max-width: 49rem; margin: 0 auto; padding: 2.75rem 0 4rem; }

.intro { padding-left: 11rem; }

.lede {
  margin: 0;
  font-size: clamp(1.6rem, 3.2vw, 2.05rem);
  line-height: 1.22;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.meta { margin: 1.1rem 0 0; color: var(--fg-soft); font-size: 1.0625rem; }
.meta .sep::before { content: "·"; margin: 0 0.6rem; }


.prose section {
  position: relative;
  padding: 2.4rem 0 0 11rem;
  margin-top: 2.4rem;
  border-top: 1px solid var(--rule);
}
.prose h2 {
  position: absolute;
  left: 0;
  top: 2.6rem;
  width: 9rem;
  margin: 0;
  color: var(--fg-soft);
  line-height: 1.5;
}
.prose h3 {
  margin: 1.9rem 0 0.35rem;
  font-size: 1.125rem;
  font-style: italic;
  font-weight: 400;
}
.prose h3:first-of-type { margin-top: 0; }
.prose p { margin: 0 0 1rem; text-wrap: pretty; }

.about { display: flow-root; }
.portrait {
  float: right;
  width: 9rem;
  margin: 0.35rem 0 0.8rem 1.6rem;
  border-radius: 2px;
  filter: grayscale(1) contrast(1.02);
}

.card {
  clear: both;
  display: block;
  margin: 1.6rem 0 0.4rem;
  padding: 1.15rem 1.35rem 1.2rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: color-mix(in srgb, var(--fg) 3.5%, transparent);
  color: var(--fg);
  text-decoration: none;
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--accent); }
.card .label { display: block; color: var(--fg-soft); }
.card .big { display: block; margin-top: 0.35rem; font-size: 1.45rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.card .small { display: block; margin-top: 0.3rem; }
.card .arrow { display: inline-block; margin-left: 0.4rem; color: var(--accent); transition: transform 0.15s; }
.card:hover .arrow { transform: translateX(3px); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
.list li:first-child { padding-top: 0; }
.list li:last-child { border-bottom: 0; }
.list .when { color: var(--fg-soft); }

.years { list-style: none; margin: 0; padding: 0; }
.years li { position: relative; padding: 0.12rem 0 0.12rem 3.6rem; }
.years .y { position: absolute; left: 0; color: var(--fg-soft); font-variant-numeric: tabular-nums; }

.badge {
  display: inline-block;
  margin-right: 0.5rem;
  padding: 0 0.4rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  vertical-align: 0.15em;
  color: var(--bg);
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- small screens ---------- */

@media (max-width: 860px) {
  main { padding: 2.25rem 0.5rem 3.5rem; margin: 0 auto; }
}

@media (max-width: 720px) {
  .site-header { padding: 1rem 1rem 0; }
  .site-title { position: static; margin: 0 0 0.5rem; font-size: 2.1rem; }
  .skyline { aspect-ratio: 940 / 240; height: auto; }
  .theme-toggle { top: 0.1rem; right: 0; width: 1.9rem; height: 1.9rem; font-size: 0.95rem; }
  main { padding: 1.9rem 1rem 3rem; }
  .intro { padding-left: 0; }
  .prose section { padding: 1.6rem 0 0; margin-top: 1.9rem; }
  .prose h2 { position: static; width: auto; margin: 0 0 1rem; }
  .portrait { width: 6.5rem; margin-left: 1rem; }
}
