/* ===================================
   CSS Custom Properties (tokens)
   =================================== */
:root {
  --color-bg:         #F8F7F4;
  --color-bg-alt:     #F1EFE9;
  --color-text:       #252422;
  --color-muted:      #7A7570;
  --color-accent:     #3D6B8F;
  --color-border:     #E0DDD7;

  --font-display:     'Libre Baskerville', Georgia, serif;
  --font-body:        'Inter', system-ui, -apple-system, sans-serif;

  --max-width:        720px;
  --section-padding:  5rem;
}


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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}


/* ===================================
   Shared layout
   =================================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
}


/* ===================================
   Header & Navigation
   =================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-bg);
  border-bottom: 1px solid transparent;
  padding: 0 1.5rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
  border-color: var(--color-border);
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.06);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  color: var(--color-text);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2.25rem;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  position: relative;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1.5px;
  background-color: var(--color-accent);
  transition: width 0.25s ease;
}

.nav-links a:hover {
  color: var(--color-text);
}

.nav-links a:hover::after {
  width: 100%;
}

/* Mobile hamburger button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 30px;
  height: 30px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background-color: var(--color-text);
  transform-origin: center;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}


/* ===================================
   Hero
   =================================== */
.hero {
  padding: 6rem 1.5rem 5rem;
  border-bottom: 1px solid var(--color-border);
}

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.875rem;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--color-text);
  margin-bottom: 0;
}

/* The signature element: a short coloured rule beneath the name */
.hero-name::after {
  content: '';
  display: block;
  width: 2.75rem;
  height: 3px;
  background-color: var(--color-accent);
  margin-top: 1rem;
  margin-bottom: 1.25rem;
}

.hero-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.125rem;
  color: var(--color-muted);
  max-width: 420px;
}


/* ===================================
   Sections (shared)
   =================================== */
.section {
  padding: var(--section-padding) 1.5rem;
}

.section--alt {
  background-color: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text);
  margin-bottom: 1.75rem;
}

.section-intro {
  font-size: 0.9375rem;
  color: var(--color-muted);
  max-width: 560px;
  margin-bottom: 2rem;
}


/* ===================================
   About
   =================================== */
.about-content p {
  max-width: 600px;
  color: var(--color-text);
  margin-bottom: 1em;
}

.about-content p:last-child {
  margin-bottom: 0;
}


/* ===================================
   Interests
   =================================== */
.interests-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 3.5rem;
}

.interest-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.375rem;
}

.interest-item p {
  font-size: 0.9375rem;
  color: var(--color-muted);
  line-height: 1.65;
}


/* ===================================
   Writing / Posts list
   =================================== */
.posts-list {
  list-style: none;
  border-top: 1px solid var(--color-border);
}

.post-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--color-border);
}

.post-title {
  text-decoration: none;
  font-size: 0.9375rem;
  color: var(--color-text);
  transition: color 0.2s ease;
}

.post-title:hover {
  color: var(--color-accent);
}

.post-date {
  font-size: 0.775rem;
  color: var(--color-muted);
  white-space: nowrap;
  flex-shrink: 0;
}


/* ===================================
   Contact
   =================================== */
#contact .container > p {
  color: var(--color-muted);
}

#contact a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.2s ease;
}

#contact a:hover {
  text-decoration-color: var(--color-accent);
}


/* ===================================
   Footer
   =================================== */
.site-footer {
  padding: 2.25rem 1.5rem;
  border-top: 1px solid var(--color-border);
}

.site-footer p {
  font-size: 0.8rem;
  color: var(--color-muted);
  text-align: center;
}


/* ===================================
   Responsive — mobile
   =================================== */
@media (max-width: 640px) {
  :root {
    --section-padding: 3.5rem;
  }

  /* Show hamburger, hide link row */
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 1.25rem;
    background-color: var(--color-bg);
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 0.9375rem;
  }

  /* Hero */
  .hero {
    padding: 4rem 1.5rem 3rem;
  }

  /* Interests: single column on mobile */
  .interests-list {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  /* Posts: stack title above date */
  .post-item {
    flex-direction: column;
    gap: 0.25rem;
  }
}


/* ===================================
   Reduced motion
   =================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
