/* ==================================================================
   The Antigle — refine.css
   ------------------------------------------------------------------
   A single, always-loaded refinement layer.

   Why it exists
   • style-visual.css / animations.css / premium.css are gated with
     data-mode="high" and get switched OFF on low-end devices. Anything
     structurally important must therefore live here, where it is never
     disabled.
   • It carries the redesigned "Browse Categories" portals, the filter
     status bar, the shared-card state and a few presentation fixes.

   Load ORDER matters: this file comes after style.css so equal-specificity
   rules here win in both high and low mode.
   ================================================================== */

/* ------------------------------------------------------------------
   1. Section headers — eyebrow + subtitle + link row
   ------------------------------------------------------------------ */
.section-header {
  align-items: flex-end;
}

.section-header > div {
  min-width: 0;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
  font-family: var(--font-heading);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  opacity: 0.9;
}

.section-eyebrow::before {
  content: '';
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-gradient);
}

.section-sub {
  margin: 0.65rem 0 0;
  max-width: 60ch;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.section-link {
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.section-link:hover {
  color: var(--text-primary);
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.1);
  transform: translateX(2px);
}

.section-link svg {
  transition: transform 0.25s ease;
}

.section-link:hover svg {
  transform: translateX(3px);
}

/* ------------------------------------------------------------------
   2. Browse Categories — "portal" cards
   ------------------------------------------------------------------ */
.category-portals {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}

.portal-card {
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 1rem;
  padding: 1.6rem 1.5rem 1.4rem !important;
  text-align: left !important;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, rgba(17, 24, 39, 0.92), rgba(11, 18, 32, 0.82));
  border: 1px solid var(--border-color);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.4s ease,
              box-shadow 0.4s ease;
}

[data-theme="light"] .portal-card,
[data-theme="main-light"] .portal-card {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 249, 0.86));
}

.portal-card::before {
  /* top accent line */
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--portal-gradient, var(--accent-gradient));
  opacity: 0.65;
  z-index: 1;
}

.portal-card::after {
  /* hover shine sweep */
  content: '';
  position: absolute;
  top: -60%;
  left: -120%;
  width: 60%;
  height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  transform: rotate(18deg);
  transition: left 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 0;
}

.portal-card:hover::after,
.portal-card:focus-visible::after {
  left: 130%;
}

.portal-card:hover,
.portal-card:focus-visible {
  transform: translateY(-8px);
  border-color: var(--portal-accent, var(--accent-cyan));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 0 40px var(--portal-glow, rgba(56, 189, 248, 0.18));
}

.portal-glow {
  position: absolute;
  top: -70px;
  right: -70px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--portal-glow, rgba(56, 189, 248, 0.2)), transparent 70%);
  filter: blur(22px);
  opacity: 0.75;
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
  z-index: 0;
}

.portal-card:hover .portal-glow {
  opacity: 1;
  transform: scale(1.22);
}

.portal-icon {
  position: relative;
  z-index: 2;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: #fff;
  background: var(--portal-gradient, var(--accent-gradient));
  box-shadow: 0 8px 24px var(--portal-glow, rgba(56, 189, 248, 0.28)),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-card:hover .portal-icon {
  transform: translateY(-2px) rotate(-6deg) scale(1.06);
}

.portal-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.portal-card .category-name {
  font-family: var(--font-heading);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  margin: 0;
}

.portal-card .category-count {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}

.portal-meta {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.35rem;
  padding-top: 0.95rem;
  border-top: 1px dashed var(--border-color);
}

.portal-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.portal-stat b {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--portal-accent, var(--accent-cyan));
  text-transform: none;
}

.portal-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: gap 0.25s ease, color 0.25s ease;
}

.portal-card:hover .portal-cta {
  gap: 0.7rem;
  color: var(--portal-accent, var(--accent-cyan));
}

.portal-cta svg {
  transition: transform 0.25s ease;
}

.portal-card:hover .portal-cta svg {
  transform: translateX(2px);
}

