/* Inner pages (case studies, about). Builds on home.css: same tokens, header, buttons and footer. */
.top { background: rgba(10,10,10,.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top nav a.on { color: var(--text); }

.page-hero { padding: 150px 0 70px; position: relative; overflow: hidden; }
.page-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px; opacity: .35;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 70% 0%, #000 0%, transparent 70%);
          mask-image: radial-gradient(ellipse 70% 80% at 70% 0%, #000 0%, transparent 70%);
}
.page-hero .wrap { position: relative; }
.crumbs { font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin-bottom: 26px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.page-hero h1 { font-size: clamp(38px, 6.4vw, 72px); line-height: 1.02; letter-spacing: -.035em; margin: 0 0 22px; font-weight: 700; max-width: 14em; }
.page-hero .lead { max-width: 38em; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 54px; }
.stat { background: var(--bg); padding: 22px 24px; }
.stat b { display: block; font-size: 28px; letter-spacing: -.02em; font-weight: 650; line-height: 1.1; margin-bottom: 6px; }
.stat span { color: var(--muted); font-size: 14px; line-height: 1.45; display: block; }

.case { padding: 90px 0; border-top: 1px solid var(--line); }
.case .grid { display: grid; grid-template-columns: 260px 1fr; gap: 56px; align-items: start; }
.case .grid > * { min-width: 0; }
.case .grid > .label { position: sticky; top: 96px; }
.prose { max-width: 44em; }
.prose h2 { font-size: clamp(26px, 3.2vw, 36px); margin-bottom: 18px; }
.prose h3 { font-size: 19px; margin: 34px 0 10px; letter-spacing: -.01em; }
.prose p, .prose li { color: #c4c4c4; font-size: 17px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 20px; margin: 0 0 18px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--dim); }
.prose strong { color: var(--text); font-weight: 600; }
.prose code, .mono { font: 500 .88em var(--mono); color: #e6e6e6; background: #1a1a1a; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.prose a { color: var(--text); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--text); }

/* Numbered steps */
.steps { list-style: none; padding: 0; margin: 26px 0 0; counter-reset: s; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.steps li { counter-increment: s; background: var(--bg); padding: 20px 22px 20px 64px; position: relative; margin: 0; }
.steps li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 22px; top: 21px; font: 500 12px var(--mono); color: var(--dim); }
.steps li b { color: var(--text); font-weight: 600; display: block; margin-bottom: 2px; }
.steps li span { color: var(--muted); font-size: 15px; }

/* Figures */
.figure { margin: 30px 0 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.figure img { display: block; width: 100%; height: auto; }
.figure.dark { background: var(--card); }
.figure.phone { max-width: 300px; border-radius: 22px; }
.caption { font-size: 13px; color: var(--dim); margin: 10px 0 0; }

/* Code block */
pre.code { font: 500 13px/1.6 var(--mono); color: #d9d9d9; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; overflow-x: auto; margin: 18px 0 0; white-space: pre; }
pre.code .c { color: var(--dim); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin: 22px 0 0; }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 640px; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); background: var(--bg-2); }
table.data td { color: #cfcfcf; font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.good { color: var(--text); font-weight: 600; }

/* Flow diagram (n8n) */
.flow { display: grid; gap: 10px; margin: 26px 0 0; }
.flow .node { border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 18px; background: var(--card); }
.flow .node b { display: block; font-size: 15px; }
.flow .node span { color: var(--muted); font-size: 14px; }
.flow .arrow-down { justify-self: center; width: 1px; height: 18px; background: var(--line-2); position: relative; }
.flow .arrow-down::after { content: ""; position: absolute; bottom: -1px; left: -4px; border: 4px solid transparent; border-top-color: var(--line-2); }
.flow .split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.flow .node.out { border-style: dashed; }

/* Timeline (about) */
.timeline { list-style: none; padding: 0; margin: 10px 0 0; border-left: 1px solid var(--line-2); }
.timeline li { position: relative; padding: 0 0 34px 28px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1px solid var(--muted); }
.timeline .when { font: 500 12px var(--mono); color: var(--dim); letter-spacing: .08em; }
.timeline h3 { margin: 4px 0 8px; font-size: 20px; }
.timeline p { margin: 0 0 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 22px; padding: 0; list-style: none; }
.chips li { font: 500 12px var(--mono); color: #cfcfcf; border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 11px; margin: 0; }

/* Previous / next */
.next { border-top: 1px solid var(--line); }
.next .wrap { display: grid; grid-template-columns: 1fr 1fr; }
.next a { display: block; padding: 46px 0; text-decoration: none; }
.next a + a { text-align: right; border-left: 1px solid var(--line); padding-left: 24px; }
.next small { display: block; font: 500 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.next strong { font-size: clamp(20px, 2.6vw, 28px); letter-spacing: -.02em; font-weight: 650; transition: color .2s; }
.next a:hover strong { color: #ffffff; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 6px; }

@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .case { padding: 64px 0; }
  .case .grid { grid-template-columns: 1fr; gap: 14px; }
  .case .grid > .label { position: static; }
  .flow .split { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .page-hero { padding: 118px 0 50px; }
  .stats { grid-template-columns: 1fr; }
  .next .wrap { grid-template-columns: 1fr; }
  .next a + a { text-align: left; border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
}
