/* Case studies: centered product hero, framed cover, article column. */

/* The header is fixed at a constant height; the hero reserves the space. */
.cs-hero { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; padding-top: calc(var(--nav-h) + 72px); text-align: center; }
@media (min-width: 768px) { .cs-hero { padding-top: calc(var(--nav-h) + 96px); } }
.cs-hero::before { content: ''; position: absolute; left: 50%; top: 0; z-index: -1; width: 100vw; height: 640px; transform: translateX(-50%); pointer-events: none;
  background:
    linear-gradient(180deg, rgba(243,228,201,0) 40%, var(--sf) 100%),
    radial-gradient(60% 60% at 50% 0%, rgba(201,167,122,.4) 0%, rgba(241,226,198,.45) 50%, rgba(243,228,201,0) 80%); }
.cs-hero .motif { margin-bottom: 20px; }
.cs-label { margin-bottom: 24px; }
.cs-kicker { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 28px; order: 3; }
.cs-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--sf-secondary); border: 1px solid var(--st-secondary); color: var(--tx-tertiary); font-size: 12px; line-height: 16px; font-weight: 525; }
.cs-tag:first-child { background: var(--indigo-100); border-color: var(--indigo-800); color: var(--indigo-800); }
.cs-tag.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cs-tag .company-link { color: inherit; }
.cs-title { order: 1; max-width: 900px; font-family: var(--font-display); font-size: clamp(38px, 5.2vw, 52px); line-height: 1.2; letter-spacing: -1px; font-weight: 425; color: var(--tx); text-wrap: balance; font-variation-settings: 'opsz' 72; }
.cs-title .accent { color: inherit; }
.cs-summary { order: 2; max-width: 700px; margin: 20px 0 28px; color: var(--tx-tertiary); font-size: 18px; line-height: 27.9px; }
.cs-summary strong { color: var(--tx-secondary); font-weight: 525; }
.cs-stack { order: 4; max-width: 760px; color: var(--tx-tertiary); font-family: var(--font-mono); font-size: 12px; line-height: 1.8; letter-spacing: .02em; }
.cs-hero .motif, .cs-hero .cs-label { order: 0; }

/* Meta as a hairline stat grid */
.cs-meta { order: 5; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; margin-top: 48px; border-block: 1px solid var(--st); text-align: left; }
.cs-meta .cell { min-width: 0; padding: 20px 24px; border-left: 1px solid var(--st-secondary); }
.cs-meta .cell:first-child { border-left: 0; padding-left: 0; }
.cs-meta .k { margin-bottom: 6px; color: var(--tx-tertiary); font-size: 12px; line-height: 16px; font-weight: 525; letter-spacing: .96px; text-transform: uppercase; }
.cs-meta .v { color: var(--tx); font-size: 16px; line-height: 1.45; font-weight: 525; letter-spacing: -.01em; }

/* Cover inside a gradient playground frame */
.cs-cover { position: relative; isolation: isolate; margin: 56px 0 0; padding: 8px; border-radius: 28px; background: linear-gradient(180deg, var(--indigo-100) 0%, var(--indigo-50) 100%); box-shadow: var(--sh-frame-glow); }
@media (min-width: 768px) { .cs-cover { margin-top: 72px; padding: 12px; border-radius: 40px; } }
.cs-cover::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background-image: var(--noise); opacity: .15; mix-blend-mode: overlay; }
.cs-cover img { width: 100%; border-radius: var(--r-xl); border: 1px solid var(--st-secondary); background: var(--sf-secondary); box-shadow: var(--sh-panel-inner); }
@media (min-width: 768px) { .cs-cover img { border-radius: 28px; } }
.cs-cover figcaption { padding: 14px 12px 6px; color: var(--tx-tertiary); font-size: 14px; line-height: 20px; text-align: center; }

