/* Itoflow research index and long-form article shell. */

.blog-page {
  --primary: var(--ink);
  --primary-light: var(--surface);
  --text: var(--ink);
  --text-light: var(--ink-soft);
  --text-muted: var(--muted);
  --background: var(--page);
  --background-light: var(--surface-subtle);
  --background-white: var(--surface);
  --white: var(--surface);
  --gray-100: color-mix(in srgb, var(--surface-subtle) 76%, var(--page));
  --gray-200: var(--line);
  --accent-deep: var(--accent-strong);
  --navy-soft: color-mix(in srgb, var(--accent) 8%, var(--surface));
  --line-soft: color-mix(in srgb, var(--line) 55%, transparent);
  --green-soft: color-mix(in srgb, var(--accent) 10%, var(--surface));
  --green-border: var(--accent);
  --green-accent: var(--accent-strong);
  --green-text: var(--ink);
  --red-soft: color-mix(in srgb, var(--warning) 8%, var(--surface));
  --red: var(--warning);
  --amber-soft: color-mix(in srgb, var(--warning) 10%, var(--surface));
  --amber: var(--warning);
  --warning-bg: color-mix(in srgb, var(--warning) 10%, var(--surface));
  --warning-border: var(--warning);
  --success-bg: color-mix(in srgb, var(--accent) 10%, var(--surface));
  --success-border: var(--accent);
  overflow-x: clip;
}

.blog-page .site-header nav,
.blog-page .footer nav {
  padding: 0;
}

.blog-page .header-nav {
  margin: 0;
  list-style: none;
}

.blog-header {
  min-height: 440px;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
}

.blog-header[data-hero-texture="research"] {
  --hero-tex-top: -62%;
  --hero-tex-right: -13%;
  --hero-tex-width: 58%;
  --hero-tex-height: 205%;
  --hero-tex-rotation: 13deg;
  --hero-tex-opacity: 0.38;
  --hero-tex-opacity-light: 0.24;
}

.blog-header .container {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  align-items: end;
  gap: clamp(32px, 7vw, 110px);
}

.blog-header .spec-kicker {
  grid-column: 1 / -1;
  margin-bottom: -6px;
}

.blog-header h1 {
  max-width: 660px;
}

.blog-header p {
  max-width: 46ch;
  margin: 0 0 7px;
}

.blog-list {
  padding: clamp(56px, 8vw, 104px) 0 clamp(80px, 11vw, 144px);
}

.blog-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(320px, 0.84fr);
  align-items: center;
  gap: clamp(40px, 7vw, 96px);
  padding-bottom: clamp(64px, 9vw, 112px);
  border-bottom: 1px solid var(--line-strong);
}

.blog-feature-visual {
  display: block;
  min-width: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  background: #03142d;
}

.blog-feature-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.blog-feature-copy {
  max-width: 520px;
}

.blog-entry-meta,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 18px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.blog-entry-meta span,
.article-tag {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0;
  text-transform: uppercase;
}

.blog-feature h2 {
  margin: 0 0 18px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(44px, 5vw, 64px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 0.98;
  text-wrap: balance;
}

.blog-feature h2 a,
.blog-entry h3 a {
  color: inherit;
  text-decoration: none;
}

.blog-feature p {
  max-width: 58ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.65;
}

.blog-archive-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  padding: clamp(64px, 8vw, 104px) 0 24px;
  border-bottom: 1px solid var(--line-strong);
}

.blog-archive-heading h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1;
}

.blog-archive-heading .spec-kicker {
  order: 2;
  margin-bottom: 5px;
}

.blog-entry {
  display: grid;
  grid-template-columns: minmax(120px, 0.24fr) minmax(280px, 0.9fr) minmax(260px, 0.86fr);
  gap: clamp(28px, 4vw, 60px);
  align-items: start;
  padding: clamp(28px, 3.6vw, 44px) 0;
  border-bottom: 1px solid var(--line);
  transition: border-color 160ms ease;
}

