/* Top bar, motion utilities, apps + details chrome */

:root {
  --hq-topbar-h: 64px;
  --hq-topbar-blur: 18px;
}

/* ─── Animated top bar ─── */
.hq-topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  min-height: var(--hq-topbar-h);
}

.hq-topbar__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(248, 250, 252, 0.88) 100%
  );
  backdrop-filter: blur(var(--hq-topbar-blur));
  -webkit-backdrop-filter: blur(var(--hq-topbar-blur));
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.hq-topbar__shine {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(13, 148, 136, 0.45),
    rgba(99, 102, 241, 0.55),
    rgba(13, 148, 136, 0.45),
    transparent
  );
  background-size: 200% 100%;
  animation: hq-shine 8s linear infinite;
  opacity: 0.85;
  pointer-events: none;
}

@keyframes hq-shine {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.hq-topbar__inner {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hq-brand--pulse {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hq-brand--pulse:hover {
  transform: scale(1.03);
}

.hq-brand--pulse .hq-brand__mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.12), rgba(99, 102, 241, 0.12));
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.25s, transform 0.25s;
}

.hq-brand--pulse:hover .hq-brand__mark {
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.2);
}

.hq-topbar__nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hq-topbar__link {
  position: relative;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s, background 0.2s, transform 0.2s;
}

.hq-topbar__link:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.05);
}

.hq-topbar__link.is-active {
  color: #0f172a;
  background: rgba(13, 148, 136, 0.12);
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.2);
}

.hq-topbar__cta {
  margin-left: 0.35rem;
  padding: 0.5rem 1.15rem !important;
  font-size: 0.88rem !important;
  border-radius: 999px;
  font-weight: 700 !important;
  color: #fff !important;
  background: linear-gradient(135deg, #0d9488, #6366f1) !important;
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.35);
  border: none !important;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.hq-topbar__cta:hover {
  color: #fff !important;
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(13, 148, 136, 0.4);
}

.hq-topbar__lang {
  display: flex;
  align-items: center;
}

.hq-topbar__lang-link {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.7rem;
  border-radius: 10px;
  color: #64748b;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.hq-topbar__lang-link:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.06);
}

@media (max-width: 640px) {
  .hq-topbar__nav .hq-topbar__link:not(.hq-topbar__cta) {
    padding: 0.4rem 0.75rem;
    font-size: 0.82rem;
  }
}

/* ─── Scroll reveal ─── */
.hq-reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.hq-reveal--in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.hq-reduced-motion .hq-reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

.hq-reduced-motion .hq-topbar__shine {
  animation: none;
}

/* ─── Apps catalog v2 ─── */
.apps-v2 {
  background: #f1f5f9;
  min-height: 60vh;
}

.apps-v2-hero {
  position: relative;
  padding: clamp(2.75rem, 7vw, 4.5rem) 1.25rem 2rem;
  overflow: hidden;
}

.apps-v2-hero__blob {
  position: absolute;
  width: 140%;
  height: 120%;
  left: -20%;
  top: -40%;
  background: radial-gradient(
    ellipse at 30% 20%,
    rgba(99, 102, 241, 0.35) 0%,
    transparent 55%
  ),
    radial-gradient(ellipse at 70% 60%, rgba(13, 148, 136, 0.3) 0%, transparent 50%);
  animation: hq-blob-drift 18s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes hq-blob-drift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(4%, 6%) scale(1.05);
  }
}

.apps-v2-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.apps-v2-hero__inner h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: #0f172a;
}

.apps-v2-hero__inner p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.6;
  color: #475569;
}

.apps-v2-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.apps-v2-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.apps-v2-chip--live {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
}

.apps-v2-chip--road {
  background: rgba(100, 116, 139, 0.15);
  color: #475569;
}

.apps-v2-body {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.apps-v2-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .apps-v2-grid--live .apps-v2-tile:first-child {
    grid-column: span 2;
    min-height: 280px;
  }
}

.apps-v2-tile {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s;
}

.apps-v2-tile:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

.apps-v2-tile__media {
  position: relative;
  height: 160px;
  overflow: hidden;
}

.apps-v2-tile--wide .apps-v2-tile__media {
  height: 200px;
}

