@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");
@import url("https://db.onlinewebfonts.com/c/2424d4ac78261b7997f56453cc4f7ddd?family=TransRobotics+Italic");

:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --ink: #18212b;
  --muted: #657180;
  --line: #dce3eb;
  --accent: #0078d4;
  --accent-soft: #eaf4fc;
  --brand-red: #d62828;
  --shadow: rgba(24, 33, 43, 0.12);
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --brand: "TransRobotics Italic", "Inter", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

.wordmark {
  color: var(--ink);
  font-family: var(--brand);
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
}

.wordmark-ma {
  color: var(--brand-red);
}

.menu-toggle,
.menu-close {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: 0 10px 28px var(--shadow);
  cursor: pointer;
}

.menu-toggle {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 900;
}

.menu-toggle:hover,
.menu-toggle:focus-visible,
.menu-close:hover,
.menu-close:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: 0;
}

.ellipsis-icon,
.ellipsis-icon::before,
.ellipsis-icon::after {
  width: 4px;
  height: 4px;
  display: block;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.ellipsis-icon {
  position: relative;
}

.ellipsis-icon::before,
.ellipsis-icon::after {
  position: absolute;
  top: 0;
}

.ellipsis-icon::before {
  left: -7px;
}

.ellipsis-icon::after {
  left: 7px;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(24, 33, 43, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.nav-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1001;
  width: min(390px, calc(100vw - 24px));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 24px 0 64px rgba(24, 33, 43, 0.2);
  transform: translateX(-102%);
  visibility: hidden;
  transition: transform 220ms ease, visibility 220ms;
}

body.nav-open {
  overflow: hidden;
}

body.nav-open .nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.nav-open .nav-drawer {
  transform: translateX(0);
  visibility: visible;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.drawer-brand {
  font-size: 1.8rem;
}

.menu-close {
  position: relative;
  flex: 0 0 auto;
  box-shadow: none;
}

.menu-close::before,
.menu-close::after {
  position: absolute;
  width: 17px;
  height: 1.5px;
  background: currentColor;
  content: "";
}

.menu-close::before {
  transform: rotate(45deg);
}

.menu-close::after {
  transform: rotate(-45deg);
}

.drawer-intro {
  margin: 34px 0 22px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.drawer-links {
  display: grid;
  border-top: 1px solid var(--line);
}

.drawer-links a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  min-height: 50px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 700;
  text-decoration: none;
}

.drawer-links a:hover,
.drawer-links a:focus-visible,
.drawer-links a.active {
  color: var(--accent);
  outline: 0;
}

.drawer-index {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.drawer-tools-title {
  margin: 28px 0 12px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.drawer-tools {
  display: grid;
  gap: 8px;
}

.drawer-tool {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--bg);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.drawer-tool::after {
  color: var(--accent);
  content: "↗";
}

.drawer-tool:hover,
.drawer-tool:focus-visible {
  border-color: var(--accent);
  outline: 0;
}

.drawer-quote {
  margin: auto 0 0;
  padding-top: 28px;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.65;
}

.drawer-quote cite {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-style: normal;
  font-weight: 700;
}

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

.page {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 78px 20px 64px;
}

.home-page .page {
  width: min(1120px, 100%);
}

.page-header {
  margin-bottom: 30px;
  text-align: center;
}

.page-header .wordmark {
  display: inline-block;
  margin-bottom: 30px;
  font-size: clamp(3.2rem, 9vw, 6.4rem);
}

.page-header h1 {
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 4.3rem);
  line-height: 1.06;
}

.page-header p {
  max-width: 680px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.12rem);
  line-height: 1.7;
}

.home-hero {
  min-height: calc(100vh - 78px);
  display: grid;
  align-content: center;
  gap: 34px;
}

.home-copy {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.home-copy .wordmark {
  display: inline-block;
  font-size: clamp(4rem, 11vw, 8.5rem);
}

.home-kicker {
  margin: 22px 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.home-copy h1 {
  max-width: 820px;
  margin: 0 auto;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.08;
}

.home-copy p {
  max-width: 720px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.14rem);
  line-height: 1.75;
}

.hero-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.hero-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.hero-visual::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0, 120, 212, 0.08);
  content: "";
  pointer-events: none;
}

.home-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.data-poem {
  max-width: 820px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  color: var(--ink);
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-style: normal;
  font-weight: 600;
  line-height: 1.7;
  text-align: center;
}

.home-actions a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 700;
  text-decoration: none;
}

.home-actions a:first-child {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.home-actions a:hover,
.home-actions a:focus-visible {
  border-color: var(--accent);
  outline: 0;
}

.post-search {
  position: relative;
  margin-bottom: 16px;
}

.post-search::before {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  content: "";
  transform: translateY(-58%);
  pointer-events: none;
}

.post-search::after {
  position: absolute;
  top: calc(50% + 5px);
  left: 28px;
  width: 7px;
  height: 2px;
  background: var(--muted);
  content: "";
  transform: rotate(45deg);
  pointer-events: none;
}

.post-search input {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px 12px 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface);
  outline: 0;
}

.post-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.12);
}

