/* =============================================================================
   case-limp-vpn.css  —  scoped re-layout for /cases/limp-vpn (all locales)
   Loaded only on the LiMP VPN case page (main.case-limp). Nothing here leaks
   to other case studies. Uses the site's own Quiet-Aurora tokens: navy
   (--c-bg-dark), electric blue (--c-cta), point yellow (--c-brand).
   Goals: balance text vs. image, present app screens as device mockups,
   add restrained scroll micro-animations. All motion honours reduced-motion.
   ========================================================================== */

/* ---- 1. Section rhythm + brand-yellow title accent -------------------------
   The text-heavy sections used to read as full-width walls. A short yellow
   rule under each section title gives vertical rhythm and ties to the brand. */
.case-limp .section__title {
  position: relative;
}
.case-limp .case-detail__section > .container > .section__title::after,
.case-limp .case-detail__hero + .case-detail__section .section__title::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin-top: 14px;
  border-radius: 3px;
  background: var(--c-brand);
}

/* Comfortable measure for lone lead paragraphs (the old "wall of text"). */
.case-limp .case-detail__section > .container > .section__lead {
  max-width: 68ch;
  font-size: 1.06rem;
  line-height: 1.72;
}

/* ---- 2. Feature rows: balance the phone against the copy -------------------
   Vertically centre the two columns and give the copy a readable measure so
   neither side dominates. */
@media (min-width: 900px) {
  .case-limp .case-feature {
    align-items: center;
    gap: clamp(40px, 5vw, 72px);
  }
  .case-limp .case-feature__copy { max-width: 60ch; }
}

/* ---- 3. App screens as device mockups --------------------------------------
   The feature images are portrait phone screenshots. Wrap each in a soft,
   on-brand stage and frame the screenshot in a phone bezel with a capped
   height so no single image ever exceeds roughly one viewport. */
.case-limp .case-feature__media {
  display: grid;
  place-items: center;
  padding: clamp(22px, 4vw, 46px);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(46, 92, 242, 0.16), rgba(46, 92, 242, 0) 62%),
    linear-gradient(180deg, #f2f6ff 0%, #e9f0ff 100%);
  border: 1px solid var(--c-border);
  overflow: hidden;
}
.case-limp .case-feature__media img {
  width: auto;
  height: auto;
  max-width: min(300px, 78%);
  max-height: clamp(430px, 58vh, 560px);
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  object-position: top center;
  border-radius: 34px;
  background: #fff;
  border: 7px solid #0b1020;                 /* device bezel (navy) */
  box-shadow:
    0 34px 60px -26px rgba(11, 16, 32, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  transition: transform var(--dur-3, 480ms) var(--ease-out, ease),
              box-shadow var(--dur-3, 480ms) var(--ease-out, ease);
}
.case-limp .case-feature__media:hover img {
  transform: translateY(-6px);
  box-shadow:
    0 44px 70px -24px rgba(11, 16, 32, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

/* ---- 4. Hero cover: lift the composited mockup off the panel --------------- */
.case-limp .case-detail__hero-cover {
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.case-limp .case-detail__hero-cover img {
  border-radius: var(--radius-xl);
  filter: drop-shadow(0 30px 50px rgba(11, 16, 32, 0.28));
}

/* ---- 5. "By the numbers" stat cards: quieter cards, louder numbers -------- */
.case-limp .card strong[style] {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

/* ---- 7. Protocol comparison — lifted out of the feature copy --------------
   The WireGuard-vs-rest table used to be jammed into the narrow feature-copy
   column beside the phone mockup. It now sits full-width below the narrative
   so it can breathe: the LiMP column is highlighted, and on small screens each
   row collapses into a labelled card (data-label) instead of a scroll-only
   4-column grid. */
.case-limp .cl-compare {
  margin-top: clamp(48px, 6vw, 80px);
}
.case-limp .cl-compare__intro {
  margin-bottom: 28px;
}
.case-limp .cl-compare__intro .eyebrow {
  color: var(--c-cta);
}
.case-limp .cl-compare__title {
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  line-height: 1.3;
  margin: 8px 0 0;
}

/* The page runs on the dark Quiet-Aurora theme, so the table is styled
   dark-native: a surface-card panel with clearly visible ruled lines
   (--c-border-strong reads on navy where the faint --c-border did not),
   generous cell padding for air, zebra rows, and a highlighted LiMP column. */
.case-limp .cl-compare {
  /* Dedicated ruling colours. The theme's --c-border (8% white) and even
     --c-border-strong (16%) wash out to nothing on the navy surface, so the
     table read as line-less. These are tuned to be clearly visible. */
  --cl-line: rgba(255, 255, 255, 0.26);
  --cl-line-soft: rgba(255, 255, 255, 0.14);
}
.case-limp .cl-compare__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--cl-line);
  border-radius: var(--radius-lg);
  background: var(--c-surface-card);
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.7);
}
.case-limp .cl-compare__scroll:focus-visible {
  outline: 3px solid var(--c-brand);
  outline-offset: 3px;
}

.case-limp .cl-compare__table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--c-text);
}
/* Air inside every cell + visible horizontal AND vertical ruling lines. */
.case-limp .cl-compare__table th,
.case-limp .cl-compare__table td {
  text-align: left;
  vertical-align: top;
  padding: 18px 22px;
  border-bottom: 1px solid var(--cl-line);
  border-right: 1px solid var(--cl-line-soft);
}
.case-limp .cl-compare__table th:last-child,
.case-limp .cl-compare__table td:last-child {
  border-right: 0;
}
.case-limp .cl-compare__table thead th {
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--c-text-muted);
  background: var(--c-bg-dark);
  border-bottom: 2px solid var(--cl-line);
  white-space: nowrap;
}
.case-limp .cl-compare__table tbody th {
  font-weight: 700;
  color: var(--c-text);
  width: 22%;
  background: rgba(255, 255, 255, 0.05);
}
/* Zebra striping for row-scan readability on the dark surface. */
.case-limp .cl-compare__table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.055);
}
.case-limp .cl-compare__table tbody tr:last-child th,
.case-limp .cl-compare__table tbody tr:last-child td {
  border-bottom: 0;
}