.blog-entry .blog-entry-meta {
  display: grid;
  gap: 7px;
  margin: 4px 0 0;
}

.blog-entry h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-wrap: balance;
}

.blog-entry p {
  max-width: 48ch;
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
}

@media (hover: hover) {
  .blog-feature h2 a:hover,
  .blog-entry h3 a:hover {
    color: var(--accent-strong);
  }

  .blog-entry:has(h3 a:hover) {
    border-color: var(--accent-strong);
  }
}

.blog-article main.container {
  position: relative;
  isolation: isolate;
  overflow: clip;
}

.blog-article .article-header {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(72px, 9vw, 120px) 0 clamp(44px, 6vw, 72px);
}

.blog-article .article-header::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -42%;
  right: -56%;
  width: 88%;
  height: 174%;
  background: url("/textures/particle-circle.webp") no-repeat center / contain;
  opacity: 0.24;
  pointer-events: none;
  transform: rotate(14deg);
}

[data-theme="light"] .blog-article .article-header::before {
  opacity: 0.16;
}

.blog-article .article-header h1 {
  max-width: 16ch;
  margin: 0 0 24px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 78px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-wrap: balance;
}

.blog-article .article-subtitle {
  max-width: 64ch;
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: clamp(18px, 2vw, 22px);
  font-style: normal;
  line-height: 1.5;
  text-wrap: pretty;
}

.blog-article .article-author {
  color: var(--muted);
  font-size: 12px;
}

.blog-article .article-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 0 clamp(88px, 12vw, 152px);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
}

.blog-article .article-content :where(p, li) {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.76;
}

.blog-article .article-content p {
  margin: 0 0 1.55em;
}

.blog-article .article-content :where(ul, ol) {
  margin: 0 0 1.75em;
  padding-left: 1.45em;
}

.blog-article .article-content li {
  margin-bottom: 0.7em;
}

.blog-article .article-content :where(h2, h3) {
  color: var(--ink);
  text-wrap: balance;
}

