/* =============================================
   Gryf AI — Global Styles (Mobile First)
   Premium Apple UI Design System
   ============================================= */

/* === Reset & CSS Custom Properties === */
:root {
  --bg-dark: #000000;
  --bg-opacity: 0.25;
  --text-light: #ffffff;
  --text-muted: #8e8e93;
  --brand-color: #bc9b59;
  --accent: var(--brand-color);
  --font-sans:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica,
    sans-serif;

  /* Apple-like Radiuses */
  --radius-sm: 10px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --radius-pill: 9999px;

  /* Deep Glassmorphism */
  --glass-bg: rgba(20, 20, 20, 0.65);
  --glass-bg-light: rgba(30, 30, 30, 0.4);
  --glass-border: rgba(255, 255, 255, 0.15); /* Sharpened for Apple-like edge */
  --glass-blur: saturate(180%) blur(48px);

  /* Spring physics transitions */
  --transition-spring: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 0.3s ease;

  /* Z-Index Architecture (ascending order) */
  --z-background: 0;
  --z-slider: 2;
  --z-slide-content: 10;
  --z-bot: 20;
  --z-subpage: 80;
  --z-menu: 90;
  --z-header: 100;
  --z-cookie: 300;
  --z-toast: 9000;
  --z-preloader: 9999;
  --z-tooltip: 10000;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-light);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.4s ease;
}

/* Custom Scrollbars applied globally */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--brand-color);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg-dark);
}
::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--brand-color) 80%, white);
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--brand-color) var(--bg-dark);
}

/* === Typography === */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: none; /* Apple uses Sentance case typically, but if we need uppercase we can override locally */
}

p {
  font-weight: 400;
  line-height: 1.5;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
}

/* === Focus Visible (Keyboard Accessibility) === */
.btn:focus-visible,
.theme-swatch:focus-visible,
.lang-btn:focus-visible,
.menu-toggle:focus-visible,
.mobile-settings-toggle:focus-visible,
.music-toggle:focus-visible,
.bg-opacity-toggle:focus-visible,
.action-btn:focus-visible,
.menu-links a:focus-visible,
.menu-dropdown a:focus-visible,
.custom-slider:focus-visible {
  outline: 2px solid var(--brand-color);
  outline-offset: 2px;
}


/* === Glass Container Mixin (Class) === */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 4px 24px -4px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* === Header (Mobile Base) === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: var(--z-header);
  pointer-events: none;
  transition: all var(--transition-spring);
}
.site-header.chat-page-header {
  background: var(--bg-dark);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}
.subpage-active .site-header {
  background: var(--bg-dark);
}

/* Custom Tooltip */
.custom-tooltip {
  position: fixed;
  z-index: var(--z-tooltip);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--brand-color);
  color: var(--brand-color);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}
.custom-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}


.logo,
.header-controls,
.menu-toggle,
.mobile-settings-toggle,
.aux-controls {
  pointer-events: auto;
}

/* Logo */
.logo-link {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.logo-img {
  height: 32px;
  width: auto;
  opacity: 0;
  transition: transform var(--transition-spring);
}
.logo-img:hover {
  transform: scale(1.05);
}
.logo-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--brand-color);
  /* mask-image set dynamically from PocketBase via JS */
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: left center;
  mask-position: left center;
  transition: background-color var(--transition-base);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

