/* Case study pages (portfolio-details-*.html). Everything is scoped under .cs */
.cs {
  --cs-ink: #171A2B;
  --cs-ink-2: #1E2236;
  --cs-ink-3: #2A2F48;
  --cs-text: #F1F3F2;
  --cs-body: rgba(241, 243, 242, .78);
  --cs-mute: rgba(241, 243, 242, .62);
  --cs-line: rgba(241, 243, 242, .12);
  --cs-teal: #00DDBC;
  --cs-teal-deep: #00B89C;
  --cs-accent: #00DDBC;           /* set per project on .cs */
  --cs-stage: #CFF5EE;            /* set per project on .cs */
  --cs-stage-2: #9FE6D9;
  --cs-spring: cubic-bezier(.34, 1.56, .64, 1);
  --cs-ease: cubic-bezier(.22, 1, .36, 1);
  --cs-s1: 8px; --cs-s2: 16px; --cs-s3: 24px; --cs-s4: 40px; --cs-s5: 64px; --cs-s6: 104px;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--cs-body);
  font-size: 18px;
  line-height: 1.7;
  position: relative;
  padding: 128px 0 var(--cs-s6);
  overflow: hidden;
}
.cs--ah { --cs-accent: #E8B4C2; --cs-stage: #F2DDE3; --cs-stage-2: #D7A2B0; }
.cs--bo { --cs-accent: #7FA6FF; --cs-stage: #DCE6FF; --cs-stage-2: #9DB6F5; }

.cs *, .cs *::before, .cs *::after { box-sizing: border-box; }
.cs img { display: block; max-width: 100%; height: auto; }
.cs p { margin: 0; color: inherit; font-size: inherit; line-height: inherit; }
.cs h1, .cs h2, .cs h3 { font-family: inherit; color: var(--cs-text); margin: 0; }
.cs ul { margin: 0; padding: 0; list-style: none; }

.cs__wrap { width: min(1180px, 100% - 48px); margin: 0 auto; position: relative; z-index: 1; }
.cs__narrow { max-width: 68ch; }

/* backdrop glow: layered radials + grain */
.cs::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 900px; pointer-events: none; z-index: 0;
  background:
    radial-gradient(600px 400px at 85% 10%, color-mix(in srgb, var(--cs-accent) 18%, transparent), transparent 70%),
    radial-gradient(500px 380px at 10% 30%, rgba(0, 221, 188, .10), transparent 70%);
}
.cs::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* breadcrumb */
.cs-crumb { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 14px; color: var(--cs-mute); margin-bottom: var(--cs-s3); }
.cs-crumb a { color: var(--cs-mute); text-decoration: none; border-radius: 4px; transition: color .2s ease; }
.cs-crumb a:hover { color: var(--cs-teal); }
.cs-crumb a:focus-visible { outline: 2px solid var(--cs-teal); outline-offset: 3px; color: var(--cs-text); }
.cs-crumb a:active { opacity: .7; }
.cs-crumb span[aria-hidden] { opacity: .5; }

/* hero */
.cs-hero { display: grid; gap: var(--cs-s3); max-width: 900px; }
.cs-sector { font-weight: 600; font-size: 16px; color: var(--cs-accent); }
.cs-hero h1 { font-size: clamp(37px, 5.4vw, 70px); font-weight: 800; line-height: 1.03; letter-spacing: -0.03em; }
.cs-lead { font-size: clamp(17px, 1.6vw, 20px); max-width: 60ch; color: rgba(241, 243, 242, .82); }
.cs-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--cs-s1); }

.cs-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 24px; border-radius: 999px;
  font-weight: 700; font-size: 16px; line-height: 1; text-decoration: none;
  transition: transform .35s var(--cs-spring), background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.cs-btn svg { width: 18px; height: 18px; flex: none; transition: transform .35s var(--cs-spring); }
.cs-btn--primary { background: var(--cs-teal); color: var(--cs-ink); box-shadow: 0 1px 2px rgba(0, 60, 52, .25), 0 12px 30px -12px rgba(0, 221, 188, .65); }
.cs-btn--primary:hover { background: var(--cs-teal-deep); color: var(--cs-ink); transform: translateY(-2px); }
.cs-btn--ghost { color: var(--cs-text); box-shadow: inset 0 0 0 1.5px rgba(241, 243, 242, .32); }
.cs-btn--ghost:hover { color: var(--cs-text); box-shadow: inset 0 0 0 1.5px var(--cs-teal); transform: translateY(-2px); }
.cs-btn:hover svg { transform: translateX(3px); }
.cs-btn:focus-visible { outline: 3px solid var(--cs-teal); outline-offset: 3px; }
.cs-btn:active { transform: translateY(0) scale(.97); }

