/* ==========================================================================
   Signal & Search — minimal blog stylesheet
   ========================================================================== */

:root {
  --bg:          #fbfaf8;
  --bg-soft:     #f3f1ed;
  --surface:     #ffffff;
  --text:        #1c1b19;
  --text-soft:   #5f5c56;
  --text-faint:  #8d8983;
  --line:        #e4e1db;
  --accent:      #b4451f;
  --accent-soft: #f6e9e3;

  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;

  --wrap: 68rem;
  --radius: 4px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #141412;
    --bg-soft:     #1c1b19;
    --surface:     #1a1917;
    --text:        #ece9e3;
    --text-soft:   #a8a49c;
    --text-faint:  #7b7770;
    --line:        #2e2c28;
    --accent:      #e08055;
    --accent-soft: #2a1f19;
  }
}

:root[data-theme="dark"] {
  --bg:          #141412;
  --bg-soft:     #1c1b19;
  --surface:     #1a1917;
  --text:        #ece9e3;
  --text-soft:   #a8a49c;
  --text-faint:  #7b7770;
  --line:        #2e2c28;
  --accent:      #e08055;
  --accent-soft: #2a1f19;
}

/* --------------------------------------------------------------- base --- */

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: .6rem 1rem;
  z-index: 10;
}
.skip:focus { left: 0; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--text);
  border-radius: 50%;
  font-family: var(--font-sans);
  font-size: .625rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.brand-name {
  font-family: var(--font-sans);
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-family: var(--font-sans);
  font-size: .875rem;
}

.nav a {
  text-decoration: none;
  color: var(--text-soft);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}

.nav a:hover {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.theme-toggle {
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color .18s ease;
}
.theme-toggle:hover { border-color: var(--accent); }

.theme-icon {
  width: .75rem;
  height: .75rem;
  border-radius: 50%;
  background: var(--text);
  box-shadow: inset -3px -2px 0 0 var(--bg);
}

/* --------------------------------------------------------------- hero --- */

.hero {
  padding-block: 6rem 4.5rem;
  max-width: 46rem;
  margin-inline: auto;
}

.eyebrow {
  margin: 0 0 1.5rem;
  font-family: var(--font-sans);
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.hero h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -.025em;
  font-weight: 500;
}

.lede {
  margin: 0 0 2rem;
  font-size: 1.1875rem;
  line-height: 1.75;
  color: var(--text-soft);
  max-width: 38rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .625rem;
  font-family: var(--font-sans);
  font-size: .8125rem;
  color: var(--text-faint);
}
.hero-meta .dot { opacity: .55; }

/* ----------------------------------------------------------- sections --- */

.section-head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

.section-rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* -------------------------------------------------------------- posts --- */

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .875rem;
  margin-bottom: 1rem;
  font-family: var(--font-sans);
  font-size: .75rem;
  color: var(--text-faint);
}

.tag {
  color: var(--accent);
  background: var(--accent-soft);
  padding: .1875rem .5rem;
  border-radius: 100px;
  font-size: .6875rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 600;
}

.read::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
  margin-right: .625rem;
  opacity: .6;
}

.post-title {
  margin: 0 0 .75rem;
  font-size: 1.625rem;
  line-height: 1.22;
  letter-spacing: -.018em;
  font-weight: 500;
}

.post-body p {
  margin: 0 0 1.125rem;
  color: var(--text-soft);
}
.post-body p:last-child { margin-bottom: 0; }

.post-body code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .875em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: .0625rem .3125rem;
  color: var(--text);
}

/* featured ---------------------------------------------------------- */

.featured {
  padding-bottom: 4rem;
  margin-bottom: 4rem;
  border-bottom: 1px solid var(--line);
  max-width: 42rem;
}

.featured .post-title {
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  line-height: 1.14;
  margin-bottom: 1rem;
}

.post-sub {
  margin: 0 0 2rem;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-faint);
  font-style: italic;
}

.featured blockquote {
  margin: 2rem 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--accent);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text);
}

/* grid -------------------------------------------------------------- */

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr));
  gap: 2.5rem;
  padding-bottom: 5rem;
}

.post-grid .post {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  transition: border-color .2s ease, transform .2s ease;
}

.post-grid .post:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  transform: translateY(-2px);
}

.post-grid .post-body p { font-size: 1rem; }

/* ------------------------------------------------------------- topics --- */

.topics { padding-bottom: 5rem; }

.topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.topic-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.125rem .25rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: padding-left .2s ease, color .2s ease;
}

.topic-list a:hover {
  padding-left: 1rem;
  color: var(--accent);
}

.topic-list span { font-size: 1.125rem; }

.topic-list small {
  font-family: var(--font-sans);
  font-size: .75rem;
  color: var(--text-faint);
}

/* -------------------------------------------------------------- about --- */

.about { padding-bottom: 6rem; }

.about-body {
  max-width: 38rem;
  color: var(--text-soft);
}
.about-body p { margin: 0 0 1.25rem; }
.about-body p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------- footer --- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  padding-block: 3rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-sans);
  font-size: .8125rem;
}

.footer-brand {
  margin: 0;
  font-weight: 600;
}

.footer-note {
  margin: 0;
  color: var(--text-faint);
}

.footer-nav {
  display: flex;
  gap: 1.25rem;
}

.footer-nav a {
  text-decoration: none;
  color: var(--text-soft);
  transition: color .18s ease;
}
.footer-nav a:hover { color: var(--accent); }

/* ---------------------------------------------------------- responsive -- */

@media (max-width: 640px) {
  .hero { padding-block: 4rem 3rem; }
  .brand-name { display: none; }
  .nav { gap: 1.25rem; }
  .post-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .post-grid .post { padding: 1.5rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