/* Aux Controls Popover */
.aux-controls {
  position: absolute;
  top: 56px;
  right: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  padding: 1rem;
  gap: 1rem;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transition: all var(--transition-spring);
  box-shadow:
    0 16px 48px -12px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.aux-controls.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Common Icon Buttons (.mobile-settings-toggle, .menu-toggle, .music-toggle, .bg-opacity-toggle, .action-btn) */
.mobile-settings-toggle,
.menu-toggle,
.music-toggle,
.bg-opacity-toggle,
.action-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #fff;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  transition: all var(--transition-spring);
}
.mobile-settings-toggle:hover,
.music-toggle:hover,
.bg-opacity-toggle:hover {
  color: var(--brand-color);
  background: rgba(255, 255, 255, 0.05);
  transform: scale(1.05);
}
.mobile-settings-toggle:active,
.music-toggle:active,
.bg-opacity-toggle:active {
  transform: scale(0.96);
}
.action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  width: 40px;
  height: 40px;
}
.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}
.action-btn:active {
  transform: scale(0.96);
}
.action-btn.liked {
  color: #ff3b30;
  border-color: #ff3b30;
  background: rgba(255, 59, 48, 0.1);
}
.action-btn.liked svg {
  fill: #ff3b30;
  stroke: #ff3b30;
}

/* Theme Swatches (inline in aux-controls) */
.theme-swatches-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 130px;
  padding: 4px 0;
}
.theme-swatch {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  flex-grow: 0;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
  display: block;
  /* Force circular clipping */
  -webkit-mask-image: -webkit-radial-gradient(circle, white calc(100% - 1.5px), transparent 100%);
  mask-image: radial-gradient(circle, white calc(100% - 1.5px), transparent 100%);
}
.theme-swatch.active::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.9rem;
  font-weight: 600;
}
.lang-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-base);
}
.lang-btn.active {
  color: #000;
  background: var(--brand-color);
  font-weight: 700;
}
.lang-btn:hover:not(.active) {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.lang-sep {
  color: rgba(255, 255, 255, 0.1);
  margin: 0 2px;
}

.menu-lang-switcher {
  font-size: 1.5rem;
  justify-content: center;
  margin: 3rem 0 2rem 0;
  width: 100%;
  gap: 8px;
}
.menu-lang-switcher .lang-btn {
  padding: 10px 20px;
  letter-spacing: 1px;
}

/* Slider Controls (Music & Opacity) */
.music-control-wrapper,
.bg-opacity-control-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.2rem;
  margin: 0 -0.2rem; /* Negate padding to align with other icons */
  border-radius: var(--radius-pill);
  transition: background var(--transition-base), gap var(--transition-base), margin var(--transition-base);
}
.music-control-wrapper:hover,
.bg-opacity-control-wrapper:hover {
  background: rgba(255, 255, 255, 0.08);
  padding-right: 1rem;
  gap: 0.5rem;
  margin: 0 -0.2rem; /* Keep negative margin on hover to prevent icon twitch */
}
/* Custom Slider (shared) */
.custom-slider.volume-slider,
.custom-slider.opacity-slider {
  width: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    width var(--transition-spring),
    opacity var(--transition-base);
  pointer-events: none;
  flex-shrink: 0;
}
.music-control-wrapper:hover .custom-slider.volume-slider,
.bg-opacity-control-wrapper:hover .custom-slider.opacity-slider {
  width: 90px;
  opacity: 1;
  pointer-events: auto;
  overflow: visible;
}

.custom-slider-track {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.custom-slider-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--brand-color);
  border-radius: 2px;
  pointer-events: none;
  transition: width 0.05s linear;
}

.custom-slider-thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  background: var(--brand-color);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: grab;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4), 0 0 12px color-mix(in srgb, var(--brand-color) 30%, transparent);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  z-index: var(--z-slider);
}
.custom-slider-thumb:hover {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5), 0 0 16px color-mix(in srgb, var(--brand-color) 50%, transparent);
}
.custom-slider-thumb:active,
.custom-slider-thumb.dragging {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.15);
}

@keyframes soundWave {
  0% {
    opacity: 0.4;
    transform: scaleY(0.8);
  }
  50% {
    opacity: 1;
    transform: scaleY(1.1);
  }
  100% {
    opacity: 0.4;
    transform: scaleY(0.8);
  }
}
.music-icon-on .wave-1 {
  transform-origin: center;
  animation: soundWave 1.2s infinite ease-in-out;
}
.music-icon-on .wave-2 {
  transform-origin: center;
  animation: soundWave 1.2s infinite ease-in-out 0.4s;
}

