/* ══════════════════════════════════════════════════════════════════
   GetAddons.io — Design System
   ══════════════════════════════════════════════════════════════════
   All tokens are CSS variables. Nothing is hardcoded.
   Any rebrand = update :root block only.
   ══════════════════════════════════════════════════════════════════ */

/* ─── TOKENS ──────────────────────────────────────────────────── */
:root {
  /* Palette */
  --clr-bg:           #e8e8e8;
  --clr-surface:      #ffffff;
  --clr-surface-2:    #f5f5f5;
  --clr-border:       #d4d4d4;
  --clr-border-hover: #b0b0b0;
  --clr-text-1:       #0f0f0f;
  --clr-text-2:       #555555;
  --clr-text-3:       #909090;
  --clr-icon-bg:      #111111;
  --clr-icon-fg:      #ffffff;

  /* Badge palette */
  --clr-chrome-bg:    #e8f0fe;
  --clr-chrome-fg:    #1a56db;
  --clr-edge-bg:      #e4f1fc;
  --clr-edge-fg:      #0063b1;
  --clr-brave-bg:     #fff0eb;
  --clr-brave-fg:     #b83424;
  --clr-firefox-bg:   #fff4ee;
  --clr-firefox-fg:   #c44b14;
  --clr-pwa-bg:       #f0f0f0;
  --clr-pwa-fg:       #333333;
  --clr-ios-bg:       #f5f5f5;
  --clr-ios-fg:       #555555;

  /* Typography */
  --font:             'DM Sans', system-ui, -apple-system, sans-serif;
  --fw-regular:       400;
  --fw-medium:        500;
  --fw-semibold:      600;
  --fw-bold:          700;
  --fw-extrabold:     800;

  /* Spacing scale (4px base) */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* Radius */
  --r-sm:   6px;
  --r-md:   12px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.07);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.09);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);

  /* Transitions */
  --ease:     cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.0, 0.0, 0.2, 1);
  --dur-fast: 160ms;
  --dur-med:  240ms;

  /* Layout */
  --max-w: 920px;
}

/* ─── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font);
  font-size: 16px;
  font-weight: var(--fw-regular);
  background: var(--clr-bg);
  color: var(--clr-text-1);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}
img { display: block; max-width: 100%; user-select: none; }
button { cursor: pointer; font-family: inherit; }
a { color: inherit; }
ul, ol { list-style: none; }

/* ─── ANIMATIONS ──────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ─── HERO ────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: var(--sp-16) var(--sp-6) var(--sp-12);
  animation: fadeUp var(--dur-med) var(--ease-out) both;
}
.hero-title {
  font-size: clamp(2rem, 7vw, 3.25rem);
  font-weight: var(--fw-extrabold);
  letter-spacing: -0.035em;
  color: var(--clr-text-1);
  line-height: 1.05;
}
.hero-sub {
  margin-top: var(--sp-3);
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  color: var(--clr-text-2);
  font-weight: var(--fw-regular);
}

/* ─── FILTER BAR ──────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  max-width: var(--max-w);
  margin: 0 auto var(--sp-10);
  padding: 0 var(--sp-6);
  animation: fadeUp var(--dur-med) 80ms var(--ease-out) both;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 7px 15px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--clr-border);
  background: var(--clr-surface);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: var(--fw-semibold);
  color: var(--clr-text-2);
  transition:
    border-color var(--dur-fast) var(--ease),
    color        var(--dur-fast) var(--ease),
    background   var(--dur-fast) var(--ease),
    box-shadow   var(--dur-fast) var(--ease);
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
}
.filter-btn:hover {
  border-color: var(--clr-border-hover);
  color: var(--clr-text-1);
  box-shadow: var(--shadow-sm);
}
.filter-btn--active {
  background: var(--clr-text-1);
  color: #fff;
  border-color: var(--clr-text-1);
  box-shadow: var(--shadow-sm);
}
.filter-btn--active:hover {
  background: #222;
  border-color: #222;
}
.filter-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  object-fit: contain;
}

/* ─── PRODUCTS SECTION ────────────────────────────────────────── */
.products-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6);
  animation: fadeUp var(--dur-med) 120ms var(--ease-out) both;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}
@media (max-width: 700px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .products-grid { grid-template-columns: 1fr; }
}

