/* Case study pages: builds on ../style.css */

.case { max-width: 1180px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 560px) { .case { padding: 0 16px; } }

/* hero */
.c-hero { max-width: var(--col); margin: 0 auto; padding: 9vh 0 40px; }
.crumb { font: 400 13px var(--mono); color: var(--ink-3); display: flex; gap: 8px; flex-wrap: wrap; }
.crumb a { color: var(--ink-2); }
.crumb a:hover { color: var(--ink); }
.c-hero h1 { font-size: clamp(44px, 8vw, 76px); margin-top: 18px; }
.c-hero .sub { font-size: clamp(18px, 2.4vw, 21px); color: var(--ink-2); margin-top: 18px; max-width: 600px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 34px; padding: 18px 0; border-block: 1px solid var(--line); }
.facts div { display: grid; gap: 2px; }
.facts dt { font: 400 12px var(--mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.facts dd { font-size: 15px; }
@media (max-width: 640px) { .facts { grid-template-columns: 1fr 1fr; } }
.c-hero .cta { margin-top: 26px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); display: inline-block; }
.btn .live-dot { background: #6fd39b; }

.c-cover { max-width: 1040px; margin: 10px auto 0; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.c-cover img { display: block; width: 100%; height: auto; }

/* 30-second version */
.tldr { max-width: var(--col); margin: 70px auto 0; padding: 28px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.tldr h2 { font: 500 12.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); display: flex; justify-content: space-between; gap: 10px; }
.tldr dl { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 30px; margin-top: 18px; }
.tldr dt { font: 400 12.5px var(--mono); color: var(--accent); margin-bottom: 4px; }
.tldr dd { color: var(--ink-2); font-size: 15.5px; }
.tldr .result dd { color: var(--ink); font-weight: 500; }
@media (max-width: 640px) { .tldr { padding: 22px 18px; } .tldr dl { grid-template-columns: 1fr; gap: 16px; } }

/* body + table of contents */
.c-body { position: relative; max-width: var(--col); margin: 0 auto; padding-bottom: 40px; }
.toc { position: fixed; top: 120px; left: calc(50vw - 720px); width: 170px; font: 400 13px var(--sans); z-index: 5; }
.toc p { font: 500 11.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 10px; }
.toc a { display: block; padding: 5px 0 5px 12px; color: var(--ink-3); border-left: 1px solid var(--line); transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--ink); border-left-color: var(--accent); }
@media (max-width: 1500px) { .toc { display: none; } }

.chap { padding: 70px 0 10px; }
.chap .k { font: 400 12.5px var(--mono); color: var(--ink-3); }
.chap h2 { font: 400 clamp(30px, 4.4vw, 40px)/1.12 var(--serif); margin: 8px 0 18px; letter-spacing: -.005em; }
.chap h3 { font: 500 17px var(--sans); margin: 26px 0 6px; }
.chap p { color: var(--ink-2); font-size: 17px; margin-bottom: 14px; }
.chap p b, .chap li b { color: var(--ink); font-weight: 500; }
.chap ul.points { display: grid; gap: 10px; margin: 6px 0 16px; }
.chap ul.points li { position: relative; padding-left: 22px; color: var(--ink-2); font-size: 16.5px; }
.chap ul.points li::before { content: ''; position: absolute; left: 2px; top: .72em; width: 8px; height: 1px; background: var(--ink-3); }
.quote { font: italic 400 clamp(24px, 3.4vw, 30px)/1.3 var(--serif); color: var(--ink); border-left: 2px solid var(--accent); padding: 4px 0 4px 20px; margin: 26px 0; }
.quote small { display: block; font: 400 13px var(--mono); font-style: normal; color: var(--ink-3); margin-top: 8px; }

.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 8px; }
.cards3 > div { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: var(--surface); }
.cards3 b { display: block; font-weight: 500; margin-bottom: 6px; }
.cards3 span { color: var(--ink-2); font-size: 14.5px; }
@media (max-width: 700px) { .cards3 { grid-template-columns: 1fr; } }

.steps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 14px 0 20px; font: 400 13px var(--mono); }
.steps span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); }
.steps span:last-child { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.steps i { font-style: normal; color: var(--ink-3); }

/* figures: wider than the text column */
.fig { margin: 30px calc(min(0px, (var(--col) - min(1040px, 100vw - 64px)) / 2)); }
.fig img { display: block; width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); cursor: zoom-in; transition: transform .5s var(--ease); }
.fig img:hover { transform: scale(1.01); }
.fig figcaption { font: 400 13px var(--mono); color: var(--ink-3); margin-top: 10px; text-align: center; }
.fig.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fig.pair figcaption { grid-column: 1 / -1; }
.fig.narrow { margin-left: 0; margin-right: 0; }
.fig.tall img { max-height: 900px; width: auto; max-width: 100%; margin: 0 auto; }
@media (max-width: 560px) { .fig { margin-left: 0; margin-right: 0; } .fig.pair { grid-template-columns: 1fr; } }

