/*
 * FlowForAI case system v1
 * Shared brand shell, typography, spacing, borders, controls, and index/icon layers.
 * Case-specific styles may vary accent color, evidence composition, and bespoke media only.
 */

.flow-case {
  --case-shell: 1120px;
  --case-wide-shell: 1280px;
  --case-section-space: clamp(56px, 5.5vw, 80px);
  --case-hero-space-top: clamp(64px, 7vw, 96px);
  --case-hero-space-bottom: clamp(56px, 6vw, 80px);
  --case-heading-gap: clamp(30px, 3.5vw, 42px);
  --case-grid-gap: clamp(16px, 2vw, 24px);
  --case-border-width: 1px;
  --case-radius-control: 8px;
  --case-radius-card: 18px;
  --case-icon-size: 36px;
  min-width: 320px;
  overflow-x: clip;
  font-family: "Inter", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

.flow-case h1,
.flow-case h2,
.flow-case h3,
.flow-case p,
.flow-case blockquote {
  font-family: inherit;
}

/* Shared FlowForAI shell */
.flow-case .site-header.case-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: var(--case-border-width) solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 17, 31, 0.88);
  backdrop-filter: blur(18px);
}

.flow-case .nav.case-nav,
.flow-case .case-shell,
.flow-case main > .hero,
.flow-case main > .section,
.flow-case main > .closing,
.flow-case .footer.case-footer {
  width: min(var(--case-shell), calc(100% - 40px));
  margin-inline: auto;
}

.flow-case .nav.case-nav {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.flow-case .brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  color: #f7fbff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.flow-case .brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: var(--case-border-width) solid rgba(255, 255, 255, 0.2);
  border-radius: var(--case-radius-control);
  color: #06111c;
  background: linear-gradient(135deg, #33d3a6, #7ce4ff);
  box-shadow: 0 10px 30px rgba(51, 211, 166, 0.22);
}

.flow-case .nav-links.case-nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 26px);
  color: #a8b6c8;
  font-size: 0.9rem;
  font-weight: 600;
}

.flow-case .nav-links.case-nav-links a {
  color: inherit;
  text-decoration: none;
}

.flow-case .nav-links.case-nav-links a:hover,
.flow-case .nav-links.case-nav-links a:focus-visible,
.flow-case .footer.case-footer a:hover,
.flow-case .footer.case-footer a:focus-visible {
  color: #f7fbff;
}

.flow-case .nav-contact {
  min-height: 44px;
  padding: 10px 15px;
  border: var(--case-border-width) solid rgba(255, 255, 255, 0.14);
  border-radius: var(--case-radius-control);
  color: #f7fbff !important;
  background: rgba(255, 255, 255, 0.06);
}

