/* ===========================================================================
   Components
   =========================================================================== */

/* --- Chip ------------------------------------------------------------------ */
.chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--r-chip);
  font-family: var(--font-body);
  font-size: var(--fs-micro);
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--chip-neutral-bg);
  color: var(--chip-neutral-ink);
}
/* The three domain hues. These encode which industry a company is in, so they
   are fixed on purpose and do not follow the project. */
.chip--orange { background: var(--chip-orange-bg); color: var(--chip-orange-ink); }
.chip--pink   { background: var(--chip-pink-bg);   color: var(--chip-pink-ink); }
.chip--amber  { background: var(--chip-amber-bg);  color: var(--chip-amber-ink); }

/* Inside a case study, chips take the project's own accent instead. The tags
   and phase markers were hardcoded to the orange tone, so MaestroX — a yellow
   project — was reading its own phases in Cellebrite's orange while every other
   accented thing on the page followed it correctly.

   The text is not the raw accent. Straight, #D6006B lands at 3.73:1 on this
   ground, under the 4.5 small text needs; carrying 30% of the ink lifts the
   worst case to 4.57 against the chip's own background while leaving the hue
   recognisably the project's. Measured for all three, not eyeballed. */
.chip--accent {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: color-mix(in srgb, var(--accent) var(--chip-accent-mix), var(--ink));
}

.chip-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }

/* --- Button ----------------------------------------------------------------
   The primary CTA is a wide-tracked uppercase label with a rule under it,
   not a filled pill — a filled orange button would out-shout the title. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  line-height: 1;
  padding-block: var(--sp-3);
  color: var(--ink);
  transition: color var(--dur-fast) var(--ease), gap var(--dur-fast) var(--ease);
}
.btn__icon { width: 13px; height: 13px; flex: none; transition: transform var(--dur-fast) var(--ease); }

/* Magnetic pull. reveal.js writes the offset; the transition is what turns a
   sequence of pointer samples into a glide, and what carries it back to rest
   when the pointer leaves. Short enough to still feel attached to the cursor. */
[data-magnetic] { transition: transform 220ms var(--ease-out), color var(--dur-fast) var(--ease); }

/* Trailing mark on a button that leaves the site. Quieter than the leading
   icon — it is a note about where the link goes, not part of the label. */
.btn__icon--trail { width: 11px; height: 11px; opacity: 0.55; margin-left: -2px; }
.btn:hover .btn__icon--trail { opacity: 1; transform: translate(2px, -2px); }

.btn--cta {
  position: relative;
  color: var(--ink-strong);
}
.btn--cta::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform-origin: left;
  transition: transform var(--dur-fast) var(--ease);
}
.btn--cta:hover { color: var(--accent); }
.btn--cta:hover .btn__icon { transform: translateX(3px); }

.btn--ghost {
  padding-inline: var(--sp-4);
  padding-block: var(--sp-3);
  border: 1px solid var(--hairline);
  border-radius: var(--r-btn);
  color: var(--ink-muted);
}
.btn--ghost:hover { color: var(--ink-strong); border-color: var(--ink-faint); }

.btn[disabled],
.btn[aria-disabled='true'] {
  color: var(--ink-faint);
  cursor: not-allowed;
}
.btn[aria-disabled='true']::after { background: var(--ink-faint); opacity: 0.4; }
.btn[aria-disabled='true']:hover { color: var(--ink-faint); }
.btn[aria-disabled='true']:hover .btn__icon { transform: none; }

/* --- Icon button ------------------------------------------------------------ */
.icon-btn {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  color: var(--ink-muted);
  transition: color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}
.icon-btn:hover { color: var(--ink-strong); border-color: var(--ink-faint); }
.icon-btn svg { width: 16px; height: 16px; }

/* --- Card -------------------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-card);
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.card--interactive:hover { transform: translateY(-3px); border-color: var(--hairline); }

.card__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  flex: 1;
}
.card__role { font-size: var(--fs-small); font-weight: 600; color: var(--ink); }
.card__text { font-size: var(--fs-small); color: var(--ink-muted); line-height: var(--lh-snug); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
  gap: var(--sp-5);
}

/* --- Pager (‹ ›) --------------------------------------------------------------- */
.pager { display: flex; gap: var(--sp-3); align-items: center; }
.pager__btn {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  color: var(--ink-muted);
  transition: color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              opacity var(--dur-fast) var(--ease);
}
.pager__btn:hover:not([disabled]) { color: var(--ink-strong); border-color: var(--ink-faint); }
.pager__btn[disabled] { opacity: 0.28; cursor: not-allowed; }
.pager__btn svg { width: 14px; height: 14px; }

/* Slide counter, in the manner of a contact sheet: 01 / 04 */
.pager__count {
  font-family: var(--font-body);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  min-width: 4.5em;
  text-align: right;
}
.pager__count b { color: var(--ink); font-weight: 500; }

/* --- Device / app frame --------------------------------------------------------
   --py is written by js/reveal.js on scroll; every transform below composes it
   so parallax and tilt stack instead of fighting. */
