/* =========================================
   Variables
========================================= */
:root {
  --bg: #ffffff;
  --text: #0a0a0a;
  --muted: #666666;
  --link: #1a3d7c;
  --accent: #dce6f8;

  --font: "Inter", "Helvetica Neue", Helvetica, "Segoe UI", Roboto, Arial, sans-serif;

  --max-width: 720px;
  /* content pages */
  --home-max-width: 650px;
  /* homepage */
  --gutter: 24px;

  --name-underline-speed: 0.4s;
  --post-underline-speed: 0.6s;
  /* slower for post titles in list */
  --back-underline-speed: 0.5s;
  /* blog back-link */
}


/* =========================================
   Base
========================================= */
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.7;
}

.content-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  box-sizing: border-box;
}


/* =========================================
   Links
========================================= */
a {
  color: var(--link);
  text-decoration: none;
  position: relative;
}

a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
  /* baseline like index */
}

a:hover::after {
  transform: scaleX(1);
}


/* =========================================
   Header
========================================= */
.site-header {
  width: 100%;
  padding: 24px 0 20px;
  position: relative;
  box-sizing: border-box;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

/* Name, thin and sharp, no underline */
.site-header__link {
  color: var(--text);
  font-size: 1.8rem;
  font-weight: 300;
  letter-spacing: 0.01em;
  transition: color 0.25s ease;
}

.site-header__link:hover {
  color: var(--link);
}

/* Full width divider under header on all non-home pages */
body:not(.home) .site-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  opacity: 0.6;
  z-index: 1;
}


/* =========================================
   Unified non-home spacing and dash
========================================= */
body:not(.home) main {
  margin: 10vh auto 10vh;
  display: flex;
  flex-direction: column;
  gap: 36px;
  position: relative;
  padding-top: 0;
}

/* short light blue dash just below header divider */
body:not(.home) main::before {
  content: "";
  position: absolute;
  top: -3vh;
  left: 0;
  width: 60px;
  height: 1.5px;
  background: var(--accent);
  border-radius: 2px;
  opacity: 0.6;
  z-index: 2;
}


/* =========================================
   Blog list
========================================= */
.posts__intro {
  display: grid;
  gap: 12px;
  max-width: 68ch;
}

.posts__title {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.1;
}

.posts__lede {
  margin: 0;
  font-size: 1.05rem;
  color: rgba(10, 10, 10, 0.75);
}

.posts__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(10, 10, 10, 0.08);
}

.posts__item {
  display: flex;
  gap: 24px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid rgba(10, 10, 10, 0.08);
}

.posts__date {
  font-size: 0.9rem;
  color: var(--muted);
  min-width: 88px;
}

.posts__link {
  flex: 1;
  font-weight: 600;
  color: var(--link);
}

/* Slower underline only for titles in the list */
.posts__list .posts__link::after {
  transition: transform var(--post-underline-speed) ease;
}


/* =========================================
   Blog post
========================================= */
.post__article {
  display: flex;
  flex-direction: column;
}

.post__header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 48px;
}

.post__title {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1.2;
}

.post__meta {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.post__lede {
  margin: 0;
  font-size: 1.1rem;
  max-width: 68ch;
  color: var(--text);
}

.post__body {
  display: grid;
  gap: 5px;
  max-width: 68ch;
}

/* Headings inside posts */
.post__body h2 {
  margin-top: 36px;
  margin-bottom: 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Quote */
.post__quote {
  margin: 0;
  padding: 18px 24px;
  border-left: 3px solid var(--link);
  background: var(--accent);
  border-radius: 6px;
  font-style: italic;
}

/* Blog back-to-list link (kept) */
.post__footer {
  margin-top: 60px;
}

.post__back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--link);
  position: relative;
  transition: transform 0.25s ease, color 0.25s ease;
}

.post__back-link::before {
  content: "\2190";
  display: inline-block;
  transform: translateY(-1px);
  transition: transform 0.25s ease;
}

.post__back-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--back-underline-speed) ease;
}

.post__back-link:hover {
  color: var(--text);
  transform: translateX(-2px);
}

.post__back-link:hover::before {
  transform: translate(-3px, -1px);
}

.post__back-link:hover::after {
  transform: scaleX(1);
}

/* ============ Acknowledgements section ============ */
.post__acknowledgements {
  margin-top: 48px;
  padding-top: 24px;
  max-width: 68ch;
}

.post__acknowledgements p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
  font-style: italic;
}

.post__acknowledgements a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.post__acknowledgements a:hover {
  color: var(--link);
}

