/* ============================================================
   Vextris — Case Study 01 Article Popup
   Wide editorial reading page · cream · serif headlines
   ============================================================ */

.ca-overlay {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: grid;
  place-items: center;
  padding: 24px 18px;
  visibility: hidden;
  pointer-events: none;
}
.ca-overlay.is-open {
  visibility: visible;
  pointer-events: auto;
}

.ca-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 9, 7, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.25s ease;
  cursor: pointer;
}
.ca-overlay.is-open .ca-backdrop { opacity: 1; }

.ca-dialog {
  position: relative;
  z-index: 3;
  width: min(1180px, 96vw);
  height: calc(100vh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #FAF6EF;
  /* a manila folder edge wraps the filed document */
  border: 1px solid #D9C089;
  border-left: 6px solid #E2C786;
  border-radius: 26px;
  box-shadow: 0 50px 140px rgba(20, 10, 6, 0.35);
  opacity: 0;
  transform-origin: 50% 50%;
  /* starts as the small sheet sitting in the folder, then unfolds to full size */
  transform: translateY(46px) scale(0.66);
  /* closing: quick, no delay */
  transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.ca-overlay.is-open .ca-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
  /* opening: hold while the cover swings open, then the lifted file unfolds into the page */
  transition: opacity 0.46s cubic-bezier(0.22, 1, 0.36, 1) 0.56s,
              transform 0.7s cubic-bezier(0.34, 1.12, 0.42, 1) 0.56s;
}

/* ============================================================
   The case-folder open sequence
   folder drops in · cover swings open · papers lift ·
   the article rises out of the file
   ============================================================ */
.ca-folder {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: 420px;
  height: 290px;
  z-index: 2;
  perspective: 1600px;
  opacity: 0;
  pointer-events: none;
}
.ca-overlay.is-open .ca-folder {
  animation: caFolderStage 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes caFolderStage {
  0%   { opacity: 0; transform: scale(0.78) translateY(26px); }
  9%   { opacity: 1; }
  22%  { transform: scale(1) translateY(0); }
  70%  { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(1.05) translateY(-10px); visibility: hidden; }
}

/* shared manila body */
.ca-folder-back,
.ca-folder-front {
  position: absolute;
  inset: 0;
  border: 1px solid #D9C089;
  border-radius: 8px 20px 20px 20px;
}
.ca-folder-back {
  background: radial-gradient(130% 110% at 18% 0%, #F3E4BC 0%, #EAD49C 58%, #E2C786 100%);
  box-shadow: 0 46px 100px rgba(58, 38, 12, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
/* the file tab — sits above the top edge, stays put while the cover opens */
.ca-folder-back::before {
  content: "";
  position: absolute;
  top: -32px;
  left: 28px;
  width: 132px;
  height: 34px;
  background: linear-gradient(180deg, #F2E2B6 0%, #EAD49C 100%);
  border: 1px solid #D9C089;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
}

/* papers tucked inside */
.ca-paper {
  position: absolute;
  left: 26px;
  right: 26px;
  top: 24px;
  height: 226px;
  background: #FCF8EE;
  border: 1px solid #E6DCC2;
  border-radius: 7px 7px 4px 4px;
  box-shadow: 0 8px 22px rgba(70, 48, 16, 0.12);
}
.ca-paper::before,
.ca-paper::after {
  content: "";
  position: absolute;
  left: 22px;
  height: 8px;
  border-radius: 3px;
  background: rgba(99, 76, 44, 0.16);
}
.ca-paper::before { top: 26px; width: 58%; }
.ca-paper::after  { top: 48px; width: 40%; }
.ca-paper.p1 { border-top: 4px solid rgba(192, 0, 0, 0.55); rotate: 0deg; z-index: 3; }
.ca-paper.p2 { left: 32px; right: 22px; top: 19px; rotate: 1.6deg; background: #F6EFDD; z-index: 2; }
.ca-paper.p3 { left: 20px; right: 32px; top: 15px; rotate: -1.8deg; background: #F1E9D4; z-index: 1; }
.ca-overlay.is-open .ca-paper { animation: caPaperLift 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.ca-overlay.is-open .ca-paper.p2 { animation-delay: 0.04s; }
.ca-overlay.is-open .ca-paper.p3 { animation-delay: 0.08s; }
@keyframes caPaperLift {
  0%, 30% { transform: translateY(0); opacity: 1; }
  62%     { transform: translateY(-14px); opacity: 1; }
  100%    { transform: translateY(-40px) scale(1.015); opacity: 0; }
}

/* the front cover that swings open at its top hinge */
.ca-folder-front {
  z-index: 4;
  transform-origin: top center;
  transform: rotateX(0deg);
  background:
    radial-gradient(130% 110% at 18% 100%, #F3E4BC 0%, #EAD49C 55%, #E2C786 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55),
              inset 0 -28px 40px rgba(146, 108, 44, 0.18);
  display: grid;
  place-items: center;
}
.ca-overlay.is-open .ca-folder-front {
  animation: caLidOpen 1.5s cubic-bezier(0.4, 0.9, 0.3, 1) forwards;
}
@keyframes caLidOpen {
  0%, 20% { transform: rotateX(0deg); }
  60%     { transform: rotateX(-156deg); }
  100%    { transform: rotateX(-162deg); }
}
/* the red ink "Case File · Open" stamp on the cover */
.ca-folder-stamp {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(165, 22, 22, 0.9);
  border: 1.5px solid rgba(176, 28, 28, 0.45);
  background: rgba(255, 253, 247, 0.6);
  border-radius: 999px;
  padding: 10px 18px 10px 15px;
  rotate: -2deg;
  white-space: nowrap;
}
.ca-folder-stamp svg { display: block; opacity: 0.8; flex: none; }
.ca-overlay.is-open .ca-folder-stamp {
  animation: caStampFade 0.7s ease forwards;
}
@keyframes caStampFade {
  0%, 30% { opacity: 1; }
  100%    { opacity: 0; }
}

/* custom slim scrollbar — quiet, matches the cream page */
.ca-dialog {
  scrollbar-width: thin;                              /* Firefox */
  scrollbar-color: rgba(160, 142, 116, 0.45) transparent;
}
.ca-dialog::-webkit-scrollbar {
  width: 10px;
}
.ca-dialog::-webkit-scrollbar-track {
  background: transparent;
  margin: 36px 0;                                     /* keep clear of the rounded corners */
}
.ca-dialog::-webkit-scrollbar-thumb {
  background: rgba(160, 142, 116, 0.40);
  border-radius: 999px;
  border: 3px solid #FAF6EF;                          /* inset the thumb off the edge */
  background-clip: padding-box;
}
.ca-dialog::-webkit-scrollbar-thumb:hover {
  background: rgba(140, 120, 94, 0.62);
  border: 3px solid #FAF6EF;
  background-clip: padding-box;
}
@media (prefers-reduced-motion: reduce) {
  .ca-backdrop, .ca-dialog { transition: none; }
  .ca-overlay.is-open .ca-dialog { transition: none; transform: none; opacity: 1; }
  .ca-folder { display: none; }
}

/* ---- the file header: a manila folder tab that caps the document ---- */
.ca-filebar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 62px;
  padding: 0 16px 0 30px;
  background: linear-gradient(180deg, #F2E2B6 0%, #EAD49C 100%);
  border-bottom: 1px solid #D9C089;
  box-shadow: 0 12px 22px -14px rgba(120, 88, 28, 0.5);
}
/* punched filing holes along the manila strip */
.ca-filebar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: repeating-linear-gradient(90deg, transparent 0 26px, rgba(120, 88, 28, 0.18) 26px 27px);
  opacity: 0.5;
}
.ca-fb-tab {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  white-space: nowrap;
  flex: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: #6e521d;
}
.ca-fb-tab svg { display: block; flex: none; color: #9a7424; }
.ca-fb-tab b {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 21px;
  letter-spacing: 0;
  color: #14110d;
  text-transform: none;
  padding-left: 3px;
}
.ca-fb-class {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #a51616;
  background: rgba(255, 253, 247, 0.7);
  border: 1.5px solid rgba(176, 28, 28, 0.4);
  border-radius: 999px;
  padding: 7px 14px;
  rotate: -1.5deg;
}
.ca-fb-class .dot { width: 7px; height: 7px; border-radius: 50%; background: #C00000; flex: none; }

/* close — lives in the file tab */
.ca-close {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(170, 130, 50, 0.45);
  border-radius: 50%;
  background: #FFFDF6;
  color: #5a4416;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(120, 88, 28, 0.18);
  transition: background 0.2s ease, transform 0.2s ease;
}
.ca-close:hover { background: #FFF7E6; transform: rotate(90deg); }
.ca-close svg { display: block; }

/* the reading column — a filed sheet with a red ruled margin */
.ca-col {
  position: relative;
  width: min(860px, calc(100% - 80px));
  margin: 0 auto;
  padding: 46px 0 56px;
}
.ca-col::before {
  content: "";
  position: absolute;
  top: -10px;
  bottom: 40px;
  left: -26px;
  width: 1.5px;
  background: linear-gradient(180deg, transparent, rgba(192, 0, 0, 0.16) 6%, rgba(192, 0, 0, 0.16) 94%, transparent);
}

.ca-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.ca-num {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 21px;
  line-height: 1;
  color: #C00000;
  border: 1.5px solid #f1d4d4;
  border-radius: 10px;
  min-width: 44px;
  height: 38px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FFFDFA;
}
.ca-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #43403a;
  background: #FFFDFA;
  border: 1px solid rgba(190, 178, 158, 0.45);
  border-radius: 999px;
  padding: 9px 17px;
  white-space: nowrap;
}
.ca-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #C00000;
  flex: none;
}

h1.ca-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 54px;
  line-height: 1.08;
  letter-spacing: -0.5px;
  color: #14110d;
  margin: 30px 0 0;
  text-wrap: balance;
}
.ca-titlerule {
  width: 60px;
  height: 3px;
  background: #C00000;
  border-radius: 2px;
  margin: 26px 0 8px;
}

/* body text */
.ca-body { padding-top: 16px; }
.ca-body p {
  font-size: 17px;
  line-height: 1.78;
  color: #4a453e;
  margin: 0 0 20px;
  text-wrap: pretty;
}
.ca-body p.ca-lede {
  font-size: 20px;
  line-height: 1.7;
  color: #3a352e;
}
.ca-body em { font-style: italic; }
.ca-body strong { font-weight: 700; color: #16130f; }

.ca-body h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 34px;
  line-height: 1.15;
  color: #14110d;
  margin: 48px 0 16px;
  text-wrap: balance;
}
.ca-body h2 .it { font-style: italic; color: #C00000; }

.ca-body ul {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.ca-body ul li {
  position: relative;
  padding-left: 26px;
  font-size: 16.5px;
  line-height: 1.65;
  color: #4a453e;
}
.ca-body ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #C00000;
}

/* big pull question */
.ca-q {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-style: italic;
  font-size: 27px;
  line-height: 1.3;
  color: #14110d;
  border-left: 3px solid #C00000;
  padding: 4px 0 4px 24px;
  margin: 28px 0 26px;
}

/* action-required note */
.ca-action {
  display: flex;
  gap: 14px;
  background: #FFF6E2;
  border: 1px solid #EFDCAE;
  border-radius: 18px;
  padding: 20px 22px;
  margin: 6px 0 24px;
}
.ca-action .ico { flex: none; color: #B07B12; padding-top: 2px; }
.ca-action .ico svg { display: block; }
.ca-action .tx { font-size: 15px; line-height: 1.65; color: #6b5418; }
.ca-action .tx b { font-weight: 700; color: #574208; }

mark.ca-fill {
  background: #FFE9A8;
  border-radius: 6px;
  padding: 1px 8px;
  font-weight: 600;
  color: #5d4a12;
}

/* results stats */
.ca-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 6px 0 24px;
}
.ca-stat {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: #FFFFFF;
  border: 1px solid rgba(190, 178, 158, 0.35);
  border-radius: 22px;
  padding: 26px 28px 24px;
  box-shadow: 0 16px 40px rgba(40, 22, 12, 0.05);
}
.ca-stat .n {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 52px;
  line-height: 1;
  color: #C00000;
}
.ca-stat .n small {
  font-size: 27px;
  font-style: italic;
  font-weight: 600;
}
.ca-stat .l {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #16130f;
  margin-top: 5px;
}
.ca-stat .d {
  font-size: 14.5px;
  line-height: 1.6;
  color: #6a655f;
}

/* results disclaimer */
.ca-body p.ca-disclaim {
  font-size: 13.5px;
  line-height: 1.65;
  font-style: italic;
  color: #8a8378;
  margin: 26px 4px 0;
}

hr.ca-rule {
  border: none;
  height: 1px;
  background: #ddd5c2;
  margin: 46px 0;
}

/* FAQ */
.ca-faq { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ca-faq .q {
  font-size: 17.5px;
  font-weight: 700;
  color: #16130f;
  margin: 14px 0 6px;
}
.ca-faq .a {
  font-size: 16.5px;
  line-height: 1.7;
  color: #4a453e;
  margin: 0 0 10px;
  text-wrap: pretty;
}

/* footer hand-off */
.ca-foot {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
  background: #FFFFFF;
  border: 1px solid rgba(190, 178, 158, 0.35);
  border-radius: 26px;
  padding: 22px 24px;
  box-shadow: 0 16px 40px rgba(40, 22, 12, 0.05);
}
.ca-foot .tx {
  min-width: 0;
  font-size: 15.5px;
  line-height: 1.65;
  color: #4a453e;
  font-style: italic;
}
.ca-foot .tx b { font-weight: 700; color: #16130f; }
.ca-foot-btn {
  margin-left: auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: #C00000;
  border: none;
  border-radius: 14px;
  padding: 16px 24px;
  cursor: pointer;
  text-decoration: none;
  font-style: normal;
  transition: background 0.2s ease, transform 0.2s ease;
}
.ca-foot-btn:hover { background: #A50000; transform: translateY(-1px); }
.ca-foot-btn svg { display: block; transition: transform 0.2s ease; }
.ca-foot-btn:hover svg { transform: translateX(3px); }

@media (max-width: 760px) {
  .ca-dialog { border-radius: 20px; border-left-width: 5px; }
  .ca-filebar { height: 54px; padding: 0 12px 0 18px; gap: 10px; }
  .ca-fb-tab { font-size: 10.5px; letter-spacing: 2px; gap: 8px; }
  .ca-fb-tab b { font-size: 18px; }
  .ca-fb-class { display: none; }
  .ca-col { width: calc(100% - 44px); padding: 36px 0 40px; }
  .ca-col::before { display: none; }
  h1.ca-title { font-size: 36px; }
  .ca-body h2 { font-size: 27px; }
  .ca-body p.ca-lede { font-size: 18px; }
  .ca-q { font-size: 22px; }
  .ca-stats { grid-template-columns: 1fr; }
  .ca-foot { flex-wrap: wrap; }
  .ca-foot-btn { margin-left: 0; }
}
