/* === ET Book self-hosted === */
@font-face {
  font-family: "et-book";
  src: url("fonts/et-book-roman-line-figures/et-book-roman-line-figures.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "et-book";
  src: url("fonts/et-book-roman-old-style-figures/et-book-roman-old-style-figures.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* semi-bold */
@font-face {
  font-family: "et-book";
  src: url("fonts/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* bold */
@font-face {
  font-family: "et-book";
  src: url("fonts/et-book-bold-line-figures/et-book-bold-line-figures.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* italic */
@font-face {
  font-family: "et-book";
  src: url("fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.woff") format("woff");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ========== Base Typography ========== */
html,
body {
  font-family: "et-book", Palatino, "Palatino Linotype", "Palatino LT STD",
               "Book Antiqua", Georgia, serif;
  font-size: 16px;
  line-height: 1.45;
  /* Slightly bolder overall text for improved readability */
  font-weight: 600;
  color: #111;
  background: #fafff7;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ========== Layout ========== */
.layout {
  display: flex;
  align-items: flex-start;
  gap: 2.4rem;
  margin-top: 6rem;
  margin-left: 8vw;
  max-width: 900px;
}

/* ========== Page-specific adjustments ========== */
/* Make pages that use <main class="writing"> look like the home page layout */
.writing {
  max-width: 540px; /* match main on home */
  margin-top: 6rem;
  margin-left: 8vw;
}

/* Subtitle immediately under the site name */
.site-subtitle {
  margin-top: 0;
  margin-bottom: 0.6rem;
  font-style: italic;
  color: #555;
  font-weight: 800;
  font-size: 1.1rem;
}

/* Top header navigation (used by some pages) — style to match sidebar nav links */
header nav {
  display: block;
  margin-left: 8vw;
  margin-top: 0.6rem;
}

header nav a {
  margin-right: 1rem;
  text-transform: none;
  font-weight: 1000;
  color: #5f5f5f;
  font-size: 15px;
  text-decoration: none;
  position: relative;
  transition: color 0.2s ease-in-out;
}

header nav a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0%;
  height: 1px;
  background-color: currentColor;
  transition: width 0.25s ease-in-out;
}

header nav a:hover {
  color: #2e3a7d;
}

header nav a:hover::after {
  width: 100%;
}

/* ========== Nav ========== */
nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

nav li {
  margin-bottom: 0.001rem;
}

/* Smooth underline and color transition */
nav a {
  position: relative;
  font-weight: 1000;
  color: #5a5a5a;
  font-size: 15px;
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

nav a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0%;
  height: 1px;
  background-color: currentColor;
  transition: width 0.25s ease-in-out;
}

nav a:hover {
  color: #2e3a7d;
}

nav a:hover::after {
  width: 100%;
}

/* ========== Main Content ========== */
main {
  max-width: 540px;
}

h1 {
  /* headings should remain distinct but a bit bolder */
  font-weight: 400;
  margin-top: 0;
  margin-bottom: 0.2rem;
}

/* Specific styling for the site name */
.site-name {
  font-weight: 600;
}

p {
  margin-top: 0;
  margin-bottom: 1.1rem;
}

/* ========== Inline Links with Highlight Animation ========== */
/* ========== Inline Links with Highlight Animation ========== */
main a {
  position: relative;
  color: #111;
  text-decoration: none;
  font-weight: 500;
  padding: 0 2px;
  transition: color 0.2s ease-in-out;
  z-index: 0; /* creates stacking context for ::before */
}

main a::before {
  content: "";
  position: absolute;
  inset: 0; /* shorthand for top:0; right:0; bottom:0; left:0 */
  width: 0;
  background: rgba(184, 193, 255, 0.45); /* soft yellow highlighter */
  z-index: -1; /* sits behind text */
  transition: width 0.35s ease-in-out;
  border-radius: 3px;
}

main a:hover::before {
  width: 100%;
}

main a:hover {
  color: #000; /* slight contrast */
}

/* ========== Responsive (Mobile) ========== */
@media (max-width: 700px) {
  .layout {
    flex-direction: column;
    margin: 3rem 2rem;
    gap: 1.5rem;
  }

  nav ul {
    display: flex;
    gap: 1.0rem;
  }

  nav li {
    margin-bottom: 0;
  }

  nav a {
    font-size: 15px;
  }

  main {
    margin-left: 0;
    max-width: 100%;
  }
}

/* ========== Social Icons (Footer) ========== */
.site-footer {
  margin-top: 1.6rem;
}

.socials {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.6rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111;
  text-decoration: none;
  padding: 6px;
  border-radius: 8px;
  transition: transform 180ms ease, color 180ms ease, box-shadow 180ms ease;
  will-change: transform;
  position: relative; /* for the highlight pseudo-element */
  z-index: 0;
}

.social-link svg {
  display: block;
  width: 22px;
  height: 22px;
}

.social-link img {
  display: block;
  width: 22px;
  height: 22px;
}

/* Highlight-style animated background similar to inline link highlighter */
.social-link::before {
  content: "";
  position: absolute;
  inset: 0; /* top:0; right:0; bottom:0; left:0 */
  background: var(--social-bg, rgba(184, 193, 255, 0.18));
  border-radius: inherit;
  z-index: -1; /* sit behind the icon */
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 320ms cubic-bezier(.2,.9,.2,1);
}

.social-link:hover::before,
.social-link:focus::before,
.social-link:focus-visible::before {
  transform: scaleX(1);
}

/* Per-network highlight color overrides */
.social-link.social-x {
  --social-bg: rgba(29, 161, 242, 0.12);
}

.social-link:hover,
.social-link:focus {
  transform: translateY(-3px) scale(1.06);
  color: #2e3a7d; /* subtle indigo on hover */
  box-shadow: 0 8px 20px rgba(46, 58, 125, 0.12);
  outline: none;
}

.social-link:focus-visible {
  box-shadow: 0 0 0 4px rgba(70, 85, 158, 0.12);
}

/* Use a distinct color for X (formerly Twitter) on hover */
.social-link.social-x:hover,
.social-link.social-x:focus {
  color: #1DA1F2;
}

@media (max-width: 420px) {
  .socials {
    gap: 0.5rem;
  }
  .social-link svg {
    width: 20px;
    height: 20px;
  }
}


pre {
  background: #f5f5f5;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1rem 0;
}

code {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 14px;
}

p code,
li code {
  background: #f5f5f5;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}