/* ARVEA public Motion Kit (2026-10-06) - home, /opportunity only.
   Direction + exact values: docs/design/2026-10-06_premium-motion-direction.md; rules: DESIGN.md "Motion".
   Compositor-only motion (transform/opacity). The one exception is the below-the-fold ritual line
   (stroke-dashoffset). Hero text is never hidden or moved: arrival animates decorative layers only.
   Every class is prefixed `m-` so the kit cannot collide with page-level rules. */

:root {
  --teal: #199BAA;
  --teal-hi: #1fb8ca;
  --ink: #0c1018;
  --line: rgba(232, 234, 237, .09);
  --line-teal: rgba(25, 155, 170, .38);
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --dur-press: 120ms;
  --dur-ui: 200ms;
  --dur-reveal: 520ms;
  --dur-arrive: 600ms;
  --pad-x: clamp(20px, 5vw, 56px);
  --dir: 1;
}
/* --teal / --teal-hi / --ink alias DESIGN.md --primary / --primary-light / --bg-deep with
   identical values (#199BAA / #1fb8ca / #0c1018); the rest are Motion Kit-only tokens
   defined in docs/design/2026-10-06_premium-motion-direction.md section 2. */
:root[dir="rtl"] { --dir: -1; }

/* ---- Atmosphere: one static teal glow + static grain, page-level, behind everything ---- */
.m-atmos {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: min(120vh, 1100px);
  overflow: clip;
  z-index: -1;
  pointer-events: none;
}
.m-atmos::before {
  content: "";
  position: absolute;
  inset-block-start: -22vmax;
  inset-inline-end: -26vmax;
  inline-size: 70vmax;
  block-size: 70vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(25, 155, 170, .30), rgba(25, 155, 170, .10) 45%, transparent 72%);
}
.m-atmos::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.1 -.35'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px;
  opacity: .06;
}

/* ---- Signature sprig: static line drawing, desktop only ---- */
.m-sprig { display: none; }
@media (min-width: 1000px) {
  .m-sprig {
    display: block;
    position: absolute;
    z-index: -1;
    inset-block-start: 50%;
    inset-inline-end: max(2vw, calc((100vw - 1200px) / 2));
    translate: 0 -50%;
    inline-size: clamp(320px, 30vw, 460px);
    block-size: auto;
    overflow: visible;
    pointer-events: none;
  }
  [dir="rtl"] .m-sprig { transform: scaleX(-1); }
  .m-sprig path {
    fill: none;
    stroke: var(--teal);
    stroke-width: 1.25;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    opacity: .55;
  }
  .m-sprig .m-arc { stroke: var(--line-teal); opacity: 1; }
}

/* ---- Eyebrow with hairline rule ---- */
.m-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 clamp(18px, 3vh, 28px);
  font-size: .75rem;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--teal-hi);
}
.m-eyebrow__rule {
  flex: none;
  inline-size: 40px;
  block-size: 1px;
  background: var(--teal);
  transform-origin: left;
}
[dir="rtl"] .m-eyebrow__rule { transform-origin: right; }
:root[lang="ar"] .m-eyebrow { font-size: .9rem; font-weight: 700; letter-spacing: 0; text-transform: none; }

/* ---- Arrival: decorative layers only, one-shot ---- */
@media (prefers-reduced-motion: no-preference) {
  .m-atmos::before { animation: m-glow-in 1.1s var(--ease-out) both; }
  .m-eyebrow__rule { animation: m-rule-in var(--dur-arrive) var(--ease-out) .15s both; }
}
@keyframes m-glow-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes m-rule-in { from { transform: scaleX(0); } to { transform: none; } }