/* per-category accents */
.portal-card--tips      { --portal-accent: #38BDF8; --portal-glow: rgba(56, 189, 248, 0.22); --portal-gradient: linear-gradient(135deg, #38BDF8, #6D5DFC); }
.portal-card--texture   { --portal-accent: #A855F7; --portal-glow: rgba(168, 85, 247, 0.22); --portal-gradient: linear-gradient(135deg, #A855F7, #6D5DFC); }
.portal-card--bg        { --portal-accent: #FACC15; --portal-glow: rgba(250, 204, 21, 0.2);  --portal-gradient: linear-gradient(135deg, #FACC15, #F97316); }
.portal-card--ui        { --portal-accent: #34D399; --portal-glow: rgba(52, 211, 153, 0.2);  --portal-gradient: linear-gradient(135deg, #34D399, #38BDF8); }

/* ------------------------------------------------------------------
   3. Workbench — tool shortcut cards
   ------------------------------------------------------------------ */
.tool-cards {
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 1rem;
}

.tool-card {
  position: relative;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.95rem;
  padding: 1.15rem 1.2rem !important;
  text-align: left !important;
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.32s ease, box-shadow 0.32s ease;
}

.tool-card:hover,
.tool-card:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(109, 93, 252, 0.55);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4), 0 0 32px rgba(109, 93, 252, 0.18);
}

.tool-card .tool-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  color: var(--accent-cyan);
  background: linear-gradient(135deg, rgba(109, 93, 252, 0.2), rgba(56, 189, 248, 0.12));
  border: 1px solid rgba(109, 93, 252, 0.32);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), color 0.32s ease;
}

.tool-card:hover .tool-icon {
  transform: scale(1.08) rotate(-5deg);
  color: #fff;
  background: linear-gradient(135deg, #6D5DFC, #38BDF8);
}

.tool-card .tool-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.tool-card .category-name {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.tool-card .category-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------------
   4. Filter status bar — makes deep-linked categories obvious
   ------------------------------------------------------------------ */
.filter-status {
  display: none;
  align-items: center;
  gap: 0.75rem;
  margin: -1rem 0 1.5rem;
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.14), rgba(109, 93, 252, 0.08));
  box-shadow: 0 0 26px rgba(56, 189, 248, 0.1);
  animation: filterStatusIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-status.visible {
  display: flex;
}

@keyframes filterStatusIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.filter-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--accent-gradient);
}

