/* ==========================================================================
   Case study components: browser and phone frames, module explorer,
   Telegram chat demo, Vipps payment flow, service chips, FAQ.
   Used by /work/nordic-club-ua and the service pages that cite it.
   Colours and type come from tokens.css only.
   ========================================================================== */

/* --- Browser frame ------------------------------------------------------- */
.shot {
  margin: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-surface);
  box-shadow: var(--shadow-lg);
}
.shot__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--c-surface-sunk);
  border-bottom: 1px solid var(--c-border);
  font-size: var(--t-cap);
  color: var(--c-text-muted);
}
.shot__bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-border);
  flex: none;
}
.shot__url {
  margin-left: var(--sp-3);
  padding: 2px 10px;
  border-radius: var(--r-full);
  background: var(--c-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
}
.shot figcaption,
.phone-cap {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--t-cap);
  color: var(--c-text-muted);
  border-top: 1px solid var(--c-border);
}

/* --- Phone frame --------------------------------------------------------- */
.phone {
  position: relative;
  margin: 0;
  width: 100%;
  max-width: 260px;
  padding: 10px;
  border-radius: 40px;
  background: var(--c-graphite);
  box-shadow: var(--shadow-lg);
}
.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 31px;
}
.phone::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 50%;
  width: 70px;
  height: 18px;
  margin-left: -35px;
  border-radius: var(--r-full);
  background: var(--c-graphite);
  z-index: 1;
}
.phone figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2.25rem;
  text-align: center;
  font-size: var(--t-cap);
  color: var(--c-text-muted);
}

/* A row of phones that scrolls sideways on small screens. */
.phone-rail {
  display: flex;
  gap: var(--sp-6);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: var(--sp-4) var(--sp-2) var(--sp-8);
  margin: 0 calc(var(--sp-2) * -1);
  list-style: none;
  -webkit-overflow-scrolling: touch;
}
.phone-rail > li {
  flex: 0 0 220px;
  scroll-snap-align: center;
}
/* Centre the row when it fits, without cutting off the first phone when
   it does not (justify-content: center would). */
.phone-rail > li:first-child { margin-left: auto; }
.phone-rail > li:last-child { margin-right: auto; }
@media (min-width: 720px) {
  .facts { grid-template-columns: repeat(4, 1fr); }
}
/* On a wide screen all five phones fit in one row, no sideways scroll. */
@media (min-width: 960px) {
  .phone-rail { gap: var(--sp-5); overflow: visible; }
  .phone-rail > li { flex: 1 1 0; min-width: 0; margin: 0; }
  .phone-rail .phone { max-width: 220px; margin: 0 auto; }
}

/* --- Facts strip --------------------------------------------------------- */
.facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
  margin: var(--sp-6) 0 0;
  padding: 0;
  list-style: none;
}
.facts li {
  padding: var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface);
}
.facts strong {
  display: block;
  font-size: var(--t-h2);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-display);
  line-height: var(--lh-snug);
}
.facts span {
  font-size: 0.875rem;
  color: var(--c-text-muted);
}

/* --- Module explorer (tabs) ---------------------------------------------- */
.explorer__tabs {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  margin-bottom: var(--sp-5);
  scrollbar-width: thin;
}
.explorer__tab {
  flex: none;
  min-height: 44px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-full);
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
}
.explorer__tab[aria-selected="true"] {
  background: var(--c-graphite);
  border-color: var(--c-graphite);
  color: var(--c-text-invert);
}
.explorer__tab:focus-visible {
  outline: 2px solid var(--c-pink-ink);
  outline-offset: 2px;
}
.explorer__panel {
  display: grid;
  gap: var(--sp-6);
  align-items: start;
}
.explorer__panel[hidden] {
  display: none;
}
@media (min-width: 960px) {
  .explorer__panel {
    grid-template-columns: 5fr 7fr;
  }
}
.explorer__panel h3 {
  font-size: var(--t-h3);
  font-weight: var(--fw-medium);
  margin-bottom: var(--sp-3);
}
.explorer__panel p {
  margin-bottom: var(--sp-4);
}
.ticks {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-5);
}
.ticks li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: var(--sp-2);
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-pink);
}
.explorer__media {
  min-width: 0;
}
.explorer__media--phone {
  display: flex;
  justify-content: center;
}

/* --- Two column split ---------------------------------------------------- */
.split {
  display: grid;
  gap: var(--sp-7);
  align-items: center;
}
@media (min-width: 960px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }
  .split--reverse > :first-child {
    order: 2;
  }
}
.split p + p {
  margin-top: var(--sp-4);
}

/* --- Telegram chat demo -------------------------------------------------- */
.tg {
  max-width: 400px;
  margin: 0 auto;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: #0e1621;
  box-shadow: var(--shadow-lg);
  color: #f5f5f5;
  font-size: 0.9375rem;
}
.tg__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: #17212b;
}
.tg__avatar {
  display: block;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}
