/* =========================================
   DESIGN TOKENS
   ========================================= */
:root {
  --font-heading: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --text-xs: 0.8125rem;
  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 2.75rem;
  --text-4xl: 3.5rem;

  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  --max-width: 42rem;
  --max-width-wide: 64rem;
  --nav-height: 3.5rem;

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

/* Light theme */
[data-theme="light"] {
  --bg-primary: #FAF9F6;
  --bg-secondary: #F0EFEC;
  --bg-elevated: #FFFFFF;
  --text-primary: #1A1A1A;
  --text-secondary: #5C5C5C;
  --text-tertiary: #8A8A8A;
  --accent: #B45A2B;
  --accent-hover: #964A22;
  --accent-subtle: rgba(180, 90, 43, 0.08);
  --border: #E2E0DC;
  --border-subtle: #ECEAE6;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --lang-is: #2E6B4F;
  --lang-en: #4A6FA5;

  /* Hero gradient — warm amber wash */
  --hero-bg: linear-gradient(
    165deg,
    #FAF9F6 0%,
    #F5EDE4 35%,
    #EDE0D0 60%,
    #F5EDE4 80%,
    #FAF9F6 100%
  );
  --hero-glow: radial-gradient(
    ellipse 80% 60% at 70% 30%,
    rgba(180, 90, 43, 0.06) 0%,
    transparent 70%
  );
}

/* Dark theme */
[data-theme="dark"] {
  --bg-primary: #161618;
  --bg-secondary: #1E1E21;
  --bg-elevated: #252528;
  --text-primary: #E8E6E1;
  --text-secondary: #A3A09A;
  --text-tertiary: #6E6B66;
  --accent: #D4845A;
  --accent-hover: #E09A74;
  --accent-subtle: rgba(212, 132, 90, 0.1);
  --border: #2E2E32;
  --border-subtle: #232326;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.3);
  --lang-is: #5DB88A;
  --lang-en: #7BA3D4;

  /* Hero gradient — warm glow on dark (stronger) */
  --hero-bg: linear-gradient(
    165deg,
    #161618 0%,
    #261D15 30%,
    #2E2318 55%,
    #261D15 75%,
    #161618 100%
  );
  --hero-glow: radial-gradient(
    ellipse 80% 60% at 70% 30%,
    rgba(212, 132, 90, 0.14) 0%,
    transparent 70%
  );
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
}

/* =========================================
   NAVIGATION
   ========================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

@supports (backdrop-filter: blur(12px)) {
  .nav {
    background-color: color-mix(in srgb, var(--bg-primary) 85%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: opacity 300ms ease, transform 300ms ease, color var(--transition-fast);
}

/* On homepage, logo starts hidden and slides in when masthead scrolls away */
body.is-home .nav-logo {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

body.is-home.nav-logo-visible .nav-logo {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-logo:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color var(--transition-fast);
}

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

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xs);
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: var(--space-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color var(--transition-fast), background-color var(--transition-fast);
  width: 2rem;
  height: 2rem;
}

.theme-toggle:hover {
  color: var(--text-primary);
  background-color: var(--bg-secondary);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }

.nav-sep {
  width: 1px;
  height: 1rem;
  background: var(--border-subtle);
}

/* Hamburger button - hidden on desktop */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  transition: color var(--transition-fast);
}

.nav-hamburger:hover {
  color: var(--text-primary);
}

