:root {
  --bg: #F3F4F3;
  --accent: #31628A;
  --deep: #1D3D57;
  --ink: #14202A;
  --muted: #6F7C86;
  --tile: #E4E9EC;
  --rule: rgba(49, 98, 138, 0.3);

  --display: "Instrument Serif", "Bodoni Moda", Didot, Georgia, serif;
  --sans: "Instrument Sans", "SF Pro Text", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, p, ul, figure { margin: 0; }
ul { list-style: none; padding: 0; }

.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* header: logo top left, nav right */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}
.logo img { width: 3.25rem; height: 3.25rem; object-fit: cover; }
.nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.25rem 1.75rem; }
.nav a { padding: 0.15rem 0; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.nav a:hover { color: var(--accent); }
.nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* shared page pieces */
.page { flex: 1; padding-top: clamp(1.5rem, 5vw, 4rem); padding-bottom: 5rem; }
.page-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(4rem, 12vw, 8.5rem);
  line-height: 0.85;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.intro { margin-top: 1.25rem; max-width: 30ch; color: var(--muted); }
.blank { color: var(--muted); opacity: 0.75; }

.frame { position: relative; overflow: hidden; background: var(--tile); }
.frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame .ph { position: absolute; left: 0.8rem; bottom: 0.6rem; font-size: 0.85rem; color: var(--muted); }
figcaption { margin-top: 0.55rem; font-size: 0.9rem; color: var(--muted); }

.site-footer { padding-top: 1.25rem; padding-bottom: 2rem; border-top: 1px solid var(--rule); font-size: 0.9rem; color: var(--muted); }

/* home: a single-screen cover */
body.home { height: 100svh; }
.cover {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding: 0 var(--gutter) 1.5rem;
  display: flex;
  flex-direction: column;
}
.cover h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: min(19vw, 6.75rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-align: center;
  white-space: nowrap;
  color: var(--accent);
}
.cover figure { flex: 1; min-height: 0; margin-top: 0.9rem; }
.cover figure img { width: 100%; height: 100%; object-fit: cover; }

/* musings: title left, entries right */
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.split .head { position: sticky; top: 2rem; }
.entries li { border-top: 1px solid var(--rule); }
.entries li:last-child { border-bottom: 1px solid var(--rule); }
.entries a { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; align-items: baseline; padding: 1.35rem 0; }
.entries .date { font-size: 0.9rem; }
.entries .title { font-family: var(--display); font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; }
.entries a:hover .title { color: var(--accent); }

/* photos: staggered gallery */
.gallery { margin-top: clamp(2rem, 5vw, 3.5rem); columns: 3 15rem; column-gap: 1.25rem; }
.gallery figure { break-inside: avoid; margin-bottom: 1.75rem; }

/* bookshelf: shelves, then lists */
.shelves { margin-top: clamp(2rem, 5vw, 3.5rem); }
.shelf {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 11rem;
  padding: 0 0.75rem;
  margin-bottom: 2.25rem;
  border-bottom: 6px solid var(--deep);
}
.book { background: var(--tile); border-radius: 2px 2px 0 0; }
.book:nth-child(4n+1) { height: 92%; width: 2.2rem; }
.book:nth-child(4n+2) { height: 75%; width: 1.8rem; }
.book:nth-child(4n+3) { height: 84%; width: 2.4rem; background: #D3DEE6; }
.book:nth-child(4n+4) { height: 68%; width: 1.9rem; }
.lists { margin-top: 3.5rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 3rem); }
.lists h2 { font-family: var(--display); font-weight: 400; font-style: italic; font-size: 2rem; line-height: 1; color: var(--accent); margin-bottom: 0.75rem; }
.lists li { border-top: 1px solid var(--rule); padding: 0.6rem 0; }
.lists li span { display: block; font-size: 0.9rem; }

/* philosophy: statement left, picture and caption right */
.phil {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.statement { font-family: var(--display); font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.12; letter-spacing: -0.01em; }
.phil .text p { margin-top: 1.5rem; max-width: 52ch; }

@media (max-width: 860px) {
  .split, .phil { grid-template-columns: 1fr; }
  .split .head { position: static; }
  .entries a { grid-template-columns: 1fr; gap: 0.15rem; }
  .lists { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* single musing page */
.post { max-width: 40rem; margin: 0 auto; }
.back { display: inline-block; margin-bottom: 2.5rem; font-size: 0.92rem; color: var(--accent); border-bottom: 1px solid var(--rule); }
.back:hover { border-bottom-color: var(--accent); }
.post-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.75rem, 7vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  color: var(--accent);
}
.post-lead { margin-top: 1.5rem; font-family: var(--display); font-size: clamp(1.4rem, 2.6vw, 1.85rem); line-height: 1.3; }
.post-figure { margin: 2.5rem 0; }
.post-figure.wide { margin-left: calc(-1 * clamp(0rem, 8vw, 6rem)); margin-right: calc(-1 * clamp(0rem, 8vw, 6rem)); }
.post-body { margin-top: 2.5rem; font-size: 1.15rem; line-height: 1.8; }
.post-body p { margin-bottom: 1.5rem; }
.post-body h2 { font-family: var(--display); font-weight: 400; font-style: italic; font-size: 2rem; line-height: 1.1; color: var(--accent); margin: 3rem 0 1rem; }
.post-body blockquote {
  margin: 2.5rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--accent);
  font-family: var(--display);
  font-size: 1.7rem;
  line-height: 1.25;
}
.post-body a { color: var(--accent); border-bottom: 1px solid var(--rule); }
.post-body a:hover { border-bottom-color: var(--accent); }
.post-end { margin-top: 3.5rem; padding-top: 1rem; border-top: 1px solid var(--accent); font-size: 0.92rem; color: var(--muted); }
.post-nav { margin-top: 2rem; display: flex; justify-content: space-between; gap: 1rem; }
.post-nav a { font-family: var(--display); font-size: 1.4rem; line-height: 1.2; }
.post-nav a:hover { color: var(--accent); }
.post-nav .next { text-align: right; margin-left: auto; }
@media (max-width: 860px) { .post-figure.wide { margin-left: 0; margin-right: 0; } }