/* stage: browser + phone */
.cs-stage {
  position: relative; margin: var(--cs-s5) 0 0; border-radius: 28px; overflow: hidden;
  padding: clamp(24px, 5vw, 72px) clamp(20px, 9vw, 128px) clamp(40px, 6vw, 88px) clamp(20px, 5vw, 64px);
  background: radial-gradient(80% 80% at 30% 20%, rgba(255, 255, 255, .85), transparent 70%), linear-gradient(150deg, var(--cs-stage), var(--cs-stage-2));
  box-shadow: 0 2px 6px rgba(8, 8, 16, .25), 0 40px 90px -40px color-mix(in srgb, var(--cs-stage-2) 55%, transparent);
}
.cs-browser { border-radius: 14px; overflow: hidden; background: #0E1018; transform: rotate(-1.2deg);
  box-shadow: 0 2px 4px rgba(23, 26, 43, .12), 0 30px 60px -20px rgba(23, 26, 43, .55), 0 0 0 1px rgba(23, 26, 43, .1); }
.cs-browser__bar { display: flex; align-items: center; gap: 6px; padding: 9px 13px; background: #1D2031; }
.cs-browser__bar b { width: 9px; height: 9px; border-radius: 99px; background: #3A3F58; }
.cs-browser__bar span { margin-left: 10px; font-size: 12px; line-height: 1; color: #9AA0B8; }
.cs-browser img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.cs-phone { position: absolute; right: clamp(12px, 4vw, 48px); bottom: clamp(12px, 3vw, 36px); width: clamp(104px, 18%, 190px);
  border-radius: 24px; padding: 6px; background: #0B0D14; box-shadow: 0 30px 50px -16px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .12); }
.cs-phone img { border-radius: 18px; aspect-ratio: 390 / 760; object-fit: cover; object-position: top; width: 100%; }

/* one orchestrated load: hero copy rises, then the stage settles in */
@media (prefers-reduced-motion: no-preference) {
  .cs-hero > * { animation: cs-rise .8s var(--cs-ease) both; }
  .cs-hero > :nth-child(2) { animation-delay: .06s; }
  .cs-hero > :nth-child(3) { animation-delay: .12s; }
  .cs-hero > :nth-child(4) { animation-delay: .2s; }
  .cs-hero > :nth-child(5) { animation-delay: .28s; }
  .cs-stage { animation: cs-rise 1s var(--cs-ease) .3s both; }
  .cs-phone { animation: cs-phone 1.1s var(--cs-spring) .75s both; }
}
@keyframes cs-rise { from { opacity: 0; transform: translate3d(0, 24px, 0); } to { opacity: 1; transform: none; } }
@keyframes cs-phone { from { opacity: 0; transform: translate3d(0, 60px, 0) rotate(4deg); } to { opacity: 1; transform: none; } }

/* project facts */
.cs-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: var(--cs-s4) 0 0; border-radius: 20px; overflow: hidden;
  background: var(--cs-line); box-shadow: 0 0 0 1px var(--cs-line); }
.cs-facts div { background: var(--cs-ink); padding: 20px 22px; }
.cs-facts dt { font-size: 14px; font-weight: 500; color: var(--cs-mute); margin-bottom: 4px; }
.cs-facts dd { margin: 0; color: var(--cs-text); font-weight: 600; font-size: 16px; line-height: 1.45; }
.cs-facts a { color: var(--cs-teal); text-decoration: underline; text-underline-offset: 3px; border-radius: 3px; }
.cs-facts a:hover { color: #fff; }
.cs-facts a:focus-visible { outline: 2px solid var(--cs-teal); outline-offset: 2px; }
.cs-facts a:active { opacity: .7; }
@media (min-width: 900px) { .cs-facts { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* sections */
.cs-section { margin-top: var(--cs-s6); }
.cs-section h2 { font-size: clamp(30px, 3.6vw, 46px); font-weight: 800; line-height: 1.08; letter-spacing: -0.03em; margin-bottom: var(--cs-s3); max-width: 22ch; }
.cs-section .cs__narrow > p + p { margin-top: var(--cs-s2); }

.cs-brief { display: grid; gap: var(--cs-s4); }
@media (min-width: 960px) { .cs-brief { grid-template-columns: 5fr 7fr; align-items: start; } .cs-brief h2 { position: sticky; top: 120px; } }
.cs-brief p + p { margin-top: var(--cs-s2); }
.cs-quote { margin: var(--cs-s3) 0 0; padding: 22px 24px; border-radius: 16px; background: var(--cs-ink-2); box-shadow: inset 3px 0 0 var(--cs-accent), 0 18px 40px -24px rgba(0, 0, 0, .6); color: var(--cs-text); font-size: 18px; }

/* feature rows */
.cs-features { display: grid; gap: var(--cs-s5); }
.cs-feature { display: grid; gap: var(--cs-s3); align-items: center; }
@media (min-width: 960px) {
  .cs-feature { grid-template-columns: 7fr 5fr; gap: var(--cs-s5); }
  .cs-feature:nth-child(even) .cs-shot { order: 2; }
}
.cs-shot { margin: 0; border-radius: 18px; overflow: hidden; background: var(--cs-ink-2);
  box-shadow: 0 0 0 1px var(--cs-line), 0 2px 4px rgba(0, 0, 0, .2), 0 30px 60px -28px rgba(0, 0, 0, .7); }
.cs-shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.cs-shot--phone { max-width: 300px; justify-self: center; border-radius: 28px; padding: 6px; background: #0B0D14; }
.cs-shot--phone img { border-radius: 22px; aspect-ratio: 390 / 760; }
.cs-feature__kind { display: inline-block; font-size: 13px; font-weight: 700; line-height: 1; padding: 6px 9px; border-radius: 7px; margin-bottom: var(--cs-s2); }
.cs-feature__kind--ux { background: rgba(231, 180, 124, .16); color: #E7B47C; }
.cs-feature__kind--seo { background: rgba(0, 221, 188, .14); color: var(--cs-teal); }
.cs-feature h3 { font-size: clamp(22px, 2.2vw, 28px); font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; margin-bottom: 12px; }

/* checklist */
.cs-list { display: grid; gap: 14px; margin-top: var(--cs-s3); }
@media (min-width: 900px) { .cs-list--cols { grid-template-columns: 1fr 1fr; column-gap: var(--cs-s4); } }
.cs-list li { position: relative; padding-left: 34px; }
.cs-list li::before { content: ''; position: absolute; left: 0; top: .38em; width: 20px; height: 20px; border-radius: 99px;
  background: rgba(0, 221, 188, .14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2300DDBC' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 10.5l2.6 2.5L14 7.5'/%3E%3C/svg%3E") center / 20px no-repeat; }
.cs-list b { color: var(--cs-text); font-weight: 700; }

/* CTA */
.cs-cta { margin-top: var(--cs-s6); border-radius: 28px; padding: clamp(32px, 6vw, 72px); position: relative; overflow: hidden;
  background:
    radial-gradient(500px 300px at 90% 0%, rgba(0, 221, 188, .22), transparent 70%),
    radial-gradient(400px 300px at 0% 100%, color-mix(in srgb, var(--cs-accent) 16%, transparent), transparent 70%),
    linear-gradient(160deg, #1B2033, #141726);
  box-shadow: 0 0 0 1px rgba(0, 221, 188, .22), 0 40px 80px -40px rgba(0, 221, 188, .35); }
.cs-cta h2 { font-size: clamp(30px, 4vw, 48px); font-weight: 800; line-height: 1.06; letter-spacing: -0.03em; max-width: 20ch; margin-bottom: var(--cs-s2); }
.cs-cta p { max-width: 56ch; }
.cs-cta .cs-actions { margin-top: var(--cs-s3); }

.cs-next { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--cs-s2); margin-top: var(--cs-s4); padding-top: var(--cs-s3); border-top: 1px solid var(--cs-line); font-size: 16px; }
.cs-next a { color: var(--cs-text); font-weight: 700; text-decoration: none; background: linear-gradient(var(--cs-teal), var(--cs-teal)) 0 100% / 100% 2px no-repeat; padding-bottom: 2px; border-radius: 2px; transition: color .2s ease; }
.cs-next a:hover { color: var(--cs-teal); }
.cs-next a:focus-visible { outline: 2px solid var(--cs-teal); outline-offset: 4px; }
.cs-next a:active { opacity: .7; }

/* scroll reveal (JS adds .cs-in); hidden only when JS has run */
@media (prefers-reduced-motion: no-preference) {
  .cs-js [data-cs-reveal] { opacity: 0; transform: translate3d(0, 28px, 0); transition: opacity .7s var(--cs-ease), transform .9s var(--cs-ease); }
  .cs-js [data-cs-reveal].cs-in { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
  .cs { font-size: 17px; padding-top: 112px; }
  .cs__wrap { width: calc(100% - 36px); }
  .cs-stage { border-radius: 20px; margin-top: var(--cs-s4); }
  .cs-section, .cs-cta { margin-top: var(--cs-s5); }
  .cs-btn { width: 100%; justify-content: center; }
}
.cs .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