.apps-v2-tile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.apps-v2-tile:hover .apps-v2-tile__media img {
  transform: scale(1.06);
}

.apps-v2-tile__grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(15, 23, 42, 0.55) 100%);
  pointer-events: none;
}

.apps-v2-tile__badge {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.apps-v2-tile--live .apps-v2-tile__badge {
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
}

.apps-v2-tile--roadmap .apps-v2-tile__badge {
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
}

.apps-v2-tile__body {
  padding: 1.25rem 1.35rem 1.4rem;
}

.apps-v2-tile__head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.apps-v2-tile__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.apps-v2-tile__head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.apps-v2-tile__body > p {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: #64748b;
  line-height: 1.55;
}

.apps-v2-tile__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.apps-v2-tile__actions .hq-btn {
  font-size: 0.86rem;
  padding: 0.45rem 0.95rem;
}

.apps-v2-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 2.5rem 0 1rem;
}

.apps-v2-section-label:first-of-type {
  margin-top: 0;
}

/* Per-tile image masks on catalog */
.apps-v2-tile--realestate .apps-v2-tile__media {
  clip-path: inset(0 round 0 0 18px 0);
}

.apps-v2-tile--playground .apps-v2-tile__media {
  clip-path: ellipse(95% 85% at 50% 20%);
  height: 170px;
}

.apps-v2-tile--hr .apps-v2-tile__media {
  border-radius: 0 0 16px 16px;
}

.apps-v2-tile--finance .apps-v2-tile__media {
  filter: saturate(0.85) contrast(1.05);
}

.apps-v2-tile--clinic .apps-v2-tile__media {
  border-radius: 32px 32px 12px 12px;
}

.apps-v2-tile--pos .apps-v2-tile__media {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
}

/* ─── App details page ─── */
.app-detail {
  background: #f8fafc;
}

.app-detail-hero {
  position: relative;
  min-height: min(42vh, 420px);
  display: flex;
  align-items: flex-end;
  padding: 3rem 1.25rem 2rem;
  overflow: hidden;
}

.app-detail-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  animation: hq-detail-bg 20s ease-in-out infinite alternate;
}

@keyframes hq-detail-bg {
  0% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1.08);
  }
}

.hq-reduced-motion .app-detail-hero__bg {
  animation: none;
}

.app-detail-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.2) 0%,
    rgba(15, 23, 42, 0.75) 100%
  );
}

.app-detail-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.app-detail-hero__crumb {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.app-detail-hero__crumb a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.app-detail-hero__crumb a:hover {
  color: #fff;
  text-decoration: underline;
}

.app-detail-hero__crumb span {
  color: rgba(255, 255, 255, 0.45);
}

.app-detail-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
}

.app-detail-hero__sum {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.95);
  max-width: 52ch;
}

.app-detail-hero__icon {
  display: inline-flex;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.app-detail-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 960px) {
  .app-detail-layout {
    grid-template-columns: 1fr 300px;
    align-items: start;
  }
}

.app-detail-prose {
  background: #fff;
  border-radius: 20px;
  padding: 2rem 2rem 2.25rem;
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.06);
}

.app-detail-prose-inner {
  font-size: 1.02rem;
  line-height: 1.7;
  color: #334155;
}

.app-detail-prose-inner p:first-child {
  margin-top: 0;
}

.app-detail-prose-inner p:last-child {
  margin-bottom: 0;
}

.app-detail-prose h2,
.app-detail-prose h3 {
  margin-top: 1.5rem;
}

.app-detail-prose p {
  line-height: 1.65;
  color: #334155;
}

.app-detail-side {
  position: sticky;
  top: calc(var(--hq-topbar-h) + 1rem);
}

.app-detail-card {
  background: linear-gradient(165deg, #fff 0%, #f8fafc 100%);
  border-radius: 20px;
  padding: 1.5rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

.app-detail-card h2 {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #94a3b8;
}

.app-detail-card .hq-btn {
  width: 100%;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.app-detail-card .hq-btn:last-of-type {
  margin-bottom: 0;
}

.app-detail-card p {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.5;
}

.app-detail-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.app-detail-status--live {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
}

.app-detail-status--road {
  background: rgba(100, 116, 139, 0.15);
  color: #475569;
}