.filter-status-text {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.filter-status-text b {
  color: var(--text-primary);
  font-weight: 700;
}

.filter-status-clear {
  appearance: none;
  flex-shrink: 0;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.filter-status-clear:hover {
  color: var(--text-primary);
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
}

/* ------------------------------------------------------------------
   5. Card action button + "shared" state
   ------------------------------------------------------------------ */
.resource-actions-menu {
  z-index: 4;
}

.menu-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.menu-btn:hover {
  background: rgba(0, 0, 0, 0.85);
}

.menu-btn.is-checked {
  color: #0b1220;
  background: #34D399;
}

.menu-btn.is-checked:hover {
  background: #10B981;
  color: #04140d;
}

/* persistent marker on a card that has already been shared */
.shared-badge {
  position: absolute;
  left: 0.7rem;
  bottom: 0.7rem;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #04140d;
  background: linear-gradient(135deg, #34D399, #38BDF8);
  box-shadow: 0 4px 16px rgba(52, 211, 153, 0.4);
  pointer-events: none;
}

.glass-card.is-shared {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.35), 0 0 26px rgba(52, 211, 153, 0.22);
}

.glass-card.is-shared::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(52, 211, 153, 0.35);
  pointer-events: none;
}

.video-card,
.resource-card {
  position: relative;
}

@keyframes sharedFlash {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); }
  60%  { box-shadow: 0 0 0 16px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.glass-card.just-shared {
  animation: sharedFlash 1s cubic-bezier(0.16, 1, 0.3, 1) 1;
}

/* share sheet: never overflow the viewport */
.share-menu {
  max-height: min(440px, calc(100vh - 24px));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.share-menu::-webkit-scrollbar {
  width: 8px;
}

.share-menu::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

/* ------------------------------------------------------------------
   6. Achievements — always-on layout (premium.css is high-mode only)
   ------------------------------------------------------------------ */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.achievement-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.achievement-card:hover {
  transform: translateY(-4px);
}

.achievement-card.unlocked {
  border-color: rgba(91, 219, 76, 0.35);
}

.achievement-card.unlocked:hover {
  border-color: rgba(91, 219, 76, 0.65);
  box-shadow: 0 8px 26px rgba(91, 219, 76, 0.16);
}

.achievement-card.locked {
  opacity: 0.75;
  border-style: dashed;
}

.achievement-body {
  flex: 1;
  min-width: 0;
}

.achievement-title {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.achievement-desc {
  font-size: 0.85rem;
  margin: 0;
  color: var(--text-secondary);
  opacity: 0.9;
}

.achievement-status {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
}

.achievement-card.unlocked .achievement-status {
  color: #5BDB4C;
  background: rgba(91, 219, 76, 0.12);
  border: 1px solid rgba(91, 219, 76, 0.35);
}

.achievement-card.locked .achievement-status {
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* ------------------------------------------------------------------
   7. Generic polish
   ------------------------------------------------------------------ */
/* Horizontal rows should hint that they scroll */
.horizontal-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.horizontal-scroll::after {
  content: '';
  flex: 0 0 1px;
}

/* Zero-results state for the grids */
.no-results {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 3.5rem 1.5rem;
  text-align: center;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
}

.no-results svg {
  width: 42px;
  height: 42px;
  opacity: 0.5;
  color: var(--accent-cyan);
}

.no-results h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.no-results p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Footer: performance-mode chip */
.footer-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.footer-mode-toggle:hover {
  color: var(--text-primary);
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

.footer-mode-toggle .mode-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.footer-mode-toggle[data-mode-state="low"] .mode-dot {
  background: #FACC15;
  box-shadow: 0 0 8px #FACC15;
}

/* ------------------------------------------------------------------
   8. Mode / motion guards
   ------------------------------------------------------------------ */
/* In low mode style-low.css already forces [data-anim] visible, but be
   explicit here too so the redesign works no matter which sheets load. */
html[data-mode="low"] [data-anim],
html[data-motion="reduced"] [data-anim] {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .portal-card,
  .portal-card::after,
  .portal-card .portal-icon,
  .portal-glow,
  .tool-card,
  .tool-card .tool-icon,
  .section-link {
    transition: none !important;
  }

  .portal-card:hover,
  .tool-card:hover {
    transform: none;
  }

  .filter-status {
    animation: none;
  }
}

@media (max-width: 640px) {
  .section-header {
    align-items: flex-start;
  }

  .portal-card {
    padding: 1.35rem 1.2rem !important;
  }

  .filter-status {
    flex-wrap: wrap;
  }

  .filter-status-text {
    flex: 1 1 100%;
    order: 3;
  }
}


/* ------------------------------------------------------------------
   9. Multi-Language Website Translator (.lang-toggle & .lang-picker)
   ------------------------------------------------------------------ */
.lang-toggle {
  height: 40px;
  padding: 0 0.7rem;
  border-radius: 999px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  font-family: var(--font-heading, inherit);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: all var(--transition-fast);
}

.lang-toggle:hover,
.lang-toggle.is-translated {
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.lang-toggle:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.lang-toggle-code {
  line-height: 1;
}

.lang-picker {
  position: fixed;
  z-index: 10000;
  width: 240px;
  background: var(--bg-surface, #0B1220);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  pointer-events: none;
}

.lang-picker.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.lang-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.lang-picker-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.lang-picker-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.lang-picker-list {
  padding: 0.4rem;
  max-height: 310px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.lang-picker-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}

.lang-picker-item:hover {
  background: var(--bg-tertiary);
}

.lang-picker-item.active {
  background: var(--bg-tertiary);
  box-shadow: inset 0 0 0 1px var(--primary, #6D5DFC);
}

.lang-picker-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 22px;
  border-radius: 5px;
  background: rgba(109, 93, 252, 0.14);
  border: 1px solid rgba(109, 93, 252, 0.3);
  color: var(--accent-cyan);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.lang-picker-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.lang-picker-label {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
}

.lang-picker-native {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.lang-picker-check {
  color: var(--accent-cyan);
  font-size: 0.85rem;
  font-weight: 700;
}

/* Hide Google Translate default top banner iframe, spinner & hover tooltips */
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
iframe.goog-te-banner-frame,
body > .skiptranslate,
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-te-spinner-pos,
.goog-te-spinner,
.goog-tooltip,
.goog-tooltip:hover,
#google_translate_element,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
.VIpgJd-ZVi9od-aZ2wEe-OiiCO {
  display: none !important;
  visibility: hidden !important;
}

body {
  top: 0 !important;
}

.goog-text-highlight {
  background-color: transparent !important;
  box-shadow: none !important;
}

/* ------------------------------------------------------------------
   10. Conditional 1-Click Prompt Copy Box in Updates (.prompt-box)
   ------------------------------------------------------------------ */
.prompt-box {
  margin: 0.9rem 0 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(11, 18, 32, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

[data-theme="light"] .prompt-box,
[data-theme="main-light"] .prompt-box {
  background: rgba(241, 245, 249, 0.9);
  border-color: rgba(109, 93, 252, 0.28);
}

.prompt-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.85rem;
  background: rgba(109, 93, 252, 0.12);
  border-bottom: 1px solid rgba(56, 189, 248, 0.18);
}

.prompt-box-label {
  font-family: var(--font-heading, inherit);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-cyan);
}

.prompt-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.prompt-copy-btn:hover {
  background: var(--accent-cyan);
  color: #050816;
  border-color: var(--accent-cyan);
}

.prompt-copy-btn.copied {
  background: rgba(34, 197, 94, 0.2);
  color: #4ADE80;
  border-color: rgba(34, 197, 94, 0.5);
}

.prompt-box-body {
  margin: 0;
  padding: 0.85rem 1rem;
  max-height: 220px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}


/* ------------------------------------------------------------------
   11. Sort Dropdown & Responsive Filter Bar
   ------------------------------------------------------------------ */
.filters-right-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

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

.sort-box {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.sort-select {
  height: 42px;
  padding: 0 2.1rem 0 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  color: var(--text-primary);
  font-family: var(--font-body, inherit);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.sort-select:hover,
.sort-select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.14);
}



/* ------------------------------------------------------------------
   12. Tool Preset Manager Bar (#5)
   ------------------------------------------------------------------ */
.preset-studio-bar {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-glass, rgba(17, 24, 39, 0.65));
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.preset-studio-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.preset-studio-title {
  font-family: var(--font-heading, inherit);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-cyan);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.preset-studio-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preset-btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn-sm:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

.preset-chips-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-chip:hover,
.preset-chip.active {
  border-color: var(--accent-cyan);
  background: rgba(109, 93, 252, 0.18);
  color: var(--accent-cyan);
}

.preset-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.preset-chip-del {
  margin-left: 0.15rem;
  opacity: 0.65;
  font-size: 0.85rem;
  line-height: 1;
}

.preset-chip-del:hover {
  opacity: 1;
  color: #ef4444;
}


/* ------------------------------------------------------------------
   13. High-Visibility Shared Card Highlight & QR Code Share Modal (#12)
   ------------------------------------------------------------------ */
@keyframes antigleCardPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.85), 0 0 36px 10px rgba(109, 93, 252, 0.65);
    transform: translateY(-4px) scale(1.015);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.35), 0 0 48px 16px rgba(56, 189, 248, 0.55);
    transform: translateY(-4px) scale(1.02);
  }
  100% {
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.55), 0 0 28px 6px rgba(109, 93, 252, 0.4);
    transform: translateY(0) scale(1);
  }
}

.glass-card.card-highlight,
.video-card.card-highlight,
.resource-card.card-highlight,
.update-card.card-highlight,
html[data-mode="low"] .glass-card.card-highlight,
html[data-mode="low"] .video-card.card-highlight,
html[data-mode="low"] .resource-card.card-highlight,
html[data-mode="low"] .update-card.card-highlight {
  border: 2px solid #38BDF8 !important;
  outline: 3px solid rgba(56, 189, 248, 0.85) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.28), 0 0 42px 12px rgba(109, 93, 252, 0.58) !important;
  animation: antigleCardPulse 2.2s ease-in-out 3 !important;
  position: relative !important;
  z-index: 12 !important;
}

.glass-card.is-shared,
.video-card.is-shared,
.resource-card.is-shared,
html[data-mode="low"] .glass-card.is-shared {
  border-color: rgba(52, 211, 153, 0.65) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 22px rgba(52, 211, 153, 0.25) !important;
}

.qr-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 0.5rem 0;
}

.qr-canvas-wrap {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 3px solid var(--accent-cyan);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qr-canvas-wrap canvas {
  display: block;
  width: 220px;
  height: 220px;
  image-rendering: pixelated;
}

.qr-url-box {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  color: var(--accent-cyan);
  word-break: break-all;
}

/* ------------------------------------------------------------------
   14. Universal Tool Tutorial Video Box (16:9 Safe Card + Embed)
   ------------------------------------------------------------------ */
.faq-video-placeholder {
  position: relative !important;
  width: 100% !important;
  max-width: 640px !important;
  height: auto !important;
  padding-bottom: 0 !important;
  margin: 1.5rem auto 0 !important;
  border-radius: 14px !important;
  overflow: hidden !important;
}

.tool-yt-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #090d16;
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.tool-yt-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.86;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.tool-yt-card:hover img {
  transform: scale(1.03);
  opacity: 1;
}

.tool-yt-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: linear-gradient(180deg, rgba(5, 8, 22, 0.25) 0%, rgba(5, 8, 22, 0.82) 100%);
  padding: 1rem;
  text-align: center;
}

.tool-yt-play-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(255, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 28px rgba(255, 0, 0, 0.55);
  transition: transform 0.2s ease;
}

.tool-yt-card:hover .tool-yt-play-btn {
  transform: scale(1.08);
}

.tool-yt-coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 2rem 1.25rem;
  background: rgba(15, 23, 42, 0.68);
  border: 1px dashed rgba(56, 189, 248, 0.32);
  border-radius: 14px;
  text-align: center;
}

/* ==================================================================
   15. Premium Web Architect UI Overhaul (Tactile Gaming Studio System)
   Follows 8pt spacing mathematics, cubic-bezier(0.16, 1, 0.3, 1) physics,
   interactive cursor border spotlight, and WCAG AA contrast.
   ================================================================== */
:root {
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-snappy: cubic-bezier(0.22, 1, 0.36, 1);
  --surface-border-subtle: rgba(148, 163, 184, 0.14);
  --surface-border-glow: rgba(56, 189, 248, 0.48);
  --surface-specular: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

/* 15.1 Upgraded Navbar with Laser Under-Border & Pill Active Indicators */
.navbar {
  border-bottom: 1px solid rgba(148, 163, 184, 0.12) !important;
  box-shadow: 0 10px 32px -10px rgba(2, 6, 23, 0.78), inset 0 -1px 0 rgba(56, 189, 248, 0.18) !important;
}

.navbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(109, 93, 252, 0.55) 35%, rgba(56, 189, 248, 0.7) 50%, rgba(109, 93, 252, 0.55) 65%, transparent 95%);
  pointer-events: none;
}

