/* ---------- design tokens ---------- */
:root {
  --bg: #f5ede4;
  --bg-soft: #ece2d4;
  --bg-dark: #0a0a0a;
  --bg-dark-soft: #1a1a1a;
  --fg: #0f0f0f;
  --fg-muted: #5a5a5a;
  --fg-on-dark: #fafafa;
  --fg-muted-on-dark: #9a9a9a;
  --accent: #3b6cf6;
  --accent-soft: rgba(59, 108, 246, 0.12);
  --border: rgba(0, 0, 0, 0.08);
  --border-on-dark: rgba(255, 255, 255, 0.1);
  --card: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.18);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --container: 1240px;
  --measure: 68ch;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ---------- layout primitives ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: clamp(1.25rem, 4vw, 3rem);
  padding-right: clamp(1.25rem, 4vw, 3rem);
}
.section { padding: clamp(4rem, 10vw, 8rem) 0; }
.section--dark { background: var(--bg-dark); color: var(--fg-on-dark); }
.section--dark a { color: #93b3ff; }

/* ---------- typography helpers ---------- */
.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.display {
  font-size: clamp(2.75rem, 8vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 0;
}
.display--mega {
  font-size: clamp(3.5rem, 11vw, 9rem);
  line-height: 0.92;
}
.display .accent { color: var(--accent); }
.h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 1rem;
}
.lead {
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: 56ch;
}
.section--dark .lead { color: var(--fg-muted-on-dark); }

/* ---------- pill chip ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--card);
  color: var(--fg);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.pill--plain::before { display: none; }
.pill--accent { color: var(--accent); }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 237, 228, 0.85);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--fg);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand__logo { height: 36px; width: auto; }
.brand__text { font-size: 1rem; }
.site-nav { display: flex; gap: 1.75rem; align-items: center; }
.site-nav a {
  color: var(--fg);
  font-weight: 500;
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--accent); text-decoration: none; }
.site-nav .nav-cta {
  background: var(--bg-dark);
  color: #fff;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
}
.site-nav .nav-cta:hover { background: var(--accent); color: #fff; }
@media (max-width: 720px) {
  .site-nav { gap: 1rem; }
  .site-nav .nav-link-mobile-hide { display: none; }
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 3rem 0 2.5rem;
  margin-top: 4rem;
  color: var(--fg-muted);
  font-size: 0.9rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  align-items: center;
  justify-content: space-between;
}
.site-footer .brand { color: var(--fg); }
.site-footer .footer-links { display: flex; gap: 1.5rem; }
.site-footer a { color: var(--fg); }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding-top: clamp(3rem, 8vw, 6rem);
  padding-bottom: clamp(3rem, 8vw, 6rem);
}
.hero__copy > * + * { margin-top: 1.5rem; }
.hero__copy .display { margin-top: 1.25rem; }
.hero__copy p { font-size: clamp(1rem, 1.3vw, 1.1875rem); line-height: 1.6; color: var(--fg-muted); max-width: 56ch; }
.hero__copy strong { color: var(--fg); font-weight: 600; }
.hero__brand-row {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.hero__brand-row .pill { background: #fff; }
.hero__brand-row .arrow { color: var(--accent); font-weight: 700; }

.photo-card {
  position: relative;
  background: #fff;
  padding: 14px 14px 14px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: rotate(2deg);
  transition: transform 0.4s ease;
  max-width: 520px;
  margin-left: auto;
}
.photo-card:hover { transform: rotate(0deg); }
.photo-card img {
  border-radius: calc(var(--radius-lg) - 6px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.photo-card__badge {
  position: absolute;
  bottom: 28px;
  left: 28px;
  background: rgba(10, 10, 10, 0.85);
  color: #fff;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.photo-card__badge strong { display: block; font-weight: 600; font-size: 0.95rem; }
.photo-card__badge span { font-size: 0.78rem; color: rgba(255, 255, 255, 0.7); }

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .photo-card { transform: rotate(0); margin: 0 auto; max-width: 440px; }
}

/* ---------- timeline ---------- */
.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-top: 2.5rem;
  border-top: 1px solid var(--border-on-dark);
}
.timeline__item .year {
  font-size: clamp(2.5rem, 4.5vw, 3.5rem);
  line-height: 1;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.timeline__item .label { font-weight: 600; color: var(--fg-on-dark); margin-bottom: 0.5rem; }
.timeline__item .desc { color: var(--fg-muted-on-dark); font-size: 0.95rem; line-height: 1.5; }
@media (max-width: 880px) { .timeline { grid-template-columns: repeat(2, 1fr); gap: 2.5rem; } }
@media (max-width: 480px) { .timeline { grid-template-columns: 1fr; } }

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border-on-dark);
}
.stats__item .number {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.stats__item .number sup { font-size: 0.5em; color: var(--accent); margin-left: 0.1em; vertical-align: super; }
.stats__item .label { color: var(--fg-muted-on-dark); font-size: 0.95rem; }
@media (max-width: 880px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- recent posts (homepage) ---------- */
.posts-section__head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.post-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 1.5rem 1.5rem 1.75rem;
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  color: var(--fg);
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.post-card .date {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
  font-weight: 600;
}
.post-card .title {
  font-size: 1.25rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  color: var(--fg);
}
.post-card .excerpt {
  color: var(--fg-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card .read-more {
  margin-top: 1.25rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}
@media (max-width: 880px) { .posts-grid { grid-template-columns: 1fr; } }

.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--fg);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}
.cta-link:hover { text-decoration: none; color: var(--accent); }
.cta-link::after { content: "→"; transition: transform 0.2s; }
.cta-link:hover::after { transform: translateX(4px); }

/* ---------- blog index (full archive) ---------- */
.archive-hero { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem); }
.archive-hero .display { margin-top: 1.25rem; }
.archive-year {
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--border);
}
.archive-year__label {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--fg);
  margin: 0 0 1.25rem;
  line-height: 1;
}
.archive-list { list-style: none; padding: 0; margin: 0; }
.archive-list li { border-bottom: 1px solid var(--border); }
.archive-list li:last-child { border-bottom: none; }
.archive-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.25rem 0;
  color: var(--fg);
}
.archive-row:hover { text-decoration: none; }
.archive-row:hover .archive-row__title { color: var(--accent); }
.archive-row__date {
  font-size: 0.85rem;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.archive-row__title {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}
@media (max-width: 600px) {
  .archive-row { grid-template-columns: 1fr; gap: 0.4rem; padding: 1rem 0; }
}

/* ---------- post page ---------- */
.post-back {
  padding: 1.5rem 0 0.5rem;
}
.post-back a {
  color: var(--fg-muted);
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.post-back a:hover { color: var(--accent); text-decoration: none; }

.post-hero {
  padding: 1.5rem 0 clamp(2rem, 5vw, 3.5rem);
  max-width: 820px;
  margin: 0 auto;
}
.post-hero .meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.post-hero .title {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0;
}

.post-body {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.125rem;
  line-height: 1.75;
  color: #1a1a1a;
}
.post-body > * + * { margin-top: 1.25em; }
.post-body h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-top: 2.5em;
  margin-bottom: 0.75em;
}
.post-body h3 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 2em;
  margin-bottom: 0.5em;
}
.post-body p { margin: 1.25em 0; }
.post-body ul, .post-body ol { padding-left: 1.5em; margin: 1.25em 0; }
.post-body li { margin: 0.5em 0; }
.post-body img,
.post-body figure {
  border-radius: var(--radius-md);
  margin: 2em auto;
  box-shadow: var(--shadow-md);
}
.post-body figure img { box-shadow: none; margin: 0; border-radius: var(--radius-md); }
.post-body figure figcaption { text-align: center; font-size: 0.9rem; color: var(--fg-muted); margin-top: 0.75rem; }
.post-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5em 0;
  padding: 0.5em 1.25em;
  color: var(--fg-muted);
  font-style: italic;
}
.post-body code {
  background: rgba(0,0,0,0.05);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.92em;
}
.post-body pre {
  overflow-x: auto;
  padding: 1.25rem;
  background: #1a1a1a;
  color: #f8f8f8;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.5;
}
.post-body pre code { background: transparent; padding: 0; color: inherit; }
.post-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.post-body iframe { max-width: 100%; border-radius: var(--radius-md); }

.post-footer {
  max-width: 720px;
  margin: clamp(3rem, 6vw, 5rem) auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------- generic page (about/podcast/etc.) wrap fallback ---------- */
.page-body {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) 0;
  font-size: 1.0625rem;
  line-height: 1.7;
}
.page-body h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0 0 1.5rem;
}
.page-body h2 { margin-top: 2em; font-weight: 700; }
.page-body img { border-radius: var(--radius-md); margin: 1.5em auto; }