/* ---- CTAs ---- */
.m-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-block-size: 52px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-ui) ease,
    border-color var(--dur-ui) ease, color var(--dur-ui) ease;
}
.m-btn--primary,
.m-btn--primary:hover,
.m-btn--primary:focus { background: var(--teal); color: var(--ink); }
.m-btn--primary { box-shadow: 0 12px 32px -14px rgba(25, 155, 170, .75); }
.m-btn--ghost,
.m-btn--ghost:hover,
.m-btn--ghost:focus { background: transparent; color: var(--text-primary, #e8eaed); border-color: var(--line-teal); }
.m-link,
.m-link:hover,
.m-link:focus {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-block-size: 48px;
  color: var(--teal-hi);
  font-weight: 600;
  text-decoration: none;
}
.m-ico {
  inline-size: 1.1em;
  block-size: 1.1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.m-ico-wa { inline-size: 1.25em; block-size: 1.25em; flex: none; fill: currentColor; }
.m-ico-arrow { transition: transform var(--dur-ui) var(--ease-out); }
[dir="rtl"] .m-ico-arrow { transform: scaleX(-1); }
@media (hover: hover) {
  .m-btn--primary:hover { background: var(--teal-hi); }
  .m-btn--ghost:hover { border-color: var(--teal-hi); color: var(--teal-hi); }
  :is(.m-btn, .m-link):hover .m-ico-arrow { transform: translateX(calc(4px * var(--dir))) scaleX(var(--dir)); }
}
.m-btn:active { transform: scale(.97); }
:is(.m-btn, .m-link):focus-visible { outline: 2px solid var(--teal-hi); outline-offset: 3px; }

/* ---- Below-the-fold reveals (never on the hero). Modern: scroll-driven; fallback: motion.js
   adds .m-io (only when scroll timelines are unsupported) and .is-in per element. No JS = visible.
   Fill is `backwards`, not `both`: after the reveal the element's own transform comes back, so
   card hover lifts still work. Ranges end at `entry 100%` so even the last card at the very
   bottom of a tall page completes (a `cover` end can be unreachable there). ---- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .js .m-reveal { animation: m-rise linear backwards; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .js .m-reveal.m-d1 { animation-range: entry 10% entry 100%; }
    .js .m-reveal.m-d2 { animation-range: entry 20% entry 100%; }
  }
  .m-io .m-reveal { transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out); }
  .m-io .m-reveal:not(.is-in) { opacity: 0; transform: translateY(18px); }
  .m-io .m-reveal.m-d1 { transition-delay: 80ms; }
  .m-io .m-reveal.m-d2 { transition-delay: 160ms; }
  .m-io .m-reveal.m-d3 { transition-delay: 240ms; }
}
@keyframes m-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---- Ritual line (opportunity 3 steps). Fallback = fully drawn. ---- */
.m-path-wrap { position: relative; padding-inline-start: 64px; }
.m-path { display: grid; gap: 22px; margin: 0; padding: 0; list-style: none; }
.m-ritual {
  position: absolute;
  inset-block-start: 22px;
  inset-inline-start: 0;
  inline-size: 48px;
  block-size: calc(100% - 44px);
  overflow: visible;
}
[dir="rtl"] .m-ritual { transform: scaleX(-1); }
.m-ritual path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.m-ritual-track { stroke: var(--line); stroke-width: 1; }
.m-ritual-line { stroke: var(--teal); stroke-width: 1.6; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .js .m-ritual-line {
      stroke-dasharray: 1;
      animation: m-draw linear both;
      animation-timeline: view();
      animation-range: entry 20% cover 65%;
    }
  }
}
@keyframes m-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.m-step {
  position: relative;
  padding: 20px 20px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg-card, #181e26);
}
.m-step__n {
  position: absolute;
  inset-inline-start: -64px;
  inset-block-start: 16px;
  display: grid;
  place-items: center;
  inline-size: 48px;
  block-size: 48px;
  border: 1px solid var(--teal);
  border-radius: 50%;
  background: var(--ink);
  color: var(--teal-hi);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}

/* ---- Mobile sticky CTA (< 900 px). motion.js toggles .is-on; hidden = unfocusable. ---- */
.m-sticky {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 40;
  display: flex;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  padding-inline-end: 84px;
  background: rgba(12, 16, 24, .96);
  border-block-start: 1px solid var(--line);
  transform: translateY(110%);
  visibility: hidden;
  transition: transform 280ms var(--ease-out), visibility 0s linear 280ms;
}
.m-sticky.is-on { transform: none; visibility: visible; transition: transform 280ms var(--ease-out), visibility 0s; }
.m-sticky .m-btn {
  flex: 1;
  min-block-size: 48px;
  padding-inline: 12px;
  gap: 8px;
  font-size: clamp(.8125rem, 3.6vw, .9375rem);
  white-space: nowrap;
}
@media (max-width: 899.98px) { .m-has-sticky { padding-block-end: 96px; } }
@media (min-width: 900px) { .m-sticky { display: none; } }

/* ---- Reduced motion: same layout and content, no movement ---- */
@media (prefers-reduced-motion: reduce) {
  .m-btn, .m-ico-arrow, .m-sticky, .m-sticky.is-on { transition: none; }
  .m-btn:active { transform: none; }
}
