/* ============================================================
   CASE STUDIES page only (cs-*) — loaded by case-studies/index.php
   Sections:  1 Why (cards)  2 Format (timeline)  3 Today (split + rows)  4 Services (tiles)
   Colour theme: teal / mint variables only. Side margins: same .container as all pages.
   ============================================================ */
 
/* ---------- Scroll reveal (only active when JS adds .cs-js) ---------- */
@keyframes csUp   { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes csLeft { from { opacity: 0; transform: translateX(-36px); } to { opacity: 1; transform: none; } }
@keyframes csRight{ from { opacity: 0; transform: translateX(36px); }  to { opacity: 1; transform: none; } }
@keyframes csZoom { from { opacity: 0; transform: scale(.92); }        to { opacity: 1; transform: none; } }
.cs-js .cs-reveal { opacity: 0; }
.cs-js .cs-reveal.is-in { opacity: 1; animation: csUp .75s cubic-bezier(.2,.7,.2,1) backwards; animation-delay: var(--d, 0s); }
.cs-js .cs-reveal.from-left.is-in  { animation-name: csLeft; }
.cs-js .cs-reveal.from-right.is-in { animation-name: csRight; }
.cs-js .cs-reveal.zoom.is-in       { animation-name: csZoom; }
 
@keyframes csFloat   { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes csPulse   { 0% { box-shadow: 0 0 0 0 rgba(0,170,165,.45); } 70% { box-shadow: 0 0 0 14px rgba(0,170,165,0); } 100% { box-shadow: 0 0 0 0 rgba(0,170,165,0); } }
@keyframes csShimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes csOrbA    { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(60px,40px) scale(1.15); } }
@keyframes csOrbB    { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-50px,-30px) scale(1.1); } }
 
/* ============================================================
   SECTION 1 — WHY THIS PAGE IS SHORT  (numbered cards, dotted bg)
   ============================================================ */