.blog-article .article-content h2 {
  margin: 2.1em 0 0.65em;
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

.blog-article .article-content h3 {
  margin: 2.2em 0 0.7em;
  font-family: var(--font-body);
  font-size: clamp(21px, 3vw, 26px);
  font-weight: 600;
  line-height: 1.22;
}

.blog-article .article-content a {
  color: var(--accent-strong);
  text-decoration-color: color-mix(in srgb, var(--accent-strong) 55%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.blog-article .article-content a:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

.blog-article .article-content :where(strong, li strong) {
  color: var(--ink);
  font-weight: 600;
}

.blog-article .article-content :where(code, pre, .math-block) {
  font-family: var(--font-mono);
}

.blog-article .article-content code {
  border: 1px solid var(--line);
  background: var(--surface-subtle);
  padding: 0.12em 0.32em;
  color: var(--ink);
  font-size: 0.86em;
}

.blog-article .article-content :where(pre, .math-block) {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface-subtle);
  color: var(--ink);
}

.blog-article .article-content :where(blockquote, .lede) {
  margin: 2.25rem 0;
  border-left: 3px solid var(--accent);
  padding-left: 24px;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.22;
}

.blog-article .article-content :where(img, video) {
  display: block;
  max-width: 100%;
  height: auto;
}

.blog-article .article-content :where(.screenshot-wrap, .screenshot-container, .product-screenshot, .chart-panel, .diagram-shell, .diagram-wrapper) {
  margin: 2.5rem 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
  box-shadow: none;
}

.blog-article .article-content :where(.screenshot-caption, .chart-caption, .diagram-caption) {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
}

.blog-article .article-content :where(.callout, .highlight-box, .technical-note, .comparison-box) {
  margin: 2.2rem 0;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 2px;
  background: var(--surface-subtle);
  box-shadow: none;
  color: var(--ink);
  padding: 22px 24px;
}

.blog-article .article-content :where(.callout-warning, .callout-problem) {
  border-left-color: var(--warning);
}

.blog-article .article-content :where(.callout, .highlight-box, .technical-note, .comparison-box) :last-child {
  margin-bottom: 0;
}

.blog-article .article-content :where(.comparison-card, .pattern-item, .pipeline-stage, .timeline-content, .trace, .review-stage, .callout-card) {
  border-color: var(--line);
  border-radius: 2px;
  background: var(--surface-subtle);
  box-shadow: none;
  color: var(--ink);
}

.blog-article .article-content :where(table, .comparison-table) {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 14px;
}

.blog-article .article-content :where(th, td) {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 10px 12px;
}

.blog-article .article-content th {
  background: var(--surface-subtle);
  font-weight: 600;
}

.blog-article .article-content :where(.table-scroll, .table-wrapper) {
  overflow-x: auto;
  margin: 2rem 0;
  -webkit-overflow-scrolling: touch;
}

.blog-article .section-break {
  width: 100%;
  height: 1px;
  margin: clamp(52px, 7vw, 76px) 0;
  background: var(--line);
}

.blog-article .references,
.blog-article .footnote-list {
  color: var(--muted);
  font-size: 14px;
}

@media (prefers-reduced-motion: no-preference) {
  .blog-article .article-header::before {
    animation: blog-article-particle-drift 28s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  }
}

@keyframes blog-article-particle-drift {
  0%,
  100% {
    transform: rotate(14deg) translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: rotate(14deg) translate3d(-2%, 1%, 0) scale(1.025);
  }
}

@media (max-width: 760px) {
  .blog-header {
    min-height: 0;
    align-items: initial;
  }

  .blog-header .container,
  .blog-feature {
    display: block;
  }

  .blog-header .spec-kicker {
    margin-bottom: 22px;
  }

  .blog-header p {
    margin-top: 24px;
  }

  .blog-feature-visual {
    margin-bottom: 36px;
  }

  .blog-feature h2 {
    font-size: clamp(42px, 13vw, 58px);
  }

  .blog-archive-heading {
    display: block;
  }

  .blog-archive-heading .spec-kicker {
    display: block;
    margin: 0 0 14px;
  }

  .blog-entry {
    display: block;
  }

  .blog-entry .blog-entry-meta {
    display: flex;
    margin: 0 0 16px;
  }

  .blog-entry h3 {
    font-size: clamp(30px, 9vw, 40px);
  }

  .blog-entry p {
    margin-top: 18px;
  }

  .blog-article .article-header {
    padding-top: 64px;
  }

  .blog-article .article-header::before {
    top: -14%;
    right: -55%;
    width: 108%;
    height: 130%;
  }

  .blog-article .article-header h1 {
    font-size: clamp(44px, 14vw, 62px);
  }

  .blog-article .article-content :where(p, li) {
    font-size: 16px;
  }

  .blog-article .article-content :where(.callout, .highlight-box, .technical-note, .comparison-box) {
    padding: 18px;
  }
}

@media (min-width: 761px) and (max-width: 980px) {
  .blog-feature {
    grid-template-columns: 1fr;
  }

  .blog-feature-copy {
    max-width: 680px;
  }

  .blog-entry {
    grid-template-columns: minmax(112px, 0.25fr) minmax(0, 1fr);
  }

  .blog-entry p {
    grid-column: 2;
    max-width: 60ch;
  }
}

/* Papers section */
.papers-section {
  padding-bottom: 0;
}

.paper-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 18px;
}

.paper-entry {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 26px;
}

.paper-entry h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.25;
}

.paper-entry h3 a {
  text-decoration: none;
}

.paper-entry h3 a:hover {
  color: var(--accent-strong);
}

.paper-authors {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.paper-entry .text-link {
  margin-top: auto;
}

/* Blog entries as contained cards, matching the paper cards */
.blog-archive {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 18px;
}

.blog-entry {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 26px;
}

.blog-entry h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.3;
}

.blog-entry h3 a {
  text-decoration: none;
}

.blog-entry h3 a:hover {
  color: var(--accent-strong);
}

.blog-entry p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.paper-abstract {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
