/**
 * Asta Technologies - Award-grade polish & micro-interactions
 * "Whitespace over Wireframes" - Fintech Slate 60-30-10 design system
 */

@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;700&display=swap");

/* Shared typography — aligned with the Asta application surfaces. */
:root {
  --asta-font-sans: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --asta-font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

html,
body,
button,
input,
select,
textarea,
.font-sans,
.font-display {
  font-family: var(--asta-font-sans) !important;
}

.font-mono,
code,
kbd,
pre,
.mono {
  font-family: var(--asta-font-mono) !important;
}

/* ── 60-30-10 Design Tokens ── */
:root {
  --asta-canvas: #0F172A;    /* 60% - Fintech Slate */
  --asta-surface: #1E293B;   /* 30% - Surfaces */
  --asta-emerald: #10b981;   /* 10% - Actions */
}

/* Smooth scroll with reduced-motion respect */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Focus-visible for keyboard accessibility (WCAG 2.2) */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Refined selection styling */
::selection {
  background: rgba(16, 185, 129, 0.35);
  color: #f4f4f5;
}

/* Flat hover for interactive cards - surface color change only */
.asta-card-lift {
  transition: background-color 0.3s ease-in-out;
}
.asta-card-lift:hover {
  background-color: rgba(51, 65, 85, 0.8);
}

/* Button press feedback */
.asta-btn-press:active {
  transform: scale(0.98);
}

/* Cursor pointer for interactive elements */
[role="button"]:not(:disabled),
button:not(:disabled),
a[href] {
  cursor: pointer;
}

/* Big screens: larger tap/hover targets, reduce hover-only reliance */
@media (min-width: 1400px) {
  a[href]:not(.cta-request):not([class*="px-"]) {
    padding: 0.25em 0;
  }
  .data-card,
  .asta-card-lift {
    min-height: 200px;
  }
}

/* Mobile: ensure 44px min touch targets */
@media (max-width: 768px) {
  button, a[role="button"], .cta-request {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Orientation prompt - suggest landscape on mobile portrait */
.orientation-prompt {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(9, 9, 11, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 1;
  transition: opacity 0.4s ease;
}
.orientation-prompt-inner {
  text-align: center;
  max-width: 320px;
}
.orientation-icon {
  font-size: 64px;
  color: #10b981;
  display: block;
  margin-bottom: 1rem;
  animation: orientation-pulse 2s ease-in-out infinite;
}
@keyframes orientation-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}
.orientation-text {
  color: #f4f4f5;
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}
.orientation-dismiss {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #a1a1aa;
  padding: 0.5rem 1.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.orientation-dismiss:hover {
  border-color: #10b981;
  color: #10b981;
}

/* Hero tidbit dissolve */
#hero-tidbit {
  visibility: hidden;
  display: none;
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}
#hero-tidbit p {
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

/* Premium: reduce backdrop-blur on mobile for performance */
@media (max-width: 768px) {
  .backdrop-blur-xl { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
}

/* Premium: smoother CTA hover */
.cta-request {
  will-change: transform;
}
.cta-request:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -8px rgba(16, 185, 129, 0.25);
}

/* Launch hero: Ghana map + marker convergence */
.hero-launch {
  background:
    radial-gradient(circle at top, rgba(16, 185, 129, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.78), rgba(2, 6, 23, 0.94));
}
.hero-map-shell {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}
.hero-map-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 78px 78px;
  mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.9) 18%, rgba(0, 0, 0, 0.9) 80%, transparent 100%);
}
.hero-map-glow {
  position: absolute;
  border-radius: 9999px;
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
}
.hero-map-glow-a {
  width: 20rem;
  height: 20rem;
  top: 14%;
  left: 18%;
  background: rgba(16, 185, 129, 0.14);
}
.hero-map-glow-b {
  width: 18rem;
  height: 18rem;
  right: 14%;
  bottom: 16%;
  background: rgba(59, 130, 246, 0.12);
}
.hero-ghana-map {
  position: absolute;
  left: 50%;
  top: 49%;
  width: min(34vw, 360px);
  transform: translate(-50%, -50%);
  opacity: 0.2;
  filter: drop-shadow(0 0 28px rgba(52, 211, 153, 0.15));
  pointer-events: none;
}
/* ── Premium Ghana map: self-drawing border + glowing city nodes ── */
@keyframes ghana-draw {
  from { stroke-dashoffset: 2500; }
  to   { stroke-dashoffset: 0; }
}
@keyframes ghana-fill-in {
  0%   { opacity: 0; }
  40%  { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes ghana-city-pop {
  0%   { opacity: 0; r: 0; }
  70%  { opacity: 1; }
  100% { opacity: 1; }
}
@keyframes ghana-ring-pulse {
  0%   { opacity: 0.7; r: 6;  stroke-width: 1.2; }
  100% { opacity: 0;   r: 18; stroke-width: 0; }
}

.hero-ghana-map .ghana-fill {
  fill: rgba(16, 185, 129, 0.07);
  stroke: none;
  animation: ghana-fill-in 2.6s ease forwards;
}
.hero-ghana-map .ghana-stroke {
  fill: none;
  stroke: rgba(110, 231, 183, 0.65);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 2500;
  stroke-dashoffset: 2500;
  animation: ghana-draw 2.1s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
.hero-ghana-map .ghana-city-dot {
  fill: #34d399;
  opacity: 0;
  animation: ghana-city-pop 0.5s ease forwards;
}
.hero-ghana-map .ghana-city-ring {
  fill: none;
  stroke: #34d399;
  stroke-width: 1;
  opacity: 0;
  animation: ghana-ring-pulse 2.2s ease-out infinite;
}
/* Staggered city reveals */
.ghana-city-dot-1, .ghana-city-ring-1  { animation-delay: 1.9s; }
.ghana-city-dot-2, .ghana-city-ring-2  { animation-delay: 2.0s; }
.ghana-city-dot-3, .ghana-city-ring-3  { animation-delay: 2.1s; }

/* Static fallback (JS adds .hero-static when animation is disabled) */
.hero-static .ghana-stroke  { stroke-dasharray: none; stroke-dashoffset: 0; animation: none; }
.hero-static .ghana-fill    { opacity: 1; animation: none; }
.hero-static .ghana-city-dot  { opacity: 1; animation: none; }
.hero-static .ghana-city-ring { opacity: 0; animation: none; }

/* Reduced-motion fallback */
@media (prefers-reduced-motion: reduce) {
  .ghana-stroke    { stroke-dasharray: none !important; stroke-dashoffset: 0 !important; animation: none !important; }
  .ghana-fill      { opacity: 1 !important; animation: none !important; }
  .ghana-city-dot  { opacity: 1 !important; animation: none !important; }
  .ghana-city-ring { opacity: 0 !important; animation: none !important; }
}
.hero-marker-cloud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-marker {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.7rem 0.45rem 0.85rem;
  color: #e2e8f0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid rgba(110, 231, 183, 0.18);
  border-radius: 9999px;
  background: rgba(2, 6, 23, 0.78);
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.25);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
  transition:
    opacity 0.65s ease,
    transform 1.6s cubic-bezier(0.22, 1, 0.36, 1),
    left 1.6s cubic-bezier(0.65, 0, 0.35, 1),
    top 1.6s cubic-bezier(0.65, 0, 0.35, 1),
    filter 0.6s ease;
  transition-delay: var(--delay);
}
.hero-marker::before {
  content: "";
  position: absolute;
  width: 0.6rem;
  height: 0.6rem;
  left: 0.42rem;
  top: 50%;
  margin-top: -0.3rem;
  border-radius: 9999px;
  background: #34d399;
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.75);
}
.hero-marker-data {
  display: inline-block;
  padding-left: 0.65rem;
  color: #7dd3fc;
  opacity: 0.92;
}
.hero-core {
  position: absolute;
  left: 50%;
  top: 49%;
  transform: translate(-50%, -50%);
  z-index: 2;
}
.hero-core-logo {
  height: 3.25rem;
  width: auto;
  max-width: 9rem;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.72);
  filter: drop-shadow(0 0 22px rgba(255, 255, 255, 0.25));
  transition: opacity 0.5s ease, transform 0.6s ease;
  pointer-events: none;
}
.hero-explore-cta {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-decoration: none;
  pointer-events: none;
  z-index: 5;
}
.hero-explore-shell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.92), rgba(5, 150, 105, 0.9));
  box-shadow: 0 20px 50px rgba(16, 185, 129, 0.25);
  overflow: hidden;
  transition:
    width 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    gap 0.5s ease,
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
.hero-explore-label,
.hero-explore-arrow {
  max-width: 0;
  opacity: 0;
  white-space: nowrap;
  color: #fff;
  transition: opacity 0.35s ease 0.2s, max-width 0.4s ease 0.2s;
}
.hero-explore-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.28em;
}
.hero-explore-arrow {
  font-size: 1rem;
}
.hero-markers-live .hero-marker {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.hero-converging .hero-marker {
  left: 50%;
  top: 49%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.32);
  filter: blur(6px);
}
.hero-converging .hero-core-logo {
  opacity: 1;
  transform: scale(1);
}
.hero-cta-live .hero-core-logo {
  opacity: 0;
  transform: scale(0.8);
}
.hero-cta-live .hero-explore-cta {
  pointer-events: auto;
}
.hero-cta-live .hero-explore-shell {
  width: 13rem;
  gap: 0.75rem;
}
.hero-cta-live .hero-explore-label,
.hero-cta-live .hero-explore-arrow {
  opacity: 1;
  max-width: 8rem;
}
.hero-cta-live .hero-explore-cta:hover .hero-explore-shell {
  transform: translateY(-2px);
  box-shadow: 0 26px 56px rgba(16, 185, 129, 0.32);
}
.hero-static .hero-marker {
  opacity: 0.9;
  transform: translate(-50%, -50%) scale(1);
  transition: none;
}
.hero-static .hero-core-logo {
  display: none;
}
.hero-static .hero-explore-cta {
  pointer-events: auto;
}
.hero-static .hero-explore-shell {
  width: 13rem;
  gap: 0.75rem;
  transition: none;
}
.hero-static .hero-explore-label,
.hero-static .hero-explore-arrow {
  opacity: 1;
  max-width: 8rem;
  transition: none;
}
@media (prefers-reduced-motion: reduce) {
  .hero-marker {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1);
    transition: none;
  }
  .hero-core-logo {
    display: none;
  }
  .hero-explore-cta {
    pointer-events: auto;
  }
  .hero-explore-shell {
    width: 13rem;
    gap: 0.75rem;
    transition: none;
  }
  .hero-explore-label,
  .hero-explore-arrow {
    opacity: 1;
    max-width: 8rem;
    transition: none;
  }
}
@media (max-width: 900px) {
  .hero-ghana-map {
    width: min(58vw, 300px);
    top: 43%;
  }
  .hero-core {
    top: 43%;
  }
  .hero-marker {
    font-size: 0.56rem;
    padding: 0.4rem 0.55rem 0.4rem 0.75rem;
  }
}
/* ── Hero headline block ── */
.hero-headline-block {
  position: absolute;
  top: 62%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: min(680px, 90vw);
  z-index: 6;           /* above scroll indicator (z-index default) and map shell */
  pointer-events: none;
}
.hero-headline-inner {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s ease 0.25s, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.25s;
}
.hero-headline-title {
  color: #f1f5f9;
  font-size: clamp(1.85rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin-bottom: 0.9rem;
  text-shadow: 0 2px 32px rgba(0, 0, 0, 0.6);
}
.hero-headline-sub {
  color: rgba(203, 213, 225, 0.78);
  font-size: clamp(0.85rem, 1.45vw, 1.05rem);
  font-weight: 300;
  line-height: 1.7;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}
/* Reveal alongside CTA */
.hero-cta-live .hero-headline-inner {
  opacity: 1;
  transform: translateY(0);
}
/* Static / reduced-motion fallbacks */
.hero-static .hero-headline-inner {
  opacity: 1;
  transform: none;
  transition: none;
}
@media (prefers-reduced-motion: reduce) {
  .hero-headline-inner { opacity: 1; transform: none; transition: none; }
}
@media (max-width: 900px) {
  .hero-headline-block { top: 64%; }
}
@media (max-width: 640px) {
  .hero-headline-block { top: 65%; width: min(520px, 92vw); }
  .hero-headline-title { font-size: clamp(1.4rem, 6vw, 1.75rem); }
  .hero-headline-sub  { font-size: 0.8rem; line-height: 1.6; }
  .hero-map-grid,
  .hero-ghana-map {
    opacity: 0.5;
  }
  .hero-marker-cloud .hero-marker:nth-child(1),
  .hero-marker-cloud .hero-marker:nth-child(2),
  .hero-marker-cloud .hero-marker:nth-child(5) {
    display: none;
  }
  .hero-marker {
    font-size: 0.52rem;
    padding: 0.35rem 0.5rem 0.35rem 0.7rem;
  }
  .hero-explore-shell {
    box-shadow: 0 14px 32px rgba(16, 185, 129, 0.22);
  }
}

/* ── Flat Design System (Whitespace over Wireframes) ── */
.asta-surface {
  background-color: var(--asta-surface);
}
.asta-surface:hover {
  background-color: #334155;
}
.asta-card-flat {
  background-color: rgba(30, 41, 59, 0.6);
  transition: background-color 0.3s ease-in-out;
}
.asta-card-flat:hover {
  background-color: rgba(51, 65, 85, 0.7);
}
.asta-input-flat {
  background-color: rgba(30, 41, 59, 0.8);
  border: none;
  transition: box-shadow 0.3s ease-in-out, background-color 0.3s ease-in-out;
}
.asta-input-flat:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.5);
  background-color: rgba(30, 41, 59, 0.95);
}
.asta-label {
  color: #94a3b8;
  font-size: 0.875rem;
}
.asta-data {
  color: #ffffff;
  font-weight: 500;
}

