/* ─────────────────────────────────────────────────────────────
   "Every project, alive." Cards orbit a particle portrait, then
   settle into a 3×3 grid as you scroll. Built from Figma frames
   738:1594 (portrait) and 738:1603 (grid).
   ───────────────────────────────────────────────────────────── */
.orbit { position: relative; height: 300vh; }

.orbit-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Fixed 1512×1075 design canvas (the Figma frame plus room for three full-height rows), scaled to fit the viewport */
.orbit-stage {
  position: relative;
  flex-shrink: 0;
  width: 1512px;
  height: 1075px;
  transform: scale(var(--stage-scale, 1));
}

.orbit-heading {
  position: absolute;
  inset-inline: 0;
  top: 38px;
  text-align: center;
  font-size: 60px;
  font-weight: 700;
  line-height: 84px;
  letter-spacing: -0.028em;
  opacity: 0;
  will-change: transform, opacity, filter;
}

.orbit-glow {
  position: absolute;
  left: 494px; /* centred on the head */
  top: 262px;
  width: 576px;
  height: 576px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  filter: blur(72px);
  pointer-events: none;
}

/* The face box from the Figma frame; the canvas overhangs it so dots can fly out */
.orbit-face {
  position: absolute;
  left: 626px;
  top: 275px; /* keep in sync with CONFIG.face in orbit.js */
  z-index: 10;
  width: 312px;
  height: 470px;
  will-change: transform, opacity;
}

/* Each orbiting card: centred on the stage, transform set per frame in JS */
.orbit-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 387.67px;
  translate: -50% -50%;
  opacity: 0;
  will-change: transform, opacity, filter;
}

/* ── Card ────────────────────────────────────────────────────── */
.orbit .card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  height: 100%;
  padding: 12px 16px;
  border: 2px solid var(--white);
  border-radius: 27px;
  /* white at 20% over the page blue, solid so cards behind don't show through */
  background: linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2)), var(--blue);
  color: var(--white);
  position: relative;
  overflow: hidden; /* keeps the decorative layers inside the rounded corners */
  isolation: isolate;
}
.orbit .card-title { position: relative; z-index: 1; font-size: 14px; font-weight: 500; white-space: nowrap; }

/* Image card */
.orbit .card--image { justify-content: center; gap: 20px; }
.orbit .card-media {
  position: relative;
  width: 100%;
  height: 192px;
  border-radius: 11px;
  overflow: hidden;
}
.orbit .media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}
/* Image slideshow: crossfade through a blur */
.orbit .slide {
  opacity: 0;
  filter: blur(8px);
  transform: scale(1.04);
  transition: opacity 0.6s var(--ease-out), filter 0.6s var(--ease-out), transform 1.2s var(--ease-out);
}
.orbit .slide.is-active { opacity: 1; filter: none; transform: none; }

/* Slow pan across the screenshot (anchored right, where the shots are cropped) */
.orbit .media-pan {
  position: absolute;
  inset: 0;
  transform-origin: 100% 50%;
  animation: mediaPan 16s ease-in-out infinite alternate;
  animation-delay: calc(var(--i, 0) * -2.3s);
}
@keyframes mediaPan {
  from { transform: scale(1.02); }
  to { transform: scale(1.09) translateX(2%); }
}
/* a hairline edge around the screenshot */
.orbit .card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

/* Work cards that open a case study */
.orbit .card--link { cursor: pointer; transition: box-shadow 0.4s var(--ease-out), background-color 0.4s; }
@media (hover: hover) { .orbit .card--link:hover { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.28); } }
.orbit .card--link:focus-visible { outline: 3px solid var(--white); outline-offset: 4px; }
.orbit .card-open {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 14px;
  border-radius: 999px;
  background: var(--white);
  color: var(--blue);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 10px 24px -10px rgba(1, 26, 102, 0.6);
  transition: transform 0.5s var(--spring);
}
.orbit .card-open-arrow {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  transition: transform 0.5s var(--spring);
}
.orbit .card-open-arrow svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) {
  .orbit .card--link:hover .card-open { transform: translateY(-3px); }
  .orbit .card--link:hover .card-open-arrow { transform: rotate(45deg); }
}
.orbit .card--link .slide.is-active { transition: opacity 0.6s var(--ease-out), filter 0.6s var(--ease-out), transform 0.9s var(--ease-out); }
@media (hover: hover) { .orbit .card--link:hover .slide.is-active { transform: scale(1.05); } }