.no-results {
  text-align: center;
  padding: var(--sp-12);
  color: var(--clr-text-3);
  font-size: 0.9rem;
}

/* ─── PRODUCT CARD ────────────────────────────────────────────── */
.product-card {
  position: relative;
  background: var(--clr-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform  var(--dur-med) var(--ease),
    box-shadow var(--dur-med) var(--ease);
  /* Staggered reveal */
  animation: fadeUp var(--dur-med) calc(var(--card-index, 0) * 40ms + 160ms) var(--ease-out) both;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.product-card--hidden {
  display: none;
}

/* Card link (icon area is the clickable element) */
.card-link {
  display: block;
  text-decoration: none;
  outline-offset: 3px;
}
.card-link:focus-visible {
  outline: 2px solid var(--clr-text-1);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

/* Card icon section */
.card-icon-section {
  aspect-ratio: 1;
  width: 100%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
}

/* Secure image wrapper */
.card-img-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--r-md);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.card-img-wrap img::selection { background: transparent; }

/* Fallback icon */
.card-img-fallback {
  font-size: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border-radius: var(--r-md);
  background: var(--clr-surface-2);
  user-select: none;
}

/* Card body */
.card-body {
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
  border-top: 1px solid #f0f0f0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.card-name {
  font-size: 0.9rem;
  font-weight: var(--fw-bold);
  color: var(--clr-text-1);
  line-height: 1.3;
}
.card-desc {
  font-size: 0.76rem;
  color: var(--clr-text-3);
  line-height: 1.5;
  flex: 1;
}
.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--sp-3);
}

/* Coming soon overlay */
.card-soon-overlay {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  background: var(--clr-text-1);
  color: #fff;
  font-size: 0.62rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--r-full);
  pointer-events: none;
}

/* ─── BADGES ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  font-size: 0.68rem;
  font-weight: var(--fw-bold);
  text-decoration: none;
  border: none;
  line-height: 1;
  transition: opacity var(--dur-fast) var(--ease);
  cursor: default;
}
a.badge, button.badge {
  cursor: pointer;
}
a.badge:hover, button.badge:hover { opacity: 0.75; }
a.badge:focus-visible, button.badge:focus-visible {
  outline: 2px solid var(--clr-text-1);
  outline-offset: 2px;
}
.badge svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}
.badge-icon-img {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
}
.badge-emoji {
  font-size: 0.75rem;
  line-height: 1;
}

.badge--chrome  { background: var(--clr-chrome-bg);  color: var(--clr-chrome-fg); }
.badge--edge    { background: var(--clr-edge-bg);    color: var(--clr-edge-fg); }
.badge--brave   { background: var(--clr-brave-bg);   color: var(--clr-brave-fg); }
.badge--firefox { background: var(--clr-firefox-bg); color: var(--clr-firefox-fg); }
.badge--pwa     { background: var(--clr-pwa-bg);     color: var(--clr-pwa-fg); }
.badge--ios     { background: var(--clr-ios-bg);     color: var(--clr-ios-fg); }

/* ─── DIVIDER ─────────────────────────────────────────────────── */
.divider,
.footer-divider {
  border: none;
  border-top: 1px solid var(--clr-border);
  margin: var(--sp-12) var(--sp-6) 0;
}

/* ─── ABOUT ───────────────────────────────────────────────────── */
.about {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
  padding: var(--sp-12) var(--sp-6);
  animation: fadeUp var(--dur-med) 200ms var(--ease-out) both;
}
.about p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--clr-text-2);
}
.about strong {
  color: var(--clr-text-1);
  font-weight: var(--fw-bold);
}

/* ─── INSTALL STRIP ───────────────────────────────────────────── */
.install-strip {
  max-width: var(--max-w);
  margin: 0 auto var(--sp-4);
  padding: 0 var(--sp-6);
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  animation: fadeUp var(--dur-med) 240ms var(--ease-out) both;
}

.install-card {
  flex: 1;
  min-width: 280px;
  background: var(--clr-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-6);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  transition: box-shadow var(--dur-fast) var(--ease);
}
.install-card:hover { box-shadow: var(--shadow-md); }

