/* ═══════════════════════════════════════════════════
   SOFTHIRE SYSTEMS — Motion Layer
   Progressive-enhancement motion primitives.
   Degrades to static on prefers-reduced-motion.
═══════════════════════════════════════════════════ */

/* Intro lock — prevents scroll during the opening sweep */
html.intro-locked, html.intro-locked body { overflow: hidden; }

/* ═══ GRAIN OVERLAY — 3% noise, overlay blend ═══ */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 9998;
  opacity: .045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='.85'/></svg>");
}

/* ═══ CUSTOM CURSOR ═══ */
.cur-dot, .cur-ring {
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 10000;
  border-radius: 50%;
  mix-blend-mode: difference;
  will-change: transform;
}
.cur-dot { width: 6px; height: 6px; background: #D4AE6A; z-index: 10001; }
.cur-ring {
  width: 32px; height: 32px;
  border: 1px solid rgba(212,174,106,.7);
  transition: width .28s cubic-bezier(.16,1,.3,1),
              height .28s cubic-bezier(.16,1,.3,1),
              border-color .28s ease;
}
.cur-ring.expand { width: 58px; height: 58px; border-color: rgba(212,174,106,1); }
@media (hover: none), (pointer: coarse) {
  .cur-dot, .cur-ring { display: none !important; }
}

/* ═══ MOTION PRIMITIVES ═══ */

/* fade — opacity + subtle rise */
[data-motion="fade"] {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity .7s cubic-bezier(.16,1,.3,1),
              transform .7s cubic-bezier(.16,1,.3,1);
  will-change: opacity, transform;
}
[data-motion="fade"].in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* stagger — children animate one-by-one, index set by JS */
[data-motion="stagger"] > * {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: opacity .75s cubic-bezier(.16,1,.3,1),
              transform .75s cubic-bezier(.16,1,.3,1);
  will-change: opacity, transform;
}
[data-motion="stagger"].in > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition-delay: calc(var(--i, 0) * 90ms);
}

/* split-text word reveal */
.mt-word {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, .5em, 0) scale(.985);
  filter: blur(4px);
  transition: opacity .55s cubic-bezier(.16,1,.3,1),
              transform .65s cubic-bezier(.16,1,.3,1),
              filter .55s cubic-bezier(.16,1,.3,1);
  will-change: opacity, transform, filter;
}
.mt-word.in {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
  transition-delay: calc(var(--i, 0) * 55ms);
}

/* shimmer sweep — fires once after element enters view */
.mt-shimmer {
  position: relative;
  display: inline-block;
  overflow: hidden;
}
.mt-shimmer::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg,
    transparent 30%,
    rgba(234,225,210,.55) 48%,
    rgba(255,240,205,.85) 50%,
    rgba(234,225,210,.55) 52%,
    transparent 70%);
  transform: translateX(-110%);
}
.mt-shimmer.fired::after {
  animation: mt-sweep 1.1s cubic-bezier(.22,1,.36,1) both;
}
@keyframes mt-sweep {
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(110%); }
}

/* magnetic buttons — JS sets --mx/--my, CSS handles the transform */
[data-motion="magnetic"] {
  transform: translate3d(var(--mx, 0), var(--my, 0), 0);
  transition: transform .35s cubic-bezier(.16,1,.3,1);
  will-change: transform;
}

/* count-up helper — tabular digits */
[data-motion="count"] { font-variant-numeric: tabular-nums; }

/* parallax */
[data-motion="parallax"] { will-change: transform; }

/* Ken Burns */
[data-motion="kenburns"] {
  transform: scale(1);
  transition: transform 14s linear;
  transform-origin: center center;
}
[data-motion="kenburns"].in { transform: scale(1.06); }

/* SVG path draw */
[data-motion="path-draw"] path,
[data-motion="path-draw"] line,
[data-motion="path-draw"] polyline {
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  transition: stroke-dashoffset 1.6s cubic-bezier(.22,1,.36,1);
}
[data-motion="path-draw"].in path,
[data-motion="path-draw"].in line,
[data-motion="path-draw"].in polyline {
  stroke-dashoffset: 0;
}

