/* =============================================================
   jakenherman.com
   ============================================================= */

:root {
  --paper: #f5f4ef;
  --sheet: #fbfaf6;
  --sheet-alt: #f1eee5;
  --ink: #1f2630;
  --ink-soft: #536172;
  --ink-faint: #6f7a88;

  --pbs-navy: #223654;
  --pbs-blue: #365d87;
  --pbs-blue-soft: #4f749d;
  --pbs-green: #5c7756;
  --pbs-amber: #af8b3d;

  --rule: #cfd6df;
  --rule-strong: #b8c3d2;
  --shadow: rgba(24, 36, 52, 0.12);

  --font-serif: 'Bitter', Georgia, serif;
  --font-sans: 'Alegreya Sans', 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

/* ----- Reset ----- */

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

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  color: var(--ink);
  font-family: var(--font-serif);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  background:
    linear-gradient(rgba(184, 195, 210, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184, 195, 210, 0.15) 1px, transparent 1px),
    linear-gradient(180deg, #f7f6f2 0%, #f2f0e9 100%);
  background-size: 24px 24px, 24px 24px, 100% 100%;
}

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

/* ----- Layout ----- */

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.2rem;
}

main {
  max-width: 980px;
  margin: 1rem auto 2.5rem;
  min-height: 60vh;
  padding: 1.8rem 1.4rem 2.8rem;
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  box-shadow: 0 10px 24px var(--shadow);
}

/* ----- Utility Bar ----- */

.utility-bar {
  background: #1b2c45;
  color: #d7e3f4;
  border-bottom: 1px solid #2f4b72;
}

.utility-bar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding: 0.38rem 0;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.utility-bar-inner span + span::before {
  content: '::';
  margin-right: 0.8rem;
  color: #7f95b3;
}

/* ----- Header ----- */

.site-header {
  background: linear-gradient(180deg, #2a4468 0%, #223654 100%);
  color: #edf3fb;
  border-bottom: 3px solid #8ca4c3;
}

.site-header .container {
  padding-top: 1.25rem;
  padding-bottom: 0.8rem;
}

.site-title {
  display: inline-block;
  color: #f7fbff;
  text-decoration: none;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
}

.site-title:hover {
  color: #d5e8ff;
}

.site-tagline {
  margin-top: 0.32rem;
  color: #c6d7ea;
  font-family: var(--font-sans);
  font-size: 0.93rem;
  font-style: italic;
}

/* ----- Nav ----- */

.site-nav {
  margin-top: 0.95rem;
  border-top: 1px solid #3e5f86;
  padding-top: 0.56rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.site-nav a {
  display: inline-block;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #deebf8;
  padding: 0.3rem 0.58rem;
  border: 1px solid #50719a;
  border-radius: 2px;
  background: linear-gradient(180deg, #3f628c 0%, #34547a 100%);
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: #1b2f4c;
  border-color: #d4c08b;
  background: linear-gradient(180deg, #e6d7af 0%, #d2bc84 100%);
}

/* ----- Footer ----- */

.site-footer {
  background: #1f314d;
  color: #d8e4f2;
  border-top: 3px solid #7f98b7;
}

.site-footer .container {
  padding-top: 0.95rem;
  padding-bottom: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.83rem;
}

/* ----- Typography ----- */

h1, h2, h3, h4 {
  color: #213752;
  line-height: 1.28;
  font-weight: 700;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.7rem;
}

h2 {
  font-size: 1.44rem;
  margin-bottom: 0.56rem;
}

h3 {
  font-size: 1.12rem;
  margin-bottom: 0.45rem;
}

p {
  margin-bottom: 1.2rem;
}

a {
  color: #3a6292;
  text-underline-offset: 2px;
}

a:hover {
  color: #23496f;
}

hr.section-rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 1.8rem 0;
}

/* ----- Home Intro ----- */

.home-intro {
  border: 1px solid var(--rule-strong);
  border-left: 4px solid var(--pbs-green);
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7fd 100%);
  padding: 0.85rem 0.95rem;
  color: var(--ink-soft);
}

.home-intro p {
  margin-bottom: 0;
}

.quick-link-note {
  margin-top: 0.7rem;
  margin-bottom: 0;
  font-family: var(--font-sans);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ----- Home About Snapshot ----- */

.home-about {
  border: 1px solid var(--rule-strong);
  border-left: 4px solid var(--pbs-amber);
  background: linear-gradient(180deg, #fffef8 0%, #faf8f0 100%);
  padding: 0.85rem 0.95rem;
  margin-bottom: 1.1rem;
}

.home-about > p {
  color: var(--ink-soft);
  margin-bottom: 0.55rem;
}

.home-about-meta {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
  gap: 0.4rem;
}

.home-about-tag {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #6b5320;
  background: #f2e8d0;
  border: 1px solid #d4bb88;
  padding: 0.18rem 0.4rem;
}

.home-about-footer {
  margin-top: 0.82rem;
}

/* ----- Hot Links ----- */

.home-hot-links {
  margin-bottom: 0;
}

.hot-links-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
  margin-top: 0.7rem;
}

.hot-link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0.72rem;
  background: #fff;
  border: 1px solid var(--rule-strong);
  text-decoration: none;
  color: var(--ink);
}

.hot-link:hover {
  background: #eef5ff;
  border-color: #9eb3cb;
  color: var(--ink);
}

.hot-link-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.hot-link-title {
  font-family: var(--font-sans);
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--pbs-navy);
  line-height: 1.3;
}

/* ----- Post List (Spreadsheet style rows) ----- */

.post-list {
  list-style: none;
  border: 1px solid var(--rule-strong);
  border-bottom: 0;
  background: #fff;
}

.post-list-item {
  display: grid;
  grid-template-columns: 175px 1fr;
  gap: 0.95rem;
  padding: 0.95rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}

.post-list-item:nth-child(even) {
  background: #f8fbff;
}

.post-list-item:hover {
  background: #eef5ff;
}

.post-meta {
  grid-column: 1;
  margin-bottom: 0;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.5;
  padding-top: 0.2rem;
}

.post-list-item .post-title,
.post-list-item .post-excerpt {
  grid-column: 2;
}

.post-list-item .post-title {
  font-size: 1.16rem;
  margin-bottom: 0.24rem;
}

.post-list-item .post-title a {
  color: var(--ink);
  text-decoration: none;
}

.post-list-item .post-title a:hover {
  color: #24466c;
  text-decoration: underline;
}

.post-excerpt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.56;
}