.frame {
  border-radius: var(--r-frame);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--hairline-soft);
  box-shadow: var(--shadow-frame);
  transform: translate3d(0, var(--py, 0px), 0);
  will-change: transform;
}
/* frame: 'none' — the wrapper gets out of the way entirely.

   These exports arrive already framed: a device window with its own rounded
   corners and its own drop shadow, black outside the radius. Wrapping that in
   a second frame did three things at once — the radius and overflow:hidden
   cut the corners the image already had, the border drew a line around it, and
   box-shadow laid a second shadow under the baked-in one. What was left read
   as a picture inside a box inside a box.

   The parallax transform stays: that is motion, not decoration. Only the
   variants that draw a title bar keep the chrome, because there the wrapper
   really is the window. */
.frame--none {
  border-radius: 0;
  overflow: visible;
  background: none;
  border: 0;
  box-shadow: none;
}

/* The deck is the exception. In a case study the export is read as a document
   and a frame around it is noise; on the home page it is one object floating on
   a coloured ground, and it needs an edge and a shadow to sit on that ground
   rather than be pasted onto it. 8px, and the shadow back. */
.slide .frame--none {
  border-radius: var(--deck-frame-radius);
  overflow: hidden;
  box-shadow: var(--shadow-frame);
}

.frame__bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: #17130F;
  border-bottom: 1px solid var(--hairline-soft);
}
.frame__dots { display: flex; gap: 6px; }
.frame__dots i { width: 9px; height: 9px; border-radius: 50%; background: #3A322B; }
.frame__label {
  font-size: var(--fs-micro);
  color: var(--ink-faint);
  margin-inline: auto;
  padding-right: 34px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The extracted deck crops vary a lot in aspect ratio — some are wide
   screenshots, some tall column slices. Cap the height and letterbox rather
   than letting a portrait crop stretch a slide past the fold. */
.frame img, .frame video {
  width: 100%;
  height: auto;
  max-height: var(--frame-max-h, 58vh);
  object-fit: contain;
  object-position: top center;
  display: block;
}

.visual { perspective: 1800px; }
.visual--tilt .frame {
  transform: translate3d(0, var(--py, 0px), 0) rotateY(-4deg) rotateX(2deg);
  transform-origin: left center;
}
.visual--dim-ai { position: relative; }
.visual--dim-ai .frame { filter: contrast(0.85) brightness(0.7) saturate(0.7); }
.visual__glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1;
  pointer-events: none;
}
.visual__glyph svg { width: clamp(64px, 8vw, 104px); height: auto; opacity: 0.9; }

/* --- Overlay ---------------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: rgba(6, 5, 4, 0.8);
  backdrop-filter: blur(6px);
  opacity: 0;
  animation: overlay-in var(--dur-fast) var(--ease) forwards;
}
.overlay[hidden] { display: none; }
.overlay__panel {
  position: relative;
  width: min(64rem, 100%);
  max-height: 86vh;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-lift);
  padding: var(--sp-6);
}
.overlay__title { font-size: var(--fs-section); margin-bottom: var(--sp-4); padding-right: var(--sp-7); }

/* --- The CV reader ----------------------------------------------------------
   A document, not a picture, so the panel gives it the whole screen and holds
   the chrome in a bar rather than floating a close button over the page. The
   download sits next to the close: someone who opens a CV usually wants to
   keep it, and making them leave the site to do that is a poor trade. */
.overlay__panel--cv {
  width: min(60rem, 100%);
  height: 88vh;
  max-height: 88vh;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.overlay__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--hairline);
  flex: none;
}
.overlay__panel--cv .overlay__title {
  font-size: var(--fs-lead);
  margin: 0;
  padding: 0;
}
.overlay__actions { display: flex; align-items: center; gap: var(--sp-4); }
.overlay__panel--cv .overlay__close { position: static; }
.overlay__pdf {
  flex: 1;
  width: 100%;
  border: 0;
  background: var(--surface-2);
}

@media (max-width: 767px) {
  .overlay__panel--cv { height: 92vh; max-height: 92vh; }
  .overlay__bar { padding: var(--sp-3) var(--sp-4); }
  .overlay__actions { gap: var(--sp-3); }
}
.overlay__close {
  position: absolute;
  top: var(--sp-4); right: var(--sp-4);
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  color: var(--ink-muted);
}
.overlay__close:hover { color: var(--ink-strong); border-color: var(--ink-faint); }

@keyframes overlay-in { to { opacity: 1; } }

/* --- Placeholder ------------------------------------------------------------------- */
.ph {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: var(--ph-ratio, 16 / 10);
  background:
    repeating-linear-gradient(45deg,
      rgba(255, 248, 240, 0.035) 0 12px,
      rgba(255, 248, 240, 0.015) 12px 24px);
  color: var(--ink-faint);
  font-family: var(--font-body);
  font-size: var(--fs-micro);
  text-align: center;
  padding: var(--sp-4);
}
.ph__label { max-width: 24rem; }
.ph__tag {
  display: block;
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-size: var(--fs-label);
  color: var(--ink-muted);
  margin-bottom: var(--sp-1);
}
