:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --ink: #111318;
  --muted: #5a5f69;
  --faint: #8a9099;
  --line: #e7e9ee;
  --line-2: #d8dbe2;
  --accent: #0b7d94;
  --accent-soft: #e8f6fa;
  --pixel: #20d5f9;
  --sans: "Helvetica World", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(17, 19, 24, .04), 0 8px 24px rgba(17, 19, 24, .05);
  --radius: 14px;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
  z-index: 100;
}
.skip:focus { left: 8px; }

.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.wrap-article { width: min(1080px, calc(100% - 40px)); margin: 0 auto; }

.kicker {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}

header.site {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 20px;
}
.site-inner .logo img { height: 26px; width: auto; }
.nav-links {
  display: flex;
  gap: 26px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.nav-links a:hover,
.nav-links a.is-active { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 16px; }
.nav-cta .login { font-size: 14px; font-weight: 500; color: var(--muted); }
.nav-cta .login:hover { color: var(--ink); }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-2);
  color: var(--ink);
  width: 40px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
}
.btn-solid { background: var(--ink); color: #fff !important; }
.btn-solid:hover { background: #000; color: #fff !important; }
.btn-line { background: #fff; color: var(--ink) !important; border-color: var(--line-2); }
.btn-line:hover { border-color: var(--ink); color: var(--ink) !important; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }

.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--faint);
}
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--ink); }
.crumb span { color: var(--faint); }
.crumb [aria-current="page"] { color: var(--ink); }

.page-hero {
  padding: 28px 0 4px;
}
.page-hero h1 {
  margin: 8px 0 8px;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -.04em;
  line-height: 1.12;
  font-weight: 650;
}
.page-hero .lede {
  margin: 0;
  max-width: 560px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
}

.blog-featured {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 0;
  align-items: stretch;
  margin: 24px auto 36px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  box-shadow: var(--shadow);
}
.blog-featured a.media {
  display: block;
  height: 100%;
  overflow: hidden;
  background: var(--bg-soft);
  min-height: 280px;
}
.blog-featured img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.blog-featured .copy {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
}
.blog-featured h2 {
  margin: 0;
  font-size: clamp(22px, 2.5vw, 30px);
  letter-spacing: -.03em;
  line-height: 1.2;
  font-weight: 650;
}
.blog-featured h2 a:hover { color: var(--accent); }
.blog-featured .excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-featured .read-more {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 650;
  color: var(--accent);
}
.blog-featured .read-more:hover { color: #075e72; }

.cat {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.meta img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}
.meta .dot { color: var(--faint); }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin: 0 0 40px;
}
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 100%;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.blog-card:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.blog-card .media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-soft);
  overflow: hidden;
}
.blog-card .media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.blog-card .media .cat {
  position: absolute;
  top: 12px;
  left: 12px;
}
.blog-card .body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 16px 18px;
  flex: 1;
}
.blog-card h2,
.blog-card h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -.02em;
  line-height: 1.3;
  font-weight: 650;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.blog-card h2 a:hover,
.blog-card h3 a:hover { color: var(--accent); }
.blog-card .meta { margin-top: auto; }

.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
}
.pager a,
.pager span {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.pager a { border: 1px solid var(--line); }
.pager a:hover { border-color: var(--ink); color: var(--ink); }
.pager a.is-current,
.pager [aria-current="page"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.pager .ellipsis { border: 0; color: var(--faint); }

.end-band {
  margin-top: 48px;
  padding: 40px 0 8px;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
}
.cta-band {
  margin: 0;
  padding: 28px 0 48px;
  background: var(--bg-soft);
  border: 0;
  border-radius: 0;
}
.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 32px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.cta-band h2 {
  margin: 6px 0 8px;
  font-size: 24px;
  letter-spacing: -.03em;
}
.cta-band p { margin: 0; color: var(--muted); font-size: 15px; }
.cta-actions { display: flex; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }

article.post { padding: 28px 0 8px; }
.post-head { max-width: 760px; }
.post-head h1 {
  margin: 10px 0 14px;
  font-size: clamp(28px, 4.2vw, 44px);
  letter-spacing: -.038em;
  line-height: 1.15;
  font-weight: 650;
  overflow-wrap: break-word;
}
.post-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}
.share {
  display: flex;
  align-items: center;
  gap: 8px;
}
.share a,
.share button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.share a:hover,
.share button:hover { color: var(--ink); border-color: var(--ink); }
.share svg { width: 15px; height: 15px; fill: currentColor; }

.post-hero {
  margin: 0 0 32px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.post-hero img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  aspect-ratio: 2 / 1;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 40px;
  align-items: start;
}
.content-main { min-width: 0; }
.toc-sidebar {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.toc,
.toc-promo {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}
.toc h2,
.toc-promo h2 {
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 650;
}
.toc ul { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow: auto; }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}
.toc a:hover,
.toc a.is-active { color: var(--accent); }
.toc .is-h3 { padding-left: 12px; }
.toc-promo p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.toc-promo p b { color: var(--ink); }

.post-content {
  font-size: 17.5px;
  line-height: 1.75;
  color: #1c1f27;
}
.post-content > *:first-child { margin-top: 0; }
.post-content p { margin: 0 0 1.15em; }
.post-content ul,
.post-content ol {
  margin: 0 0 1.2em;
  padding-left: 1.3em;
}
.post-content li { margin: 0 0 .4em; }
.post-content h2 {
  margin: 2em 0 .7em;
  font-size: 1.55rem;
  letter-spacing: -.03em;
  line-height: 1.25;
  font-weight: 650;
  color: var(--ink);
}
.post-content h3 {
  margin: 1.6em 0 .5em;
  font-size: 1.2rem;
  letter-spacing: -.02em;
  line-height: 1.3;
  font-weight: 650;
  color: var(--ink);
}
.post-content h4 {
  margin: 1.3em 0 .4em;
  font-size: 1.05rem;
  font-weight: 650;
}
.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.post-content a:hover { color: #075e72; }
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 1.2em 0;
}
.post-content blockquote {
  margin: 1.4em 0;
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--pixel);
  color: var(--muted);
}
.post-content pre,
.post-content code {
  font-family: var(--mono);
  background: var(--bg-soft);
  border-radius: 6px;
}
.post-content code { padding: .12em .35em; font-size: .9em; }
.post-content pre { padding: 14px; overflow-x: auto; }
.post-content hr,
.post-content .content-break {
  width: 100%;
  height: 1px;
  border: 0;
  background: var(--line);
  margin: 22px 0;
}
.post-content .blog-cta {
  margin: 1.1rem 0 1.5rem;
  font-size: 1.02em;
  color: var(--ink);
}
.post-content iframe {
  max-width: 100%;
  border: 0;
  border-radius: 10px;
}