.navbar-nav .nav-link {
  position: relative;
  padding: 0.48rem 0.9rem !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
  transition: color 0.2s var(--ease-spring), background 0.2s var(--ease-spring), transform 0.2s var(--ease-spring) !important;
}

.navbar-nav .nav-link:hover {
  background: rgba(56, 189, 248, 0.08) !important;
  transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
  background: linear-gradient(135deg, rgba(109, 93, 252, 0.22), rgba(56, 189, 248, 0.14)) !important;
  color: #38BDF8 !important;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.35), 0 4px 14px rgba(56, 189, 248, 0.15);
}

/* 15.2 Hero Command Center Perspective Grid & Upgraded Hero Stat Cards */
.hero {
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(56, 189, 248, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(109, 93, 252, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 25%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 25%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

.hero-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  background: rgba(109, 93, 252, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.32);
  color: #38BDF8 !important;
  font-size: 0.76rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.24em !important;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.16);
  margin-bottom: 1rem !important;
}

.hero-title {
  font-size: clamp(2.6rem, 6.5vw, 4.75rem) !important;
  line-height: 1.06 !important;
  letter-spacing: -0.02em !important;
  text-shadow: 0 12px 42px rgba(109, 93, 252, 0.35);
}

.hero-stats {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
  gap: 0.9rem !important;
  max-width: 780px !important;
  width: 100% !important;
  margin: 2.25rem auto 0 !important;
}

.hero-stat-card {
  position: relative;
  overflow: hidden;
  padding: 0.95rem 1.1rem !important;
  border-radius: 16px !important;
  background: linear-gradient(160deg, rgba(17, 24, 39, 0.88), rgba(9, 13, 24, 0.92)) !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.36), var(--surface-specular) !important;
  transition: transform 0.28s var(--ease-spring), border-color 0.28s var(--ease-spring), box-shadow 0.28s var(--ease-spring) !important;
}

