/* Shared styles for blog pages. Matches the main site's Apple-inspired system. */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --ink: #1d1d1f;
  --ink-secondary: #6e6e73;
  --hairline: #d2d2d7;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-swift: cubic-bezier(0.32, 0.72, 0, 1);
  --nav-h: 52px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Switzer', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.47059;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(0, 113, 227, 0.18); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: calc(var(--nav-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.nav-inner {
  max-width: 1024px;
  margin: 0 auto;
  height: var(--nav-h);
  padding-left: max(22px, env(safe-area-inset-left));
  padding-right: max(22px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.nav-name:hover { text-decoration: none; }
.nav-links { display: flex; gap: 24px; }
.nav-links a {
  font-size: 12px;
  color: rgba(29, 29, 31, 0.8);
  display: inline-flex;
  align-items: center;
  min-height: var(--nav-h);
  padding: 0 4px;
  margin: 0 -4px;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + env(safe-area-inset-top) + clamp(56px, 9vh, 110px)) max(22px, env(safe-area-inset-left)) clamp(72px, 11vh, 130px) max(22px, env(safe-area-inset-right));
  animation: fadeUp 0.8s var(--ease-swift);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .page { animation: none; }
}

.post-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-secondary);
}
.post-head h1 {
  font-size: clamp(34px, 5.6vw, 54px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 14px 0 0;
  text-wrap: balance;
}
.post-head { margin-bottom: 44px; padding-bottom: 34px; border-bottom: 1px solid var(--hairline); }

.post-body { font-size: 18px; line-height: 1.6; letter-spacing: -0.012em; }
.post-body > * + * { margin-top: 1.15em; }
.post-body h2 {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-top: 1.9em;
}
.post-body h3 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.018em;
  margin-top: 1.7em;
}
.post-body strong { font-weight: 600; }
.post-body ul, .post-body ol { padding-left: 1.3em; }
.post-body li + li { margin-top: 0.45em; }
.post-body blockquote {
  border-left: 3px solid var(--blue);
  padding: 4px 0 4px 22px;
  color: var(--ink-secondary);
  font-size: 19px;
}
.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 18px;
  display: block;
  margin: 2em auto;
}
.post-body code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.88em;
  background: var(--bg-alt);
  padding: 2px 7px;
  border-radius: 6px;
}
.post-body pre {
  background: var(--bg-alt);
  border-radius: 14px;
  padding: 20px 24px;
  overflow-x: auto;
}
.post-body pre code { background: none; padding: 0; }
.post-body hr { border: none; border-top: 1px solid var(--hairline); margin: 2.4em 0; }

.post-foot {
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  padding: 12px 0;
  margin: -12px 0;
}
.back-link::before { content: '‹'; font-size: 17px; }
.back-link:hover { text-decoration: none; }
.post-foot .meta { font-size: 13px; color: var(--ink-secondary); }

/* Blog index listing */
.index-head { margin-bottom: 52px; }
.index-head h1 {
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 600;
  letter-spacing: -0.027em;
  line-height: 1.05;
}
.index-head h1 .muted { color: var(--ink-secondary); }
.index-head p { margin-top: 16px; font-size: 18px; color: var(--ink-secondary); }
.post-list { border-top: 1px solid var(--hairline); }
.post-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
  position: relative;
  z-index: 0;
}
.post-row:hover { text-decoration: none; }
.post-row::before {
  content: '';
  position: absolute;
  inset: 4px -16px;
  border-radius: 14px;
  background: var(--bg-alt);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.25s var(--ease);
}
.post-row:hover::before, .post-row:active::before { opacity: 1; }
.post-row .t {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.35;
  transition: color 0.25s var(--ease);
}
.post-row:hover .t { color: var(--blue); }
.post-row .d { font-size: 14px; color: var(--ink-secondary); white-space: nowrap; }
.post-row .x {
  font-size: 15px;
  color: var(--ink-secondary);
  margin-top: 6px;
  font-weight: 400;
  letter-spacing: -0.008em;
}
@media (max-width: 600px) {
  .post-row { flex-direction: column; gap: 6px; }
}