/* Highlighted LiMP / WireGuard column — legible on navy, with a continuous
   blue edge down the column so "our" option reads at a glance. */
.case-limp .cl-compare__table thead th.is-limp {
  color: #fff;
  background: var(--c-cta);
  border-bottom-color: var(--c-cta);
}
.case-limp .cl-compare__table td.is-limp {
  background: rgba(46, 92, 242, 0.24);
  font-weight: 600;
  color: #fff;
  box-shadow: inset 3px 0 0 var(--c-cta),
              inset -3px 0 0 var(--c-cta);
}
.case-limp .cl-compare__table tbody tr:nth-child(even) td.is-limp {
  background: rgba(46, 92, 242, 0.3);
}

.case-limp .cl-compare__refs {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  margin-top: 16px;
  line-height: 1.6;
}

/* Small screens: stop shrinking a 4-column table; stack each row as a card
   with the column name shown as an inline label. */
@media (max-width: 640px) {
  .case-limp .cl-compare__scroll {
    overflow-x: visible;
    border: 0;
    background: none;
    box-shadow: none;
  }
  .case-limp .cl-compare__table {
    min-width: 0;
  }
  .case-limp .cl-compare__table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
  }
  .case-limp .cl-compare__table tbody tr {
    display: block;
    margin-bottom: 18px;
    border: 1px solid var(--cl-line);
    border-radius: var(--radius-md);
    background: var(--c-surface-card);
    overflow: hidden;
  }
  .case-limp .cl-compare__table tbody th {
    display: block;
    width: auto;
    font-size: 1rem;
    padding: 14px 18px;
    background: var(--c-bg-dark);
    border-right: 0;
    border-bottom: 1px solid var(--cl-line);
  }
  .case-limp .cl-compare__table tbody td {
    display: grid;
    grid-template-columns: minmax(0, 42%) 1fr;
    gap: 12px 16px;
    align-items: start;
    padding: 13px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--cl-line-soft);
  }
  /* Cancel the desktop column-edge glow when rows become cards. */
  .case-limp .cl-compare__table tbody td.is-limp {
    box-shadow: none;
  }
  .case-limp .cl-compare__table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--c-text-muted);
  }
  .case-limp .cl-compare__table tbody td.is-limp::before {
    color: #8fb0ff;
  }
  .case-limp .cl-compare__table tbody tr td:last-child {
    border-bottom: 0;
  }
}

/* ---- 8. Scroll-reveal micro-animations ------------------------------------
   Base state is only applied when motion is allowed; under reduced-motion the
   .cl-anim rule never hides anything, so content is always visible. */
@media (prefers-reduced-motion: no-preference) {
  .case-limp .cl-anim {
    opacity: 0;
    transform: translateY(20px);
    transition:
      opacity 0.6s var(--ease-out, cubic-bezier(.16, 1, .3, 1)),
      transform 0.6s var(--ease-out, cubic-bezier(.16, 1, .3, 1));
    transition-delay: calc(var(--cl-i, 0) * 55ms);
    will-change: opacity, transform;
  }
  .case-limp .cl-anim.cl-in {
    opacity: 1;
    transform: none;
  }
}

/* ---- 9. Spacing polish — give glued components room to breathe -------------
   Audit across the page: the sitewide base rhythm is a touch tight for a
   long-form case study, and several groups read as "stuck together". These
   scoped bumps add air without touching any other case page. */

/* Hero layout — THE actual "stuck together" bug.
   This page's markup uses .case-detail__hero-grid / -copy / -visual, but the
   sitewide hero CSS is written for .case-detail__hero-inner / -cover. So none
   of it matched: the hero never became a grid, got no column gutter, and the
   phone mockup dropped straight under the copy flush against the limpvpn.com
   chip with ZERO gap — that's the padding that "никак не правился".
   Restore the intended layout: two columns on desktop, a real gap when
   stacked, so the mockup lifts off the chip. */