[data-theme="light"] .hero-stat-card,
[data-theme="main-light"] .hero-stat-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(241, 245, 249, 0.9)) !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08) !important;
}

.hero-stat-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent-gradient);
  opacity: 0.7;
}

.hero-stat-card:hover {
  transform: translateY(-4px) !important;
  border-color: rgba(56, 189, 248, 0.5) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 0 24px rgba(56, 189, 248, 0.18) !important;
}

.hero-stat-value {
  font-family: 'Oxanium', var(--font-heading) !important;
  font-size: 1.45rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em;
}

/* 15.3 Tactile Glass Cards with Interactive Cursor Spotlight Border */
.glass-card,
.video-card,
.resource-card,
.update-card {
  position: relative;
  border: 1px solid var(--surface-border-subtle);
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.42), var(--surface-specular);
  transition: transform 0.32s var(--ease-spring),
              border-color 0.32s var(--ease-spring),
              box-shadow 0.32s var(--ease-spring);
}

.glass-card.has-spotlight::before,
.video-card.has-spotlight::before,
.resource-card.has-spotlight::before,
.update-card.has-spotlight::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    360px circle at var(--card-mx, 50%) var(--card-my, 50%),
    rgba(56, 189, 248, 0.11),
    rgba(109, 93, 252, 0.05) 45%,
    transparent 75%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.glass-card.has-spotlight:hover::before,