/* GEO: visible breadcrumb trail (no borders; spacing + mono per Asta terminal aesthetic) */
.asta-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0;
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0.5rem 1.5rem 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
}
.asta-breadcrumb__link {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s ease;
}
.asta-breadcrumb__link:hover {
  color: #34d399;
}
.asta-breadcrumb__current {
  color: #e2e8f0;
  font-weight: 600;
}
.asta-breadcrumb__sep {
  color: #64748b;
  margin: 0 0.4rem;
  user-select: none;
}

/* ===== Legibility (WCAG AA) — added site-wide ===== */
/* Emerald CTA buttons must use dark text; white-on-emerald is ~2.5:1 (fails AA). */
.bg-emerald-500.text-white,
.bg-emerald-400.text-white,
.bg-\[\#10b981\].text-white,
.bg-\[\#10B981\].text-white { color: #04241a !important; }
/* Muted slate body text (slate-500 4.24:1, slate-600 2.66:1 on the dark page) fails AA.
   These pages use slate-500/600 only on dark grounds, so lift both to slate-400 (AA on
   dark). Safety net: restore the darker slate inside any light surface (where the lighter
   shade would fail) so light cards are never harmed. */
.text-slate-500 { color: #94a3b8 !important; }
.text-slate-600 { color: #94a3b8 !important; }
.bg-white .text-slate-500, .bg-slate-50 .text-slate-500, .bg-slate-100 .text-slate-500,
.bg-zinc-50 .text-slate-500, .bg-zinc-100 .text-slate-500, .bg-gray-50 .text-slate-500,
.bg-gray-100 .text-slate-500, [class*="bg-white"] .text-slate-500 { color: #64748b !important; }
.bg-white .text-slate-600, .bg-slate-50 .text-slate-600, .bg-slate-100 .text-slate-600,
.bg-zinc-50 .text-slate-600, .bg-zinc-100 .text-slate-600, .bg-gray-50 .text-slate-600,
.bg-gray-100 .text-slate-600, [class*="bg-white"] .text-slate-600 { color: #475569 !important; }