/* Hamburger animation */
.nav-hamburger svg line {
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

.nav-hamburger[aria-expanded="true"] .hamburger-top {
  transform: translateY(6px) rotate(45deg);
}

.nav-hamburger[aria-expanded="true"] .hamburger-mid {
  opacity: 0;
}

.nav-hamburger[aria-expanded="true"] .hamburger-bot {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile nav */
@media (max-width: 640px) {
  .nav-hamburger {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    padding: var(--space-md) var(--space-lg) var(--space-xl);
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

  @supports (backdrop-filter: blur(12px)) {
    .nav-links {
      background-color: color-mix(in srgb, var(--bg-primary) 95%, transparent);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }
  }

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

  /* Main nav items take full width = one per row, centered */
  .nav-links li {
    flex-basis: 100%;
    text-align: center;
  }

  .nav-links li a,
  .nav-links li button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0;
    font-size: var(--text-base);
  }

  /* Separator spans full width to force a row break */
  .nav-sep {
    flex-basis: 100%;
    height: 1px;
    width: 3rem;
    margin: var(--space-sm) auto;
    background: var(--border-subtle);
  }

  .nav-links li:has(.nav-icon) {
    display: none;
  }

  /* Lang + dark mode share a row */
  .nav-links li:has(.lang-toggle),
  .nav-links li:has(.theme-toggle) {
    flex-basis: auto;
  }

  .nav-links li:has(.lang-toggle) {
    margin-right: var(--space-lg);
  }
}

.nav-links a.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.1em;
  padding: 0.15rem 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text-tertiary);
  border-radius: 4px;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav-links a.lang-toggle:hover {
  color: var(--text-primary);
  background-color: var(--bg-secondary);
}

.lang-toggle-sep {
  color: var(--text-tertiary);
}

.lang-toggle-active {
  color: var(--text-primary);
  font-weight: 600;
}

/* =========================================
   LAYOUT
   ========================================= */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* =========================================
   MASTHEAD
   ========================================= */
.masthead {
  padding: var(--space-2xl) var(--space-lg) var(--space-xl);
  max-width: var(--max-width);
  margin: 0 auto;
}

.masthead-name {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  line-height: var(--leading-tight);
}

.masthead-tagline {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
  max-width: 60ch;
}

/* =========================================
   HERO / FEATURED
   ========================================= */
.hero-wrapper {
  background: var(--hero-bg);
  position: relative;
  overflow: hidden;
  transition: background var(--transition-normal);
}

.hero-wrapper--has-image .hero-bg-image {
  position: absolute;
  inset: 0;
  background: var(--hero-image) center / cover no-repeat;
  opacity: 0.08;
  filter: saturate(0.3);
  pointer-events: none;
}

[data-theme="dark"] .hero-wrapper--has-image .hero-bg-image {
  opacity: 0.12;
  filter: saturate(0.4);
}

.hero-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hero-glow);
  pointer-events: none;
}

/* Subtle noise texture for depth */
.hero-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.3;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

.hero {
  position: relative;
  z-index: 1;
  padding: var(--space-2xl) var(--space-lg) var(--space-3xl);
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 500;
  line-height: var(--leading-tight);
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  max-width: 20ch;
}

.hero-title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

.hero-excerpt {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  max-width: 50ch;
  margin-bottom: var(--space-lg);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.hero-meta time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.hero-read-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  margin-top: var(--space-lg);
  transition: gap var(--transition-fast), color var(--transition-fast);
}

.hero-read-link:hover {
  gap: 0.7em;
  color: var(--accent-hover);
}

.hero-read-link svg {
  width: 16px;
  height: 16px;
}

/* =========================================
   LANGUAGE TAGS
   ========================================= */
.lang-tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  display: inline-block;
}

.lang-tag--is {
  color: var(--lang-is);
  background: rgba(46, 107, 79, 0.1);
}

[data-theme="dark"] .lang-tag--is {
  background: rgba(93, 184, 138, 0.12);
}

.lang-tag--en {
  color: var(--lang-en);
  background: rgba(74, 111, 165, 0.1);
}

[data-theme="dark"] .lang-tag--en {
  background: rgba(123, 163, 212, 0.12);
}

/* =========================================
   POST LIST
   ========================================= */
.section-header {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-lg);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.section-link {
  font-size: var(--text-sm);
  font-weight: 500;
}

.post-list {
  list-style: none;
}

.post-item {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: border-color var(--transition-normal);
}

.post-item:last-child {
  border-bottom: none;
}