.post-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(24, 33, 43, 0.08);
}

.post-list {
  display: grid;
}

.post-row {
  width: 100%;
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.post-row:last-child {
  border-bottom: 0;
}

.post-row:hover,
.post-row:focus-visible {
  background: var(--accent-soft);
  outline: 0;
}

.post-date {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.blog-category {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.post-title {
  display: block;
  color: var(--ink);
  font-size: clamp(1.16rem, 3vw, 1.48rem);
  font-weight: 800;
  line-height: 1.28;
}

.post-excerpt {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  line-height: 1.65;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}

.post-tag {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px 20px 22px;
  border-top: 1px solid var(--line);
}

.pagination button {
  min-width: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.pagination button[aria-current="page"] {
  color: #fff;
  background: var(--accent);
}

.blog-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  overflow-y: auto;
  padding: clamp(14px, 4vw, 44px);
  background: rgba(247, 249, 252, 0.94);
}

.blog-modal.active {
  display: block;
}

.blog-content {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 60px var(--shadow);
}

.blog-content h1 {
  margin: 8px 0 22px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
}

.blog-content h2,
.blog-content h3 {
  margin: 30px 0 10px;
  line-height: 1.3;
}

.blog-content p,
.blog-content li {
  line-height: 1.8;
}

.blog-content a {
  color: var(--accent);
}

.blog-content img {
  width: 100%;
  max-height: 440px;
  display: block;
  object-fit: cover;
  margin: 22px 0;
  border-radius: 6px;
}

.blog-content pre {
  overflow-x: auto;
  padding: 16px;
  border-radius: 6px;
  background: #eef2f6;
}

.blog-content code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #eef2f6;
}

.blog-content table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
}

.blog-content th,
.blog-content td {
  padding: 10px;
  border: 1px solid var(--line);
  text-align: left;
}

.blog-close {
  margin-top: 22px;
  padding: 10px 14px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

.post-list-empty {
  padding: 24px;
  color: var(--muted);
}

.site-footer {
  padding: 32px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(300px, 1.4fr) auto;
  align-items: center;
  gap: 24px;
}

.footer-inner strong {
  font-size: 0.95rem;
}

.footer-inner p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.subscribe-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.subscribe-form input {
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 6px 0 0 6px;
  color: var(--ink);
  background: var(--bg);
  outline: 0;
}

.subscribe-form input:focus {
  border-color: var(--accent);
}

.subscribe-form button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 0 6px 6px 0;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.github-link {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.github-link:hover,
.github-link:focus-visible {
  color: var(--accent);
  outline: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-visual img {
    animation: sketch-drift 9s ease-in-out infinite alternate;
  }

  @keyframes sketch-drift {
    from {
      transform: scale(1);
    }
    to {
      transform: scale(1.025);
    }
  }
}

@media (max-width: 720px) {
  .menu-toggle {
    top: 12px;
    left: 12px;
  }

  .page {
    padding: 74px 16px 44px;
  }

  .home-hero {
    min-height: auto;
  }

  .hero-visual {
    aspect-ratio: 4 / 3;
    min-height: 0;
  }

  .hero-visual img {
    object-position: center;
  }

  .post-row {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 20px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}