.flow-case .language-toggle,
.flow-case .nav-toggle {
  min-width: 44px;
  min-height: 44px;
  border: var(--case-border-width) solid rgba(124, 228, 255, 0.35);
  border-radius: var(--case-radius-control);
  color: #f7fbff;
  background: rgba(124, 228, 255, 0.08);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.flow-case .language-toggle {
  display: inline-flex;
  padding: 0 13px;
  align-items: center;
  justify-content: center;
}

.flow-case .nav-toggle {
  display: none;
  padding: 10px;
}

.flow-case .nav-toggle span:not(.sr-only) {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: #f7fbff;
}

/* One explicit type scale across every case */
.flow-case main h1 {
  max-width: 820px;
  margin: 0 0 24px;
  font-size: clamp(3rem, 4.45vw, 4rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.052em;
  text-wrap: balance;
}

.flow-case main h2 {
  max-width: 900px;
  margin: 0 0 18px;
  font-size: clamp(2.15rem, 3.4vw, 3rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.042em;
  text-wrap: balance;
}

.flow-case main h3 {
  margin: 0 0 10px;
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.018em;
}

.flow-case .skill-grid h2,
.flow-case .qa-copy h2,
.flow-case .proof-copy h2,
.flow-case .delivery-heading h2,
.flow-case .demo-heading h2,
.flow-case .section-split-heading h2 {
  font-size: clamp(2rem, 2.7vw, 2.375rem);
}

.flow-case main p {
  line-height: 1.7;
}

.flow-case .hero-lede,
.flow-case .case-lead {
  max-width: 680px;
  margin: 0 0 28px;
  font-size: clamp(1.08rem, 1.55vw, 1.25rem);
  line-height: 1.65;
}

.flow-case .eyebrow,
.flow-case .case-eyebrow {
  margin: 0 0 16px;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.flow-case .hero-note,
.flow-case figcaption,
.flow-case .asset-note,
.flow-case .metric-source,
.flow-case .demo-links,
.flow-case .demo-links span {
  font-size: 0.84rem;
  line-height: 1.55;
}

html[lang="zh-Hant"] .flow-case main h1 {
  max-width: 760px;
  font-size: clamp(2.65rem, 4.1vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

html[lang="zh-Hant"] .flow-case main h2 {
  font-size: clamp(2.05rem, 3.3vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

html[lang="zh-Hant"] .flow-case main h3 {
  font-size: clamp(1.12rem, 1.65vw, 1.35rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

html[lang="zh-Hant"] .flow-case .skill-grid h2,
html[lang="zh-Hant"] .flow-case .qa-copy h2,
html[lang="zh-Hant"] .flow-case .proof-copy h2,
html[lang="zh-Hant"] .flow-case .delivery-heading h2,
html[lang="zh-Hant"] .flow-case .demo-heading h2,
html[lang="zh-Hant"] .flow-case .section-split-heading h2 {
  font-size: clamp(1.95rem, 2.7vw, 2.375rem);
}

/* Shared vertical rhythm and density */
.flow-case main > .hero,
.flow-case .case-hero {
  min-height: 0;
  padding-top: var(--case-hero-space-top);
  padding-bottom: var(--case-hero-space-bottom);
}

.flow-case main > .section,
.flow-case main > .closing,
.flow-case .case-section,
.flow-case .case-closing {
  min-height: 0;
  padding-top: var(--case-section-space);
  padding-bottom: var(--case-section-space);
}

.flow-case .section-heading,
.flow-case .case-heading,
.flow-case .wide-heading,
.flow-case .demo-heading {
  max-width: 900px;
  margin-bottom: var(--case-heading-gap);
}

.flow-case .section-heading > p:last-child,
.flow-case .case-heading > p:last-child,
.flow-case .wide-heading > p:last-child,
.flow-case .skill-grid > div > p:last-child,
.flow-case .qa-copy > p:not(.qa-status),
.flow-case .demo-heading > p {
  max-width: 760px;
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.7;
}

.flow-case .hero-grid,
.flow-case .case-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.7fr);
  gap: clamp(36px, 5vw, 64px);
  align-items: center;
}

.flow-case .snapshot {
  margin-top: clamp(44px, 5vw, 64px);
}

.flow-case .pipeline,
.flow-case .limit-grid,
.flow-case .input-grid,
.flow-case .material-grid,
.flow-case .mode-grid,
.flow-case .story-grid,
.flow-case .capability-grid,
.flow-case .principle-grid,
.flow-case .boundary-grid,
.flow-case .qa-metrics {
  gap: var(--case-grid-gap);
}

.flow-case .pipeline {
  overflow: visible;
  border: 0;
  border-radius: 0;
}

.flow-case .pipeline article,
.flow-case .limit-grid article,
.flow-case .mode-card,
.flow-case .qa-metrics article,
.flow-case .capability-grid article,
.flow-case .principle-grid article,
.flow-case .boundary-grid article,
.flow-case .delivery-steps article,
.flow-case .story-proof {
  min-height: 0;
  border: var(--case-border-width) solid rgba(255, 255, 255, 0.12);
  border-radius: var(--case-radius-card);
}

.flow-case .pipeline article,
.flow-case .limit-grid article {
  padding: 24px;
}

.flow-case .pipeline article {
  border-right: var(--case-border-width) solid rgba(255, 255, 255, 0.12);
}

.flow-case .pipeline h3,
.flow-case .limit-grid h3 {
  margin: 22px 0 10px;
}

.flow-case .pipeline p,
.flow-case .limit-grid p {
  font-size: 0.94rem;
  line-height: 1.65;
}

/* Number markers and icon layers share one visual language. */
.flow-case .pipeline article > span,
.flow-case .limit-grid article > span,
.flow-case .delivery-steps article > span,
.flow-case .section-index,
.flow-case .node-icon {
  display: inline-grid;
  width: var(--case-icon-size);
  min-width: var(--case-icon-size);
  height: var(--case-icon-size);
  padding: 0;
  place-items: center;
  border: var(--case-border-width) solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.flow-case .section-index {
  padding-top: 0;
}

.flow-case .delivery-steps {
  gap: 10px;
  background: transparent;
}

.flow-case .delivery-steps article {
  grid-template-columns: var(--case-icon-size) 1fr;
  padding: 14px 16px;
  align-items: center;
}

.flow-case .button,
.flow-case .demo-actions a,
.flow-case .download-link,
.flow-case .delivery-link {
  display: inline-flex;
  min-height: 46px;
  padding: 11px 17px;
  align-items: center;
  justify-content: center;
  border-width: var(--case-border-width);
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
}

.flow-case .hero-media,
.flow-case .input-grid figure,
.flow-case .material-grid figure,
.flow-case .qa-media,
.flow-case .evidence-frame,
.flow-case .wide-proof {
  border-width: var(--case-border-width);
  border-radius: var(--case-radius-card);
}

.flow-case .hero-media img,
.flow-case .input-grid img,
.flow-case .material-grid img,
.flow-case .qa-media img,
.flow-case .evidence-frame img,
.flow-case .wide-proof img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.flow-case .section > .closing {
  width: 100%;
  margin: 0;
  padding: clamp(30px, 4vw, 48px);
}

.flow-case .closing h2,
.flow-case .case-closing h2,
.flow-case .case-closing blockquote {
  max-width: 900px;
  font-size: clamp(2.1rem, 3.2vw, 2.75rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

html[lang="zh-Hant"] .flow-case .closing h2,
html[lang="zh-Hant"] .flow-case .case-closing h2,
html[lang="zh-Hant"] .flow-case .case-closing blockquote {
  font-size: clamp(2rem, 3.1vw, 2.625rem);
  line-height: 1.14;
  letter-spacing: -0.028em;
}

.flow-case .case-closing .closing-summary {
  max-width: 760px;
  margin: 20px auto 0;
  color: #a8b6c8;
  font-size: 1rem;
  line-height: 1.7;
}

.flow-case .footer.case-footer {
  display: flex;
  padding: 34px 0 44px;
  justify-content: space-between;
  gap: 30px;
  border-top: var(--case-border-width) solid rgba(255, 255, 255, 0.08);
  color: #a8b6c8;
}

.flow-case .footer.case-footer p {
  margin: 12px 0 0;
  color: inherit;
}

.flow-case .footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

@media (max-width: 1120px) {
  .flow-case .nav-toggle {
    display: block;
  }

  .flow-case .nav-links.case-nav-links {
    position: absolute;
    top: 72px;
    right: 20px;
    left: 20px;
    display: none;
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    border: var(--case-border-width) solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(8, 17, 31, 0.98);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  }

  .flow-case .nav-links.case-nav-links.is-open {
    display: flex;
  }

  .flow-case .nav-links.case-nav-links a,
  .flow-case .language-toggle {
    width: 100%;
    min-height: 44px;
    padding: 11px 13px;
    justify-content: flex-start;
  }

  .flow-case .hero-grid,
  .flow-case .case-hero-grid,
  .flow-case .section-split-heading,
  .flow-case .proof-grid,
  .flow-case .delivery-grid,
  .flow-case .qa-grid,
  .flow-case .skill-grid,
  .flow-case .closing {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .flow-case {
    --case-section-space: 52px;
    --case-hero-space-top: 60px;
    --case-hero-space-bottom: 56px;
    --case-heading-gap: 28px;
  }

  .flow-case .nav.case-nav,
  .flow-case .case-shell,
  .flow-case main > .hero,
  .flow-case main > .section,
  .flow-case main > .closing,
  .flow-case .footer.case-footer {
    width: min(var(--case-shell), calc(100% - 32px));
  }

  .flow-case main h1,
  html[lang="zh-Hant"] .flow-case main h1 {
    font-size: clamp(2.45rem, 11.8vw, 3.2rem);
    line-height: 1.04;
  }

  .flow-case main h2,
  html[lang="zh-Hant"] .flow-case main h2,
  .flow-case .closing h2,
  html[lang="zh-Hant"] .flow-case .closing h2,
  .flow-case .case-closing h2,
  html[lang="zh-Hant"] .flow-case .case-closing h2,
  .flow-case .case-closing blockquote,
  html[lang="zh-Hant"] .flow-case .case-closing blockquote {
    font-size: clamp(2rem, 9vw, 2.55rem);
    line-height: 1.1;
  }

  .flow-case .pipeline,
  .flow-case .limit-grid,
  .flow-case .input-grid,
  .flow-case .material-grid,
  .flow-case .mode-grid,
  .flow-case .story-grid,
  .flow-case .capability-grid,
  .flow-case .principle-grid,
  .flow-case .boundary-grid,
  .flow-case .qa-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .flow-case .pipeline article {
    border-right: var(--case-border-width) solid rgba(255, 255, 255, 0.12);
  }

  .flow-case .footer.case-footer {
    flex-direction: column;
  }

  .flow-case .footer-links {
    align-items: flex-start;
  }
}