/* live phone frame */
.phone { width: min(300px, 70vw); margin: 30px auto; border-radius: 42px; padding: 10px; background: #111; box-shadow: 0 30px 60px rgb(0 0 0 / .18); }
.phone img { display: block; width: 100%; border-radius: 32px; }
.phone + figcaption { font: 400 13px var(--mono); color: var(--ink-3); text-align: center; }

/* mic state demo (Airlearn) */
.mic-demo { margin: 26px 0; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.mic { width: 84px; height: 84px; border-radius: 50%; border: 0; background: #5aa9f0; display: grid; place-items: center; position: relative; transition: background .3s, transform .2s; }
.mic svg { width: 32px; height: 32px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.mic:hover { transform: scale(1.04); }
.mic::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid #5aa9f0; opacity: 0; }
.mic[data-s="listening"]::after { animation: micpulse 1.2s infinite; opacity: 1; }
.mic[data-s="analysing"] { background: #8fa4c4; }
.mic[data-s="correct"] { background: #33b07a; }
.mic[data-s="incorrect"] { background: #e05a5a; }
.mic[data-s="missed"] { background: #c9c9c9; }
.mic-text b { display: block; font-weight: 500; }
.mic-text span { color: var(--ink-2); font-size: 14.5px; }
.mic-text small { display: block; margin-top: 10px; font: 400 12px var(--mono); color: var(--ink-3); }
@keyframes micpulse { from { transform: scale(.95); opacity: .8; } to { transform: scale(1.25); opacity: 0; } }
@media (max-width: 480px) { .mic-demo { grid-template-columns: 1fr; justify-items: center; text-align: center; } }

/* next project */
.next { max-width: var(--col); margin: 60px auto 0; border-top: 1px solid var(--line); padding: 40px 0 10px; }
.next a { display: block; }
.next small { font: 400 12.5px var(--mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.next strong { display: block; font: 400 clamp(34px, 6vw, 56px)/1.05 var(--serif); margin-top: 8px; }
.next a:hover .arrow { transform: translate(4px, -4px); color: var(--accent); }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 60; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 24px; opacity: 0; pointer-events: none; transition: opacity .3s; cursor: zoom-out; }
.lb.on { opacity: 1; pointer-events: auto; }
.lb img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 30px 80px rgb(0 0 0 / .25); transform: scale(.96); transition: transform .4s var(--ease); }
.lb.on img { transform: none; }

.credit { max-width: var(--col); margin: 14px auto 0; font: 400 13px/1.6 var(--mono); color: var(--ink-3); padding: 12px 16px; border-left: 2px solid var(--line); }

/* key decisions */
.decisions { display: grid; gap: 14px; margin-top: 8px; counter-reset: dec; }
.dec { position: relative; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); padding: 22px 24px 20px 62px; counter-increment: dec; transition: border-color .3s, transform .4s var(--ease); }
.dec:hover { border-color: var(--ink-3); transform: translateY(-2px); }
.dec::before { content: counter(dec, decimal-leading-zero); position: absolute; left: 22px; top: 22px; font: 400 13px var(--mono); color: var(--accent); }
.dec h3 { font: 400 22px/1.25 var(--serif); margin: 0 0 12px; }
.dec dl { display: grid; grid-template-columns: 92px 1fr; gap: 8px 14px; }
.dec dt { font: 400 12px var(--mono); color: var(--ink-3); padding-top: 3px; text-transform: uppercase; letter-spacing: .05em; }
.dec dd { color: var(--ink-2); font-size: 15.5px; }
.dec dd.trade { color: var(--ink-3); font-style: italic; }
@media (max-width: 560px) { .dec { padding: 20px 18px 18px; } .dec::before { position: static; display: block; margin-bottom: 6px; } .dec dl { grid-template-columns: 1fr; gap: 2px; } .dec dd { margin-bottom: 8px; } }

/* interactive user flow */
.flowfig { margin: 30px calc(min(0px, (var(--col) - min(1040px, 100vw - 64px)) / 2)); padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.flow-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.flow-title { font: 400 24px var(--serif); }
.btn.small { padding: 7px 14px; font-size: 13.5px; }
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px 30px; list-style: none; }
.fs { position: relative; }
.fs:not(:nth-child(4n))::after { content: '→'; position: absolute; right: -22px; top: 22px; color: var(--ink-3); font-size: 15px; }
.fs:nth-child(4n)::after { content: '↓'; position: absolute; left: 50%; bottom: -24px; color: var(--ink-3); font-size: 15px; }
.fs:last-child::after { content: none; }
.fs button { width: 100%; height: 100%; text-align: left; display: grid; gap: 4px; align-content: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); transition: border-color .25s, background .25s, transform .3s var(--ease); }
.fs button:hover { border-color: var(--ink-3); transform: translateY(-2px); }
.fs-n { font: 400 12px var(--mono); color: var(--ink-3); }
.fs-name { font: 500 15.5px var(--sans); color: var(--ink); }
.fs-opts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.fs-opts i { font: normal 400 11.5px var(--mono); color: var(--ink-2); padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); }
.fs.on button { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.fs.on .fs-n { color: var(--accent); }
.fs.seen button { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.flow-side { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; padding-top: 18px; border-top: 1px dashed var(--line); }
.flow-branch { display: flex; gap: 12px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .25s; }
.flow-branch:hover, .flow-branch.on { border-color: var(--accent); }
.flow-branch.dashed { border-style: dashed; }
.flow-branch b { display: block; font-weight: 500; font-size: 15px; }
.flow-branch small { font: 400 12px var(--mono); color: var(--ink-3); }
.flow-note { margin-top: 16px; min-height: 3.2em; padding: 12px 16px; border-radius: 12px; background: var(--bg); color: var(--ink-2); font-size: 15px; border-left: 2px solid var(--accent); }
.flowfig figcaption { font: 400 13px var(--mono); color: var(--ink-3); margin-top: 12px; text-align: center; }
.flowfig figcaption a { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) {
  .flowfig { margin-left: 0; margin-right: 0; padding: 16px; }
  .flow { grid-template-columns: 1fr; gap: 22px; }
  .fs::after, .fs:not(:nth-child(4n))::after, .fs:nth-child(4n)::after { content: '↓'; right: auto; left: 22px; top: auto; bottom: -21px; }
  .fs:last-child::after { content: none; }
  .flow-side { grid-template-columns: 1fr; }
}