/* Chat Active Title */
.chat-active-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40vw;
}
.chat-active-title.show {
  opacity: 1;
}

/* === Hamburger Menu === */
.hamburger {
  position: relative;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all var(--transition-spring);
}
.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 2px;
  background: #fff;
  left: 0;
  border-radius: 2px;
  transition: all var(--transition-spring);
}
.hamburger::before {
  top: -7px;
}
.hamburger::after {
  top: 7px;
}
[aria-expanded="true"] .hamburger {
  background: transparent;
}
[aria-expanded="true"] .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}
[aria-expanded="true"] .hamburger::after {
  top: 0;
  transform: rotate(-45deg);
}

/* === Fullscreen Menu === */
.fullscreen-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: color-mix(in srgb, var(--bg-dark) 85%, transparent);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  z-index: var(--z-menu);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.5s ease,
    visibility 0.5s;
  overflow-y: auto;
  padding: 2rem 1rem;
}
.fullscreen-menu.active {
  opacity: 1;
  visibility: visible;
}

.menu-links {
  list-style: none;
  text-align: center;
  width: 100%;
}
.menu-links li {
  margin: 1rem 0;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  transition:
    opacity 0.5s ease,
    transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.fullscreen-menu.active .menu-links li {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Stagger */
.fullscreen-menu.active .menu-links li:nth-child(1) {
  transition-delay: 0.05s;
}
.fullscreen-menu.active .menu-links li:nth-child(2) {
  transition-delay: 0.1s;
}
.fullscreen-menu.active .menu-links li:nth-child(3) {
  transition-delay: 0.15s;
}
.fullscreen-menu.active .menu-links li:nth-child(4) {
  transition-delay: 0.2s;
}
.fullscreen-menu.active .menu-links li:nth-child(5) {
  transition-delay: 0.25s;
}
.fullscreen-menu.active .menu-links li:nth-child(6) {
  transition-delay: 0.3s;
}
.fullscreen-menu.active .menu-links li:nth-child(7) {
  transition-delay: 0.35s;
}

.menu-links a {
  color: #fff;
  text-decoration: none;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  transition:
    color var(--transition-base),
    opacity var(--transition-base);
  display: inline-block;
}
.menu-links:hover > li > a,
.menu-links:hover > li.has-dropdown > .dropdown-toggle {
  opacity: 0.3;
}
.menu-links > li > a:hover,
.menu-links > li.has-dropdown > .dropdown-toggle:hover {
  opacity: 1;
  color: #fff;
}

.menu-socials {
  position: relative;
  margin-top: 3rem;
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}
.menu-socials a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: color var(--transition-base);
}
.menu-socials a:hover {
  color: #fff;
}

/* Menu Dropdowns */
.menu-links .has-dropdown > .dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}
.dropdown-arrow {
  display: inline-block;
  font-size: 1.2rem;
  line-height: 1;
  transition: transform var(--transition-spring);
  opacity: 0.5;
}
.has-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
  opacity: 1;
}
.menu-dropdown {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity var(--transition-base);
  opacity: 0;
  pointer-events: none;
}
.has-dropdown.open .menu-dropdown {
  max-height: 400px;
  opacity: 1;
  pointer-events: auto;
}
.menu-dropdown li {
  margin: 1rem 0;
}
.menu-dropdown a {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--brand-color);
  opacity: 0.8;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.menu-dropdown a:hover {
  opacity: 1;
  transform: scale(1.02);
}

/* === Swiper (Mobile Base) === */
.swiper {
  width: 100vw;
  height: 100vh;
}
.swiper-slide {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Slide Backgrounds */
.video-background,
.slide-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-background);
}
.video-background video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-background::after,
.slide-bg::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-dark);
  opacity: calc(1 - var(--bg-opacity));
  transition:
    opacity var(--transition-base),
    background-color 0.4s ease;
  pointer-events: none;
}


