/* TashiOS site-kit — GSAP + Three.js motion helpers (Tier A/B/C/D) */

.site-motion__word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.site-motion__word-inner {
  display: inline-block;
}

[data-three-hero] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero--motion,
.hero[data-three-wrap] {
  position: relative;
  overflow: hidden;
}

.hero--motion > .container,
.hero--motion > .hero__content,
.hero[data-three-wrap] > .container,
.hero[data-three-wrap] > .hero__content {
  position: relative;
  z-index: 1;
}

/* Scale-in images: wrap <img data-gsap-scale-in> in a clipped frame */
.site-motion__frame {
  overflow: hidden;
  display: block;
}

[data-gsap-scale-in] {
  will-change: transform;
  display: block;
  width: 100%;
}

[data-gsap-parallax] {
  will-change: transform;
}

/* Prevent FOUC before GSAP runs — use transform so motion feels smooth, not a hard blink */
html.site-motion-pending [data-gsap-reveal],
html.site-motion-pending [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
}

html.site-motion-pending [data-gsap-stagger] > *:not(.site-motion--visible),
html.site-motion-pending [data-reveal-stagger] > *:not(.site-motion--visible) {
  opacity: 0;
  transform: translateY(20px) scale(0.97);
}

[data-gsap-stagger] > *,
[data-reveal-stagger] > * {
  will-change: transform, opacity;
}

[data-gsap-stagger] > *.site-motion--visible,
[data-reveal-stagger] > *.site-motion--visible {
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  [data-three-hero] {
    display: none !important;
  }

  html.site-motion-pending [data-gsap-reveal],
  html.site-motion-pending [data-gsap-stagger] > *,
  html.site-motion-pending [data-reveal],
  html.site-motion-pending [data-reveal-stagger] > *,
  [data-gsap-reveal],
  [data-gsap-stagger] > *,
  [data-gsap-headline] .site-motion__word-inner,
  [data-reveal],
  [data-reveal-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
  }

  [data-gsap-parallax],
  [data-gsap-scale-in] {
    transform: none !important;
  }
}

/* ── Line reveal ── */
.site-motion__line {
  display: block;
  overflow: hidden;
}

.site-motion__line-inner {
  display: block;
}

[data-gsap-line-reveal] {
  display: block;
}

html.site-motion-pending [data-gsap-line-reveal] .site-motion__line-inner {
  opacity: 0;
  transform: translateY(110%);
}

[data-gsap-clip-reveal] {
  will-change: clip-path;
}

/* ── 3D card tilt ── */
.site-motion__tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
}

.site-motion__tilt-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.35), transparent 62%);
  transition: opacity 200ms ease;
}

/* ── Sticky nav shrink ── */
[data-nav-shrink] {
  transition:
    padding 320ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 320ms ease,
    box-shadow 320ms ease,
    backdrop-filter 320ms ease;
}

[data-nav-shrink].site-header--shrunk {
  padding-block: clamp(0.35rem, 1.2vw, 0.55rem) !important;
  background-color: color-mix(in srgb, var(--surface, #fff) 82%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  box-shadow: 0 8px 32px rgba(8, 10, 18, 0.08);
}

/* ── Magnetic CTAs — do not override display; .btn-primary uses inline-flex + gap for icon+text ── */
.site-motion__magnetic {
  will-change: transform;
}

/* ── Marquee ── */
.site-motion__marquee {
  overflow: hidden;
  width: 100%;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.site-motion__marquee-inner {
  display: flex;
  width: max-content;
  gap: var(--marquee-gap, 2rem);
  will-change: transform;
}

.site-motion__marquee-track {
  display: flex;
  align-items: center;
  gap: inherit;
  flex-shrink: 0;
}

/* ── Form micro-animations ── */
.form-status {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  transition: opacity 220ms ease, transform 220ms ease;
}

.form-status--pending {
  opacity: 0.85;
}

.form-status--success {
  color: var(--success, #15803d);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-status--success::before {
  content: '';
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: site-form-check 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.form-status--error {
  color: var(--danger, #b91c1c);
}

form.site-form--shake,
form[data-contact-form].site-form--shake {
  animation: site-form-shake 480ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes site-form-check {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes site-form-shake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-6px); }
  36% { transform: translateX(5px); }
  54% { transform: translateX(-4px); }
  72% { transform: translateX(3px); }
}

/* ── Polish: selection, focus, shimmer, dividers ── */
::selection {
  background: color-mix(in srgb, var(--accent, #6366f1) 28%, transparent);
  color: inherit;
}

:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent, #6366f1) 65%, #fff);
  outline-offset: 3px;
}

.site-motion__shimmer {
  position: relative;
  overflow: hidden;
}

.site-motion__shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 38%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 62%
  );
  transform: translateX(-120%);
  animation: site-shimmer 2.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes site-shimmer {
  0%, 72% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

.site-motion__glow {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent, #6366f1) 18%, transparent),
    0 12px 40px color-mix(in srgb, var(--accent, #6366f1) 22%, transparent);
}

.site-motion__divider {
  height: 1px;
  border: 0;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--border, #cbd5e1) 80%, transparent),
    transparent
  );
  margin-block: clamp(1.5rem, 4vw, 2.5rem);
}

@media (prefers-reduced-motion: reduce) {
  [data-nav-shrink],
  .site-motion__magnetic,
  .site-motion__tilt-card,
  .site-motion__marquee-inner,
  .site-motion__shimmer::after,
  form.site-form--shake {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }

  [data-nav-shrink].site-header--shrunk {
    backdrop-filter: none;
  }
}

/* Tailwind CDN preflight sets h1–h6 to font-size:inherit — restore CMS section headings */
.section__header h2,
.cta-band h2,
.cta-float-card h2,
.cta-minimal h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink-900);
}
.page-hero h1,
.page-header h1 {
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: 1.1;
}
.section--dark .section__header h2,
.section--dark .page-hero h1 { color: #fff; }
.section--brand .section__header h2 { color: #fff; }
