:root {
  --ink: #193049;
  --muted: #607286;
  --paper: #fdfbf6;
  --sand: #f0eadc;
  --leaf: #597562;
  --line: #dfd8c9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

.site-header, main, footer { max-width: 1080px; margin: 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; }

.site-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.back-link { color: var(--ink); font-weight: 700; text-decoration: none; }
.back-link:hover { color: var(--leaf); }
.course-label, .eyebrow, .thought-date { color: var(--leaf); font-size: .73rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.hero { max-width: 720px; padding: 7rem 0 5rem; }
.hero .eyebrow { margin: 0 0 .7rem; }
h1, h2, h3 { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; line-height: 1.08; }
h1 { margin: 0; font-size: clamp(3.25rem, 9vw, 6.5rem); letter-spacing: -.04em; }
.hero > p:last-child { max-width: 590px; margin: 1.4rem 0 0; color: var(--muted); font-size: clamp(1rem, 2vw, 1.2rem); }

.thought-archive { border-top: 1px solid var(--line); padding: 2.6rem 0 5rem; }
h2 { margin: 0; font-size: 2rem; }
.search-label { display: block; width: min(360px, 100%); margin: 0 0 2rem; color: var(--muted); font-size: .85rem; font-weight: 600; }
input {
  display: block;
  width: 100%;
  margin-top: .35rem;
  padding: .7rem .85rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
}
input:focus { outline: 3px solid #b8cdbb; outline-offset: 2px; }

.thoughts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.thoughts:has(.thought-card:only-child) { grid-template-columns: minmax(0, 720px); }
.thought-card { min-height: 210px; overflow: hidden; padding: 1.7rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 22px rgba(26, 45, 56, .04); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.thought-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(26, 45, 56, .1); }
.thought-card:focus-visible { outline: 3px solid #8faf94; outline-offset: 3px; }
.thought-card:has(.thought-image) { padding-top: 0; }
.thought-image { display: block; width: calc(100% + 3.4rem); height: 210px; margin: 0 -1.7rem 1.7rem; object-fit: cover; }
.thought-date { margin: 0 0 .75rem; }
h3 { margin: 0; font-size: 1.7rem; }
h3 a { color: inherit; text-decoration-color: #a2b5a2; text-decoration-thickness: 1px; text-underline-offset: .16em; }
h3 a:hover { color: var(--leaf); }
.thought-author { margin: .35rem 0 0; color: var(--muted); font-size: .95rem; font-weight: 600; }
.thought-body a { color: inherit; text-decoration-color: #8faf94; text-decoration-thickness: 1px; text-underline-offset: .16em; }
.thought-body a:hover { color: var(--leaf); }
blockquote { margin: 1rem 0; padding: .15rem 0 .15rem 1rem; color: var(--ink); border-left: 2px solid #a2b5a2; font-family: "DM Serif Display", Georgia, serif; font-size: 1.25rem; line-height: 1.35; }
.note { margin: 1rem 0 0; color: var(--muted); }
.thought-body { margin-top: 1rem; }
.thought-body p { margin: 0 0 .9rem; color: var(--muted); }
.thought-body p:last-child { margin-bottom: 0; }
.user-bold { font-size: 1.075em; font-weight: 700; }
.empty-state { margin-top: 1rem; padding: 3.5rem 1.5rem; text-align: center; background: var(--sand); border-radius: 8px; }
.empty-state .eyebrow { margin: 0 0 .5rem; }
.empty-state p:last-child { margin: .85rem 0 0; color: var(--muted); }
footer { padding-top: 2rem; padding-bottom: 2rem; color: var(--muted); border-top: 1px solid var(--line); font-size: .85rem; }

.thought-reader { width: 100vw; max-width: none; height: 100vh; max-height: none; overflow: hidden; padding: 0; color: var(--ink); background: var(--paper); border: 0; }
body:has(.thought-reader[open]) { overflow: hidden; }
.thought-reader::backdrop { background: rgba(25, 48, 73, .45); }
.reader-close { position: fixed; top: 1.25rem; right: 1.5rem; z-index: 2; display: inline-flex; align-items: center; gap: .5rem; padding: .65rem .8rem; color: var(--ink); background: rgba(253, 251, 246, .9); border: 1px solid var(--line); border-radius: 999px; font: 600 .8rem Inter, sans-serif; cursor: pointer; backdrop-filter: blur(6px); }
.reader-close:hover { background: #fff; }
.reader-close:focus-visible { outline: 3px solid #8faf94; outline-offset: 3px; }
.reader-close span { font-size: 1.3rem; font-weight: 400; line-height: .7; }
.reader-content { height: 100%; }
.reader-thought { width: 100%; height: 100vh; margin: 0 auto; padding: clamp(1rem, 4vh, 4rem) clamp(1.25rem, 6vw, 8rem); display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(1.5rem, 2.5vw, 5rem); }
.reader-thought .thought-image { width: 100%; height: 86vh; margin: 0; border-radius: 10px; object-fit: cover; }
.reader-copy { width: 100%; min-width: 0; max-height: 90vh; display: flex; flex-direction: column; justify-content: center; }
.reader-copy .thought-date { margin-bottom: .7rem; font-size: clamp(.85rem, .9vw, 1.25rem); }
.reader-thought h3 { max-width: 100%; font-size: clamp(2rem, 3.25vw, 6.5rem); letter-spacing: -.035em; }
.reader-thought blockquote { max-width: 100%; margin: clamp(.8rem, 1.8vh, 1.75rem) 0; padding-left: clamp(.85rem, 1.1vw, 1.5rem); font-size: clamp(1.5rem, 2.1vw, 3.2rem); line-height: 1.28; }
.reader-thought .thought-body { max-width: 100%; margin-top: clamp(.8rem, 1.7vh, 1.6rem); font-size: clamp(1.05rem, 1.4vw, 2.25rem); line-height: 1.38; }
.reader-thought .thought-body p { margin-bottom: clamp(.45rem, 1vh, .8rem); }
.source-note { margin: .4rem 0 0; color: var(--muted); font-size: .8rem; }
.reader-thought .source-note { font-size: clamp(.85rem, .9vw, 1.25rem); }
.reader-thought .thought-author { margin-top: clamp(.45rem, .7vh, .8rem); font-size: clamp(1rem, 1.05vw, 1.55rem); }

@media (max-width: 640px) {
  .site-header { min-height: 64px; }
  .course-label { display: none; }
  .hero { padding: 4.5rem 0 3.5rem; }
  .thoughts { grid-template-columns: 1fr; }
  .reader-close { top: .75rem; right: .75rem; }
  .reader-thought { grid-template-columns: 1fr; grid-template-rows: 23vh 1fr; gap: 1rem; padding: 3.5rem 1.25rem 1.25rem; }
  .reader-thought .thought-image { height: 23vh; }
  .reader-copy { max-height: none; justify-content: start; }
  .reader-thought h3 { font-size: clamp(1.35rem, 6vw, 2rem); }
  .reader-thought blockquote { font-size: clamp(1rem, 4vw, 1.3rem); }
  .reader-thought .thought-body { font-size: clamp(.78rem, 3.1vw, .92rem); }
}