.cs-rules { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.cs-rule { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--mint-100); border-radius: 20px; padding: 28px 28px 26px; box-shadow: 0 6px 20px rgba(0,122,120,.06); color: var(--text-body); transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease; }
.cs-rule::before { content: ""; position: absolute; left: 0; top: 0; height: 4px; width: 100%; background: linear-gradient(90deg, var(--teal-main), var(--teal-deep)); transform: scaleX(0); transform-origin: left; transition: transform .45s ease; }
.cs-rule-no { position: absolute; right: 18px; top: 4px; font-size: 84px; line-height: 1; font-weight: 900; color: var(--mint-100); transition: color .35s ease, transform .35s ease; user-select: none; }
.cs-rule-ic { position: relative; width: 56px; height: 56px; border-radius: 16px; background: var(--mint-50); border: 1px solid var(--mint-200); color: var(--teal-deep); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; transition: all .35s ease; }
.cs-rule-ic svg { width: 26px; height: 26px; }
.cs-rule h3 { position: relative; font-size: 1.15rem; font-weight: 800; color: var(--text-dark); margin: 0 0 8px; }
.cs-rule p { position: relative; margin: 0; }
.cs-rule b { color: var(--text-dark); }
.cs-rule:hover { transform: translateY(-8px); border-color: var(--teal-main); box-shadow: 0 18px 38px rgba(0,122,120,.16); }
.cs-rule:hover::before { transform: scaleX(1); }
.cs-rule:hover .cs-rule-no { color: var(--mint-200); transform: scale(1.08) translateX(-4px); }
.cs-rule:hover .cs-rule-ic { background: linear-gradient(135deg, var(--teal-main), var(--teal-deep)); color: #fff; border-color: transparent; transform: rotate(-6deg) scale(1.08); animation: csPulse 1.4s ease-out infinite; }
 
.cs-banner { position: relative; overflow: hidden; margin-top: 28px; border-radius: 20px; padding: 26px 30px; text-align: center; font-size: 1.15rem; color: #fff; background: linear-gradient(110deg, var(--teal-deep), var(--teal-main), var(--teal-deep)); background-size: 200% 100%; animation: csShimmer 6s linear infinite; box-shadow: 0 14px 34px rgba(0,122,120,.25); transition: transform .35s ease, box-shadow .35s ease; }
.cs-banner p { margin: 0; position: relative; }
.cs-banner b { color: #fff; border-bottom: 2px solid rgba(255,255,255,.6); }
.cs-banner:hover { transform: scale(1.015); box-shadow: 0 20px 44px rgba(0,122,120,.32); }
 
/* ============================================================
   SECTION 2 — THE FORMAT  (zig-zag timeline, line draws itself)
   ============================================================ */
.cs-tl { position: relative; list-style: none; padding: 0; margin: 0; }
.cs-tl::before, .cs-tl::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 4px; margin-left: -2px; border-radius: 4px; }
.cs-tl::before { background: var(--mint-200); }
.cs-tl::after { background: linear-gradient(180deg, var(--teal-main), var(--teal-deep)); transform: scaleY(0); transform-origin: top; transition: transform 2.2s cubic-bezier(.4,.1,.2,1); }
.cs-tl.is-in::after, html:not(.cs-js) .cs-tl::after { transform: scaleY(1); }
.cs-tl-item { position: relative; width: 50%; padding: 0 56px 34px 0; }
.cs-tl-item:last-child { padding-bottom: 0; }
.cs-tl-item:nth-child(even) { margin-left: 50%; padding: 0 0 34px 56px; }
.cs-tl-item:nth-child(even):last-child { padding-bottom: 0; }
.cs-tl-card { position: relative; background: #fff; border: 1px solid var(--mint-200); border-radius: 18px; padding: 20px 24px; color: var(--text-body); box-shadow: 0 6px 18px rgba(0,122,120,.07); transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease, background .35s ease; }
.cs-tl-card p { margin: 0; }
.cs-tl-card b { display: block; font-size: 1.08rem; color: var(--text-dark); margin-bottom: 4px; transition: color .3s ease; }
.cs-tl-card::after { content: ""; position: absolute; top: 24px; right: -9px; width: 16px; height: 16px; background: #fff; border-top: 1px solid var(--mint-200); border-right: 1px solid var(--mint-200); transform: rotate(45deg); transition: all .35s ease; }
.cs-tl-item:nth-child(even) .cs-tl-card::after { right: auto; left: -9px; transform: rotate(-135deg); }
.cs-tl-node { position: absolute; top: 12px; right: -24px; width: 48px; height: 48px; border-radius: 50%; z-index: 2; background: linear-gradient(135deg, var(--teal-main), var(--teal-deep)); color: #fff; font-weight: 800; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; border: 4px solid var(--mint-50); box-shadow: 0 6px 16px rgba(0,122,120,.3); transition: transform .35s ease; }
.cs-tl-item:nth-child(even) .cs-tl-node { right: auto; left: -24px; }
.cs-tl-item:hover .cs-tl-node { transform: scale(1.22) rotate(8deg); animation: csPulse 1.4s ease-out infinite; }
.cs-tl-item:hover .cs-tl-card { transform: translateY(-6px); border-color: var(--teal-main); box-shadow: 0 16px 34px rgba(0,122,120,.16); background: var(--mint-50); }
.cs-tl-item:hover .cs-tl-card::after { background: var(--mint-50); border-color: var(--teal-main); }
.cs-tl-item:hover .cs-tl-card b { color: var(--teal-deep); }
 
/* ---------- Corner dots (left & right edges only, fading inward) ---------- */
.cs-dots { position: relative; overflow: hidden; }
.cs-dots::before, .cs-dots::after { content: ""; position: absolute; top: 0; bottom: 0; width: 240px; background-image: radial-gradient(var(--teal-main) 1.6px, transparent 1.6px); background-size: 22px 22px; opacity: .3; pointer-events: none; }
.cs-dots::before { left: 0; -webkit-mask-image: linear-gradient(to right, #000, transparent); mask-image: linear-gradient(to right, #000, transparent); }
.cs-dots::after { right: 0; -webkit-mask-image: linear-gradient(to left, #000, transparent); mask-image: linear-gradient(to left, #000, transparent); }
.cs-dots > .container { position: relative; z-index: 1; }
 
/* ============================================================
   SECTION 3 — WHAT WE CAN SHOW YOU TODAY  (split: intro left, sliding rows right)
   ============================================================ */
.cs-split { display: grid; grid-template-columns: 5fr 7fr; gap: 56px; align-items: center; }
.cs-split-intro { text-align: left; }
.cs-split-intro .tech-description { margin-left: 0; margin-right: 0; text-align: left; }
.cs-rows { display: grid; gap: 18px; }
.cs-row { position: relative; overflow: hidden; display: flex; gap: 20px; align-items: center; background: #fff; border: 1px solid var(--mint-200); border-radius: 20px; padding: 24px 28px; box-shadow: 0 6px 18px rgba(0,122,120,.07); color: var(--text-body); transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s ease, border-color .4s ease, background .4s ease; }
.cs-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, var(--teal-main), var(--teal-deep)); transform: scaleY(0); transform-origin: top; transition: transform .45s ease; }
.cs-row-ic { flex: 0 0 62px; width: 62px; height: 62px; border-radius: 18px; background: var(--mint-50); border: 1px solid var(--mint-200); color: var(--teal-deep); display: flex; align-items: center; justify-content: center; transition: all .4s ease; }
.cs-row-ic svg { width: 28px; height: 28px; }
.cs-row-body { flex: 1; position: relative; z-index: 1; }
.cs-row-body h3 { font-size: 1.15rem; font-weight: 800; color: var(--text-dark); margin: 0 0 6px; }
.cs-row-body p { margin: 0; }
.cs-row-body a { color: var(--teal-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.cs-row-no { position: absolute; right: 20px; bottom: -14px; font-size: 76px; line-height: 1; font-weight: 900; color: var(--mint-100); transition: color .4s ease, transform .4s ease; user-select: none; pointer-events: none; }
.cs-row:hover { transform: translateX(12px); border-color: var(--teal-main); background: var(--mint-50); box-shadow: 0 16px 36px rgba(0,122,120,.16); }
.cs-row:hover::before { transform: scaleY(1); }
.cs-row:hover .cs-row-ic { background: linear-gradient(135deg, var(--teal-main), var(--teal-deep)); color: #fff; border-color: transparent; transform: rotate(-8deg) scale(1.08); animation: csPulse 1.4s ease-out infinite; }
.cs-row:hover .cs-row-no { color: var(--mint-200); transform: translateY(-6px); }
 
/* ============================================================
   SECTION 4 — SERVICES IN BRIEF  (numbered tiles, fill on hover)
   ============================================================ */
.cs-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cs-tile { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; min-height: 130px; padding: 20px 22px; background: #fff; border: 1px solid var(--mint-200); border-radius: 18px; text-decoration: none; box-shadow: 0 4px 14px rgba(0,122,120,.06); transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease; }
.cs-tile::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, var(--teal-main), var(--teal-deep)); transform: scaleY(0); transform-origin: bottom; transition: transform .4s cubic-bezier(.4,.1,.2,1); z-index: 0; }
.cs-tile > * { position: relative; z-index: 1; }
.cs-tile-no { font-size: .85rem; font-weight: 800; letter-spacing: .1em; color: var(--teal-main); transition: color .3s ease; }
.cs-tile-name { font-size: 1.08rem; font-weight: 800; color: var(--text-dark); line-height: 1.3; margin: 10px 0; transition: color .3s ease; }
.cs-tile-arrow { align-self: flex-end; width: 34px; height: 34px; border-radius: 50%; background: var(--mint-50); color: var(--teal-deep); display: flex; align-items: center; justify-content: center; transition: all .35s ease; }
.cs-tile-arrow svg { width: 16px; height: 16px; }
.cs-tile:hover { transform: translateY(-8px); border-color: var(--teal-main); box-shadow: 0 18px 36px rgba(0,122,120,.22); }
.cs-tile:hover::before { transform: scaleY(1); }
.cs-tile:hover .cs-tile-no { color: #bff7f1; }
.cs-tile:hover .cs-tile-name { color: #fff; }
.cs-tile:hover .cs-tile-arrow { background: #fff; transform: translateX(4px) rotate(-45deg); }
 
/* ---------- legacy helpers (kept in case other pages use them) ---------- */
.cs-body p { color: var(--text-body); margin-bottom: 16px; }
.cs-body p:last-child { margin-bottom: 0; }
.cs-body a { color: var(--teal-deep); font-weight: 600; }
 
/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1199px) {
  .cs-tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 991px) {
  .cs-split { grid-template-columns: 1fr; gap: 32px; }
  .cs-split-intro { text-align: center; }
  .cs-split-intro .tech-eyebrow { margin-left: auto; margin-right: auto; }
  .cs-split-intro .tech-description { margin-left: auto; margin-right: auto; text-align: center; }
  .cs-dots::before, .cs-dots::after { width: 90px; }
  .cs-tiles { grid-template-columns: repeat(2, 1fr); }
  .cs-tl::before, .cs-tl::after { left: 24px; }
  .cs-tl-item, .cs-tl-item:nth-child(even) { width: 100%; margin-left: 0; padding: 0 0 26px 70px; }
  .cs-tl-node, .cs-tl-item:nth-child(even) .cs-tl-node { left: 0; right: auto; }
  .cs-tl-card::after, .cs-tl-item:nth-child(even) .cs-tl-card::after { left: -9px; right: auto; transform: rotate(-135deg); }
}
@media (max-width: 767px) {
  .cs-row { padding: 20px 18px; gap: 14px; }
  .cs-row:hover { transform: translateY(-4px); }
  .cs-row-no { font-size: 56px; }
  .cs-rules { grid-template-columns: 1fr; }
  .cs-rule-no { font-size: 64px; }
  .cs-banner { padding: 22px 20px; font-size: 1.05rem; }
}
@media (max-width: 480px) {
  .cs-tiles { grid-template-columns: 1fr; }
}
 
/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .cs-js .cs-reveal, .cs-js .cs-reveal.is-in { animation: none; opacity: 1; }
  .cs-banner { animation: none; }
  .cs-tl::after { transition: none; transform: scaleY(1); }
  .cs-rule, .cs-tl-card, .cs-row, .cs-tile { transition: none; }
}
 