/* ═══ PAGE-LOAD INTRO ═══ */
.intro-veil {
  position: fixed; inset: 0; z-index: 9999;
  background: #050507;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  overflow: hidden;
}
.intro-veil.done {
  opacity: 0; visibility: hidden;
  transition: opacity .55s cubic-bezier(.22,1,.36,1), visibility 0s linear .55s;
}
.intro-veil .sweep {
  position: absolute; top: 50%; left: 0;
  width: var(--sw, 0%);
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #D4AE6A 20%, #D4AE6A 80%, transparent 100%);
  transform: translateY(-50%);
  box-shadow: 0 0 20px rgba(212,174,106,.6), 0 0 40px rgba(212,174,106,.3);
  transition: none;
}
.intro-veil .mark {
  position: relative; z-index: 2;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: clamp(26px, 4.2vw, 44px);
  color: #D4AE6A;
  letter-spacing: .02em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .55s cubic-bezier(.22,1,.36,1),
              transform .55s cubic-bezier(.22,1,.36,1);
}
.intro-veil .mark em {
  font-style: italic; color: #EAE1D2;
}
.intro-veil .mark.show { opacity: 1; transform: translateY(0); }

/* ═══ FOOTER WORDMARK — outline → gold fill on scroll ═══ */
.wordmark {
  display: block;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: clamp(54px, 17vw, 240px);
  line-height: .9;
  letter-spacing: -.02em;
  text-align: center;
  white-space: nowrap;
  margin: 56px 0 24px;
  padding: 0 24px;
  user-select: none;
  pointer-events: none;
  color: transparent;
  -webkit-text-stroke: 1px rgba(184,150,78,.35);
  background: linear-gradient(90deg,
    #D4AE6A 0%,
    #B8964E var(--wm-fill, 0%),
    transparent var(--wm-fill, 0%),
    transparent 100%);
  -webkit-background-clip: text;
          background-clip: text;
  overflow: hidden;
}

/* ═══ FOOTER TIMEZONE CLOCKS ═══ */
.fclocks {
  display: flex; gap: 32px; flex-wrap: wrap;
  justify-content: center; align-items: flex-start;
  padding: 24px 48px 28px;
  border-top: 1px solid rgba(184,150,78,.14);
  border-bottom: 1px solid rgba(184,150,78,.08);
  margin-top: 8px;
}
.fclock {
  display: flex; flex-direction: column; gap: 4px;
  align-items: center;
  font-family: 'DM Mono', 'Courier New', monospace;
  min-width: 120px;
}
.fclock .fccity {
  font-size: 9px; letter-spacing: .26em;
  text-transform: uppercase;
  color: #B8964E;
}
.fclock .fctime {
  font-size: 22px; letter-spacing: .04em;
  color: #EAE1D2;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.fclock .fcgmt {
  font-size: 8px; letter-spacing: .22em;
  text-transform: uppercase;
  color: #5E5448;
}
@media (max-width: 640px) {
  .fclocks { padding: 20px 20px 24px; gap: 22px; }
  .fclock { min-width: 92px; }
  .fclock .fctime { font-size: 18px; }
}

/* ═══ PLATFORM GLOBE MOUNT ═══ */
.platform-globe-wrap {
  display: flex; justify-content: center; align-items: center;
  margin: 20px auto 32px;
  position: relative;
}
.platform-globe-wrap canvas {
  width: 420px; height: 420px;
  max-width: 90vw;
  contain: layout paint;
  opacity: 0;
  transition: opacity .8s cubic-bezier(.22,1,.36,1);
}
.platform-globe-wrap[data-loaded="1"] canvas { opacity: 1; }
.platform-globe-wrap .globe-fallback {
  width: 320px; height: 320px; max-width: 80vw;
  display: none;
}
.platform-globe-wrap[data-fallback="1"] .globe-fallback { display: block; }
.platform-globe-wrap[data-fallback="1"] canvas { display: none; }
@media (max-width: 640px) {
  .platform-globe-wrap canvas { width: 300px; height: 300px; }
}

/* ═══ FOCUS STATES ═══ */
:focus-visible {
  outline: 2px solid #D4AE6A;
  outline-offset: 3px;
  border-radius: 1px;
}

/* ═══ REDUCED-MOTION KILL-SWITCH ═══ */
@media (prefers-reduced-motion: reduce) {
  .grain { display: none; }
  .cur-dot, .cur-ring { display: none !important; }
  .intro-veil { display: none !important; }
  .mt-shimmer::after { display: none !important; }
  [data-motion="fade"],
  [data-motion="stagger"] > *,
  .mt-word {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  [data-motion="magnetic"],
  [data-motion="parallax"] { transform: none !important; }
  [data-motion="kenburns"],
  [data-motion="kenburns"].in { transform: none !important; }
  .wordmark { --wm-fill: 100%; }
  .platform-globe-wrap canvas { display: none; }
  .platform-globe-wrap .globe-fallback { display: block; }
}
