/* ============================================================
   ALSYST — Premium polish layer
   Loaded after responsive-polish.css. Editorial micro-details
   that lift the page from "good" to "$20k agency-quality":
   refined motion, hover states, type rhythm, focus, depth.
   ============================================================ */

/* ===== Type rhythm — display + body finer details ===== */
.display, .hero-pl-h, .hero h1, h1, h2, h3 {
  font-feature-settings: "ss01", "ss02", "kern", "liga", "calt";
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.display .it, .hero-pl-h .it, h1 .it, h2 .it {
  font-style: italic;
  font-feature-settings: "ss01", "ss02", "kern", "liga";
}
p, li, .hero-sub, .hero-pl-sub, .lede, .section-lede {
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Tighten letter-spacing on huge display sizes */
@media (min-width: 1040px){
  .hero-pl-h, .hero h1.display { letter-spacing: -.034em !important; }
  .section-head h2, .explainer-head h2, .cases-head h2 { letter-spacing: -.025em !important; }
}

/* ===== Reveal animations — premium stagger ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.reveal.in, .reveal.is-in, .reveal.in-view {
  opacity: 1;
  transform: none;
}
.reveal.delay-1 { transition-delay: .08s; }
.reveal.delay-2 { transition-delay: .16s; }
.reveal.delay-3 { transition-delay: .24s; }
.reveal.delay-4 { transition-delay: .32s; }
.reveal.delay-5 { transition-delay: .40s; }
.reveal.delay-6 { transition-delay: .48s; }
@media (prefers-reduced-motion: reduce){
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ===== Buttons — refined micro-interactions ===== */
.pill-cta, .sso, .wl-cta, .cta-btn, .btn,
.modal-btn, .ac-submit, .topbar-cta {
  position: relative;
  isolation: isolate;
  transition:
    transform .18s cubic-bezier(.2,.7,.2,1),
    box-shadow .25s cubic-bezier(.2,.7,.2,1),
    background-color .2s ease,
    color .2s ease,
    border-color .2s ease,
    filter .2s ease;
}
.pill-cta:hover, .wl-cta:hover, .cta-btn:hover, .ac-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.pill-cta:active, .wl-cta:active, .cta-btn:active, .ac-submit:active {
  transform: translateY(0) scale(.98);
  transition-duration: .08s;
}
.sso:hover {
  transform: translateY(-1px);
  border-color: color-mix(in oklab, currentColor 45%, transparent);
}
.sso:active { transform: translateY(0); }

/* Primary CTA: subtle inner highlight + glow */
.pill-cta {
  background-image: linear-gradient(180deg,
    color-mix(in oklab, var(--accent, #3403C9) 110%, white 6%),
    var(--accent, #3403C9));
  box-shadow:
    0 1px 0 rgba(255,255,255,.18) inset,
    0 0 0 1px color-mix(in oklab, var(--accent, #3403C9) 30%, transparent),
    0 14px 32px -16px color-mix(in oklab, var(--accent, #3403C9) 60%, transparent);
}
.pill-cta:hover {
  box-shadow:
    0 1px 0 rgba(255,255,255,.22) inset,
    0 0 0 1px color-mix(in oklab, var(--accent, #3403C9) 50%, transparent),
    0 22px 40px -16px color-mix(in oklab, var(--accent, #3403C9) 75%, transparent);
}

/* ===== Links — refined underline animation ===== */
a:not(.brand):not(.sso):not(.pill-cta):not(.wl-cta):not(.cta-btn):not(.btn):not(.signin-link):not(.modal-btn):not(.case-tab):not(.lang-opt):not(.foot-grid a):not(.nav-links a) {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .2s ease, text-decoration-color .2s ease;
}

/* Footer + nav links: animated underline on hover */
.foot-grid a, .nav-links a, .mobile-menu nav a {
  position: relative;
  transition: color .2s ease;
}
.foot-grid a::after, .nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 100%; height: 1px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(.3);
  transform-origin: left center;
  transition: opacity .25s ease, transform .35s cubic-bezier(.2,.7,.2,1);
}
.foot-grid a:hover::after, .nav-links a:hover::after {
  opacity: .65;
  transform: scaleX(1);
}

/* ===== Cards — refined depth + hover ===== */
.way, .case-card, .step, .signup-card, .agent-card,
.pm-card, .ac-card, .modal-card, .study-modal-panel {
  transition:
    transform .35s cubic-bezier(.2,.7,.2,1),
    box-shadow .4s cubic-bezier(.2,.7,.2,1),
    border-color .25s ease;
  will-change: transform;
}
.way:hover, .case-card:hover, .step:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--ink, #f5f5f5) 18%, transparent);
}
html[data-theme="dark"] .way:hover,
html[data-theme="dark"] .case-card:hover,
html[data-theme="dark"] .step:hover {
  box-shadow: 0 24px 60px -28px rgba(0,0,0,.55);
}
html[data-theme="light"] .way:hover,
html[data-theme="light"] .case-card:hover,
html[data-theme="light"] .step:hover {
  box-shadow: 0 24px 60px -28px rgba(0,0,0,.18);
}

/* ===== Eyebrow / small caps polish ===== */
.eyebrow, .live-dot + span, .nav-eyebrow, .case-tag {
  font-feature-settings: "kern", "ss01";
  letter-spacing: .14em;
}

/* ===== Live dot — static, no pulse ===== */
.live-dot, .ss-pulse {
  position: relative;
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ADE80;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ===== Section heads — stable rhythm ===== */
.section-head, .explainer-head, .cases-head {
  position: relative;
}
.section-head .eyebrow, .explainer-head .eyebrow, .cases-head .eyebrow {
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--muted);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ===== Scrollbar — refined ===== */
@media (pointer: fine){
  *::-webkit-scrollbar { width: 10px; height: 10px; }
  *::-webkit-scrollbar-track { background: transparent; }
  *::-webkit-scrollbar-thumb {
    background: color-mix(in oklab, var(--ink, #f5f5f5) 12%, transparent);
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: padding-box;
  }
  *::-webkit-scrollbar-thumb:hover {
    background: color-mix(in oklab, var(--ink, #f5f5f5) 24%, transparent);
    background-clip: padding-box;
    border: 2px solid transparent;
  }
  html { scrollbar-color: color-mix(in oklab, var(--ink, #f5f5f5) 14%, transparent) transparent; }
}

/* ===== Image / canvas loading ===== */
img[loading="lazy"]:not([src=""]):not(.loaded) {
  filter: blur(12px);
  transform: scale(1.02);
  transition: filter .6s ease, transform .6s ease;
}
img[loading="lazy"].loaded,
img[loading="lazy"][src]:not([src=""]) {
  filter: none;
  transform: none;
}

/* ===== Trust strip — premium horizontal scroll on mobile ===== */
@media (max-width: 720px){
  .trust-strip-inner {
    display: flex !important;
    gap: 22px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 18px;
    mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
  }
  .trust-strip-inner::-webkit-scrollbar { display: none; }
  .trust-strip-inner > * { flex-shrink: 0; white-space: nowrap; }
}

/* ===== Hero glow refinement ===== */
.hero-glow {
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: .9;
  filter: saturate(1.1);
}
@media (prefers-color-scheme: light){
  .hero-glow { mix-blend-mode: multiply; opacity: .35; }
}

/* ===== Hero subtle parallax float on agent card ===== */
@media (min-width: 1040px) and (prefers-reduced-motion: no-preference){
  @keyframes alsystAgentFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
  }
  .hero-pl .agent-card { animation: alsystAgentFloat 9s ease-in-out infinite; }
}

/* ===== Theme toggle — refined ===== */
.theme-toggle {
  transition: background .25s ease, border-color .25s ease, transform .2s ease;
}
.theme-toggle:hover { transform: rotate(-12deg); }
.theme-toggle:active { transform: rotate(0) scale(.92); }
.theme-toggle svg { transition: opacity .35s ease, transform .4s cubic-bezier(.2,.7,.2,1); }

/* ===== Lang picker — refined dropdown ===== */
.lang-menu {
  transform-origin: top right;
  transform: translateY(-6px) scale(.96);
  opacity: 0; visibility: hidden;
  transition: opacity .22s ease, transform .25s cubic-bezier(.2,.7,.2,1), visibility .22s;
}
.lang-menu.open {
  transform: translateY(0) scale(1);
  opacity: 1; visibility: visible;
}
.lang-opt {
  transition: background .15s ease, color .15s ease;
}

/* ===== Form fields — refined focus ===== */
input, textarea, select {
  transition: border-color .2s ease, box-shadow .25s ease, background-color .2s ease;
}
input:focus, textarea:focus, select:focus,
.hl-composer:focus-within {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent, #3403C9) 20%, transparent);
}

/* ===== Modal — refined entrance ===== */
.modal { transition: opacity .3s ease; }
.modal:not(.show) { pointer-events: none; opacity: 0; }
.modal-card, .pm-card, .signin-modal-card {
  transform: translateY(16px) scale(.98);
  opacity: 0;
  transition: transform .42s cubic-bezier(.2,.7,.2,1), opacity .35s ease;
}
.modal.show .modal-card,
.modal.show .pm-card,
.modal.show .signin-modal-card {
  transform: none; opacity: 1;
}

/* ===== Mobile menu — premium slide ===== */
.mobile-menu {
  transition: transform .42s cubic-bezier(.2,.7,.2,1), opacity .35s ease;
  transform: translateX(100%);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-backdrop {
  transition: opacity .35s ease, visibility .35s;
  opacity: 0; visibility: hidden;
}
.mobile-menu-backdrop.open {
  opacity: 1; visibility: visible;
  backdrop-filter: blur(8px);
}
.mobile-menu nav a {
  position: relative;
  transition: color .2s ease, padding-left .25s cubic-bezier(.2,.7,.2,1);
}
.mobile-menu nav a:hover { padding-left: 8px; }
.mobile-menu nav a:hover::before {
  content: "→";
  position: absolute;
  left: -10px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--accent, #3403C9);
  opacity: 0;
  animation: arrowIn .25s forwards;
}
@keyframes arrowIn { to { opacity: 1; left: -16px; } }

/* ===== Manifesto lines — refined kerning ===== */
.sm-line {
  font-feature-settings: "ss01", "kern", "liga";
  letter-spacing: -.018em;
}

/* ===== Cases — refined hover on tabs ===== */
.case-tab {
  transition: padding-left .35s cubic-bezier(.2,.7,.2,1), background .25s ease, color .2s ease;
}
.case-tab:hover { padding-left: 12px; }
.case-tab.active { padding-left: 24px; }
.case-tab .nm { transition: letter-spacing .35s cubic-bezier(.2,.7,.2,1); }
.case-tab.active .nm { letter-spacing: -.018em; }

/* ===== Token ledger — refined row hover ===== */
.ledger-row {
  transition: background .15s ease, padding-left .25s cubic-bezier(.2,.7,.2,1);
  border-radius: 8px;
}
.ledger-row:hover {
  background: color-mix(in oklab, var(--ink, #f5f5f5) 4%, transparent);
  padding-left: 6px;
  padding-right: 6px;
  margin: 0 -6px;
}

/* ===== Pre-launch dashboard — hero polish ===== */
.hero .left h1, .sector-head h1 {
  font-feature-settings: "ss01", "kern", "liga", "calt";
  letter-spacing: -.025em;
}

/* ===== GDPR bar — premium entrance ===== */
#gdpr-bar {
  animation: gdprSlideIn .55s cubic-bezier(.2,.7,.2,1) .8s both;
  box-shadow:
    0 1px 0 rgba(255,255,255,.05) inset,
    0 24px 60px -28px rgba(0,0,0,.55);
}
@keyframes gdprSlideIn {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce){
  #gdpr-bar { animation: none; }
}

/* ===== Pre-launch banner — shimmer removed ===== */
.prelaunch-bar::before { display: none !important; }
/* legacy shimmer kept below for reference */
.alsyst-noop-shimmer {
.prelaunch-bar {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.prelaunch-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in oklab, var(--accent, #3403C9) 22%, transparent) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: pbShimmer 8s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
  opacity: .5;
}
@keyframes pbShimmer {
  0%, 70%   { transform: translateX(-100%); }
  85%       { transform: translateX(100%); }
  100%      { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce){
  .prelaunch-bar::before { animation: none; }
}

/* ===== Subtle iridescence on accent text ===== */
.it, .accent .it {
  position: relative;
  display: inline-block;
}

/* ===== Section dividers — quiet but premium ===== */
section + section,
section.section,
.section,
.cases,
.cta {
  position: relative;
}
.section-head + *,
.cases-head + *,
.explainer-head + * {
  margin-top: 32px;
}

/* ===== Number count-up: stable line height ===== */
.count-up { font-variant-numeric: tabular-nums; font-feature-settings: "tnum", "ss01"; }
.hs-num, .case-stat .v, .meta-stat .v, .wl-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "ss01";
}

/* ===== Rotating word — refined ===== */
.rotator, .rotating-word {
  display: inline-block;
  position: relative;
  vertical-align: baseline;
}

/* ===== AI orb — glow removed for a cleaner look ===== */

/* ===== Link reveal cursor (already accent) — glow on focus ===== */
a:focus-visible, button:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent, #3403C9) 28%, transparent);
}

/* ===== Ensure nothing pokes out of viewport horizontally ===== */
body > *, .wrap > *, .container > * { min-width: 0; }

/* ===== Print niceties — already in responsive layer, reinforce ===== */
@media print {
  .reveal { opacity: 1 !important; transform: none !important; }
  .live-dot::after, .ss-pulse::after { display: none !important; }
}
