/* ─── Motion system (mobile-first, content visible without JS) ─── */
:root {
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-dur: 1.05s;
  --motion-dur-lg: 1.35s;
  --motion-x: 52px;
  --motion-y: 64px;
}

/* Varsayılan: içerik görünür. JS .js-motion ekleyince başlangıç halleri aktif olur */
.js-motion .motion-in:not(.is-in) {
  opacity: 0;
  will-change: opacity, transform;
}
.js-motion .motion-in.motion-from-left:not(.is-in) { transform: translate3d(calc(var(--motion-x) * -1), 0, 0); }
.js-motion .motion-in.motion-from-right:not(.is-in) { transform: translate3d(var(--motion-x), 0, 0); }
.js-motion .motion-in.motion-from-up:not(.is-in) { transform: translate3d(0, var(--motion-y), 0); }
.js-motion .motion-in.motion-from-down:not(.is-in) { transform: translate3d(0, calc(var(--motion-y) * -0.7), 0); }
.js-motion .motion-in.motion-scale:not(.is-in) { transform: scale(0.94); }
.js-motion .motion-in.motion-mask:not(.is-in) {
  opacity: 1;
  clip-path: inset(0 78% 0 0);
  transform: none;
}
.js-motion .motion-in {
  transition:
    opacity var(--motion-dur) var(--motion-ease),
    transform var(--motion-dur) var(--motion-ease),
    clip-path var(--motion-dur-lg) var(--motion-ease);
  transition-delay: calc(var(--d, 0) * 120ms);
}
.js-motion .motion-in.is-in {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0 0);
}
.js-motion .motion-in.is-in .motion-child {
  opacity: 1;
  transform: none;
}
.js-motion .motion-child {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 0.9s var(--motion-ease), transform 0.9s var(--motion-ease);
  transition-delay: calc(var(--d, 0) * 120ms + 80ms);
}

/* Maske satırları — JS yoksa görünür */
.mask-line {
  display: block;
  overflow: hidden;
}
.mask-line__inner {
  display: inline-block;
  max-width: 100%;
}
.js-motion .hero-content--intro:not(.is-ready) .mask-line__inner,
.js-motion .motion-in:not(.is-in) .mask-line__inner {
  transform: translate3d(0, 110%, 0);
  opacity: 0;
}
.js-motion .hero-content--intro.is-ready .mask-line__inner,
.js-motion .motion-in.is-in .mask-line__inner {
  transform: none;
  opacity: 1;
  transition: transform 1s var(--motion-ease), opacity 0.85s var(--motion-ease);
}
.js-motion .hero-content--intro.is-ready .hero-kicker .mask-line__inner { transition-delay: 0.08s; }
.js-motion .hero-content--intro.is-ready .hero-brand .mask-line__inner { transition-delay: 0.22s; }
.js-motion .hero-content--intro.is-ready h1 .mask-line__inner { transition-delay: 0.38s; }
.js-motion .hero-content--intro.is-ready .hero-lead .mask-line__inner { transition-delay: 0.54s; }
.js-motion .hero-content--intro.is-ready .hero-actions {
  animation: motionFadeUp 0.75s var(--motion-ease) 0.72s both;
}
.js-motion .motion-in.is-in .mask-line__inner { transition-delay: calc(var(--d, 0) * 100ms + 60ms); }

@keyframes motionFadeUp {
  from { opacity: 0; transform: translate3d(0, 22px, 0); }
  to { opacity: 1; transform: none; }
}

/* Hero media layers — zoom ayrı, shift ayrı */
.hero-media-shift {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media-zoom {
  position: absolute;
  inset: -3%;
  width: 106%;
  height: 106%;
  will-change: transform;
}
.hero-media-zoom .hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  animation: none;
}
.js-motion .hero:not(.is-ready) .hero-media-zoom {
  transform: scale(1.12);
}
.js-motion .hero.is-ready .hero-media-zoom {
  transform: scale(1);
  transition: transform 1.55s var(--motion-ease);
}
.js-motion .hero.is-ready .carousel-item.active .hero-media-zoom {
  animation: heroSettle 6.5s var(--motion-ease) 1.55s both;
}
@keyframes heroSettle {
  from { transform: scale(1); }
  to { transform: scale(1.045); }
}