.tg__name {
  font-weight: var(--fw-medium);
  line-height: 1.2;
}
.tg__status {
  font-size: var(--t-cap);
  color: #8b9aa8;
}
.tg__lang {
  margin-left: auto;
  display: flex;
  border: 1px solid #2b3a48;
  border-radius: var(--r-full);
  overflow: hidden;
}
.tg__lang button {
  min-width: 40px;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: #8b9aa8;
  font: inherit;
  font-size: var(--t-cap);
  cursor: pointer;
}
.tg__lang button[aria-pressed="true"] {
  background: #2b5278;
  color: #fff;
}
.tg__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  height: 400px;
  overflow-y: auto;
  padding: var(--sp-4);
  scroll-behavior: smooth;
}
.tg__msg {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 14px;
  line-height: 1.4;
  white-space: pre-line;
  animation: tg-in 0.25s ease-out;
}
.tg__msg--bot {
  align-self: flex-start;
  background: #182533;
  border-bottom-left-radius: 4px;
}
.tg__msg--me {
  align-self: flex-end;
  background: #2b5278;
  border-bottom-right-radius: 4px;
}
.tg__msg b {
  font-weight: var(--fw-semibold);
}
.tg__btns {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), 1fr);
  gap: 4px;
  max-width: 88%;
  align-self: flex-start;
  width: 88%;
}
.tg__btns button {
  min-height: 40px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: #22303f;
  color: #fff;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}
.tg__btns button:hover:not(:disabled) {
  background: #2b3d50;
}
.tg__btns button:disabled {
  opacity: 0.45;
  cursor: default;
}
.tg__btns button:focus-visible,
.tg__lang button:focus-visible,
.tg__restart:focus-visible {
  outline: 2px solid #f2c200;
  outline-offset: 1px;
}
.tg__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: #17212b;
  font-size: 0.875rem;
  color: #f2c200;
}
.tg__restart {
  min-height: 32px;
  padding: 0 var(--sp-3);
  border: 1px solid #2b3a48;
  border-radius: var(--r-full);
  background: transparent;
  color: #cfd8e0;
  font: inherit;
  font-size: var(--t-cap);
  cursor: pointer;
}
@keyframes tg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tg__msg { animation: none; }
  .tg__body { scroll-behavior: auto; }
}

/* --- Vipps payment flow -------------------------------------------------- */
.pay {
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  background: var(--c-surface);
  padding: var(--sp-5);
  box-shadow: var(--shadow-md);
}
.pay__label {
  font-size: var(--t-cap);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: var(--sp-3);
}
.pay__tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}
.pay__tier {
  min-height: 64px;
  padding: var(--sp-3);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pay__tier span {
  display: block;
  font-size: 0.8125rem;
  color: var(--c-text-muted);
}
.pay__tier[aria-pressed="true"] {
  border-color: var(--c-pink-ink);
  background: var(--c-glass);
}
.pay__tier:focus-visible,
.pay__next:focus-visible {
  outline: 2px solid var(--c-pink-ink);
  outline-offset: 2px;
}
.pay__steps {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-5);
  counter-reset: step;
}
.pay__step {
  position: relative;
  padding: var(--sp-3) 0 var(--sp-3) 2.75rem;
  border-top: 1px solid var(--c-border);
  color: var(--c-text-muted);
  counter-increment: step;
  transition: color 0.2s;
}
.pay__step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: var(--sp-3);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--c-border-strong);
  font-size: var(--t-cap);
}
.pay__step b {
  display: block;
  color: inherit;
  font-weight: var(--fw-medium);
}
.pay__step small {
  display: block;
  font-size: 0.8125rem;
}
.pay__step.is-done,
.pay__step.is-now {
  color: var(--c-text);
}
.pay__step.is-done::before {
  content: "\2713";
  background: var(--c-graphite);
  border-color: var(--c-graphite);
  color: var(--c-text-invert);
}
.pay__step.is-now::before {
  border-color: var(--c-pink-ink);
  color: var(--c-pink-ink);
  box-shadow: 0 0 0 4px var(--c-glass);
}
.pay__step--invoice {
  display: none;
}
.pay.is-invoice .pay__step--vipps {
  display: none;
}
.pay.is-invoice .pay__step--invoice {
  display: block;
}
.pay__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.pay__note {
  font-size: 0.875rem;
  color: var(--c-text-muted);
}

/* --- Edge cases list ----------------------------------------------------- */
.edges {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  list-style: none;
  padding: 0;
  margin: var(--sp-6) 0 0;
}
.edges li {
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
}
.edges h3 {
  font-size: 1rem;
  font-weight: var(--fw-semibold);
  margin-bottom: var(--sp-2);
}
.edges p {
  color: var(--c-text-muted);
  font-size: 0.9375rem;
}