/* =========================================
   Post images
========================================= */
.post__figure {
  margin: 28px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.post__figure img {
  max-width: 100%;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.post__figure figcaption {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  max-width: 68ch;
  line-height: 1.4;
}


/* ===== Clean, minimalist Back Arrow ===== */
.page-footer {
  margin-top: 80px;
  /* adds breathing room above */
  margin-bottom: 80px;
  /* extra white space below */
  text-align: left;
}

.page-footer .content-container {
  padding-top: 0;
  /* remove any inherited padding */
}

.back-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--link);
  font-weight: 500;
  font-size: 1rem;
  position: relative;
  transition: color 0.25s ease, transform 0.25s ease;
}

.back-arrow::before {
  content: "\2190";
  font-size: 1.1rem;
  transform: translateY(-1px);
  transition: transform 0.25s ease;
}

.back-arrow::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.back-arrow:hover {
  color: var(--text);
  transform: translateX(-2px);
}

.back-arrow:hover::before {
  transform: translate(-3px, -1px);
}

.back-arrow:hover::after {
  transform: scaleX(1);
}


/* =========================================
   Courses
========================================= */
.courses__intro {
  display: grid;
  gap: 12px;
  max-width: 68ch;
}

.courses__title {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.1;
}

.courses__lede {
  margin: 0;
  font-size: 1.05rem;
  color: rgba(10, 10, 10, 0.75);
}

.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.cats__link {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid rgba(10, 10, 10, 0.10);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.cats__link::after {
  display: none;
}

.cats__link:hover {
  background: var(--accent);
  border-color: rgba(10, 10, 10, 0.15);
}

.cat-block {
  scroll-margin-top: 96px;
}

.cat-title {
  margin: 0 0 8px;
  font-size: 1.4rem;
  font-weight: 600;
}

.courses__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(10, 10, 10, 0.08);
}

.courses__item {
  border-bottom: 1px solid rgba(10, 10, 10, 0.08);
  padding: 18px 0;
}

/* Names look like text, not links */
.courses__name {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  cursor: default;
}

.courses__name:hover {
  color: var(--text);
}

.courses__name::after {
  display: none;
}

.courses__desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 68ch;
}


/* =========================================
   Experience
========================================= */
.experience__intro {
  display: grid;
  gap: 12px;
  max-width: 68ch;
}

.experience__title {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.1;
}

.experience__lede {
  margin: 0;
  font-size: 1.05rem;
  color: rgba(10, 10, 10, 0.75);
}

.experience__list {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.experience__item {
  border-bottom: 1px solid rgba(10, 10, 10, 0.08);
  padding-bottom: 20px;
}

.experience__role {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.experience__meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.experience__text {
  margin: 0;
  font-size: 1rem;
  max-width: 68ch;
  line-height: 1.65;
  color: var(--text);
}


/* =========================================
   Projects
========================================= */
.projects__intro {
  display: grid;
  gap: 12px;
  max-width: 68ch;
}

.projects__title {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.1;
}

.projects__lede {
  margin: 0;
  font-size: 1.05rem;
  color: rgba(10, 10, 10, 0.75);
}

.projects__list {
  display: flex;
  flex-direction: column;
  gap: 32px;
  border-top: 1px solid rgba(10, 10, 10, 0.08);
}

.project {
  border-bottom: 1px solid rgba(10, 10, 10, 0.08);
  padding-bottom: 20px;
}

.project__name {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 600;
}

.project__meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.project__desc {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
}

.project__links {
  margin: 0;
  font-size: 0.95rem;
  color: var(--link);
}

.project__links a {
  color: var(--link);
  position: relative;
}

.project__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.project__links a:hover::after {
  transform: scaleX(1);
}


/* =========================================
   Home
========================================= */
body.home main {
  max-width: var(--home-max-width);
  margin: 25vh auto 15vh;
  padding: 0 24px;
}

body.home p {
  margin-bottom: 24px;
}

body.home .contact {
  margin-top: 32px;
  font-size: 0.95rem;
}

body.home footer {
  margin-top: 48px;
  color: var(--muted);
  font-size: 14px;
  text-align: left;
}


/* =========================================
   Mobile
========================================= */
@media (max-width: 600px) {
  .content-container {
    padding: 0 16px;
  }

  .site-header {
    padding: 16px 0 14px;
  }

  .site-header__link {
    font-size: 1.5rem;
  }

  body:not(.home) main {
    margin: 12vh auto 8vh;
    gap: 32px;
  }

  body:not(.home) main::before {
    top: -4vh;
  }

  .posts__title,
  .courses__title,
  .experience__title,
  .projects__title {
    font-size: 1.9rem;
  }

  .post__title {
    font-size: 2rem;
  }
}