.case-limp .case-detail__hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 4.5vw, 56px);
  align-items: center;
}
@media (min-width: 900px) {
  .case-limp .case-detail__hero-grid {
    grid-template-columns: 57fr 43fr;
  }
}
/* Belt-and-braces: guarantee air above the mockup even if the grid gap is ever
   overridden, and keep the chip from crowding it. */
.case-limp .case-detail__hero-visual { margin-top: clamp(8px, 1.5vw, 16px); }

/* Hero: separate the fact row (Industry / Year / Engagement) from the lead
   with a divider, and give the facts more horizontal gap so they don't crowd. */
.case-limp .case-detail__hero-meta {
  gap: 20px 44px;
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--c-border);
}

/* Feature copy: looser paragraph rhythm than the sitewide 12px. */
.case-limp .case-feature__text p { margin-bottom: 16px; }
.case-limp .case-feature__text p:last-child { margin-bottom: 0; }

/* Highlight / tech-stack chips: more space between pills and above the row. */
.case-limp .case-highlights {
  gap: 14px;
  margin-top: 28px;
}

/* Stat & methodology cards: a bit more inner air and a clearer grid gutter. */
.case-limp .grid { gap: clamp(20px, 2.4vw, 32px); }
.case-limp .grid .card { padding: clamp(22px, 2.4vw, 30px); }

/* Stacked lead paragraphs (the US/EU launch section) need a gap between them. */
.case-limp .section__lead + .section__lead { margin-top: 20px; }

/* FAQ: turn the glued list into spaced, self-contained cards. */
.case-limp .faq {
  gap: 12px;
  /* Sitewide .faq is centered (margin: 0 auto), but on this case the section
     heading sits flush left — the centered column read as misaligned. Pin the
     list to the left edge so it lines up under the title (keep the readable
     measure via max-width). */
  margin-left: 0;
  max-width: 900px;
}
.case-limp .faq__item {
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--dur-2, 220ms) var(--ease, ease),
              background var(--dur-2, 220ms) var(--ease, ease);
}
/* Hover cue: highlight the card edge and light up the +/× pictogram. */
.case-limp .faq__item:hover { border-color: var(--c-cta); }
.case-limp .faq__item:hover .faq__q::after {
  background: var(--c-cta);
  color: #fff;
}
.case-limp .faq__item[open] {
  border-color: var(--c-cta);
}

/* ---- 10. Long-form prose sections → two readable columns -------------------
   The narrative sections ("The brief", "Anonymous billing", "Launching across
   the US/EU") were single essay-length paragraphs run full-width — the exact
   "wall of text" Артур flagged: ~110-char lines, nothing for the eye to grab.

   Earlier attempt columnised the whole container and gave the <h2> a
   `column-span: all`. That works in Chrome but WebKit/Safari has a
   long-standing bug: a spanning child collapses the following multicol back to
   a single full-width flow — so on Safari the block still rendered as a wall.

   Fix: the leads are wrapped in an explicit `.cl-prose` block (see markup).
   We columnise THAT wrapper only; the heading lives outside it, so there is no
   `column-span` anywhere and every engine — Safari included — columnises the
   prose reliably. Applied 1:1 across all four locales (EN/DE/FR/IT). */
.case-limp .cl-prose { max-width: 1000px; }
.case-limp .cl-prose > .section__lead {
  font-size: 1.06rem;
  line-height: 1.72;
  max-width: 68ch;                 /* comfortable measure on mobile (single col) */
}
@media (min-width: 761px) {
  /* Columnise ONLY pure-prose wrappers. A .cl-prose that also contains a
     block component (e.g. the "By the numbers" stat grid) must NOT become
     multicol, or the multicol engine fragments the grid into a jagged,
     misaligned mess. The :not(:has(...)) guard keeps such sections single-flow
     so the inner .grid renders as its normal 3-up layout. */
  .case-limp .cl-prose:not(:has(.grid)) {
    column-count: 2;
    column-gap: clamp(40px, 4.5vw, 72px);
  }
  .case-limp .cl-prose:not(:has(.grid)) > .section__lead {
    max-width: none;               /* each paragraph fills its own column */
    margin-top: 0;
    orphans: 3;
    widows: 3;
  }
  .case-limp .cl-prose:not(:has(.grid)) > .section__lead + .section__lead { margin-top: 1.05rem; }
  /* Non-columnised prose (contains a grid): keep the lead a readable measure. */
  .case-limp .cl-prose:has(.grid) > .section__lead { max-width: 68ch; }
}

/* ---- 11. Gap after the hero (first block) --------------------------------
   The gap below the hero was hero padding-bottom (≤104px) + first section
   padding-top (≤88px) ≈ up to 192px — reads as a dead void under the fold.
   Cap the combined gap after the first block to ≤120px (64 + 56). */
.case-limp .case-detail__hero { padding-bottom: clamp(40px, 5vw, 64px); }
.case-limp .case-detail__hero + .case-detail__section { padding-top: clamp(36px, 4.5vw, 56px); }