/* Expand image: dar çerçeveden tam genişliğe */
.expand-stage {
  margin: 0 0 2.25rem;
  overflow: hidden;
}
.expand-frame {
  --expand: 0;
  width: calc(72% + (28% * var(--expand)));
  margin-inline: auto;
  overflow: hidden;
  border-radius: calc(4px * (1 - var(--expand)));
  aspect-ratio: 16 / 11;
  background: var(--navy);
  will-change: width;
}
.expand-zoom {
  width: 100%;
  height: 100%;
  transform: scale(calc(1.1 - (0.1 * var(--expand))));
  transform-origin: center center;
  will-change: transform;
}
.expand-zoom img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Mobil hizmet kartları */
.svc-stack {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.svc-card {
  display: block;
  background: var(--navy);
  color: #fff;
  border: 1px solid rgba(184, 151, 90, 0.18);
  overflow: hidden;
  text-decoration: none;
  transform: scale(0.965);
  opacity: 0.78;
  transition:
    transform 0.55s var(--motion-ease),
    opacity 0.55s var(--motion-ease),
    border-color 0.45s var(--motion-ease),
    box-shadow 0.55s var(--motion-ease);
}
.svc-card.is-focus {
  transform: scale(1);
  opacity: 1;
  border-color: rgba(184, 151, 90, 0.45);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}
/* Entry uses transform; focus uses independent scale and contrast properties. */
.js-motion .svc-card.motion-in.is-in { scale: .95; filter: brightness(.72); }
.js-motion .svc-card.motion-in.is-in.is-focus { scale: 1; filter: brightness(1); }
.js-motion .svc-card.motion-in { transition: transform 1s var(--motion-ease), opacity 1s var(--motion-ease), scale .65s var(--motion-ease), filter .65s var(--motion-ease); }
.svc-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0a1422;
}
.svc-card__media.is-type {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(184, 151, 90, 0.22), transparent 50%),
    linear-gradient(160deg, #141414, #0a0a0a);
}
.svc-card__zoom {
  width: 100%;
  height: 100%;
  transform: scale(1.06);
  transition: transform 0.7s var(--motion-ease);
}
.svc-card.is-focus .svc-card__zoom { transform: scale(1); }
.svc-card__zoom img {
  width: auto;
  height: auto;
  max-width: 80px;
  max-height: 80px;
  object-fit: contain;
  object-position: center;
  padding: 0;
  display: block;
  background:
    radial-gradient(circle at 30% 20%, rgba(184, 151, 90, 0.16), transparent 48%),
    linear-gradient(165deg, #141414, #0a0a0a);
}
.svc-card__zoom { display: grid; place-items: center; }
.svc-card__media { aspect-ratio: 16 / 7; background: radial-gradient(ellipse at center, #2a2a2a, #0a0a0a 75%); }
.svc-card__media::after { content: ''; position: absolute; inset: 18px; border: 1px solid #b8975a40; pointer-events: none; }
.svc-card:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.svc-card__glyph {
  font-family: var(--font-display);
  font-size: 4.5rem;
  color: rgba(212, 184, 122, 0.35);
  line-height: 1;
}
.svc-card__num {
  position: absolute;
  left: 0.9rem;
  top: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--gold);
  z-index: 1;
}
.svc-card__body {
  padding: 1rem 1.05rem 1.15rem;
}
.svc-card__body h3 {
  color: #fff;
  font-size: 1.35rem;
  margin: 0 0 0.45rem;
}
.svc-card__body p {
  margin: 0 0 0.75rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.9rem;
  line-height: 1.55;
}
.svc-card__body .more {
  color: var(--gold-soft);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Quote panel motion child */
.js-motion .quote-panel:not(.is-in) .quote-text,
.js-motion .quote-panel:not(.is-in) .quote-meta {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
}
.js-motion .quote-panel.is-in .quote-text {
  opacity: 1;
  transform: none;
  transition: opacity 1s var(--motion-ease), transform 1s var(--motion-ease);
}
.js-motion .quote-panel.is-in .quote-meta {
  opacity: 1;
  transform: none;
  transition: opacity 0.9s var(--motion-ease) 0.14s, transform 0.9s var(--motion-ease) 0.14s;
}

/* Marquee pause when offscreen */
.ref-track.is-paused .ref-track-inner {
  animation-play-state: paused;
}

.section-services,
.section,
.cta-band,
.quote-panel {
  overflow-x: clip;
}

/* ─── Mobile priority layout ─── */
@media (max-width: 991.98px) {
  :root {
    --motion-x: 48px;
    --motion-y: 60px;
    --motion-dur: 1s;
    --motion-dur-lg: 1.3s;
  }

  .hero,
  .hero .carousel,
  .hero .carousel-inner,
  .hero .carousel-item {
    height: auto;
    min-height: 0;
  }
  .hero {
    min-height: 92svh;
  }
  .hero-slide {
    min-height: 92svh;
    height: 92svh;
    max-height: none;
    aspect-ratio: auto;
    align-items: flex-end;
  }
  .hero-media-shift,
  .hero-media-zoom,
  .hero-media-zoom .hero-media {
    animation: none;
  }
  .js-motion .hero.is-ready .carousel-item.active .hero-media-zoom {
    animation: heroSettle 7s var(--motion-ease) 1.4s both;
  }
  .hero-content {
    padding: 5.5rem 0 4.5rem;
    max-width: 100%;
  }
  .hero-brand { font-size: clamp(2.15rem, 11vw, 3rem); }
  .hero h1 {
    font-size: clamp(1.25rem, 5.4vw, 1.65rem);
    max-width: 14ch;
  }
  .hero p,
  .hero-lead {
    font-size: 0.92rem;
    -webkit-line-clamp: 3;
    margin-bottom: 1.15rem;
  }
  .hero-actions .btn {
    padding: 0.62rem 0.95rem;
    font-size: 0.6rem;
  }
  .hero .carousel-indicators { bottom: 3.4rem; }
  .hero-scroll { bottom: 0.85rem; }

  .expand-stage { margin: 0.25rem 0 1.75rem; }
  .expand-frame {
    width: calc(78% + (22% * var(--expand)));
    aspect-ratio: 5 / 4;
  }

  .team-card.motion-mask .team-photo {
    overflow: hidden;
  }
  .js-motion .team-card.motion-mask:not(.is-in) .team-photo {
    clip-path: inset(0 70% 0 0);
  }
  .js-motion .team-card.motion-mask.is-in .team-photo {
    clip-path: inset(0 0 0 0);
    transition: clip-path 1.25s var(--motion-ease);
    transition-delay: calc(var(--d, 0) * 110ms);
  }
}

@media (max-width: 430px) {
  :root { --motion-x: 42px; --motion-y: 56px; }
  .hero-slide { min-height: 90svh; height: 90svh; }
}

@media (max-width: 360px) {
  :root { --motion-x: 36px; }
  .hero-brand { font-size: clamp(1.9rem, 10vw, 2.4rem); }
  .svc-card__body h3 { font-size: 1.2rem; }
}

/* Masaüstü: motion devam eder, svc-stack gizli */
@media (min-width: 992px) {
  :root {
    --motion-x: 56px;
    --motion-y: 48px;
  }
  .expand-stage { margin: 0 0 2.75rem; }
  .js-motion .hero:not(.is-ready) .hero-media-zoom { transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .js-motion .motion-in,
  .js-motion .motion-in:not(.is-in),
  .js-motion .motion-child,
  .js-motion .hero-content--intro:not(.is-ready) .mask-line__inner,
  .js-motion .motion-in:not(.is-in) .mask-line__inner,
  .js-motion .hero:not(.is-ready) .hero-media-zoom,
  .js-motion .hero.is-ready .hero-media-zoom,
  .js-motion .hero.is-ready .carousel-item.active .hero-media-zoom,
  .js-motion .hero-content--intro.is-ready .hero-actions,
  .svc-card,
  .svc-card__zoom,
  .expand-frame,
  .expand-zoom {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    animation: none !important;
    transition: none !important;
    filter: none !important;
  }
  .expand-frame { width: 100% !important; }
  .svc-card { opacity: 1; transform: none; }
}

/* Scroll-driven signature scene; regular document scrolling remains native. */
.safety-scene{--p:0;height:170svh;position:relative;background:#0a0a0a}
.safety-scene__sticky{position:sticky;top:0;height:100svh;overflow:hidden;display:grid;place-items:center;isolation:isolate;background:#0a0a0a}
.safety-scene__sticky::before{content:'';position:absolute;inset:0;background:#f7f5ef;opacity:var(--p);z-index:-1}
.safety-grid{position:absolute;inset:0;background-image:linear-gradient(#b8975a18 1px,transparent 1px),linear-gradient(90deg,#b8975a18 1px,transparent 1px);background-size:60px 60px;transform:translateY(calc(var(--p) * -60px))}
.safety-shield{width:clamp(220px,30vw,360px);margin-top:-100px;transform:translate(calc(var(--p) * -23vw),calc(var(--p) * -10vh)) scale(calc(1 - var(--p) * .5)) rotate(calc(var(--p) * -12deg));will-change:transform;filter:drop-shadow(0 20px 30px #0004)}
.safety-copy{position:absolute;bottom:12%;text-align:center;color:#f7f5ef;opacity:calc(1 - var(--p) * 1.5);transform:translateY(calc(var(--p) * -60px))}
.safety-copy h2{color:inherit;font-size:clamp(40px,6vw,72px);line-height:1}
.safety-destination{position:absolute;color:#0a0a0a;font-family:var(--font-display);font-size:clamp(44px,8vw,100px);opacity:var(--p);transform:translateY(calc((1 - var(--p)) * 80px))}
.js-motion .hero.is-ready .carousel-item.active .hero-media-zoom{animation-fill-mode:forwards}
.js-motion .hero-content--intro.is-ready h1 .mask-line__inner{transition-delay:calc(.25s + var(--line-index,0) * .15s)}
.js-motion .motion-in.is-in .mask-title .mask-line__inner{transition-delay:calc(.1s + var(--line-index,0) * .15s)}
.team-card.is-in .team-photo{clip-path:inset(0)}
.team-card.is-in .team-photo img{transform:scale(1)}
.service-visual.is-in{clip-path:inset(0)}
@media(max-width:991px){.hero h1{font-size:clamp(1.65rem,7vw,2.3rem);max-width:18ch}}
html:not(.js-motion) .safety-scene{height:auto}
html:not(.js-motion) .safety-scene__sticky{position:relative}
@media(prefers-reduced-motion:reduce){.safety-scene{height:auto}.safety-scene__sticky{position:relative;height:650px;max-height:90svh}.safety-destination{display:none}.js-motion .svc-card.motion-in{scale:1!important;filter:none!important}}
html, body { overflow-x: clip; }
@media(prefers-reduced-motion:reduce){.svc-card{scale:1!important;filter:none!important}}
/* Compact mobile slider: show the whole source image without zoom cropping. */
@media (max-width: 991.98px) {
  .hero { min-height: 0; }
  .hero-slide { height: auto; min-height: 560px; max-height: none; padding-top: 240px; background: #0a0a0a; align-items: flex-end; }
  .hero-media-shift { height: 240px; inset: 0 0 auto; transform: none !important; }
  .hero-media-zoom { inset: 0; width: 100%; height: 100%; }
  .hero-media-zoom .hero-media { object-fit: contain; object-position: center; }
  .js-motion .hero .hero-media-zoom,
  .js-motion .hero.is-ready .carousel-item.active .hero-media-zoom { transform: none; animation: none; transition: none; }
  .hero-slide::before { background: linear-gradient(0deg, #0a0a0a 0%, #0a0a0a 45%, transparent 65%); pointer-events: none; }
  .hero-content { padding: 1.2rem 0 4rem; }
  .hero h1 { font-size: clamp(1.45rem, 6vw, 1.9rem); }
  .hero-brand { font-size: 2rem; }
  .hero .carousel-indicators { bottom: 1.8rem; }
  .hero-scroll { display: none; }
}
@media(max-width: 430px) {
  .hero-slide { height: auto; min-height: 530px; padding-top: 215px; }
  .hero-media-shift { height: 215px; }
}