/* Slide Content */
.slide-content {
  position: relative;
  z-index: var(--z-slide-content);
  text-align: center;
  width: 100%;
  padding: 0 1rem;
  /* Removed the general animation here to animate children individually */
}

/* Dignified Animation for Text Elements */
.slide-content .sub-heading,
.slide-content .main-heading,
.slide-content .description,
.slide-content .bot-container-wrapper {
  opacity: 0;
  transform: translateY(40px);
  filter: blur(10px);
  transition: all 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Promote to GPU layer only during animation */
.swiper-slide-active .slide-content .sub-heading,
.swiper-slide-active .slide-content .main-heading,
.swiper-slide-active .slide-content .description,
.swiper-slide-active .slide-content .bot-container-wrapper {
  will-change: transform, opacity;
}

.swiper-slide-active .slide-content .sub-heading {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  transition-delay: 0.3s;
}

.swiper-slide-active .slide-content .main-heading {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  transition-delay: 0.5s;
}

.swiper-slide-active .slide-content .description {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  transition-delay: 0.7s;
}

.sub-heading {
  font-size: clamp(0.8rem, 3vw, 1.1rem);
  color: var(--brand-color);
  margin-bottom: clamp(1rem, 2vh, 1.5rem);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
}
.main-heading {
  font-size: clamp(2.5rem, 13vw, 13rem);
  line-height: 0.9;
  margin-bottom: 2rem;
  color: #fff;
  letter-spacing: -0.04em;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

.slide-content .main-heading {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
}

.outlined-text {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--brand-color);
  letter-spacing: 2px;
  display: inline-block;
  margin-top: 2px;
  transition: -webkit-text-stroke-color var(--transition-base);
}
.description {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 460px;
  margin: 0 auto;
  font-weight: 400;
}

/* Bot Pill Trigger */
.bot-container-wrapper.floating-center {
  position: relative;
  margin: 2rem auto 0 auto;
  z-index: var(--z-bot);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(30px) scale(0.9);
  transition:
    transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 1.2s;
}
.swiper-slide-active .bot-container-wrapper.floating-center,
.swiper-slide-active .slide-content .bot-container-wrapper {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
  filter: blur(0) !important;
  transition-delay: 0.9s;
}

/* Force block or full width flex for mobile to prevent floating right */
@media (max-width: 767px) {
  .bot-container-wrapper.floating-center {
    width: 100%;
    margin-top: 1.5rem;
    display: flex !important;
    justify-content: center;
    align-items: center;
  }
}

.btn.bot-pill-trigger {
  text-decoration: none;
  color: inherit;
  width: fit-content;
  outline: none;
  --pill-h: 64px;
  height: var(--pill-h);
  border-radius: calc(var(--pill-h) / 2);
  padding: 0 calc(var(--pill-h) / 2);
  overflow: hidden;
}
.btn.bot-pill-trigger:hover {
  border-color: var(--brand-color);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.5),
    0 0 20px color-mix(in srgb, var(--brand-color) 25%, transparent);
}