/* Article column */
.cs-body { max-width: 680px; margin: 0 auto; padding-bottom: 96px; }
@media (min-width: 768px) { .cs-body { padding-bottom: 128px; } }
.cs-section { padding-top: 72px; }
@media (min-width: 768px) { .cs-section { padding-top: 96px; } }
.cs-section-index { display: block; margin-bottom: 12px; font-family: var(--font-mono); font-size: 13px; letter-spacing: .78px; color: var(--indigo-500); }
.cs-h2 { margin-bottom: 20px; scroll-margin-top: 112px; font-size: clamp(24px, 3vw, 28px); line-height: 1.25; letter-spacing: -.025em; font-weight: 625; color: var(--tx); text-wrap: balance; }
.cs-body p { margin-bottom: 20px; color: var(--tx); font-size: 17px; line-height: 1.65; }
.cs-body p strong, .cs-list li strong { font-weight: 625; }
.cs-body a:not([class]) { color: var(--indigo-800); text-decoration: underline; text-decoration-color: rgba(107,70,48,.35); text-underline-offset: 2px; transition: text-decoration-color var(--d-normal) ease-out; }
.cs-body a:not([class]):hover { text-decoration-color: var(--indigo-800); }
.cs-list { display: grid; gap: 10px; margin: 0 0 20px; padding-left: 0; list-style: none; }
.cs-list li { position: relative; padding-left: 26px; color: var(--tx); font-size: 17px; line-height: 1.65; }
.cs-list li::before { content: ''; position: absolute; left: 0; top: .42em; width: 16px; height: 16px; border-radius: 50%; background: var(--indigo-100) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b4630' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 12.5 3.2 3L17 9'/%3E%3C/svg%3E") center / 12px no-repeat; }
.cs-body code { padding: 2px 6px; border: 1px solid var(--st-secondary); border-radius: 6px; background: var(--indigo-50); color: var(--tx); font-family: var(--font-mono); font-size: .82em; overflow-wrap: anywhere; }

/* Callout */
.cs-note { margin-top: 24px; padding: 14px 20px; border-radius: var(--r-2xl); background: var(--indigo-50); border: 1px solid var(--indigo-100); color: var(--tx-secondary) !important; font-size: 14px !important; line-height: 1.6 !important; }
.cs-note .company-link { color: var(--indigo-800); }

/* Feature panel */
.cs-own { margin-top: 28px; padding: 32px; border-radius: var(--r-xl); background: var(--card); border: 1px solid var(--st-secondary); }
.cs-own h3 { margin-bottom: 18px; font-size: 20px; line-height: 26px; font-weight: 525; color: var(--tx); }
.cs-own .cs-list { margin-bottom: 0; }
.cs-own .cs-list li { font-size: 16px; color: var(--tx-secondary); }

/* Enterprise-feature cards */
.cs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 28px 0 0; }
.cs-body:has(.cs-grid) .cs-grid { width: min(1000px, 100vw - 12vw); margin-left: 50%; transform: translateX(-50%); }
.cs-card { min-width: 0; padding: 28px 24px; border-radius: var(--r-xl); background: var(--card); border: 1px solid var(--st-secondary); }
.cs-card .h { margin-bottom: 20px; font-family: var(--font-mono); font-size: 13px; letter-spacing: .78px; text-transform: uppercase; color: var(--indigo-500); }
.cs-card .t { margin-bottom: 10px; font-size: 20px; line-height: 26px; font-weight: 525; color: var(--tx); }
.cs-card p { margin: 0; color: var(--tx-tertiary); font-size: 15px; line-height: 1.6; }

/* Stepper: pills on a connecting line */
.cs-flow { position: relative; display: flex; flex-direction: column; gap: 12px; margin: 32px 0 0; padding: 0; list-style: none; counter-reset: step; }
.cs-flow::before { content: ''; position: absolute; left: 19px; top: 20px; bottom: 20px; width: 1px; background: var(--st); }
.cs-flow li { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; align-items: center; padding: 8px 20px 8px 8px; border-radius: 999px; background: var(--card); border: 1px solid var(--st); box-shadow: var(--sh-pill-lift); counter-increment: step; }
.cs-flow li::before { content: counter(step); grid-row: span 2; display: grid; place-items: center; width: 32px; height: 32px; margin-left: 2px; border-radius: 50%; background: var(--indigo-100); color: var(--indigo-800); font-size: 13px; font-weight: 625; }
.cs-flow li b { color: var(--tx); font-size: 15px; line-height: 1.35; font-weight: 525; }
.cs-flow li span { color: var(--tx-tertiary); font-size: 14px; line-height: 1.45; }
.cs-flow li.human { border-color: var(--green-200); background: var(--green-50); }
.cs-flow li.human::before { background: var(--card); color: var(--green-700); }
.cs-caption { margin: 14px 0 0 !important; color: var(--tx-tertiary) !important; font-size: 14px !important; line-height: 20px !important; }