.video-card.has-spotlight:hover::before,
.resource-card.has-spotlight:hover::before,
.update-card.has-spotlight:hover::before {
  opacity: 1;
}

.video-card:hover,
.resource-card:hover,
.update-card:hover {
  transform: translateY(-6px);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 20px 44px -10px rgba(0, 0, 0, 0.55),
              0 0 28px rgba(109, 93, 252, 0.2),
              var(--surface-specular);
}

/* 15.4 Floating Category & Rarity Pills on Card Thumbnails */
.card-cat-pill {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  font-family: 'Oxanium', var(--font-heading);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f8fafc;
  background: rgba(5, 8, 22, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.card-cat-pill[data-cat="ui"],
.card-rarity-pill[data-rarity="epic"] {
  border-color: rgba(168, 85, 247, 0.6);
  color: #e9d5ff;
  background: rgba(30, 14, 54, 0.82);
}

.card-cat-pill[data-cat="tips"],
.card-rarity-pill[data-rarity="rare"] {
  border-color: rgba(56, 189, 248, 0.6);
  color: #bae6fd;
  background: rgba(8, 28, 48, 0.82);
}

.card-rarity-pill[data-rarity="legendary"] {
  border-color: rgba(250, 204, 21, 0.65);
  color: #fef08a;
  background: rgba(45, 28, 6, 0.85);
}

.card-cat-pill[data-cat="bg"] {
  border-color: rgba(52, 211, 153, 0.6);
  color: #a7f3d0;
  background: rgba(6, 38, 28, 0.82);
}

/* Move "New" badge slightly if category pill is on top-left */
.recently-added-badge {
  left: auto !important;
  right: 3.1rem !important;
  top: 0.7rem !important;
}

/* 15.5 Upgraded Video Play Icon Overlay */
.video-play-overlay .play-icon {
  width: 56px !important;
  height: 56px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, rgba(109, 93, 252, 0.92), rgba(56, 189, 248, 0.92)) !important;
  border: 2px solid rgba(255, 255, 255, 0.45) !important;
  box-shadow: 0 8px 28px rgba(56, 189, 248, 0.5) !important;
  transition: transform 0.28s var(--ease-spring), box-shadow 0.28s var(--ease-spring) !important;
}

.video-card:hover .video-play-overlay .play-icon {
  transform: scale(1.12) !important;
  box-shadow: 0 0 36px rgba(56, 189, 248, 0.8), 0 0 0 8px rgba(56, 189, 248, 0.16) !important;
}

/* 15.6 Upgraded Filter Bar & Tactical Pills */
.filters-bar {
  padding: 0.85rem 1rem !important;
  border-radius: 16px !important;
  background: rgba(11, 18, 32, 0.72) !important;
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), var(--surface-specular) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme="light"] .filters-bar,
[data-theme="main-light"] .filters-bar {
  background: rgba(255, 255, 255, 0.88) !important;
}