/* Placeholder for a work example without a screenshot: drifting soft light */
.orbit .ph { background: rgba(255, 255, 255, 0.1); }
.orbit .ph-blob {
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.55;
  animation: phDrift 9s ease-in-out infinite alternate;
}
.orbit .ph-blob:nth-child(1) { background: rgba(255, 255, 255, 0.35); top: -30%; left: -10%; }
.orbit .ph-blob:nth-child(2) { background: rgba(120, 150, 255, 0.6); bottom: -40%; right: -15%; animation-duration: 11s; animation-delay: -3s; }
.orbit .ph-blob:nth-child(3) { background: rgba(255, 255, 255, 0.22); top: 10%; left: 40%; width: 45%; animation-duration: 7s; animation-delay: -5s; }
@keyframes phDrift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(18%, 12%) scale(1.25); }
}
.orbit .ph-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
}
.orbit .ph-label code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; opacity: 0.75; }
.orbit .ph-label span:last-child { font-size: 15px; font-weight: 500; opacity: 0.85; }
.orbit .ph-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}
.orbit .ph-icon svg { width: 16px; height: 16px; fill: currentColor; }
.orbit .is-paused .ph-blob,
.orbit .is-paused .media-pan,
.orbit .is-paused .quote-mark,
.orbit .is-paused .quote-hl,
.orbit .is-paused .logos-glow { animation-play-state: paused; }

/* Quote */
.orbit .quote { position: relative; z-index: 1; width: 100%; padding: 10px 20px; }
/* in a row stretched by a taller card, keep the body centred under the title */
.orbit .card--quote .quote { margin-block: auto; }
.orbit .quote-text { font-size: 23px; font-weight: 500; line-height: 1.24; letter-spacing: -0.005em; }
.orbit .quote-text.is-long { font-size: 19px; line-height: 1.28; }
.orbit .quote-author { margin-top: 10px; font-size: 14px; font-weight: 500; opacity: 0.8; }
/* A big, faint quotation mark drifting behind the text */
.orbit .quote-mark {
  position: absolute;
  top: -22px;
  right: 18px;
  z-index: 0;
  font-size: 210px;
  font-weight: 900;
  line-height: 1;
  color: rgba(255, 255, 255, 0.14);
  pointer-events: none;
  user-select: none;
  animation: quoteMark 7s ease-in-out infinite alternate;
  animation-delay: calc(var(--i, 0) * -1.3s);
}
@keyframes quoteMark {
  from { transform: translateY(0) rotate(-4deg); }
  to { transform: translateY(10px) rotate(3deg); }
}
/* A soft highlighter sweeps under the quote, line by line, when the card comes alive */
.orbit .quote-hl {
  background: linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2)) no-repeat 0 92% / 0% 0.38em;
  animation: quoteHighlight 1.8s var(--ease-out) 0.5s forwards;
}
@keyframes quoteHighlight { to { background-size: 100% 0.38em; } }

/* Blur swap used by rotating quotes */
.orbit .swap { transition: opacity 0.3s var(--ease-out), filter 0.3s var(--ease-out), transform 0.3s var(--ease-out); }
.orbit .swap.is-out { opacity: 0; filter: blur(6px); transform: translateY(-6px); }
.orbit .swap.is-in { opacity: 0; filter: blur(6px); transform: translateY(6px); transition: none; }