.typewriter-text {
  display: inline-block;
  min-width: 1px;
}
.typewriter-text.typing::after {
  content: "|";
  display: inline-block;
  color: var(--brand-color);
  font-weight: 400;
  animation: blink-cursor 0.7s step-end infinite;
  margin-left: 2px;
}
@keyframes blink-cursor {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.chat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s infinite;
}
.chat-icon svg {
  stroke: var(--brand-color);
  transition: stroke var(--transition-base);
  width: 24px;
  height: 24px;
}
.btn.bot-pill-trigger .trigger-text {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}
@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: max(85px, calc(env(safe-area-inset-bottom, 40px) + 40px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.6;
  z-index: var(--z-bot);
  animation: fade-up 2s infinite;
}
.scroll-indicator span {
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.mouse {
  width: 24px;
  height: 38px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  position: relative;
}
.wheel {
  width: 4px;
  height: 6px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 2px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  animation: scroll-wheel 1.5s infinite;
}
@keyframes scroll-wheel {
  0% {
    top: 6px;
    opacity: 1;
  }
  100% {
    top: 16px;
    opacity: 0;
  }
}
@keyframes fade-up {
  0%,
  100% {
    transform: translate(-50%, 0);
    opacity: 0.5;
  }
  50% {
    transform: translate(-50%, 6px);
    opacity: 0.8;
  }
}

.swiper-pagination-bullet {
  background: rgba(255, 255, 255, 0.4);
  opacity: 1;
}
.swiper-pagination-bullet-active {
  background: var(--brand-color);
  transform: scale(1.5);
  transition: background var(--transition-base);
}

/* === Subpage Overlays (Fullpage) === */
.subpage-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-dark);
  z-index: var(--z-subpage);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
              visibility 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.subpage-overlay.active {
  opacity: 1;
  visibility: visible;
}
.subpage-content {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 7rem 1.5rem 3rem 1.5rem;
  max-width: 800px;
  width: 100%;
  transform: translateY(30px);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: none;
}
.subpage-overlay.active .subpage-content {
  transform: translateY(0);
  opacity: 1;
}
.subpage-content .main-heading {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
}
.subpage-content .text-content p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.1rem;
  margin-bottom: 1.8rem;
  font-weight: 300;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

/* === Chat Layout === */
.chat-page-body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg-dark);
}
.chat-page-main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-top: 5rem;
  transition: padding-top var(--transition-base);
}

.chat-back-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color var(--transition-base);
  padding-right: 0.8rem;
  border-right: 1px solid var(--glass-border);
  margin-right: 0.8rem;
}
.chat-back-arrow:hover {
  color: #fff;
}
.chat-back-arrow svg {
  margin-top: 2px;
}
.desktop-only-back {
  display: none;
}

.chat-action-icons {
  display: flex;
  gap: 0.5rem;
}

/* === Buttons (Unified Premium) === */
.btn {
  text-decoration: none;
  color: #fff;
  padding: 0 24px;
  min-height: 52px;
  background: rgba(30, 30, 30, 0.5);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  transition: all var(--transition-spring);
  outline: none;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.btn:hover {
  transform: translateY(-4px) scale(1.03);
  background: rgba(40, 40, 40, 0.7);
  border-color: var(--brand-color);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.5),
    0 0 20px color-mix(in srgb, var(--brand-color) 25%, transparent);
}
.btn:active {
  transform: translateY(-2px) scale(0.98);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.btn-primary {
  background: var(--brand-color);
  color: #000;
  border-color: var(--brand-color);
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--brand-color) 85%, white);
  border-color: color-mix(in srgb, var(--brand-color) 85%, white);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
}
.btn-text {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  min-height: auto;
  padding: 0.5rem 1rem;
  color: var(--text-muted);
}
.btn-text:hover {
  color: #fff;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

/* === Cookies (Apple-style Glassmorphism) === */
.cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120px) scale(0.95);
  width: 95%;
  max-width: 500px;
  background: color-mix(in srgb, var(--bg-dark) 80%, rgba(30,30,30,0.9));
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  z-index: var(--z-cookie);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.cookie-banner.show {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}
.cookie-content p {
  font-size: 0.9rem;
  color: #bbb;
  margin-bottom: 0;
  text-align: center;
}
.cookie-buttons {
  display: flex;
  gap: 0.8rem;
  flex-direction: column;
  margin-top: 1.2rem;
  align-items: center;
  justify-content: center;
}
.cookie-buttons .btn {
  width: 100%;
}

.cookie-settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: color-mix(in srgb, var(--bg-dark) 50%, transparent);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: calc(var(--z-cookie) + 10);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  padding: 1rem;
}
.cookie-settings-modal.show {
  opacity: 1;
  visibility: visible;
}

