/* Case-study pages. Builds on the tokens and components in /styles.css. */

.case .narrow { max-width: 780px; }
.case .narrow-p { max-width: 720px; }
.case .h2 { font-size: clamp(34px, 5vw, 56px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; margin-bottom: 24px; }
.case .body { font-size: 19px; line-height: 1.6; color: var(--muted); margin-bottom: 18px; }
.case code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; background: var(--bg-alt); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
.case .section { padding: 110px 0; }

/* Hero */
.case-hero { background: var(--dark); color: var(--dark-text); padding: 140px 0 100px; position: relative; overflow: hidden; }
.case-hero::before {
  content: ""; position: absolute; width: 900px; height: 900px; right: -320px; top: -320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(138, 92, 255, 0.28), transparent 60%); pointer-events: none;
}
.case-hero::after {
  content: ""; position: absolute; width: 700px; height: 700px; left: -300px; bottom: -380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(41, 151, 255, 0.22), transparent 60%); pointer-events: none;
}
.case-hero .container { position: relative; z-index: 1; }
.back { display: inline-block; color: var(--dark-muted); font-size: 15px; margin-bottom: 40px; }
.back:hover { color: #fff; text-decoration: none; }
.case-title { font-size: clamp(44px, 7.5vw, 92px); font-weight: 800; letter-spacing: -0.045em; line-height: 1.02; max-width: 980px; }
.grad { background: linear-gradient(90deg, #2997ff, #b67cff, #ff7a85); -webkit-background-clip: text; background-clip: text; color: transparent; }
.case-sub { font-size: clamp(19px, 2.2vw, 24px); color: #a1a1a6; line-height: 1.45; max-width: 820px; margin-top: 28px; }
.facts { display: grid; grid-template-columns: repeat(4, auto); gap: 14px 40px; margin-top: 44px; justify-content: start; }
.facts dt { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #86868b; }
.facts dd { margin: 4px 0 0; font-size: 16px; font-weight: 500; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 56px; }
.hero-stats div { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 20px; padding: 24px; }
.hero-stats b { display: block; font-size: clamp(34px, 4vw, 48px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; background: linear-gradient(90deg, #2997ff, #b67cff, #ff7a85); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-stats span { display: block; color: #a1a1a6; font-size: 14px; margin-top: 10px; }

/* Cards & grids */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid2.wide { gap: 56px; }
.card-c { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.card-c .icon { font-size: 30px; margin-bottom: 14px; }
.card-c h3, .point h3 { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.card-c p, .point p { color: var(--muted); font-size: 16px; line-height: 1.55; }
.point { padding: 26px 28px; border-radius: var(--radius); background: var(--bg-alt); }

/* Pipeline strip */
.strip { list-style: none; display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin: 36px 0 12px; counter-reset: none; }
.strip li {
  position: relative; cursor: pointer; text-align: center; font-size: 13.5px; font-weight: 600; line-height: 1.25;
  padding: 16px 8px 14px; border-radius: 16px; background: var(--bg-alt); border: 1px solid var(--line);
  transition: transform 0.35s var(--ease), border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.strip li span { display: grid; place-items: center; width: 28px; height: 28px; margin: 0 auto 8px; border-radius: 50%; font-size: 13px; font-weight: 800; color: #fff; background: #6e6e73; }
.strip li.llm span { background: #8a5cff; }
.strip li.guard span { background: #2f9e44; }
.strip li:hover { transform: translateY(-3px); border-color: var(--accent); }
.strip li.active { border-color: var(--accent); box-shadow: 0 0 0 4px var(--spot); background: var(--card); transform: translateY(-3px); }
.legend { display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: 14px; margin-bottom: 40px; }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #6e6e73; margin-right: 6px; vertical-align: 0; }
.legend .dot.llm { background: #8a5cff; }
.legend .dot.guard { background: #2f9e44; }

.stages { display: flex; flex-direction: column; gap: 16px; }
.stage-card {
  display: grid; grid-template-columns: 56px 1fr; gap: 20px; scroll-margin-top: 80px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; box-shadow: var(--shadow);
  border-left: 4px solid #6e6e73;
}
.stage-card.llm { border-left-color: #8a5cff; }
.stage-card.guard { border-left-color: #2f9e44; }
.stage-card .n { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff; background: #6e6e73; }
.stage-card.llm .n { background: #8a5cff; }
.stage-card.guard .n { background: #2f9e44; }
.stage-card > div { min-width: 0; }
.stage-card h3 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.stage-card p { color: var(--muted); font-size: 16.5px; line-height: 1.6; }
.stage-card p b { color: var(--text); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chips span { font-size: 13px; font-weight: 500; padding: 5px 12px; border-radius: 980px; background: var(--bg-alt); border: 1px solid var(--line); }
.code {
  margin-top: 16px; padding: 18px 20px; border-radius: 14px; overflow-x: auto;
  background: #0b0b0f; color: #d6d6e0; border: 1px solid #2c2c2e; font-size: 13.5px; line-height: 1.55;
}
.code code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
.files { display: grid; gap: 8px; margin-top: 16px; }
.files div { display: grid; grid-template-columns: 170px 1fr; gap: 14px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.files div:last-child { border-bottom: 0; }
.files span { color: var(--muted); font-size: 15px; }

/* Agents */
.agents { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 12px; }
.agent { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px; }
.agent b { display: block; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 6px; }
.agent b::before { content: "◆ "; background: linear-gradient(90deg, #2997ff, #b67cff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.agent p { color: var(--muted); font-size: 14.5px; line-height: 1.5; }

/* Safety (always dark) */
.dark-band { background: var(--dark); color: var(--dark-text); }
.dark-band .body { color: var(--dark-muted); }
.layers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 12px; }
.layer { background: var(--dark-card); border: 1px solid var(--dark-line); border-radius: var(--radius); padding: 28px; }
.layer .tag { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #b67cff; }
.layer h3 { font-size: 22px; font-weight: 700; margin: 6px 0 14px; letter-spacing: -0.02em; }
.layer ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.layer li { position: relative; padding-left: 26px; font-size: 15px; line-height: 1.45; color: #d2d2d7; }
.layer li::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.layer li.ok::before { content: "✓"; color: #30d158; }
.layer li.no::before { content: "✕"; color: #ff453a; }
.dark-band code { background: #1c1c1e; border-color: #2c2c2e; color: #f5f5f7; }

.journey { list-style: none; display: flex; flex-direction: column; gap: 30px; margin-top: 8px; }
.journey li { position: relative; padding: 22px 24px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.journey li + li::before {
  content: "↓"; position: absolute; top: -26px; left: 28px; font-size: 16px; line-height: 1; color: var(--muted);
}
.journey .step { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.journey h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 6px; }
.journey p { color: var(--muted); font-size: 15.5px; line-height: 1.55; }
.impact { list-style: none; display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.impact li { font-size: 18px; color: var(--muted); padding-left: 22px; position: relative; }
.impact li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.impact b { color: var(--text); }

.lessons { padding-left: 22px; display: flex; flex-direction: column; gap: 16px; }
.lessons li { font-size: 19px; line-height: 1.55; color: var(--muted); }
.lessons b { color: var(--text); }

.case-cta { padding: 140px 0 150px; }
.case-cta .contact-title { font-size: clamp(40px, 7vw, 76px); }
.case-cta .contact-links { margin-top: 32px; }
.case-cta .btn-outline { color: var(--text); }

@media (max-width: 1000px) {
  .strip { grid-template-columns: repeat(4, 1fr); }
  .agents { grid-template-columns: repeat(2, 1fr); }
  .layers, .grid3 { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: repeat(2, auto); }
}
@media (max-width: 734px) {
  .case .section { padding: 80px 0; }
  .case-hero { padding: 110px 0 70px; }
  .grid2, .grid2.wide { grid-template-columns: 1fr; gap: 16px; }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .agents { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .stage-card { grid-template-columns: 1fr; padding: 24px 22px; gap: 12px; }
  .files div { grid-template-columns: 1fr; gap: 2px; }
  .hero-stats div { padding: 18px; }
}