/* Trusted by: logos on a blueprint grid, with corner marks and a drifting spotlight */
.orbit .logos-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  align-self: stretch;
  display: flex;
  align-items: center;
  min-height: 110px;
  margin: 2px 0 2px;
  border-radius: 14px;
  overflow: hidden;
}
.orbit .logos-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: center;
  -webkit-mask-image: radial-gradient(ellipse 72% 78% at 50% 50%, #000 25%, transparent 100%);
  mask-image: radial-gradient(ellipse 72% 78% at 50% 50%, #000 25%, transparent 100%);
}
.orbit .logos-glow {
  position: absolute;
  top: 50%;
  left: 8%;
  width: 180px;
  height: 180px;
  margin: -90px 0 0 -90px;
  border-radius: 50%;
  background: radial-gradient(rgba(255, 255, 255, 0.32), transparent 65%);
  animation: logosGlow 9s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes logosGlow {
  from { left: 8%; top: 40%; }
  50% { top: 62%; }
  to { left: 92%; top: 45%; }
}
.orbit .logos-corners {
  --t: rgba(255, 255, 255, 0.75);
  position: absolute;
  inset: 8px;
  background:
    linear-gradient(var(--t), var(--t)) top left / 12px 1.5px,
    linear-gradient(var(--t), var(--t)) top left / 1.5px 12px,
    linear-gradient(var(--t), var(--t)) top right / 12px 1.5px,
    linear-gradient(var(--t), var(--t)) top right / 1.5px 12px,
    linear-gradient(var(--t), var(--t)) bottom left / 12px 1.5px,
    linear-gradient(var(--t), var(--t)) bottom left / 1.5px 12px,
    linear-gradient(var(--t), var(--t)) bottom right / 12px 1.5px,
    linear-gradient(var(--t), var(--t)) bottom right / 1.5px 12px;
  background-repeat: no-repeat;
  pointer-events: none;
}
.orbit .logos {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 20px;
}
.orbit .logo-idealo { position: relative; flex-shrink: 0; width: 123px; height: 38px; }
.orbit .logo-part { position: absolute; }
.orbit .logo-part img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; }
.orbit .logo-bar { background: var(--white); }
.orbit .logo-gasag { display: block; flex-shrink: 0; }
/* The divider is a 38px horizontal line in Figma, turned upright */
.orbit .logos-divider { position: relative; align-self: stretch; width: 0; }
.orbit .logos-divider img {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  rotate: -90deg;
}

/* Current status */
.orbit .status { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.orbit .status-row { display: flex; align-items: center; gap: 10px; padding: 10px 20px; }
.orbit .status-label { flex: 1; font-size: 17px; font-weight: 900; text-box: trim-both cap alphabetic; }
.orbit .status-dot { position: relative; width: 12px; height: 12px; flex-shrink: 0; }
.orbit .status-dot img { display: block; }
.orbit .status-dot::after { /* soft "live" ping */
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #00fd44;
  animation: statusPing 1.8s var(--ease-out) infinite;
}
@keyframes statusPing { from { opacity: 0.7; } to { transform: scale(2.6); opacity: 0; } }
.orbit .card-book { align-self: flex-start; }

/* Pause CSS-driven loops when the card isn't live */
.orbit .is-paused .status-dot::after { animation-play-state: paused; }

/* ── Fallback (mobile / reduced motion) ──────────────────────── */
.orbit-fallback { display: none; }

.orbit.is-static { height: auto; padding: 96px 20px; overflow-x: clip; }
.orbit.is-static .orbit-sticky { display: none; }
.orbit.is-static .orbit-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  max-width: 1243px;
  margin: 0 auto;
}
.fallback-heading {
  text-align: center;
  font-size: clamp(38px, 6vw, 60px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.028em;
}
.fallback-face { display: none; } /* the portrait only makes sense inside the orbit */
.fallback-face .orbit-face { position: relative; left: auto; top: auto; }
.fallback-grid { display: grid; gap: 20px; width: 100%; }
@media (min-width: 768px) { .fallback-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; } }
.fallback-grid > *, .fallback-heading, .fallback-face {
  opacity: 0;
  filter: blur(6px);
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), filter 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  transition-delay: var(--delay, 0s);
}
.fallback-face { filter: none; transform: none; }
.orbit-fallback .is-shown { opacity: 1; filter: none; transform: none; } /* scoped: the services tab bar also uses .is-shown */

@media (max-width: 420px) {
  .orbit .quote-text { font-size: 21px; }
  .orbit .logos { padding: 16px 8px; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .fallback-grid > *, .fallback-heading, .fallback-face { transition: none; opacity: 1; filter: none; transform: none; }
  .orbit .status-dot::after, .orbit .ph-blob, .orbit .media-pan,
  .orbit .quote-mark, .orbit .logos-glow { animation: none; }
  .orbit .quote-hl { animation: none; background-size: 100% 0.38em; }
}
