.motion-gallery {
  background: #0c0c10;
  color: #f5f5f5;
  border-top: 1px solid #343434;
}
.motion-gallery > .wrap { padding-block: clamp(70px, 9vw, 140px); }
.motion-gallery .sub { max-width: 58ch; margin-bottom: 2rem; }
.motion-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.motion-demo {
  min-width: 0;
  padding: 8px 8px 16px;
  border: 1px solid #ffffff23;
  border-radius: 18px;
  background: #111117;
}
.motion-demo:focus-within { border-color: #7394ff; }
.motion-stage {
  display: block;
  width: 100%;
  height: 394px;
  border: 0;
  background: #17171e;
  border-radius: 11px;
}
.motion-demo h3 { font-size: 20px; margin: 12px 7px 4px; }
.motion-demo p { font-size: 14px; line-height: 1.4; color: #c2c3d0; margin: 0 7px; }
@media (max-width: 1020px) { .motion-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) { .motion-grid { grid-template-columns: 1fr; } }

@media (min-width: 761px) and (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .motion-gallery {
      position: relative;
      isolation: isolate;
      view-timeline: --gallery-entry block;
    }
    .motion-gallery::before {
      content: "";
      position: absolute;
      inset: 0 0 auto;
      height: min(88svh, 720px);
      z-index: -1;
      pointer-events: none;
      background: radial-gradient(ellipse at 76% 0%, #383171 0%, #242047 35%, transparent 72%);
      animation: gallery-light linear both;
      animation-timeline: --gallery-entry;
      animation-range: entry 0% entry 86%;
    }
    #motion-heading {
      animation: gallery-title linear both;
      animation-timeline: --gallery-entry;
      animation-range: entry 3% entry 42%;
    }
    .motion-demo {
      --reveal-start: 4%;
      --reveal-end: 64%;
      --reveal-angle: -3deg;
      transform-origin: 50% 90%;
      animation: gallery-card linear both;
      animation-timeline: view();
      animation-range: entry var(--reveal-start) entry var(--reveal-end);
    }
    .motion-demo:focus-within { animation: none; }

    @media (min-width: 1021px) {
      .motion-demo:nth-child(3n + 2) { --reveal-start: 14%; --reveal-end: 76%; --reveal-angle: 0deg; }
      .motion-demo:nth-child(3n) { --reveal-start: 24%; --reveal-end: 88%; --reveal-angle: 3deg; }
    }
    @media (min-width: 651px) and (max-width: 1020px) {
      .motion-demo:nth-child(even) { --reveal-start: 17%; --reveal-end: 80%; --reveal-angle: 3deg; }
    }
    @media (max-width: 650px) {
      .motion-demo { --reveal-start: 0%; --reveal-end: 52%; --reveal-angle: -1.5deg; }
    }

    @keyframes gallery-light {
      0%, 100% { opacity: 0; clip-path: inset(0 0 90% 0); }
      42% { opacity: .85; clip-path: inset(0); }
      72% { clip-path: inset(0); }
    }
    @keyframes gallery-title {
      from { opacity: .25; transform: translateY(28px); clip-path: inset(0 0 84% 0); }
      to { opacity: 1; transform: none; clip-path: inset(-12% 0); }
    }
    @keyframes gallery-card {
      0% {
        opacity: 0;
        transform: perspective(1000px) translateY(52px) rotateX(13deg) rotate(var(--reveal-angle)) scale(.94);
        clip-path: inset(0 0 68% 0 round 18px);
      }
      55% { opacity: 1; }
      100% { opacity: 1; transform: none; clip-path: inset(0 round 18px); }
    }
  }
}
/* A travelling colour seam opens the gallery as the reading scene leaves. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .motion-gallery {
      position: relative;
      view-timeline: --gallery-entry block;
    }
    .motion-gallery::after {
      content: "";
      position: absolute;
      inset: 0 0 auto;
      height: clamp(52px, 9vw, 126px);
      pointer-events: none;
      transform-origin: top;
      background: linear-gradient(168deg, #d8f45d 0 34%, #a99cff 34% 68%, #4941aa 68%);
      animation: takt-veil linear both;
      animation-timeline: --gallery-entry;
      animation-range: entry 0% entry 42%;
    }
    @keyframes takt-veil {
      from { clip-path: polygon(0 0,100% 0,100% 100%,0 68%); }
      to { clip-path: polygon(0 0,100% 0,100% 0,0 0); }
    }
    .motion-gallery .sub, .rates .sub {
      animation: takt-caption linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 16%;
    }
    @keyframes takt-caption {
      from { opacity: .4; translate: 0 12px; }
      to { opacity: 1; translate: none; }
    }
  }
  header nav a { position: relative; }
  header nav a::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 2px;
    background: #d8f45d;
    scale: 0 1;
    transform-origin: right;
    transition: scale .24s ease-out;
  }
  header nav a:is(:hover,:focus-visible)::after { scale: 1; transform-origin: left; }
  .brief-options input:checked + span { animation: takt-settle .34s ease-out; }
  @keyframes takt-settle {
    35% { transform: scale(.95); }
    72% { transform: scale(1.025); }
  }
}

/* Orbit mark beside the process heading. */
.reading .eyebrow::before {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='8' fill='none' stroke='black' stroke-width='1.5' stroke-dasharray='40 11' transform='rotate(15 12 12)'/%3E%3Ccircle cx='19.73' cy='9.93' r='2.3'/%3E%3Ccircle cx='12' cy='12' r='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (prefers-reduced-motion: no-preference) {
  .reading .eyebrow::before { animation: process-orbit 8s linear infinite; }
  @keyframes process-orbit { to { transform: rotate(1turn); } }
}


/* Section-specific line icons */
.eyebrow[data-en]::before {
  width: 20px; height: 20px; flex: 0 0 20px;
  background: currentColor;
}
.eyebrow[data-en="Digital studio"]::before {
  mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'1.65'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'm12%203%209%205-9%205-9-5z%20M3%2012l9%205%209-5%20M3%2016l9%205%209-5'%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
  --section-motion: mark-lift;
}
.eyebrow[data-en="Design and development"]::before {
  mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'1.65'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Crect%20x%3D'2.5'%20y%3D'4'%20width%3D'19'%20height%3D'16'%20rx%3D'2.5'%2F%3E%3Cpath%20d%3D'M3%209h18m-13%204-2%202%202%202m7-4%202%202-2%202'%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
  --section-motion: mark-pulse;
}
.eyebrow[data-en="Mobile development"]::before {
  mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'1.65'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Crect%20x%3D'6'%20y%3D'2'%20width%3D'12'%20height%3D'20'%20rx%3D'3'%2F%3E%3Cpath%20d%3D'M10%205h4m-3%2014h2'%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
  --section-motion: mark-tilt;
}
.eyebrow[data-en="Telegram"]::before {
  mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'1.65'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M2.5%2010.5%2021%203l-3.5%2017-6-5-3%203v-5l9-7-11%206z'%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
  --section-motion: mark-send;
}
.eyebrow[data-en="AI and automation"]::before {
  mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'1.65'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Crect%20x%3D'6'%20y%3D'6'%20width%3D'12'%20height%3D'12'%20rx%3D'3'%2F%3E%3Crect%20x%3D'10'%20y%3D'10'%20width%3D'4'%20height%3D'4'%20rx%3D'1'%2F%3E%3Cpath%20d%3D'M9%203v3m6-3v3M9%2018v3m6-3v3M3%209h3m-3%206h3m12-6h3m-3%206h3'%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
  --section-motion: mark-pulse;
}
.eyebrow[data-en="Pricing"]::before {
  mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'1.65'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M3%204h8l10%2010-8%208L3%2012z'%2F%3E%3Ccircle%20cx%3D'7.5'%20cy%3D'8'%20r%3D'1'%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
  --section-motion: mark-tilt;
}
.eyebrow[data-en="Contact"]::before {
  mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'1.65'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Crect%20x%3D'2.5'%20y%3D'5'%20width%3D'19'%20height%3D'14'%20rx%3D'2.5'%2F%3E%3Cpath%20d%3D'm4%207%208%206%208-6'%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
  --section-motion: mark-lift;
}
@media (prefers-reduced-motion: no-preference) {
  .shot .eyebrow::before, .rates .eyebrow::before, .contact .eyebrow::before {
    animation: var(--section-motion) 4s ease-in-out infinite;
  }
  @keyframes mark-lift { 50% { transform: translateY(-2px); } }
  @keyframes mark-tilt { 45% { transform: rotate(-8deg); } }
  @keyframes mark-send { 50% { transform: translate(2px,-2px); } }
  @keyframes mark-pulse { 50% { opacity: .7; transform: scale(.94); } }
}


/* Cylindrical gallery of live demos. */
.motion-gallery:has(.motion-reel) { overflow-x: clip; }
.motion-gallery:has(.motion-reel) #motion-heading,
.motion-gallery:has(.motion-reel) .sub { text-align: center; margin-inline: auto; }
.motion-grid.motion-reel {
  --card: min(60vw, 740px);
  display: flex; align-items: stretch; gap: clamp(12px, 2vw, 32px);
  box-sizing: border-box; width: 100vw; margin-left: calc(50% - 50vw);
  padding: 2rem calc((100vw - var(--card)) / 2);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.motion-reel::-webkit-scrollbar { display:none; }
.motion-reel .motion-demo {
  flex: 0 0 var(--card); box-sizing:border-box; scroll-snap-align:center;
  animation:none; transform-origin:center;
  transform:perspective(1000px) rotateY(var(--yaw,0deg));
}
.motion-reel .reel-side {cursor:pointer}
.motion-reel .reel-side iframe {pointer-events:none}
.reel-controls {display:flex;align-items:center;justify-content:center;gap:18px}
.reel-controls output {font-variant-numeric:tabular-nums}
.reel-controls button {width:44px;height:44px;border:1px solid #55545d;border-radius:50%;color:inherit;background:transparent;font:inherit;cursor:pointer}
.reel-controls button:disabled {opacity:.35}
@media(max-width:760px){.motion-grid.motion-reel{--card:84vw}.motion-reel .motion-demo{transform:perspective(850px) rotateY(var(--yaw,0deg))}}
@media(prefers-reduced-motion:reduce){.motion-grid.motion-reel .motion-demo{transform:none}}

/* Scroll-driven panorama */
#motion.panoramic { height: calc(100svh + 320svh); }
#motion.panoramic > .wrap {
  position: sticky; top: 56px; height: calc(100svh - 56px); box-sizing: border-box;
  display: flex; flex-direction: column; justify-content: center; padding-block: 10px;
}
#motion.panoramic #motion-heading { font-size: clamp(32px, 7vh, 82px); margin-block: 0; animation: none; }
#motion.panoramic .sub { margin-block: 8px; animation:none; }
.panoramic .motion-grid.motion-reel { overflow-x: hidden; scroll-snap-type: none; padding-block: 14px; flex:none; }
#motion.panoramic .motion-stage { height: clamp(210px, 40svh, 394px); }
#motion.panoramic .reel-controls { flex:none; }
.motion-gallery:has(.motion-reel) > .wrap { position:relative; }
.motion-reel { position:relative; }
.motion-reel .reel-side { filter:brightness(.87); }
@supports (backdrop-filter:blur(1px)) {
  .motion-gallery:has(.motion-reel) .wrap::after {
    content:""; position:absolute; pointer-events:none; z-index:1;
    left:calc(50% - 50vw); width:100vw; inset-block:0;
    backdrop-filter:blur(4px);
    mask-image:linear-gradient(90deg,#000,transparent 21%,transparent 79%,#000);
  }
}
@media(max-width:760px) {
  #motion.panoramic .sub { font-size:14px; }
  .motion-gallery:has(.motion-reel) .wrap::after { mask-image:linear-gradient(90deg,#000,transparent 8%,transparent 92%,#000); }
}

/* Leave room for all three projected cards and their rounded corners. */
@media (min-width: 761px) {
  .motion-grid.motion-reel { --card: min(29vw, 740px); gap: clamp(12px, 1.5vw, 28px); }
  .panoramic .motion-grid.motion-reel { padding-block: clamp(22px, 4vh, 42px); }
}
@media (max-width: 760px) {
  .panoramic .motion-grid.motion-reel { padding-block: 22px; }
}