.post-item-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: var(--leading-snug);
  letter-spacing: -0.015em;
  margin-bottom: var(--space-sm);
}

.post-item-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

.post-item-excerpt {
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-sm);
  max-width: 60ch;
}

.post-item-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.post-item-meta time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

/* Post with image — side-by-side layout */
.post-item--has-image {
  display: grid;
  grid-template-columns: 1fr 10rem;
  gap: var(--space-lg);
  align-items: start;
}

.post-item-image {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 4px;
  margin-top: var(--space-xs);
  background: var(--bg-secondary);
  transition: background-color var(--transition-normal);
}

/* Placeholder for posts with images but no actual file yet */
.post-item-image-placeholder {
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 4px;
  margin-top: var(--space-xs);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-normal);
}

.post-item-image-placeholder svg {
  width: 24px;
  height: 24px;
  color: var(--text-tertiary);
  opacity: 0.4;
}

@media (max-width: 640px) {
  .post-item--has-image {
    grid-template-columns: 1fr 6rem;
    gap: var(--space-md);
  }
}

/* =========================================
   ABOUT PAGE
   ========================================= */
.about-intro {
  display: flex;
  gap: var(--space-xl);
  align-items: flex-start;
  margin-bottom: var(--space-xl);
}

.about-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.about-intro p:first-child {
  margin-top: 0;
}

.timeline {
  position: relative;
  padding-left: 7rem;
  margin: var(--space-xl) 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5.5rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-xl);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-year {
  position: absolute;
  left: -7rem;
  top: 0;
  width: 5rem;
  text-align: right;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  font-weight: 600;
  padding-top: 0.15em;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.65rem;
  top: 0.45rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-content h3 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 500;
  margin: 0 0 var(--space-xs);
  color: var(--text-primary);
}

.timeline-content p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.about-photo-download {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.about-footnote {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  font-style: italic;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}

.about-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.about-photo-thumb {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  transition: opacity var(--transition-fast);
}

.about-photo-thumb:hover {
  opacity: 0.85;
}

.about-photo-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.about-photos-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
}

.about-blurbs {
  margin-top: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.about-blurb {
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-elevated);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.article-body .about-blurb h3 {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-top: 0;
  margin: 0 0 var(--space-xs);
}

.about-blurb p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

.about-download-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.about-download-link:hover {
  color: var(--accent);
}

/* =========================================
   SUBSCRIBE BANNER
   ========================================= */
.subscribe-banner {
  margin: var(--space-2xl) 0;
  padding: var(--space-xl);
  background: var(--bg-secondary);
  border-radius: 8px;
  transition: background-color var(--transition-normal);
}

.subscribe-banner h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 500;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.01em;
}

.subscribe-banner p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-lg);
  max-width: 45ch;
}

.subscribe-form {
  display: flex;
  gap: var(--space-sm);
  max-width: 28rem;
}

.subscribe-input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.subscribe-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.subscribe-input::placeholder {
  color: var(--text-tertiary);
}

.subscribe-btn {
  padding: 0.6rem 1.2rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: white;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
  white-space: nowrap;
}

.subscribe-btn:hover {
  background: var(--accent-hover);
}

/* =========================================
   SEARCH
   ========================================= */
.search-form {
  display: flex;
  gap: var(--space-sm);
  max-width: 32rem;
  margin-bottom: var(--space-xl);
}

.search-input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-btn {
  padding: 0.6rem 1.2rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: white;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
  white-space: nowrap;
}

.search-btn:hover {
  background: var(--accent-hover);
}

.search-meta {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-lg);
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
  padding: var(--space-2xl) 0 var(--space-xl);
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--space-2xl);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-xl);
}

.footer-bio {
  max-width: 44ch;
}

.footer-name {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-xs);
  letter-spacing: -0.01em;
}

.footer-bio p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

.footer-copyright {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-sm);
}

.footer-icons {
  display: flex;
  gap: var(--space-md);
  align-self: center;
}