.filter-btn {
  border-radius: 999px !important;
  font-weight: 600 !important;
  transition: all 0.22s var(--ease-spring) !important;
}

.filter-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.45) !important;
}

.filter-btn.active {
  background: linear-gradient(135deg, #6D5DFC, #38BDF8) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 6px 20px rgba(109, 93, 252, 0.4) !important;
}

/* 15.7 Staggered Grid Entrance Choreography */
@keyframes cardEntranceUp {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

html:not([data-mode="low"]) .cards-grid > .glass-card {
  animation: cardEntranceUp 0.38s var(--ease-spring) both;
}

html:not([data-mode="low"]) .cards-grid > .glass-card:nth-child(1) { animation-delay: 20ms; }
html:not([data-mode="low"]) .cards-grid > .glass-card:nth-child(2) { animation-delay: 60ms; }
html:not([data-mode="low"]) .cards-grid > .glass-card:nth-child(3) { animation-delay: 100ms; }
html:not([data-mode="low"]) .cards-grid > .glass-card:nth-child(4) { animation-delay: 140ms; }
html:not([data-mode="low"]) .cards-grid > .glass-card:nth-child(5) { animation-delay: 180ms; }
html:not([data-mode="low"]) .cards-grid > .glass-card:nth-child(6) { animation-delay: 220ms; }

@media (prefers-reduced-motion: reduce) {
  .cards-grid > .glass-card {
    animation: none !important;
  }
}

/* ==================================================================
   16. Android & Mobile Hero Section Fix (SpawnPoint)
   Prevents horizontal & vertical overflow on 320px–768px screens (including
   clamping the 800px .hero-content::before & .hero-glow pseudo-elements) so
   the entire Hero section fits 100% inside the Android screen.
   ================================================================== */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
}

.hero,
.hero-content {
  box-sizing: border-box !important;
  max-width: 100% !important;
}

.hero-glow,
.hero-content::before {
  max-width: 100vw !important;
  overflow: hidden !important;
}

@media (max-width: 768px) {
  .hero {
    min-height: auto !important;
    padding: calc(var(--navbar-height, 70px) + 0.9rem) 0.75rem 1.35rem !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .hero-glow,
  .hero-content::before {
    width: 100vw !important;
    height: 100% !important;
  }

  .hero-content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0 0.15rem !important;
    margin: 0 auto !important;
  }

  .hero-subtitle {
    font-size: 0.6rem !important;
    letter-spacing: 0.12em !important;
    padding: 0.2rem 0.6rem !important;
    margin-bottom: 0.4rem !important;
    max-width: 100% !important;
  }

  .hero-title {
    font-size: clamp(1.75rem, 8vw, 2.35rem) !important;
    line-height: 1.05 !important;
    letter-spacing: -0.5px !important;
    margin-bottom: 0.25rem !important;
    word-break: break-word !important;
    max-width: 100% !important;
  }

  .typewriter-wrapper {
    font-size: 0.78rem !important;
    min-height: 1.25rem !important;
    margin: 0.25rem 0 0.45rem !important;
    max-width: 100% !important;
    padding: 0 0.2rem !important;
    flex-wrap: wrap !important;
  }

  .hero-desc {
    font-size: 0.78rem !important;
    line-height: 1.42 !important;
    margin: 0 auto 0.8rem !important;
    max-width: 96% !important;
    padding: 0 0.15rem !important;
  }

  .hero-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.45rem !important;
    width: 100% !important;
    max-width: 360px !important;
    margin: 0 auto !important;
  }

  .btn-hero-primary,
  .btn-hero-secondary {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 0.56rem 0.45rem !important;
    font-size: 0.75rem !important;
    gap: 0.35rem !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  .btn-hero-primary svg,
  .btn-hero-secondary svg {
    width: 15px !important;
    height: 15px !important;
    flex-shrink: 0 !important;
  }

  .hero-stats {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.45rem !important;
    margin: 0.8rem auto 0 !important;
    width: 100% !important;
    max-width: 360px !important;
  }

  .hero-stat-card {
    min-width: 0 !important;
    width: 100% !important;
    padding: 0.45rem 0.55rem !important;
    gap: 0.45rem !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
  }

  .hero-stat-icon {
    width: 26px !important;
    height: 26px !important;
    border-radius: 7px !important;
  }

  .hero-stat-icon svg {
    width: 14px !important;
    height: 14px !important;
  }

  .hero-stat-body {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .hero-stat-value {
    font-size: 0.92rem !important;
    line-height: 1.05 !important;
  }

  .hero-stat-label {
    font-size: 0.56rem !important;
    letter-spacing: 0.04em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
  }
}

/* ==================================================================
   17. High-Priority Shared Card Highlight & QR Modal Override
   Placed after Section 15 cardEntranceUp so .card-highlight animation
   always wins and visibly pulses when a shared card is scrolled to.
   ================================================================== */
.cards-grid > .glass-card.card-highlight,
.glass-card.card-highlight,
.video-card.card-highlight,
.resource-card.card-highlight,
.update-card.card-highlight,
html[data-mode="low"] .glass-card.card-highlight,
html[data-mode="low"] .video-card.card-highlight,
html[data-mode="low"] .resource-card.card-highlight,
html[data-mode="low"] .update-card.card-highlight {
  border: 2.5px solid #38BDF8 !important;
  outline: 3px solid rgba(52, 211, 153, 0.85) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.32), 0 0 48px 14px rgba(109, 93, 252, 0.65) !important;
  animation: antigleCardPulse 1.8s ease-in-out 4 !important;
  position: relative !important;
  z-index: 20 !important;
}