/* Article table */
.cs-table-wrap { overflow-x: auto; overscroll-behavior-inline: contain; margin-top: 28px; border: 1px solid var(--st); border-radius: var(--r-lg); background: var(--card); }
.cs-table { width: 100%; min-width: 600px; border-collapse: collapse; text-align: left; font-size: 14px; line-height: 1.6; }
.cs-table th, .cs-table td { padding: 14px 20px; border-bottom: 1px solid var(--st-secondary); vertical-align: top; color: var(--tx-secondary); }
.cs-table thead th { background: var(--sf-secondary); color: var(--tx); font-weight: 625; }
.cs-table tbody th { color: var(--tx); font-weight: 525; }
.cs-table tbody tr:last-child > * { border-bottom: 0; }

/* Figure */
.cs-figure { margin: 32px 0 0; padding: 8px; border-radius: var(--r-3xl); background: linear-gradient(180deg, var(--indigo-100), var(--indigo-50)); box-shadow: var(--sh-frame-glow); }
.cs-figure img { width: 100%; border-radius: 18px; border: 1px solid var(--st-secondary); }
.cs-figure figcaption { padding: 12px 10px 4px; color: var(--tx-tertiary); font-size: 14px; text-align: center; }

/* Cross-sell bar for repo / demo links */
.cs-repo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 24px; padding: 14px 14px 14px 20px; border-radius: var(--r-2xl); background: var(--indigo-50); border: 1px solid var(--indigo-100); }
.cs-repo + .cs-repo { margin-top: 10px; }
.cs-repo .rt { color: var(--tx-tertiary); font-size: 12px; font-weight: 525; letter-spacing: .96px; text-transform: uppercase; }
.cs-repo .rn { margin-top: 2px; color: var(--tx); font-size: 16px; font-weight: 525; overflow-wrap: anywhere; }
.cs-repo-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 18px; border-radius: 999px; background: var(--sr-slate); color: var(--tx-inverse); font-size: 15px; font-weight: 525; white-space: nowrap; box-shadow: var(--sh-btn-primary); transition: background-color .35s var(--ease-ui), transform .35s var(--ease-ui); }
.cs-repo-btn:hover { background: #36261a; }
.cs-repo-btn:active { transform: scale(.96); }
.cs-repo-btn svg { width: 16px; height: 16px; flex: none; }

/* Up next: "Read more" divider */
.cs-project-nav { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 96px; padding-top: 56px; border-top: 1px solid var(--st-secondary); text-align: center; }
.cs-next-label { margin: 0 !important; color: var(--tx-tertiary) !important; font-size: 12px !important; line-height: 16px !important; font-weight: 525; letter-spacing: 2px; text-transform: uppercase; }
.cs-next { font-family: var(--font-display); font-size: 28px; line-height: 35px; font-weight: 525; letter-spacing: -.7px; color: var(--tx); font-variation-settings: 'opsz' 72; transition: color var(--d-normal) ease-out; }
.cs-next:hover { color: var(--indigo-800); }
.cs-next-btn { margin-top: 6px; }

/* Entrance */
@media (prefers-reduced-motion: no-preference) {
  .up { animation: csUp var(--d-entrance) var(--ease-reveal) both; }
  .cs-title { animation-delay: .05s; } .cs-summary { animation-delay: .1s; } .cs-kicker, .cs-stack, .cs-meta { animation-delay: .15s; }
  @keyframes csUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}

@media (max-width: 900px) {
  .cs-grid, .cs-body:has(.cs-grid) .cs-grid { grid-template-columns: 1fr; width: auto; margin-left: 0; transform: none; }
}
@media (max-width: 767px) {
  .cs-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-meta .cell { padding: 16px 0 16px 16px; }
  .cs-meta .cell:nth-child(odd) { border-left: 0; padding-left: 0; }
  .cs-meta .cell:nth-child(-n+2) { border-bottom: 1px solid var(--st-secondary); }
  .cs-meta .v { font-size: 14px; }
  .cs-summary { font-size: 17px; }
  .cs-body p, .cs-list li { font-size: 16px; }
  .cs-own { padding: 24px; }
  .cs-flow li { border-radius: 20px; }
  .cs-repo { padding: 16px; }
  .cs-repo-btn { width: 100%; }
  .cs-next { font-size: 24px; line-height: 30px; }
}