/* --- Admin mock (no real data, drawn bars only) -------------------------- */
.admin-mock {
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  font-size: 0.8125rem;
}
.admin-mock__top {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--c-graphite);
  overflow-x: auto;
}
.admin-mock__top span {
  flex: none;
  padding: 4px 10px;
  border-radius: var(--r-full);
  color: #cfd0d4;
}
.admin-mock__top span.is-on {
  background: var(--c-pink-ink);
  color: #fff;
}
.admin-mock__row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 0.9fr;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--c-border);
}
.admin-mock__row--head {
  color: var(--c-text-muted);
  font-size: var(--t-cap);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
}
.admin-mock__bar {
  height: 10px;
  border-radius: var(--r-full);
  background: var(--c-surface-sunk);
}
.admin-mock__pill {
  justify-self: start;
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: var(--t-cap);
  background: var(--c-surface-sunk);
}
.admin-mock__pill--ok {
  background: #e3f4ea;
  color: #1d6b3d;
}
.admin-mock__pill--wait {
  background: var(--c-glass);
  color: var(--c-pink-ink);
}
.admin-mock__note {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--t-cap);
  color: var(--c-text-muted);
  background: var(--c-surface-sunk);
}

/* --- Service chips ------------------------------------------------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  list-style: none;
  padding: 0;
  margin: var(--sp-5) 0 0;
}
.chips a {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-full);
  background: var(--c-surface);
  color: var(--c-text);
  text-decoration: none;
}
.chips a:hover {
  border-color: var(--c-pink-ink);
  color: var(--c-pink-ink);
}

/* --- Case proof block on service pages ----------------------------------- */
.case-proof {
  display: grid;
  gap: var(--sp-6);
  align-items: center;
  padding: var(--sp-6);
  border-radius: var(--r-xl);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
}
@media (min-width: 960px) {
  .case-proof {
    grid-template-columns: 6fr 5fr;
  }
}
.case-proof__kicker {
  font-size: var(--t-cap);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--c-pink-ink);
  margin-bottom: var(--sp-3);
}
.case-proof h2,
.case-proof h3 {
  font-size: var(--t-h3);
  font-weight: var(--fw-medium);
  margin-bottom: var(--sp-3);
}
.case-proof p {
  margin-bottom: var(--sp-4);
}

/* --- FAQ ----------------------------------------------------------------- */
.faq {
  max-width: var(--container-text);
}
.faq details {
  border-top: 1px solid var(--c-border);
  padding: var(--sp-4) 0;
}
.faq details:last-child {
  border-bottom: 1px solid var(--c-border);
}
.faq summary {
  cursor: pointer;
  font-weight: var(--fw-medium);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 28px;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  flex: none;
  color: var(--c-pink-ink);
  font-size: 1.25rem;
  line-height: 1;
}
.faq details[open] summary::after {
  content: "\2212";
}
.faq details p {
  margin-top: var(--sp-3);
  color: var(--c-text-muted);
}

/* --- Small helpers ------------------------------------------------------- */
.case-section-lead {
  max-width: 60ch;
  color: var(--c-text-muted);
  font-size: var(--t-body-lg);
  margin-bottom: var(--sp-6);
}
.disclose {
  padding: var(--sp-5);
  border-left: 3px solid var(--c-pink);
  background: var(--c-surface);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
}
.disclose p + p {
  margin-top: var(--sp-3);
}

/* --- Before / after ------------------------------------------------------ */
.ba {
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
}
.ba--before {
  background: var(--c-surface-sunk);
  color: var(--c-text-muted);
}
.ba--before .ticks li::before {
  background: var(--c-border-strong);
}
.ba--after {
  background: var(--c-surface);
  box-shadow: var(--shadow-md);
}
.ba .ticks {
  margin-bottom: 0;
}

/* --- Laptop frame -------------------------------------------------------- *
 * The desktop sibling of .phone: a dark screen bezel with a camera dot and
 * a light base, so desktop and phone screens read as one set of devices.
 * ------------------------------------------------------------------------- */
.laptop {
  margin: 0 auto;
  width: 100%;
  max-width: 920px;
  padding: 0 4%;
}
.laptop__screen {
  position: relative;
  padding: 2.4% 2.4% 3.2%;
  border-radius: 18px 18px 6px 6px;
  background: var(--c-graphite);
  box-shadow: var(--shadow-lg);
}
.laptop__screen::before {
  content: "";
  position: absolute;
  top: 0.9%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: #3a3c42;
}
.laptop__screen img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
}
.laptop__base {
  position: relative;
  height: 12px;
  margin: 0 -4.5%;
  border-radius: 2px 2px 14px 14px;
  background: linear-gradient(#e2e3e7, #b8bac1);
  box-shadow: 0 12px 24px rgba(17, 18, 20, 0.12);
}
.laptop__base::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 16%;
  height: 5px;
  margin-left: -8%;
  border-radius: 0 0 8px 8px;
  background: #a9abb2;
}
.laptop figcaption {
  margin-top: var(--sp-4);
  text-align: center;
  font-size: var(--t-cap);
  color: var(--c-text-muted);
}

/* Hero: laptop and phone side by side, the laptop takes most of the row. */
@media (min-width: 960px) {
  .split--devices {
    grid-template-columns: 2.3fr 1fr;
    gap: var(--sp-6);
  }
}