/* Home page: show only the 3 most recent posts */
.home-post-list .post-list-item:nth-child(n + 4) {
  display: none;
}

.all-posts-link {
  display: inline-block;
  margin-top: 1.15rem;
  padding: 0.28rem 0.45rem;
  border: 1px solid var(--rule-strong);
  background: #f1f5fb;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: #375a84;
}

.all-posts-link:hover {
  color: #203f62;
  border-color: #9eb3cb;
}

/* ----- Shared page blocks ----- */

.blog-header,
.about-content {
  max-width: 74ch;
}

.blog-intro {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-style: italic;
}

.about-content h1 {
  padding-bottom: 0.62rem;
  border-bottom: 1px solid var(--rule);
}

.about-links {
  list-style: none;
  border: 1px solid var(--rule-strong);
  border-bottom: 0;
  margin-top: 0.45rem;
}

.about-links li {
  border-bottom: 1px solid var(--rule);
  padding: 0.45rem 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  background: #f9fbff;
}

.about-links li:nth-child(even) {
  background: #f2f6fc;
}

/* ----- Resume timeline ----- */

.resume-page {
  max-width: 860px;
  margin: 0 auto;
}

.resume-header {
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--rule-strong);
  border-left: 4px solid var(--pbs-blue);
  background: linear-gradient(180deg, #f8fbff 0%, #edf4fd 100%);
}

.resume-intro {
  margin-bottom: 0.55rem;
  color: var(--ink-soft);
  max-width: 70ch;
}

.resume-source {
  margin-bottom: 0;
  color: var(--ink-faint);
  font-family: var(--font-sans);
  font-size: 0.93rem;
}

.resume-source a {
  font-weight: 600;
}

.resume-timeline {
  position: relative;
  margin-top: 1.45rem;
}

.resume-timeline::before {
  content: '';
  position: absolute;
  top: 0.2rem;
  bottom: 0.2rem;
  left: 6.72rem;
  width: 2px;
  background: linear-gradient(180deg, #90a6c2 0%, #7392b7 100%);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1.15rem;
  align-items: start;
  margin-bottom: 1.15rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 6.46rem;
  top: 0.9rem;
  width: 0.66rem;
  height: 0.66rem;
  border-radius: 50%;
  background: #eff5fd;
  border: 2px solid #4f749d;
  z-index: 1;
}

.timeline-marker {
  justify-self: start;
  margin-top: 0.58rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #4f6176;
  border: 1px solid var(--rule-strong);
  background: #f1f5fb;
  padding: 0.22rem 0.48rem;
}

.timeline-card {
  background: #fff;
  border: 1px solid var(--rule-strong);
  border-left: 4px solid #4f749d;
  padding: 0.82rem 0.92rem 0.72rem;
  box-shadow: 0 3px 10px rgba(34, 54, 84, 0.08);
}

.timeline-card h2 {
  margin-bottom: 0.36rem;
  font-size: 1.16rem;
}

.timeline-card p {
  margin-bottom: 0.52rem;
  color: var(--ink-soft);
}

.timeline-card ul {
  margin: 0 0 0.1rem 1.1rem;
}

.timeline-card li {
  margin-bottom: 0.22rem;
  color: #2e4158;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  line-height: 1.46;
}

/* ----- Generic post styles (if used) ----- */

.post {
  max-width: 720px;
}

.post-header {
  margin-bottom: 1.9rem;
  padding-bottom: 1.05rem;
  border-bottom: 1px solid var(--rule);
}

.back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-faint);
}

