* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
}

html {
  background: var(--page-bg);
}

body {
  background: var(--page-bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  transition: background-color 180ms ease, color 180ms ease;
}

.blog-home {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

a {
  color: var(--accent-text);
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

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

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid var(--border);
}

.site-nav {
  width: 100%;
  min-height: 4rem;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

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

.brand-title {
  margin-left: -3rem;
}

.brand-logo {
  display: block;
  width: auto;
  height: 3rem;
}

.nav-actions,
.nav-links {
  display: flex;
  align-items: center;
}

.nav-actions {
  gap: 1.25rem;
}

.nav-links {
  gap: 1.75rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text-primary);
}

.nav-links .cta-link {
  border-radius: 0.375rem;
  padding: 0.375rem 1rem;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgb(194 65 12 / 0.2);
}

.nav-links .cta-link:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

[data-theme="dark"] .nav-links .cta-link,
[data-theme="dark"] .nav-links .cta-link:hover {
  color: #0b1220;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
  color: var(--text-primary);
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.content {
  width: min(100%, 96rem);
  min-height: 68vh;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

.blog-home .content {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.page-intro {
  max-width: 56rem;
  margin: 0.6rem 0 2.5rem;
  padding: 3rem 0 2rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  margin: 0 0 1rem;
  border: 1px solid var(--cyan-border);
  border-radius: 0.4rem;
  padding: 0.45rem 0.75rem;
  background: var(--cyan-soft);
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: var(--text-primary);
}

h1 {
  margin: 0.5rem 0 0.6rem;
  font-size: clamp(2.7rem, 7vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

h2 {
  margin: 0.45rem 0 0.5rem;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

h3 {
  margin-top: 1.8rem;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 43rem;
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: clamp(1.1rem, 2.3vw, 1.35rem);
  line-height: 1.55;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.featured-post {
  margin: 0 0 2rem;
}

.featured-card {
  position: relative;
  display: grid;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: 0 12px 32px rgb(15 23 42 / 0.08);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.featured-card:hover,
.featured-card:focus-within,
.post-card:hover,
.post-card:focus-within {
  border-color: var(--accent);
  background: var(--surface-muted);
  box-shadow: 0 12px 32px rgb(194 65 12 / 0.18);
}

.featured-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.featured-copy {
  align-self: center;
  padding: clamp(1rem, 2vw, 1.5rem);
}

.featured-copy h2 {
  margin: 0.45rem 0 0.5rem;
  font-size: clamp(1.2rem, 2vw, 1.75rem);
  line-height: 1.1;
}

.featured-copy .card-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 0.9rem;
  line-height: 1.35;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 1.5rem;
}

.post-list {
  display: grid;
  gap: 1rem;
}

.post-card {
  position: relative;
  display: grid;
  overflow: hidden;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
  box-shadow: 0 12px 30px rgb(15 23 42 / 0.045);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.post-card-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card-copy {
  padding: clamp(1rem, 2vw, 1.5rem);
}

.post-card h2 {
  margin: 0.35rem 0 0.5rem;
  font-size: clamp(1rem, 1.6vw, 1.4rem);
  line-height: 1.12;
}

.post-card h2 a,
.featured-copy h2 a {
  color: var(--text-primary);
  text-decoration: none;
}

.post-card h2 a:hover,
.featured-copy h2 a:hover {
  color: var(--accent-text);
  text-decoration: none;
}

.card-title::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
}

.card-title:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.post-card .card-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 0.85rem;
  line-height: 1.35;
}

.post-card p {
  margin: 0.4rem 0 0;
  color: var(--text-secondary);
}

.meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.post {
  max-width: 60rem;
  margin: 2.5rem auto 0;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  background-color: var(--surface);
}

.post h1 {
  margin-top: 1rem;
  font-size: clamp(2.4rem, 5vw, 4rem);
}

.post .lede {
  margin: 1rem 0 2.5rem;
}

.post-header {
  margin-top: 1rem;
}

.post-header h1 {
  margin-top: 0.6rem;
}

.post-hero {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  object-fit: cover;
}

.post-body {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.post-body h2,
.post-body h3 {
  margin-top: 2rem;
}

.post-body p {
  margin: 0.9rem 0;
}

.post-body ul {
  padding-left: 1.25rem;
}

.post-body img {
  display: block;
  max-width: 100%;
  height: auto;
}

.blog-figure {
  margin: 2rem 0;
}

.blog-figure img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.blog-figure figcaption {
  margin-top: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
}

.measurement-table-panel {
  overflow: hidden;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
}

.measurement-table-scroll {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.measurement-table-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.measurement-table-panel table {
  width: 100%;
  min-width: 48rem;
  border-collapse: collapse;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: left;
}

.measurement-table-panel th,
.measurement-table-panel td {
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 1rem;
  vertical-align: top;
}

.measurement-table-panel th {
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.measurement-table-panel tbody tr:last-child td {
  border-bottom: 0;
}

.measurement-table-panel tbody tr:hover {
  background: var(--surface-muted);
}

.measurement-table-panel td:first-child {
  min-width: 13rem;
  color: var(--text-primary);
  font-weight: 600;
}

.measurement-table-panel td:nth-child(2) {
  min-width: 15rem;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.measurement-table-panel td:last-child {
  min-width: 20rem;
}

.measurement-table-panel td a {
  font-weight: 700;
}

[data-theme="dark"] .blog-figure-light,
html:not([data-theme="dark"]) .blog-figure-dark {
  display: none;
}

.breadcrumbs {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li:not(:last-child)::after {
  margin-left: 0.5rem;
  color: var(--text-secondary);
  content: "/";
}

.breadcrumbs [aria-current="page"] {
  color: var(--text-primary);
}

.tag-row {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.tag {
  display: inline-block;
  margin: 0 0.45rem 0.45rem 0;
  border: 1px solid var(--accent-soft-border);
  border-radius: 0.35rem;
  padding: 0.2rem 0.6rem;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.8rem;
  font-weight: 700;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.6rem 1.5rem 2.2rem;
  background: var(--surface-muted);
}

.footer-inner {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer-links {
  display: inline-flex;
  gap: 1rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

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

.footer-links .social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.social-link i {
  font-size: 1.15rem;
}

@media (max-width: 760px) {
  .site-nav {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

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

  .content {
    padding: 1.5rem 1rem 3.5rem;
  }

  .blog-home .content {
    padding-bottom: 2rem;
  }

  .post-card-copy {
    padding: 0.65rem;
  }

  .post-card .meta {
    font-size: 0.68rem;
  }

  .post-card h2 {
    margin: 0.25rem 0 0.35rem;
    font-size: 0.9rem;
    line-height: 1.08;
  }

  .post-card .card-description {
    -webkit-line-clamp: 2;
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .post-card p {
    margin-top: 0.3rem;
  }

  .page-intro {
    padding: 2.5rem 0 1.5rem;
  }

  .post {
    margin-top: 1.5rem;
  }

  .measurement-table-panel {
    margin-inline: -0.5rem;
  }

  .measurement-table-panel table {
    font-size: 0.85rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .featured-card,
  .post-card {
    grid-template-columns: 1fr;
  }

  .featured-image,
  .post-card-image {
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 640px) {
  .brand-logo {
    height: 3.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
