/* work.css — screenshots of live client sites, for /work and the case
   studies only (site.css stays the one stylesheet everywhere else).

   Built on site.css's tokens (--ks-*), so the frames sit in the same Onyx
   ladder with the Kenro Digital red accent. Every height here scales with
   the width (aspect-ratio and padding percentages), so the phone lands in
   the same place on the browser frame at every screen size.

   Markup contract:
     figure.kw-showcase > .kw-browser (.kw-bar + img)
                        + .kw-phone > .kw-screen (.kw-status + img)
                        + figcaption.kw-caption
     a.kd-surface.kw-card > .kw-thumb (.kw-bar + img) + .kw-card-body */

/* ── Browser window ─────────────────────────────────────────────────── */
.kw-browser {
  position: relative;
  border: 1px solid var(--ks-line-strong);
  border-radius: 14px;
  background: var(--ks-elevated);
  overflow: hidden;
  box-shadow:
    0 28px 70px -28px rgba(220, 38, 38, 0.3),
    0 18px 48px rgba(0, 0, 0, 0.55);
}
.kw-browser img,
.kw-thumb img {
  width: 100%;
  height: auto;
  aspect-ratio: 1440 / 900;
  object-fit: cover;
  object-position: top;
}
.kw-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 36px;
  padding: 0 14px;
  border-bottom: 1px solid var(--ks-line);
  background: var(--ks-surface);
}
.kw-dots {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}
.kw-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ks-line-strong);
}
.kw-dots i:first-child {
  background: var(--ks-brand);
}
/* An empty twin of the dots on the right keeps the address centred. */
.kw-bar::after {
  content: "";
  flex: 0 0 42px;
}
.kw-url {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  max-width: 340px;
  height: 22px;
  margin: 0 auto;
  padding: 0 10px;
  border: 1px solid var(--ks-line);
  border-radius: 7px;
  background: var(--ks-soft);
  color: var(--ks-muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kw-url svg {
  flex: 0 0 auto;
  color: var(--ks-brand-light);
}

/* ── Phone ──────────────────────────────────────────────────────────── */
.kw-phone {
  /* Not a percentage: on the absolutely placed phone that would follow
     the whole figure's width, not the phone's. */
  padding: clamp(4px, 0.9vw, 8px);
  /* Elliptical radii: the phone is ~2.3x taller than wide, so 13% across
     and 5.8% down draw one even corner. */
  border-radius: 13% / 5.8%;
  border: 1px solid var(--ks-line-strong);
  background: #0b0b0c;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 24px 60px rgba(0, 0, 0, 0.7),
    0 0 48px -12px rgba(220, 38, 38, 0.3);
}
.kw-screen {
  overflow: hidden;
  border-radius: 10.8% / 4.9%;
  background: #000;
}
/* The status bar sits above the screenshot, so the island never covers
   the site's own header. Padding percentages follow the width. */
.kw-status {
  position: relative;
  display: block;
  padding-top: 9%;
  background: #0b0b0c;
}
.kw-status::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30%;
  height: 52%;
  transform: translate(-50%, -50%);
  border-radius: 99px;
  background: #000;
}
.kw-phone.is-light .kw-status {
  background: #ffffff;
}
.kw-phone img {
  width: 100%;
  height: auto;
  aspect-ratio: 390 / 844;
  object-fit: cover;
  object-position: top;
}

/* ── Showcase: the browser, with the phone over its lower right ─────── */
.kw-live {
  padding-top: 28px;
}
.kw-showcase {
  position: relative;
  margin: 0;
  /* Room under the browser for the phone's overhang and the caption. */
  padding-bottom: 46%;
}
.kw-showcase .kw-browser {
  width: 100%;
}
.kw-showcase .kw-phone {
  position: absolute;
  right: 3%;
  bottom: 0;
  width: 37%;
}
.kw-caption {
  position: absolute;
  left: 0;
  bottom: 0;
  max-width: 52%;
  margin: 0;
  color: var(--ks-faint);
  font-size: 13px;
  line-height: 1.5;
}
.kw-caption a {
  color: var(--ks-muted);
}
.kw-caption a:hover {
  color: var(--ks-text);
}
@media (min-width: 760px) {
  .kw-showcase {
    padding-bottom: 6%;
  }
  .kw-showcase .kw-browser {
    width: 87%;
  }
  .kw-showcase .kw-phone {
    right: 0;
    width: 23%;
  }
  .kw-caption {
    max-width: 60%;
  }
}

/* ── Cards on /work: a framed screenshot over the case-study card ───── */
a.kd-surface.kw-card {
  padding: 0;
  overflow: hidden;
}
.kw-thumb {
  display: block;
  border-bottom: 1px solid var(--ks-line);
  background: var(--ks-surface);
  overflow: hidden;
}
.kw-thumb .kw-bar {
  height: 30px;
  padding: 0 12px;
}
.kw-thumb .kw-dots i {
  width: 8px;
  height: 8px;
}
.kw-thumb .kw-bar::after {
  flex-basis: 36px;
}
.kw-thumb .kw-url {
  height: 18px;
  font-size: 10.5px;
}
.kw-thumb img {
  transition: transform 400ms ease;
}
a.kw-card:hover .kw-thumb img {
  transform: scale(1.02);
}
.kw-card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 22px 22px 24px;
}
.kw-card-body p.kd-who {
  margin: 0 0 6px;
}
/* Two across on /work (kg-grid-2 alone would open a third track beside
   the full-width card), and the latest project spans the row. */
@media (min-width: 760px) {
  .kd-grid.kw-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
a.kd-surface.kw-feature {
  grid-column: 1 / -1;
}
/* Wide screens: screenshot left, story right. */
@media (min-width: 900px) {
  a.kd-surface.kw-feature {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  }
  .kw-feature .kw-thumb {
    border-bottom: 0;
    border-right: 1px solid var(--ks-line);
  }
  .kw-feature .kw-card-body {
    justify-content: center;
    padding: 32px 34px;
  }
  .kw-feature .kw-card-body h3 {
    font-size: 24px;
  }
  /* Keep the link with the copy so the block centres as one. */
  .kw-feature .kw-card-body .kg-go {
    margin-top: 10px;
  }
}
.kw-badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 7px;
  margin: 0 0 14px;
  padding: 5px 10px;
  border: 1px solid rgba(220, 38, 38, 0.45);
  border-radius: 999px;
  background: var(--ks-brand-soft);
  color: var(--ks-brand-light);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.kw-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ks-brand);
}

/* ── A client's own published figures, inside a case study ─────────── */
/* site.css's .kd-proof, tightened to stay three across on a phone. */
.kd-proof.kw-figures {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
}
.kw-figures div {
  padding: 16px 14px;
}
.kw-figures b {
  font-size: clamp(19px, 5vw, 24px);
}
.kw-figures-note {
  margin: 12px 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .kw-thumb img {
    transition: none;
  }
  a.kw-card:hover .kw-thumb img {
    transform: none;
  }
}