.back-link::before {
  content: '\2190\00a0';
}

.back-link:hover {
  color: #24466c;
}

.post-content {
  max-width: 70ch;
}

.post-content p {
  margin-bottom: 1.3rem;
}

.post-content h2 {
  margin-top: 1.9rem;
  margin-bottom: 0.7rem;
}

.post-content h3 {
  margin-top: 1.35rem;
  margin-bottom: 0.44rem;
}

.post-content ul,
.post-content ol {
  margin: 0 0 1.3rem 1.35rem;
}

.post-content li {
  margin-bottom: 0.32rem;
}

.post-content blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 0.95rem;
  border-left: 3px solid var(--pbs-amber);
  color: var(--ink-soft);
  font-style: italic;
}

.post-content blockquote p {
  margin-bottom: 0;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.83em;
  background: #edf2f8;
  border: 1px solid #d0dae7;
  padding: 0.08em 0.3em;
}

.post-content pre {
  margin-bottom: 1.3rem;
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  background: #1e3048;
  color: #e8f1ff;
  border: 1px solid #375475;
  border-left: 4px solid #88a5c7;
}

.post-content pre code {
  background: none;
  border: 0;
  padding: 0;
}

/* ----- Open Science page ----- */

.open-science-page {
  max-width: 920px;
}

.open-science-intro-block {
  border: 1px solid var(--rule-strong);
  border-left: 4px solid var(--pbs-green);
  background: linear-gradient(180deg, #f6fbf5 0%, #eef7ec 100%);
  padding: 0.85rem 0.95rem;
  margin-bottom: 1.4rem;
}

.open-science-intro-block p {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.open-science-section {
  margin-bottom: 1.6rem;
}

.open-science-section h2 {
  font-size: 1.18rem;
  color: var(--pbs-navy);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.38rem;
  margin-bottom: 0.75rem;
}

.open-science-section p {
  color: var(--ink-soft);
  max-width: 74ch;
}

.principles-list {
  list-style: none;
  border: 1px solid var(--rule-strong);
  border-bottom: 0;
  max-width: 74ch;
}

.principles-list li {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-sans);
  font-size: 0.96rem;
  background: #f9fbff;
  color: var(--ink-soft);
}

.principles-list li:nth-child(even) {
  background: #f2f6fc;
}

/* Projects grid */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
  margin-top: 0.75rem;
}

.project-card {
  background: #fff;
  border: 1px solid var(--rule-strong);
  border-top: 3px solid var(--pbs-blue);
  padding: 0.82rem 0.9rem 0.75rem;
  display: flex;
  flex-direction: column;
}

.project-card-name {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--pbs-navy);
  margin-bottom: 0.45rem;
}

.project-card-desc {
  font-family: var(--font-sans);
  font-size: 0.91rem;
  color: var(--ink-soft);
  line-height: 1.52;
  flex: 1;
  margin-bottom: 0;
}

.project-card-team {
  margin-top: 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.project-card-team a {
  color: var(--ink-soft);
}

.project-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--rule);
}

.project-card-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.22rem 0.44rem;
  border: 1px solid var(--rule-strong);
  background: #f1f5fb;
  color: #375a84;
}

.project-card-link:hover {
  background: #e0ecff;
  border-color: #9eb3cb;
  color: #203f62;
}

/* Principles grid */

.principles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
  margin-top: 0.65rem;
  max-width: 74ch;
}

.principle-item {
  background: #fff;
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--pbs-green);
  padding: 0.65rem 0.78rem;
}

.principle-term {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--pbs-navy);
  margin-bottom: 0.28rem;
}

.principle-desc {
  font-family: var(--font-sans);
  font-size: 0.91rem;
  color: var(--ink-soft);
  line-height: 1.46;
}

/* ----- Responsive ----- */

@media (max-width: 760px) {
  html { font-size: 16px; }

  main {
    margin-top: 0.7rem;
    padding: 1.35rem 0.95rem 2rem;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  .site-nav a {
    padding: 0.3rem 0.48rem;
  }

  .post-list-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .resume-header {
    padding: 0.75rem 0.8rem;
  }

  .resume-timeline {
    margin-top: 1.1rem;
  }

  .resume-timeline::before {
    left: 0.52rem;
    top: 0.4rem;
    bottom: 0.4rem;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.42rem;
    padding-left: 1.45rem;
    margin-bottom: 1rem;
  }

  .timeline-item::before {
    left: 0.2rem;
    top: 0.64rem;
  }

  .timeline-marker {
    margin-top: 0;
    width: fit-content;
  }

  .post-meta,
  .post-list-item .post-title,
  .post-list-item .post-excerpt {
    grid-column: 1;
  }

  .site-footer .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .utility-bar-inner {
    gap: 0.35rem;
  }

  .utility-bar-inner span + span::before {
    margin-right: 0.35rem;
  }

  .hot-links-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .principles-grid {
    grid-template-columns: 1fr;
  }
}