.cookie-modal-content {
  background: color-mix(in srgb, var(--bg-dark) 90%, rgba(30,30,30,0.9));
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  padding: 2rem;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  transform: scale(0.95);
  opacity: 0;
  transition: all var(--transition-spring);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.cookie-settings-modal.show .cookie-modal-content {
  transform: scale(1);
  opacity: 1;
}
.cookie-modal-content h3 {
  font-size: 1.5rem;
  margin-bottom: 0.8rem;
}
.cookie-modal-content p {
  font-size: 0.95rem;
  color: #aaa;
  margin-bottom: 2rem;
}

.cookie-toggles {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.toggle-info strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}
.toggle-info span {
  font-size: 0.85rem;
  color: #888;
}

/* Toggle Switch (Apple iOS style) */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 30px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #39393d;
  transition: 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
input:checked + .slider {
  background-color: var(--brand-color);
}
input:focus + .slider {
  box-shadow: 0 0 1px var(--brand-color);
}
input:checked + .slider:before {
  transform: translateX(20px);
}
.slider.round {
  border-radius: var(--radius-pill);
}
.slider.round:before {
  border-radius: 50%;
}
.slider.disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.cookie-modal-actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.cookie-modal-actions .btn {
  width: 100%;
}

/* === Preloader === */
#site-preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-dark);
  z-index: var(--z-preloader);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
}
#site-preloader.fade-out {
  opacity: 0;
  pointer-events: none;
}
.loader-spin {
  width: 44px;
  height: 44px;
  animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* =============================================
   DESKTOP OVERRIDES (min-width: 768px)
   ============================================= */
@media (min-width: 768px) {
  .site-header {
    padding: 1.2rem 3rem;
  }
  .logo-img {
    height: 38px;
  }
  .chat-active-title {
    font-size: 1.1rem;
    max-width: 40vw;
  }

  .aux-controls {
    top: 64px;
    right: 60px;
    padding: 1rem;
    background: var(--glass-bg-light);
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 1.5rem;
  }
  .theme-swatches-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    max-width: none;
    width: auto;
    gap: 8px;
    justify-content: center;
  }

  .chat-page-main {
    padding-top: 5.5rem;
  }
  .desktop-only-back {
    display: inline;
  }
  .chat-back-arrow {
    margin-right: 1.2rem;
    padding-right: 1.2rem;
  }

  .menu-links a {
    font-size: 2.4rem;
    letter-spacing: -0.03em;
  }
  .menu-dropdown a {
    font-size: 1.1rem;
  }
  .menu-socials {
    bottom: 3rem;
    margin-top: 0;
    position: absolute;
    gap: 2.5rem;
  }
  .menu-socials a {
    font-size: 0.9rem;
  }

  .slide-content {
    padding: 0 2rem;
  }
  .sub-heading {
    font-size: clamp(1.1rem, 1.2vw, 1.8rem);
    margin-bottom: clamp(1.2rem, 2vh, 2rem);
    letter-spacing: 3px;
  }
  .main-heading {
    font-size: clamp(5.5rem, 13vw, 15rem);
    margin-bottom: clamp(2rem, 2.5vh, 3.5rem);
  }
  .description {
    font-size: clamp(1.3rem, 1.2vw, 2rem);
    max-width: clamp(600px, 45vw, 1000px);
  }

  /* Removed absolute positioning offsets from media query for correct flex flow */
  .btn.bot-pill-trigger {
    --pill-h: clamp(76px, 5.5vw, 105px);
    height: var(--pill-h);
    border-radius: calc(var(--pill-h) / 2);
    padding: 0 calc(var(--pill-h) / 2);
    gap: clamp(12px, 1.5vw, 24px);
  }
  .btn.bot-pill-trigger .trigger-text {
    font-size: clamp(1.3rem, 1.5vw, 2.2rem);
  }
  .chat-icon svg {
    width: clamp(28px, 2.2vw, 40px);
    height: clamp(28px, 2.2vw, 40px);
  }

  .scroll-indicator {
    bottom: 30px;
    gap: 10px;
  }
  .scroll-indicator span {
    font-size: 0.8rem;
  }
  .mouse {
    width: 28px;
    height: 44px;
  }
  .wheel {
    width: 4px;
    height: 8px;
    top: 8px;
  }
  @keyframes scroll-wheel {
    0% {
      top: 8px;
      opacity: 1;
    }
    100% {
      top: 20px;
      opacity: 0;
    }
  }

  .subpage-overlay {
    padding: 0;
    align-items: center;
    justify-content: flex-start;
  }
  .subpage-content {
    max-width: 900px;
    padding: 9rem 4rem 4rem 4rem;
    margin-top: 0;
  }
  .subpage-content .main-heading {
    font-size: 2.8rem;
    margin-bottom: 2rem;
  }
  .subpage-content .text-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
  }

  .cookie-banner {
    bottom: 2rem;
    padding: 1.8rem 2.5rem;
    max-width: 700px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .cookie-content p {
    text-align: center;
  }
  .cookie-buttons {
    flex-direction: row;
    margin-top: 1.5rem;
    justify-content: center;
  }
  .cookie-buttons .btn {
    width: auto;
  }

  .cookie-modal-content {
    padding: 3rem;
    max-width: 600px;
  }
  .cookie-modal-actions {
    flex-direction: row;
    justify-content: center;
  }
  .cookie-modal-actions .btn {
    width: auto;
  }

  .action-btn {
    width: 44px;
    height: 44px;
  }
  .loader-spin {
    width: 56px;
    height: 56px;
  }
}