.table-responsive {
  display: block;
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 1.4rem 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: #c1c1c1 #f5f5f5;
  scrollbar-width: thin;
}
.table-responsive::-webkit-scrollbar,
.table-top-scroll-wrapper::-webkit-scrollbar {
  height: 10px;
  background: #f5f5f5;
}
.table-responsive::-webkit-scrollbar-thumb,
.table-top-scroll-wrapper::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}
.table-top-scroll-wrapper {
  display: block;
  width: 100%;
  overflow-x: auto;
  height: 12px;
  border: 1px solid var(--line);
  border-bottom: none;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  background: #f9fafb;
  visibility: hidden;
  scrollbar-color: #c1c1c1 #f5f5f5;
  scrollbar-width: thin;
}
.table-top-scroll-wrapper.has-scroll { visibility: visible; }
.table-top-scroll-content { height: 1px; }
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: .95rem;
}
.post-content table th,
.post-content table td {
  padding: 12px 14px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.post-content table th {
  background: var(--bg-soft);
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
}
.post-content table tr:nth-child(even) { background: #fafbfc; }

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 36px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.post-tags .tag {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink);
}

.related {
  margin: 0 0 8px;
  padding-top: 0;
}
.related h2 {
  margin: 0 0 18px;
  font-size: 22px;
  letter-spacing: -.03em;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.related-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  min-height: 100%;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.related-card:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  color: inherit;
}
.related-card .media {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--bg-soft);
  overflow: hidden;
}
.related-card img { width: 100%; height: 100%; object-fit: cover; }
.related-card .body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 16px;
  flex: 1;
}
.related-card .card-title {
  margin: 0;
  font-size: 15px;
  letter-spacing: -.02em;
  line-height: 1.35;
  font-weight: 650;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.related-card:hover .card-title { color: var(--accent); }
.related-card time { margin-top: auto; font-size: 12px; color: var(--faint); }

.empty {
  padding: 48px 0 80px;
  text-align: center;
  color: var(--muted);
}
.empty h1 { color: var(--ink); }

footer.site-foot {
  border-top: 1px solid var(--line);
  padding: 48px 0 28px;
  color: var(--muted);
  background: var(--bg-soft);
}
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
footer.site-foot h3 {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}
footer.site-foot ul { list-style: none; padding: 0; margin: 0; }
footer.site-foot li { margin: 0 0 8px; font-size: 14px; }
footer.site-foot a { color: var(--muted); }
footer.site-foot a:hover { color: var(--ink); }
.foot-logo { height: 26px; width: auto; }
.legal { margin-top: 28px; font-size: 12px; color: var(--faint); }

@media (max-width: 800px) {
  .blog-featured { grid-template-columns: 1fr; }
  .blog-featured a.media { min-height: 0; aspect-ratio: 16 / 10; }
  .blog-featured .copy { padding: 20px 18px 22px; }
  .content-layout { grid-template-columns: 1fr; }
  .toc-sidebar { position: static; order: -1; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
  .blog-grid,
  .related-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 16px 20px 20px;
    gap: 14px;
    z-index: 30;
  }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-cta .login { display: none; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .page-hero { padding-top: 28px; }
  .post-hero img { aspect-ratio: 16 / 10; }
}

@media (max-width: 560px) {
  .wrap, .wrap-article { width: calc(100% - 32px); }
  .blog-grid,
  .related-grid,
  .foot-grid { grid-template-columns: 1fr; }
  .post-content { font-size: 16.5px; }
  .cta-inner { padding: 22px 18px; }
  .cta-band { padding: 16px 0 0; }
  .end-band { padding: 28px 0 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blog-card { transition: none; }
}
