/*
 Theme Name:   Bricks Child Theme
 Theme URI:    https://bricksbuilder.io/
 Description:  Use this child theme to extend Bricks.
 Author:       Bricks
 Author URI:   https://bricksbuilder.io/
 Template:     bricks
 Version:      1.1
 Text Domain:  bricks
*/


@layer bricks {
  body.bricks-is-frontend :focus-visible {
    outline: 3px dashed #ffffff;
    outline-offset: 2px;
  }
}

.highlight {
  color: var(--accent);
}

a:not(.btn):not(.search-result) {
  transition: color 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

a:not(.btn):not(.search-result):hover {
  color: var(--highlight-content);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(0 100% 100% 0);
  white-space: nowrap;
  border-width: 0;
}

html.animations-paused *,
html.animations-paused *::before,
html.animations-paused *::after,
body.animations-paused *,
body.animations-paused *::before,
body.animations-paused *::after {
  animation: none !important;
}

html.animations-paused .blog-card,
html.animations-paused .bento-logo,
body.animations-paused .blog-card,
body.animations-paused .bento-logo {
  opacity: 1 !important;
  filter: none !important;
  transform: none !important;
}

html.animations-paused .robot__antenna-light,
html.animations-paused .robot__eye--left,
html.animations-paused .robot__eye--right,
body.animations-paused .robot__antenna-light,
body.animations-paused .robot__eye--left,
body.animations-paused .robot__eye--right {
  animation: none !important;
}

/* Keep search loading feedback active even when animations are paused */
html.animations-paused .search-dialog__spinner,
body.animations-paused .search-dialog__spinner {
  animation: lab-flask-slosh 1.05s ease-in-out infinite !important;
}

html.animations-paused .search-dialog__spinner::after,
body.animations-paused .search-dialog__spinner::after {
  animation: lab-liquid-dot 1s ease-in-out infinite !important;
}

html.animations-paused .search-dialog__icon-wrapper--loading::before,
body.animations-paused .search-dialog__icon-wrapper--loading::before {
  animation: lab-bubble-rise 1.05s ease-out infinite !important;
}

html.animations-paused .search-dialog__icon-wrapper--loading::after,
body.animations-paused .search-dialog__icon-wrapper--loading::after {
  animation: lab-bubble-rise 1.25s ease-out 0.22s infinite !important;
}


.mobile-nav__overlay--open {
  background: rgba(0,0,0,0.65);
    pointer-events: all;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* Prevent FOUC: keep menu hidden by default until explicitly opened */
#mobileNav,
.mobile-nav {
  transform: translateX(-100%);
  visibility: hidden;
  pointer-events: none;
}

/* Open only when JS sets real open state */
#mobileNav.mobile-nav--open[aria-hidden="false"],
.mobile-nav.mobile-nav--open[aria-hidden="false"] {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

/* Focus ring only for keyboard navigation, not touch/mouse */
#mobileNav a:focus:not(:focus-visible),
#mobileNav button:focus:not(:focus-visible),
.mobile-nav a:focus:not(:focus-visible),
.mobile-nav button:focus:not(:focus-visible) {
  outline: none;
}

@media (max-width: 795px) {
  .nav__content {
    display: none !important;
  }

  .menu-trigger {
    display: flex !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .footer__access {
    display: none !important;
  }

  .robot__antenna-light,
  .robot__eye--left,
  .robot__eye--right {
    animation: none !important;
  }
}

a[target="_blank"]:not(.btn, .tool-card *)::after {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-left: 0.25em;
  vertical-align: middle;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M10 14 21 3'/%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M10 14 21 3'/%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3C/svg%3E");
  mask-repeat: no-repeat;
  mask-size: contain;
}

/* ─────────────────────────────────────────────
   KEYFRAMES
   ───────────────────────────────────────────── */

@keyframes fadeBlur {
  from {
    opacity: 0;
    filter: blur(15px);
  }
  to {
    opacity: 1;
    filter: blur(0px);
  }
}

@keyframes heroFadeUp {
  from {
    opacity: 0;
    filter: blur(15px);
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    filter: blur(0px);
    transform: translateY(0);
  }
}

@keyframes staggerFadeUp {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    filter: blur(0px);
    transform: translateY(0);
  }
}

/* Mobile variants — no blur (prevents GPU throttling & glow artifacts on iOS/Android) */
@keyframes heroFadeUpMobile {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes staggerFadeUpMobile {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─────────────────────────────────────────────
   HERO — entrance animations
   ───────────────────────────────────────────── */

/* All hero elements fade up + blur simultaneously */
.hero__badge,
.hero__heading,
.hero__text,
.hero__btn-wrapper {
  animation: heroFadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

/* "Page Building" — each char is split by JS and gets its own delay */
.hero__heading .stagger {
  display: inline-block;
}

.hero__heading .stagger .char {
  display: inline-block;
  animation: staggerFadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  /* animation-delay is set per-char via inline style in custom.js */
}

/* ─────────────────────────────────────────────
   BLOG CARDS — scroll stagger (repeats each time)
   ───────────────────────────────────────────── */

.bricks-is-frontend .blog-card {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.bricks-is-frontend .blog-card.blog-card--visible {
  opacity: 1;
  transform: none;
}

.bricks-is-frontend .blog-card.blog-card--visible:hover {
  transform: translateY(-6px);
}

.bricks-is-frontend .blog-card.blog-card--visible:hover a {
  color: var(--highlight-content);
}

/* ─────────────────────────────────────────────
   BENTO GRID — entrance animations
   ───────────────────────────────────────────── */

/* Logos: initially hidden with blur; JS adds .logo-visible with stagger */
.bento-logo {
  opacity: 0;
  filter: blur(8px);
  transform: scale(0.85);
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.bento-logo.logo-visible {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

/* Cursor images: hidden initially, revealed + moved by JS */
.code-editor__pgl-cursor,
.code-editor__user-cursor {
  opacity: 0;
}

/* Blinking text cursor inside the code editor typewriter */
@keyframes typewriter-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 0.85em;
  background-color: var(--brand);
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: typewriter-blink 0.75s step-end infinite;
}

/* ------------------------------------ */
/* CLICKABLE PARENT Links Overlay */
/* ------------------------------------ */
.bricks-is-frontend .clickable-parent a::after {
  content: "";
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 1;
}

/* ------------------------------------ */
/* Animation Toggle */
/* ------------------------------------ */

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 100px;
  padding: 0.375rem 0.875rem 0.375rem 0.4rem;
  cursor: pointer;
  font-family: "DM Sans", sans-serif;
  transition:
    background 0.2s,
    border-color 0.2s;
}

.toggle-pill:hover {
  background: rgba(255, 255, 255, 0.05);
}

.toggle-pill--stopped {
  border-color: rgba(255, 96, 96, 0.15);
}

.toggle-pill--stopped:hover {
  background: rgba(255, 96, 96, 0.04);
}

.toggle-pill__btn {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(52, 185, 100, 0.12);
  color: #34b964;
  position: relative;
  transition:
    background 0.2s,
    color 0.2s;
  pointer-events: none;
}

.toggle-pill--stopped .toggle-pill__btn {
  background: rgba(255, 96, 96, 0.1);
  color: #ff6060;
}

.toggle-pill__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition:
    opacity 0.15s,
    transform 0.15s;
}

.toggle-pill__icon--play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.toggle-pill__icon--pause {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
}

.toggle-pill--stopped .toggle-pill__icon--play {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
}
.toggle-pill--stopped .toggle-pill__icon--pause {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.toggle-pill__label {
  font-size: 0.8125rem;
  color: #9d9aa1;
}

.toggle-pill__label-state {
  color: #e8e6ea;
  font-weight: 500;
  transition: color 0.2s;
}

.toggle-pill__label-state--stopped {
  color: #ff6060;
}

/* ─────────────────────────────────────────────
   MOBILE — blur-free animation overrides
   Prevents GPU throttling & glow artifacts on iOS/Android
   ───────────────────────────────────────────── */

@media (max-width: 767px) {
  .hero__badge,
  .hero__heading,
  .hero__text,
  .hero__btn-wrapper {
    animation-name: heroFadeUpMobile;
  }

  .hero__heading .stagger .char {
    animation-name: staggerFadeUpMobile;
  }
}