/* === Offer Section === */
.offer-section {
  max-width: 900px;
  margin: 0 auto;
}
.offer-section h2 {
  font-size: 1.8rem;
  margin-bottom: 2.5rem;
  color: var(--brand-color);
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.architecture-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}
.arch-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2rem;
  border-radius: 24px;
  transition: all var(--transition-spring);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.arch-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--brand-color);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.arch-card h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.arch-card p {
  font-size: 1rem;
  color: #bbb;
  margin-bottom: 0;
}
.synergy-note {
  font-style: italic;
  border-left: 2px solid var(--brand-color);
  padding-left: 1.5rem;
  margin-top: 2.5rem;
  color: #eee;
}
@media (min-width: 768px) {
  .architecture-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .offer-section h2 {
    font-size: 2.4rem;
  }
  .arch-card {
    padding: 2.5rem;
  }
}

/* === Toast Notification (replaces alert()) === */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  z-index: var(--z-toast);
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow:
    0 8px 32px -8px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast-notification.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* === Chat Load Error === */
.chat-load-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 1.1rem;
  text-align: center;
  padding: 2rem;
}

/* === Chat Password Screen === */
.chat-pwd-form {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  flex-direction: column;
  gap: 15px;
  padding: 2rem;
  text-align: center;
  max-width: 400px;
  margin: auto;
  border-radius: 20px;
  margin-top: 20vh;
}
.chat-pwd-form h2 {
  color: var(--brand-color);
}
.chat-pwd-input {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}
.chat-pwd-submit {
  width: 100%;
  box-sizing: border-box;
}
.chat-pwd-error {
  color: #ff3b30;
  margin-top: 10px;
}
.chat-under-const {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 1.5rem;
  color: var(--brand-color);
  font-weight: bold;
}

/* Avatars in Pill */
.avatars-container {
  display: flex;
  align-items: center;
  height: var(--pill-h);
}
.avatars-container:empty {
  display: none;
}
.avatars-group {
  display: inline-flex;
  align-items: center;
  flex-direction: row;
  position: relative;
  --avatar-size: calc(var(--pill-h) - 20px);
  height: var(--pill-h);
}

.avatars-group img.pill-avatar {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  flex-shrink: 0;
  box-shadow: none;
  background-color: transparent;
  display: block;
}

.avatars-group img.pill-avatar:not(:first-child) {
  margin-left: calc(var(--avatar-size) * -0.33);
}

.avatars-container.left:not(:empty) {
  margin-left: calc(var(--pill-h) / -2 + 10px);
}
.avatars-container.right:not(:empty) {
  margin-right: calc(var(--pill-h) / -2 + 10px);
}