.install-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--clr-icon-bg);
  color: var(--clr-icon-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.install-icon svg { width: 24px; height: 24px; }

.install-info { flex: 1; }
.install-title {
  font-size: 0.9rem;
  font-weight: var(--fw-bold);
  color: var(--clr-text-1);
  line-height: 1.3;
}
.install-sub {
  margin-top: var(--sp-1);
  font-size: 0.75rem;
  color: var(--clr-text-3);
  line-height: 1.45;
}
.install-btn {
  display: inline-block;
  margin-top: var(--sp-3);
  padding: 8px 16px;
  background: var(--clr-text-1);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-size: 0.78rem;
  font-weight: var(--fw-bold);
  text-decoration: none;
  font-family: var(--font);
  transition:
    opacity   var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
  cursor: pointer;
}
.install-btn:hover {
  opacity: 0.82;
  transform: translateY(-1px);
}
.install-btn:active { transform: translateY(0); }
.install-btn:focus-visible {
  outline: 2px solid var(--clr-text-1);
  outline-offset: 3px;
}

/* ─── FOOTER ──────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: var(--sp-8) var(--sp-6) var(--sp-10);
  animation: fadeUp var(--dur-med) 280ms var(--ease-out) both;
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--clr-icon-bg);
  color: var(--clr-icon-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition:
    opacity   var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}
.social-link:hover {
  opacity: 0.78;
  transform: translateY(-2px);
}
.social-link:focus-visible {
  outline: 2px solid var(--clr-text-1);
  outline-offset: 3px;
}
.social-link svg { width: 18px; height: 18px; }
.social-link--linkedin { background: #0a66c2; }

.footer-tagline {
  font-size: 0.82rem;
  color: var(--clr-text-2);
  font-weight: var(--fw-medium);
  margin-bottom: var(--sp-2);
}
.footer-copy {
  font-size: 0.75rem;
  color: var(--clr-text-3);
}

/* ─── MODAL ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease);
}
.modal-overlay--open { opacity: 1; }
/* hidden state is handled via the hidden attribute + JS class toggle */
.modal-overlay[hidden] { display: none; }
.modal-overlay:not([hidden]) { display: flex; }

.modal {
  background: var(--clr-surface);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: scaleIn var(--dur-med) var(--ease-out) both;
}

.modal-close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--clr-surface-2);
  color: var(--clr-text-2);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease);
}
.modal-close:hover { background: var(--clr-border); }
.modal-close:focus-visible {
  outline: 2px solid var(--clr-text-1);
  outline-offset: 2px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: var(--fw-extrabold);
  color: var(--clr-text-1);
  margin-bottom: var(--sp-2);
  padding-right: var(--sp-8); /* avoid close btn overlap */
}
.modal-desc {
  font-size: 0.85rem;
  color: var(--clr-text-2);
  line-height: 1.55;
  margin-bottom: var(--sp-5);
}

.modal-steps {
  counter-reset: steps;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.modal-steps li {
  counter-increment: steps;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--clr-text-2);
}
.modal-steps li::before {
  content: counter(steps);
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--clr-text-1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: var(--fw-extrabold);
  flex-shrink: 0;
  margin-top: 1px;
}
.modal-steps li strong { color: var(--clr-text-1); }

.modal-urls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.modal-url-chip {
  display: inline-block;
  padding: 7px 14px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--clr-border);
  background: var(--clr-surface-2);
  font-size: 0.8rem;
  font-weight: var(--fw-bold);
  color: var(--clr-text-1);
  text-decoration: none;
  transition:
    border-color var(--dur-fast) var(--ease),
    background   var(--dur-fast) var(--ease);
}
.modal-url-chip:hover {
  border-color: var(--clr-border-hover);
  background: var(--clr-border);
}
.modal-url-chip:focus-visible {
  outline: 2px solid var(--clr-text-1);
  outline-offset: 2px;
}

/* ─── ACCESSIBILITY ───────────────────────────────────────────── */
.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;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── RESPONSIVE TWEAKS ───────────────────────────────────────── */
@media (max-width: 600px) {
  .hero { padding: var(--sp-10) var(--sp-6) var(--sp-8); }
  .install-strip { flex-direction: column; }
  .install-card { min-width: unset; }
  .divider, .footer-divider { margin-left: var(--sp-4); margin-right: var(--sp-4); }
  .modal { padding: var(--sp-6); }
}