/* ============================================================
   NOUS RESEARCH — design clone
   Monochromatic blue-on-white, monospace, brutalist/academic
   ============================================================ */

:root {
  /* themeable palette — light (default) */
  --nous-blue: #0071a9;        /* primary text / lines / links */
  --nous-blue-dim: #4a9bc4;    /* muted text */
  --bg: #ffffff;               /* page background */
  --code-bg: #eef6fb;          /* code / pre background */
  --focus-bg: #ffffff;         /* skip-link focus background */
  --img-blend: multiply;       /* duotone blend mode for imagery */

  --dash: 1px dashed var(--nous-blue);
  --mono: "Courier Prime", "Courier New", Courier, monospace;
  --display: "Courier Prime", "Courier New", Courier, monospace;
  --maxw: 1180px;
}

/* dark theme — same design, inverted palette */
:root[data-theme="dark"] {
  --nous-blue: #4db8e8;        /* brighter cyan reads well on dark */
  --nous-blue-dim: #6f93a6;
  --bg: #0a0e12;               /* near-black with a cool tint */
  --code-bg: #121a21;
  --focus-bg: #0a0e12;
  --img-blend: screen;         /* screen blends imagery onto dark bg */
}

* { box-sizing: border-box; }

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

body { transition: background-color 0.2s ease, color 0.2s ease; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--nous-blue);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--nous-blue);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip-link:focus { left: 8px; top: 8px; background: var(--focus-bg); padding: 4px 8px; }

/* ---------- Layout shell ---------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Top navigation ---------- */
.site-nav {
  padding: 26px 0 18px;
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0 0 18px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  justify-content: center;
  border-bottom: var(--dash);
}
.site-nav a {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 14px;
}

/* ---------- Content section grid ---------- */
.section {
  display: grid;
  grid-template-columns: 30% 45% 25%;
  gap: 24px;
  padding: 38px 0;
  border-bottom: var(--dash);
  align-items: start;
}
.section:last-of-type { border-bottom: var(--dash); }

.section .col-media { min-height: 10px; }
.section .col-media img {
  width: 100%;
  height: auto;
  /* duotone / cyanotype blueprint treatment */
  filter: grayscale(1) contrast(1.05) brightness(1.05) sepia(1) hue-rotate(160deg) saturate(4);
  mix-blend-mode: var(--img-blend);
}

.section .col-body h2,
.section .col-body .heading {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  letter-spacing: 0.03em;
}
.section .col-body p { margin: 0 0 14px; max-width: 46ch; }

.section .col-meta {
  text-align: left;
  font-size: 13px;
  line-height: 1.4;
}
.section .col-meta .icon {
  margin-top: 14px;
  font-size: 26px;
  line-height: 1;
}

/* ---------- Generic page (single) ---------- */
.page {
  padding: 40px 0 80px;
}
.page-title {
  font-size: 30px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
}
.page-divider {
  border: 0;
  border-top: var(--dash);
  margin: 18px 0 30px;
}
.page-content { max-width: 70ch; }
.page-content h2 { font-size: 18px; text-transform: uppercase; text-decoration: underline; text-underline-offset: 3px; margin-top: 32px; }
.page-content h3 { font-size: 15px; text-transform: uppercase; }
.page-content ul, .page-content ol { padding-left: 22px; }
.page-content code {
  background: var(--code-bg);
  padding: 1px 5px;
  border: 1px dashed var(--nous-blue-dim);
}
.page-content pre {
  background: var(--code-bg);
  border: var(--dash);
  padding: 14px;
  overflow-x: auto;
}
.page-content blockquote {
  border-left: 3px solid var(--nous-blue);
  margin: 18px 0;
  padding-left: 16px;
  color: var(--nous-blue-dim);
}

/* ---------- Blog list ---------- */
.blog-title {
  font-size: 40px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 36px 0 24px;
}
.blog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding-bottom: 70px;
}
.post-card {
  border: var(--dash);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.post-card .card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.post-card .card-title {
  font-weight: 700;
  font-size: 17px;
  text-transform: none;
}
.post-card .card-author {
  font-size: 12px;
  white-space: nowrap;
  color: var(--nous-blue-dim);
}
.post-card .card-excerpt {
  font-size: 14px;
  margin: 0;
  color: var(--nous-blue);
}

/* ---------- Blog single ---------- */
.post-meta {
  font-size: 13px;
  color: var(--nous-blue-dim);
  margin: 0 0 20px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: var(--dash);
  padding: 24px 0 40px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--nous-blue-dim);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .section { grid-template-columns: 1fr; gap: 14px; }
  .section .col-meta { order: 3; }
  .blog-grid { grid-template-columns: 1fr; }
  .site-nav ul { gap: 16px; }
  .blog-title { font-size: 30px; }
  .page-title { font-size: 24px; }
}

/* ---------- Theme toggle ---------- */
.nav-row {
  position: relative;
}
.theme-toggle {
  position: absolute;
  top: -4px;
  right: 0;
  background: transparent;
  border: 1px dashed var(--nous-blue);
  color: var(--nous-blue);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover {
  background: var(--nous-blue);
  color: var(--bg);
}
.theme-toggle .tt-icon { font-size: 13px; }
/* show the right label per theme */
.theme-toggle .tt-dark { display: inline; }
.theme-toggle .tt-light { display: none; }
:root[data-theme="dark"] .theme-toggle .tt-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .tt-light { display: inline; }

@media (max-width: 860px) {
  .theme-toggle {
    position: static;
    margin: 0 auto 14px;
    display: flex;
    width: max-content;
  }
}