.footer-icon {
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
}

.footer-icon:hover {
  color: var(--text-primary);
}

.footer-icon svg {
  width: 20px;
  height: 20px;
}

/* =========================================
   DOT SEPARATOR
   ========================================= */
.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-tertiary);
  display: inline-block;
}

/* =========================================
   LANGUAGE FILTER
   ========================================= */
.lang-filter {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.lang-filter-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-filter-btn:hover {
  border-color: var(--text-tertiary);
  color: var(--text-secondary);
}

.lang-filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 640px) {
  .masthead-name {
    font-size: var(--text-2xl);
  }

  .hero-title {
    font-size: var(--text-3xl);
  }

  .hero-excerpt {
    font-size: var(--text-base);
  }

  .subscribe-form {
    flex-direction: column;
  }

  .footer-inner {
    flex-direction: column;
  }

}

/* =========================================
   ARTICLE / POST PAGE
   ========================================= */
.article-header {
  padding: var(--space-3xl) var(--space-lg) var(--space-xl);
  max-width: var(--max-width);
  margin: 0 auto;
}

.article-title {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 500;
  line-height: var(--leading-tight);
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.article-meta time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

/* Hero image for articles that have one */
.article-hero {
  max-width: var(--max-width-wide);
  margin: 0 auto var(--space-2xl);
  padding: 0 var(--space-lg);
}

.article-hero img {
  width: 100%;
  border-radius: 6px;
  aspect-ratio: 21 / 9;
  object-fit: cover;
}

/* Article body — the core reading experience */
.article-body {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-3xl);
}

.article-body > * + * {
  margin-top: 1.5em;
}

.article-body h2 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-top: 2.5em;
  margin-bottom: 0.5em;
  line-height: var(--leading-tight);
}

.article-body h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-top: 2em;
  margin-bottom: 0.4em;
  line-height: var(--leading-snug);
}

.article-body p {
  line-height: var(--leading-relaxed);
}

.article-body a {
  text-decoration: underline;
  text-decoration-color: var(--accent-subtle);
  text-underline-offset: 2px;
  transition: text-decoration-color var(--transition-fast), color var(--transition-fast);
}

.article-body a:hover {
  text-decoration-color: var(--accent);
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: var(--space-lg);
  margin-left: 0;
  color: var(--text-secondary);
  font-style: italic;
}

.article-body img {
  max-width: 100%;
  border-radius: 4px;
  height: auto;
}

.article-body pre {
  background: var(--bg-secondary);
  border-radius: 6px;
  padding: var(--space-lg);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-secondary);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.article-body pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

.article-body ul,
.article-body ol {
  padding-left: 1.5em;
}

.article-body li + li {
  margin-top: 0.4em;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 2.5em 0;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.article-body th,
.article-body td {
  padding: 0.5em 0.75em;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.article-body th {
  font-weight: 600;
  color: var(--text-primary);
}

.article-body .footnote {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Post footer with tags and navigation */
.article-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-2xl);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
}

.article-tag {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.article-tag:hover {
  color: var(--text-secondary);
  border-color: var(--text-tertiary);
}

/* Subscribe CTA at end of posts */
.post-subscribe {
  margin-top: var(--space-2xl);
  padding: var(--space-xl);
  background: var(--bg-secondary);
  border-radius: 8px;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 640px) {
  .article-title {
    font-size: var(--text-3xl);
  }

  .article-hero img {
    border-radius: 0;
    aspect-ratio: 16 / 9;
  }

  .article-header {
    padding-top: var(--space-2xl);
  }

  .about-intro {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .about-photo {
    width: 120px;
    height: 120px;
  }

  .timeline {
    padding-left: 4.5rem;
  }

  .timeline::before {
    left: 3rem;
  }

  .timeline-year {
    left: -4.5rem;
    width: 2.5rem;
  }

  .timeline-item::before {
    left: -1.65rem;
  }
}
