.mainstreetfy-case-study-page {
  --case-ink: #071916;
  --case-green: #1ed760;
  --case-lime: #c9ff4f;
  --case-cream: #f7f3e9;
  --case-muted: #5d6966;
  background: #fff;
}

.mainstreetfy-case-study-page .guide-button { text-decoration: none; }
.case-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.case-section { padding: 92px 0; }
.case-section h2 { max-width: 850px; margin: 10px 0 22px; color: var(--case-ink); font-size: clamp(2.2rem, 4.5vw, 4rem); line-height: 1.03; letter-spacing: -.045em; }
.case-intro { max-width: 820px; color: var(--case-muted); font-size: 1.15rem; line-height: 1.75; }
.case-section--cream { background: var(--case-cream); }
.case-section--white { background: #fff; }
.case-section--lavender { background: #edf0ff; }

.case-hero { overflow: hidden; padding: 86px 0 96px; color: #fff; background: radial-gradient(circle at 80% 10%, rgba(30,215,96,.2), transparent 32%), linear-gradient(140deg, #0b1e19, #050806); }
.case-hero__grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 54px; align-items: center; }
.case-pill { display: inline-flex; margin: 0 0 24px; padding: 8px 12px; border: 1px solid rgba(201,255,79,.4); border-radius: 999px; color: var(--case-lime); font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.case-hero h1 { max-width: 670px; margin: 0; color: #fff; font-size: clamp(3.3rem, 6.2vw, 5.7rem); line-height: .94; letter-spacing: -.06em; }
.case-lead { max-width: 650px; margin: 28px 0 0; color: #bdc9c4; font-size: 1.18rem; line-height: 1.7; }
.case-actions { display: flex; flex-wrap: wrap; gap: 18px 22px; align-items: center; margin-top: 30px; }
.case-link { color: inherit; font-weight: 800; text-underline-offset: 4px; }
.case-note { max-width: 570px; margin: 20px 0 0; color: #91a39b; font-size: .83rem; line-height: 1.55; }
.case-hero__visual { width: 900px; margin: 0; }
.case-hero__visual img { display: block; width: 100%; height: auto; border: 1px solid rgba(255,255,255,.18); border-radius: 18px; box-shadow: 0 34px 90px rgba(0,0,0,.55); }
.case-hero__visual figcaption { margin-top: 12px; color: #8fa098; font-size: .78rem; }

.case-facts { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-top: 42px; }
.case-facts article { min-height: 180px; padding: 25px; border: 1px solid #d5dbd1; border-radius: 12px; background: rgba(255,255,255,.7); }
.case-facts strong { display: block; margin-bottom: 42px; color: var(--case-ink); font-size: 1.15rem; }
.case-facts span { color: var(--case-muted); line-height: 1.55; }

.case-section--dark { color: #fff; background: var(--case-ink); }
.case-section--dark h2 { color: #fff; }
.case-mobile-story { display: grid; grid-template-columns: minmax(0,.8fr) minmax(460px,1fr); gap: 70px; align-items: center; }
.case-mobile-story > div:first-child > p:not(.section-kicker) { color: #b7c7c0; font-size: 1.08rem; line-height: 1.7; }
.case-section--dark .section-kicker--bright,
.brief-heading .section-kicker--bright { color: var(--case-ink) !important; background: var(--case-lime); }
.case-checks { display: grid; gap: 12px; margin: 30px 0 0; padding: 0; list-style: none; }
.case-checks li { position: relative; padding-left: 29px; color: #e6f1ec; }
.case-checks li::before { content: "✓"; position: absolute; left: 0; color: var(--case-green); font-weight: 900; }
.phone-pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; align-items: end; }
.phone-pair figure { margin: 0; }
.phone-pair img { display: block; width: 100%; height: auto; border: 1px solid rgba(255,255,255,.16); border-radius: 27px; box-shadow: 0 25px 65px rgba(0,0,0,.4); }
.phone-pair figure:first-child { transform: translateY(-22px); }
.phone-pair figcaption { margin-top: 10px; color: #8ea098; font-size: .76rem; text-align: center; }

.case-timeline { max-width: 930px; margin-top: 46px; }
.case-timeline article { display: grid; grid-template-columns: 68px 1fr; gap: 22px; padding: 30px 0; border-top: 1px solid #d9dfdc; }
.case-timeline article:last-child { border-bottom: 1px solid #d9dfdc; }
.case-timeline > article > span { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 50%; color: var(--case-ink); background: var(--case-lime); font-size: .8rem; font-weight: 900; }
.case-timeline h3 { margin: 0 0 9px; color: var(--case-ink); font-size: 1.45rem; }
.case-timeline p { margin: 0; color: var(--case-muted); line-height: 1.7; }

.case-split { display: grid; grid-template-columns: minmax(0,.95fr) minmax(430px,1fr); gap: 60px; align-items: center; }
.case-split > div:first-child > p:not(.section-kicker) { color: var(--case-muted); font-size: 1.08rem; line-height: 1.75; }
.architecture-card { display: grid; padding: 34px; border: 1px solid #c8d0ef; border-radius: 16px; background: #fff; box-shadow: 0 22px 50px rgba(18,30,68,.09); text-align: center; }
.architecture-card > span { padding: 18px; border-radius: 9px; color: #fff; background: var(--case-ink); font-weight: 900; }
.architecture-card > i { width: 2px; height: 28px; margin: 0 auto; background: #7891e2; }
.architecture-card > div { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.architecture-card b { padding: 22px 12px; border: 1px solid #cbd5f3; border-radius: 9px; color: var(--case-ink); background: #f3f5ff; }

.lesson-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 42px; }
.lesson-grid article { min-height: 250px; padding: 27px; border: 1px solid #d8dfdc; border-radius: 12px; background: #fbfcfb; }
.lesson-grid article:nth-child(4), .lesson-grid article:nth-child(5) { grid-column: span 1; }
.lesson-grid span { color: #117a39; font-size: .75rem; font-weight: 900; }
.lesson-grid h3 { margin: 56px 0 10px; color: var(--case-ink); font-size: 1.35rem; }
.lesson-grid p { margin: 0; color: var(--case-muted); line-height: 1.65; }

.brief-section { color: #fff; background: linear-gradient(145deg,#0a211a,#07110e); }
.brief-section h2 { color: #fff; }
.brief-heading { max-width: 840px; }
.brief-heading > p:not(.section-kicker) { color: #b8c8c1; font-size: 1.08rem; line-height: 1.7; }
.brief-section .reading-gate { max-width: 820px; margin: 42px 0 0; color: var(--case-ink); }
.build-kit-links { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-top: 28px; padding: 24px; border: 1px solid rgba(201,255,79,.26); border-radius: 12px; background: rgba(255,255,255,.06); }
.build-kit-links .case-link { color: #fff; }
.walkthrough-section { color: #fff; background: #0d2c23; }
.walkthrough-card { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(280px,.7fr); gap: clamp(32px,6vw,84px); align-items: center; }
.walkthrough-card h2 { max-width: 760px; margin: 12px 0 18px; color: #fff; }
.walkthrough-card > div > p:not(.section-kicker) { max-width: 720px; color: #c4d4ce; font-size: 1.08rem; line-height: 1.7; }
.walkthrough-details { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 24px 0 0; padding: 0; list-style: none; color: #e8f3ee; font-weight: 700; }
.walkthrough-details li::before { content: "✓"; margin-right: 8px; color: var(--case-green); }
.walkthrough-action { padding: 30px; border: 1px solid rgba(201,255,79,.35); border-radius: 14px; background: #071916; box-shadow: 0 22px 55px rgba(0,0,0,.2); }
.walkthrough-action p { margin: 0 0 20px; color: #fff; line-height: 1.5; }
.walkthrough-action .guide-button { width: 100%; }
.walkthrough-action small { display: block; margin-top: 15px; color: #b9cbc4; line-height: 1.5; }
.walkthrough-dialog { width: min(620px,calc(100% - 32px)); padding: clamp(24px,5vw,44px); border: 0; border-radius: 18px; color: var(--case-ink); background: #f7f3e9; box-shadow: 0 30px 90px rgba(0,0,0,.38); }
.walkthrough-dialog::backdrop { background: rgba(3,14,11,.78); backdrop-filter: blur(4px); }
.walkthrough-dialog h2 { margin: 10px 34px 12px 0; font-size: clamp(2rem,5vw,3rem); line-height: 1.02; }
.walkthrough-dialog__copy > p:not(.section-kicker) { color: var(--case-muted); line-height: 1.65; }
.walkthrough-dialog__cta { width:100%; margin-top:24px; }
.walkthrough-dialog small { display: block; margin-top: 18px; color: var(--case-muted); text-align: center; }
.walkthrough-close { position: absolute; top: 15px; right: 17px; width: 38px; height: 38px; border: 0; border-radius: 50%; color: var(--case-ink); background: rgba(7,25,22,.08); font-size: 1.7rem; line-height: 1; cursor: pointer; }
.brief-section .reading-gate h3 { margin: 10px 0 12px; font-size: 2rem; }
.reading-gate { position: relative; z-index: 1; padding: 42px; border: 1px solid #b9cfea; border-radius: 16px; background: radial-gradient(circle at 90% 10%,rgba(80,161,241,.22),transparent 35%),linear-gradient(135deg,#edf6ff,#f7f3e9); box-shadow: 0 24px 60px rgba(8,27,49,.13); text-align: center; }
.reading-gate > p:not(.section-kicker) { max-width: 720px; margin: 18px auto 28px; color: var(--case-muted); line-height: 1.65; }
.reading-gate form { display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; max-width: 720px; margin: 0 auto; align-items: start; text-align: left; }
.reading-gate form > div:not(.honeypot-field) { display: grid; gap: 7px; }
.reading-gate label { color: var(--case-ink); font-size: .84rem; font-weight: 800; }
.reading-gate input { min-height: 54px; border: 1px solid #9fb4c9; border-radius: 8px; padding: 0 13px; color: var(--case-ink); background: #fff; font: inherit; }
.reading-gate .guide-button { grid-column: 1 / -1; width: 100%; margin: 2px 0 0; }
.reading-gate .form-feedback { grid-column: 1 / -1; }
.reading-gate > small { display: block; margin-top: 18px; color: var(--case-muted); }
.unlocked-note { display: flex; margin: 34px 0 28px; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #b4d6c4; border-radius: 10px; padding: 18px 22px; color: var(--case-ink); background: #eaf8f0; }
.unlocked-note span { color: #145a36; font-weight: 900; }
.unlocked-note p { margin: 0; color: #38614d; }
.build-brief { overflow: hidden; margin-top: 42px; border: 1px solid rgba(201,255,79,.26); border-radius: 15px; background: #06100d; }
.build-brief header { display: flex; gap: 20px; justify-content: space-between; align-items: center; padding: 25px 28px; border-bottom: 1px solid rgba(255,255,255,.11); background: #10251e; }
.build-brief h3 { margin: 5px 0 0; color: #fff; font-size: 1.45rem; }
.build-brief button { flex: 0 0 auto; min-height: 42px; padding: 0 16px; border: 0; border-radius: 7px; color: var(--case-ink); background: var(--case-lime); font: inherit; font-size: .8rem; font-weight: 900; cursor: pointer; }
.build-brief pre { overflow-x: auto; margin: 0; padding: 32px; white-space: pre-wrap; }
.build-brief code { color: #e4f1eb; font-family: ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace; font-size: .9rem; line-height: 1.75; }
.adapt-brief { margin-top: 16px; padding: 30px; border: 1px solid rgba(255,255,255,.16); border-radius: 12px; background: rgba(255,255,255,.06); }
.adapt-brief h3 { margin: 0 0 18px; color: #fff; }
.adapt-brief ol { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; margin: 0; padding-left: 21px; color: #c5d3cd; line-height: 1.55; }
.next-step { max-width: 850px; }
.next-step > p:not(.section-kicker) { color: var(--case-muted); font-size: 1.1rem; line-height: 1.7; }
.next-step .case-link { color: var(--case-ink); }

@media (max-width: 940px) {
  .case-hero__grid, .case-mobile-story, .case-split, .walkthrough-card { grid-template-columns: 1fr; }
  .case-hero__visual { width: 110%; }
  .case-facts { grid-template-columns: repeat(2,1fr); }
  .case-mobile-story { gap: 55px; }
  .phone-pair { max-width: 620px; }
  .lesson-grid { grid-template-columns: repeat(2,1fr); }
  .adapt-brief ol { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 620px) {
  .case-shell { width: min(100% - 30px,1180px); }
  .case-section { padding: 68px 0; }
  .case-hero { padding: 90px 0 68px; }
  .case-hero h1 { font-size: clamp(3rem,15vw,4.3rem); }
  .case-hero__grid { gap: 42px; }
  .case-hero__visual { width: 145%; }
  .case-facts, .lesson-grid { grid-template-columns: 1fr; }
  .case-facts article { min-height: 150px; }
  .case-facts strong { margin-bottom: 28px; }
  .case-mobile-story { grid-template-columns: minmax(0,1fr); }
  .phone-pair { gap: 10px; }
  .phone-pair figure:first-child { transform: translateY(-12px); }
  .case-timeline article { grid-template-columns: 52px 1fr; gap: 12px; }
  .case-timeline > article > span { width: 40px; height: 40px; }
  .architecture-card { padding: 20px; }
  .architecture-card > div { grid-template-columns: 1fr; }
  .build-brief header { display: grid; }
  .build-brief button { width: 100%; }
  .build-brief pre { padding: 22px 18px; }
  .adapt-brief ol { grid-template-columns: 1fr; }
  .reading-gate { padding: 34px 20px; }
  .reading-gate form { grid-template-columns: 1fr; }
  .unlocked-note { align-items: flex-start; flex-direction: column; }
}
