/* ==========================================================================
   Aichemy — theme on top of Bootstrap 5.3.8
   Colour modes use Bootstrap's native data-bs-theme="dark|light".
   ========================================================================== */

/* ---------- Tokens: dark (default) ---------- */
[data-bs-theme="dark"] {
  --ac-bg: #09090C;
  --ac-surface: #111116;
  --ac-surface-2: #16161C;
  --ac-surface-raised: #1C1C23;
  --ac-line: #23232B;
  --ac-line-soft: #1A1A21;
  --ac-line-strong: #6A6A77;
  --ac-ink: #F2F2F5;
  --ac-ink-2: #B9B9C4;
  --ac-ink-muted: #8B8B98;
  --ac-brand: #8B6CFF;
  --ac-brand-soft: #1E1838;
  --ac-brand-glow: rgba(139, 108, 255, .22);
  --ac-gold-glow: rgba(245, 184, 46, .10);
  --ac-mint: #2DD4BF;
  --ac-mint-soft: #0F2A27;
  --ac-cta: #F5B82E;
  --ac-cta-hover: #FFC94D;
  --ac-on-cta: #1A1200;
  --ac-grid: rgba(255, 255, 255, .035);
  --ac-solid: #F2F2F5;
  --ac-on-solid: #09090C;

  /* Bootstrap overrides */
  --bs-body-bg: var(--ac-bg);
  --bs-body-color: var(--ac-ink);
  --bs-secondary-color: var(--ac-ink-muted);
  --bs-border-color: var(--ac-line);
  --bs-link-color: var(--ac-brand);
  --bs-link-color-rgb: 139, 108, 255;
  --bs-link-hover-color: var(--ac-brand);
  --bs-link-hover-color-rgb: 139, 108, 255;
  --bs-emphasis-color: var(--ac-ink);
  --bs-tertiary-bg: var(--ac-surface-raised);
}

/* ---------- Tokens: light ---------- */
[data-bs-theme="light"] {
  --ac-bg: #FAFAF7;
  --ac-surface: #FFFFFF;
  --ac-surface-2: #FFFFFF;
  --ac-surface-raised: #F3F2EE;
  --ac-line: #E7E5E0;
  --ac-line-soft: #EFEDE8;
  --ac-line-strong: #8E8B84;
  --ac-ink: #111114;
  --ac-ink-2: #3D3D46;
  --ac-ink-muted: #6B6B76;
  --ac-brand: #5B3FE0;
  --ac-brand-soft: #EEEAFD;
  --ac-brand-glow: rgba(91, 63, 224, .12);
  --ac-gold-glow: rgba(230, 168, 23, .10);
  --ac-mint: #0B7A6C;
  --ac-mint-soft: #E6F6F3;
  --ac-cta: #E6A817;
  --ac-cta-hover: #F0B429;
  --ac-on-cta: #1A1200;
  --ac-grid: rgba(17, 17, 20, .045);
  --ac-solid: #111114;
  --ac-on-solid: #FAFAF7;

  --bs-body-bg: var(--ac-bg);
  --bs-body-color: var(--ac-ink);
  --bs-secondary-color: var(--ac-ink-muted);
  --bs-border-color: var(--ac-line);
  --bs-link-color: var(--ac-brand);
  --bs-link-color-rgb: 91, 63, 224;
  --bs-link-hover-color: var(--ac-brand);
  --bs-link-hover-color-rgb: 91, 63, 224;
  --bs-emphasis-color: var(--ac-ink);
  --bs-tertiary-bg: var(--ac-surface-raised);
}

:root {
  --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-font-size: 1rem;
  --bs-border-radius: 10px;
  --bs-border-radius-lg: 16px;
  --bs-border-radius-xl: 22px;
  --ac-focus: 0 0 0 .2rem var(--ac-brand-soft);
}

body {
  -webkit-font-smoothing: antialiased;
  background: var(--ac-bg);
  color: var(--ac-ink);
}

:focus-visible { outline: 2px solid var(--ac-brand); outline-offset: 2px; }

.text-ink-2 { color: var(--ac-ink-2) !important; }
.text-muted-ac { color: var(--ac-ink-muted) !important; }
.text-brand { color: var(--ac-brand) !important; }
.text-gold { color: var(--ac-cta) !important; }
.text-mint { color: var(--ac-mint) !important; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ac-ink-muted); }
.container-ac { max-width: 1280px; }

/* ---------- Buttons ---------- */
.btn { --bs-btn-font-weight: 600; --bs-btn-font-size: .875rem; --bs-btn-padding-x: 1.125rem; --bs-btn-padding-y: .5625rem; --bs-btn-border-radius: 10px; white-space: nowrap; }
.btn-gold {
  --bs-btn-bg: var(--ac-cta); --bs-btn-border-color: var(--ac-cta); --bs-btn-color: var(--ac-on-cta);
  --bs-btn-hover-bg: var(--ac-cta-hover); --bs-btn-hover-border-color: var(--ac-cta-hover); --bs-btn-hover-color: var(--ac-on-cta);
  --bs-btn-active-bg: var(--ac-cta-hover); --bs-btn-active-border-color: var(--ac-cta-hover); --bs-btn-active-color: var(--ac-on-cta);
}
.btn-solid {
  --bs-btn-bg: var(--ac-solid); --bs-btn-border-color: var(--ac-solid); --bs-btn-color: var(--ac-on-solid);
  --bs-btn-hover-bg: var(--ac-solid); --bs-btn-hover-border-color: var(--ac-solid); --bs-btn-hover-color: var(--ac-on-solid);
  --bs-btn-active-bg: var(--ac-solid); --bs-btn-active-color: var(--ac-on-solid);
}
.btn-solid:hover { opacity: .9; }
.btn-line {
  --bs-btn-bg: var(--ac-surface); --bs-btn-border-color: var(--ac-line); --bs-btn-color: var(--ac-ink);
  --bs-btn-hover-bg: var(--ac-surface); --bs-btn-hover-border-color: var(--ac-line-strong); --bs-btn-hover-color: var(--ac-ink);
  --bs-btn-active-bg: var(--ac-surface-raised); --bs-btn-active-color: var(--ac-ink);
}
.btn-ghost-ac {
  --bs-btn-color: var(--ac-ink-muted); --bs-btn-hover-color: var(--ac-ink); --bs-btn-active-color: var(--ac-ink);
  --bs-btn-bg: transparent; --bs-btn-hover-bg: transparent; --bs-btn-border-color: transparent; --bs-btn-hover-border-color: transparent;
}
.btn-icon {
  width: 38px; height: 38px; padding: 0; display: inline-grid; place-items: center;
  border: 1px solid var(--ac-line); border-radius: 10px; background: transparent; color: var(--ac-ink-muted);
}
.btn-icon:hover { color: var(--ac-ink); background: var(--ac-surface-raised); }

/* ---------- Navbar ---------- */
.ac-nav {
  position: sticky; top: 0; z-index: 1030;
  background: color-mix(in srgb, var(--ac-bg) 78%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--ac-line-soft);
  min-height: 68px;
}
.ac-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ac-ink); text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.ac-brand:hover { color: var(--ac-ink); }
.ac-brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--ac-ink); display: grid; place-items: center; }
.ac-brand-mark::after { content: ""; width: 10px; height: 10px; border-radius: 999px; background: var(--ac-brand); box-shadow: 0 0 0 3px var(--ac-bg); }
.ac-nav .nav-link { font-size: 14px; color: var(--ac-ink-muted); padding: 8px 12px !important; border-radius: 8px; }
.ac-nav .nav-link:hover, .ac-nav .nav-link.active { color: var(--ac-ink); }
.ac-nav > .container-xl { flex-wrap: nowrap; }
.ac-divider { width: 1px; height: 22px; background: var(--ac-line); }
.offcanvas { --bs-offcanvas-bg: var(--ac-bg); --bs-offcanvas-border-color: var(--ac-line); }
.offcanvas .nav-link { font-size: 16px; font-weight: 500; color: var(--ac-ink); padding: 12px !important; border-radius: 10px; }
.offcanvas .nav-link:hover { background: var(--ac-surface-raised); }

/* ---------- Hero (centered, compact) ---------- */
.ac-hero {
  position: relative; overflow: hidden; border-radius: 28px; border: 1px solid var(--ac-line);
  background-color: var(--ac-surface);
  background-image:
    radial-gradient(640px 360px at 88% 0%, var(--ac-brand-glow), transparent 70%),
    radial-gradient(520px 300px at 8% 110%, var(--ac-gold-glow), transparent 70%),
    linear-gradient(var(--ac-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--ac-grid) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  padding: 44px 40px 36px;
}
.ac-hero-inner {
  max-width: 760px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
}
.ac-hero-search { width: 100%; max-width: 620px; display: flex; flex-direction: column; gap: 10px; }
.ac-pill {
  display: inline-flex; align-items: center; gap: 10px; min-height: 30px; padding: 5px 14px 5px 10px;
  border-radius: 999px; border: 1px solid var(--ac-line); background: var(--ac-bg); font-size: 13px; color: var(--ac-ink-2);
}
.ac-dot { width: 8px; height: 8px; flex: none; border-radius: 999px; background: var(--ac-mint); box-shadow: 0 0 0 4px var(--ac-mint-soft); }
.ac-h1 { font-size: 52px; line-height: 1.06; font-weight: 800; letter-spacing: -.035em; margin: 0; text-wrap: balance; }
.ac-lead { max-width: 560px; font-size: 17px; line-height: 26px; color: var(--ac-ink-2); text-wrap: balance; }

.ac-search {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 6px 0 20px; text-align: left;
  border-radius: 999px; border: 1px solid var(--ac-line-strong); background: var(--ac-bg);
  transition: border-color .15s, box-shadow .15s;
}
.ac-search:focus-within { border-color: var(--ac-brand); box-shadow: 0 0 0 4px var(--ac-brand-soft); }
.ac-search input { flex-grow: 1; min-width: 0; font: inherit; font-size: 15px; color: var(--ac-ink); background: transparent; border: 0; outline: none; }
.ac-search input::placeholder { color: var(--ac-ink-muted); }
.ac-search input:focus-visible { outline: none; }
.ac-search .btn { height: 40px; border-radius: 999px; padding: 0 18px; display: inline-flex; align-items: center; gap: 8px; }

.ac-chips { justify-content: center; }
.ac-chip {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--ac-line); background: var(--ac-surface); color: var(--ac-ink-2); font-size: 13px; transition: border-color .15s, color .15s;
}
.ac-chip:hover { border-color: var(--ac-line-strong); color: var(--ac-ink); }
.ac-chip[aria-pressed="true"] { border-color: var(--ac-brand); color: var(--ac-brand); background: var(--ac-brand-soft); }

/* ---------- Section heads ---------- */
.ac-section { padding-top: 88px; }
.ac-sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--ac-line-soft); }
.ac-sec-title { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 26px; line-height: 32px; font-weight: 700; letter-spacing: -.025em; }
.ac-sec-sub { margin: 4px 0 0; font-size: 15px; color: var(--ac-ink-muted); }
.ac-link { color: var(--ac-brand); text-decoration: none; font-size: 14px; font-weight: 500; }
.ac-link:hover { text-decoration: underline; color: var(--ac-brand); }

/* ---------- Tool card ---------- */
.ac-card {
  position: relative; display: flex; flex-direction: column; gap: 14px; height: 100%; padding: 20px;
  background: var(--ac-surface); border: 1px solid var(--ac-line); border-radius: 16px;
  color: var(--ac-ink); text-decoration: none; transition: border-color .18s, transform .18s, background .18s;
}
.ac-card:hover { color: var(--ac-ink); border-color: color-mix(in srgb, var(--ac-brand) 40%, var(--ac-line)); transform: translateY(-2px); background: var(--ac-surface-2); }
/* Top accent: sits on the card's top border, thickest in the middle, thinning and fading into both corners */
.ac-card--featured { padding-top: 22px; }
.ac-card--featured::before {
  content: ""; position: absolute; top: -1px; left: 12px; right: 12px; height: 3px; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, var(--ac-brand) 28%, var(--ac-brand) 72%, transparent 100%);
  clip-path: ellipse(50% 100% at 50% 0); /* 3px in the centre → 0px at the ends */
}
.ac-logo { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.ac-card--featured .ac-logo { width: 52px; height: 52px; }
.ac-name { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 16px; line-height: 22px; font-weight: 700; letter-spacing: -.01em; }
.ac-verified { color: var(--ac-brand); font-size: 15px; }
.ac-price { margin: 2px 0 0; font-size: 13px; line-height: 18px; color: var(--ac-ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-desc { margin: 0; font-size: 14px; line-height: 21px; color: var(--ac-ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 42px; }
.ac-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.ac-tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 12px; font-weight: 500; border: 1px solid var(--ac-line); color: var(--ac-ink-2); }
.ac-tag--cat { border-color: transparent; background: var(--ac-brand-soft); color: var(--ac-brand); }
.ac-new { position: absolute; top: 14px; right: 14px; font-size: 10px; font-weight: 700; letter-spacing: .06em; height: 20px; padding: 0 7px; display: inline-flex; align-items: center; border-radius: 6px; background: var(--ac-mint-soft); color: var(--ac-mint); }

/* ---------- Banner ---------- */
.ac-banner {
  border-radius: 22px; overflow: hidden; background-color: var(--ac-surface);
  border: 1px solid color-mix(in srgb, var(--ac-cta) 35%, var(--ac-line));
  background-image: radial-gradient(600px 220px at 100% 0%, var(--ac-gold-glow), transparent 70%);
}
.ac-banner-icon { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center; color: var(--ac-cta); font-size: 22px; border: 1px solid color-mix(in srgb, var(--ac-cta) 40%, var(--ac-line)); }
.ac-banner-foot { border-top: 1px solid var(--ac-line); }

/* ---------- Categories ---------- */
.ac-cat {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; text-align: left;
  border: 1px solid var(--ac-line); background: var(--ac-surface); color: var(--ac-ink); transition: border-color .15s, background .15s;
}
.ac-cat:hover { border-color: color-mix(in srgb, var(--ac-brand) 40%, var(--ac-line)); background: var(--ac-surface-2); }
.ac-cat-icon { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--ac-brand-soft); color: var(--ac-brand); font-size: 18px; }
.ac-cat-count { font-size: 13px; font-weight: 600; color: var(--ac-brand); font-variant-numeric: tabular-nums; }

/* ---------- Video reviews ---------- */
.ac-vid { display: flex; flex-direction: column; gap: 12px; color: var(--ac-ink); text-decoration: none; }
.ac-vid:hover { color: var(--ac-ink); }
.ac-thumb {
  position: relative; aspect-ratio: 16 / 9; border-radius: 16px; border: 1px solid var(--ac-line); overflow: hidden;
  display: grid; place-items: center; background-color: var(--ac-surface);
  background-image: linear-gradient(var(--ac-grid) 1px, transparent 1px), linear-gradient(90deg, var(--ac-grid) 1px, transparent 1px);
  background-size: 24px 24px; transition: border-color .15s;
}
.ac-vid:hover .ac-thumb { border-color: var(--ac-line-strong); }
/* Fallback: tool logo on the grid */
.ac-thumb-logo { width: 68px; height: 68px; border-radius: 18px; }
/* Real thumbnail: hqdefault is 4:3 with black bars, cover on 16:9 crops them off */
.ac-thumb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.ac-thumb.has-img .ac-thumb-logo { display: none; }
.ac-vid:hover .ac-thumb-img { transform: scale(1.03); }
.ac-thumb.has-img::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(0,0,0,.55), transparent 45%); }
/* Play button, centred, appears on both versions */
.ac-thumb-play {
  position: absolute; z-index: 1; width: 46px; height: 46px; border-radius: 999px; display: grid; place-items: center;
  background: rgba(9, 9, 12, .72); color: #fff; font-size: 22px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transform: scale(.9); transition: opacity .15s, transform .15s;
}
.ac-thumb.has-img .ac-thumb-play, .ac-vid:hover .ac-thumb-play { opacity: 1; transform: none; }
.ac-thumb:not(.has-img) .ac-thumb-play { display: none; }
/* Tool chip, bottom-left: keeps the tool identifiable on busy thumbnails */
.ac-thumb-tool {
  position: absolute; z-index: 1; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 7px;
  height: 28px; padding: 0 10px 0 4px; border-radius: 8px; background: rgba(9, 9, 12, .78); color: #fff;
  font-size: 11px; font-weight: 600; letter-spacing: .02em; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  max-width: calc(100% - 20px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ac-thumb-tool img { width: 20px; height: 20px; border-radius: 5px; flex: none; }

/* ---------- Newsletter ---------- */
.ac-panel { border-radius: 22px; border: 1px solid var(--ac-line); background: var(--ac-surface); padding: 40px 44px; }
.ac-input {
  font-size: 15px; height: 46px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--ac-line-strong); background: var(--ac-bg); color: var(--ac-ink);
}
.ac-input:focus { background: var(--ac-bg); color: var(--ac-ink); border-color: var(--ac-brand); box-shadow: var(--ac-focus); }
.ac-input::placeholder { color: var(--ac-ink-muted); }

.ac-nl-title { margin: 6px 0; font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.03em; text-wrap: balance; }
.ac-nl-btn { height: 46px; padding: 0 22px; }
.ac-nl-note { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 13px; color: var(--ac-ink-muted); }
.ac-nl-note .bi { color: var(--ac-mint); }
.ac-nl-done { display: flex; align-items: center; gap: 8px; min-height: 46px; margin: 0; padding: 0 16px; border-radius: 12px; background: var(--ac-mint-soft); color: var(--ac-mint); font-weight: 600; }
.ac-nl-done.d-none { display: none !important; }
.ac-input:user-invalid { border-color: #F26D6D; }

/* ---------- Footer ---------- */
.ac-footer { padding-top: 96px; padding-bottom: 40px; }
.ac-footer-inner { border-top: 1px solid var(--ac-line-soft); padding-top: 48px; }
.ac-flink { color: var(--ac-ink-muted); text-decoration: none; font-size: 14px; }
.ac-flink:hover { color: var(--ac-ink); }
.ac-social { display: flex; gap: 8px; flex-wrap: wrap; }
.ac-social a {
  width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--ac-line); color: var(--ac-ink-muted); font-size: 16px; text-decoration: none;
  transition: color .15s, border-color .15s, background .15s;
}
.ac-social a:hover { color: var(--ac-ink); border-color: var(--ac-line-strong); background: var(--ac-surface-raised); }
.ac-social a[aria-label="YouTube"]:hover { color: #FF4D4D; }

/* ---------- Empty state ---------- */
.ac-empty { border: 1px dashed var(--ac-line-strong); border-radius: 16px; padding: 48px; text-align: center; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1199.98px) {
  .ac-hero { padding: 40px 32px 32px; }
  .ac-h1 { font-size: 46px; }
}

@media (max-width: 767.98px) {
  .ac-nav { min-height: 60px; }
  .ac-brand { font-size: 17px; }
  #navCta { --bs-btn-padding-x: .875rem; --bs-btn-padding-y: .4375rem; font-size: 13px; }
  .ac-hero { padding: 28px 18px 22px; border-radius: 22px; }
  .ac-hero-inner { gap: 14px; }
  .ac-pill { font-size: 12px; white-space: nowrap; }
  .ac-h1 { font-size: 34px; line-height: 1.1; letter-spacing: -.03em; }
  .ac-lead { font-size: 15px; line-height: 23px; }
  .ac-search { height: 48px; padding: 0 5px 0 16px; gap: 8px; }
  .ac-search input { font-size: 14.5px; }
  .ac-search .btn { width: 38px; height: 38px; padding: 0; justify-content: center; }
  .ac-chips { flex-wrap: nowrap !important; justify-content: flex-start; overflow-x: auto; margin-right: -18px; padding-right: 18px; scrollbar-width: none; }
  .ac-chips::-webkit-scrollbar { display: none; }
  .ac-chip { flex: none; }
  .ac-section { padding-top: 56px; }
  .ac-sec-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .ac-sec-title { font-size: 22px; line-height: 28px; }
  .ac-card:hover { transform: none; }
  .ac-scroll-row { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; margin-right: -12px; scrollbar-width: none; }
  .ac-scroll-row::-webkit-scrollbar { display: none; }
  .ac-scroll-row > * { flex: 0 0 78%; scroll-snap-align: start; }
  .ac-panel { padding: 28px 20px; }
  .ac-nl-title { font-size: 22px; }
  .ac-nl-btn { width: 100%; }
  .ac-footer { padding-top: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Utility Bootstrap doesn't ship */
@media (min-width: 768px) { .w-md-auto { width: auto !important; } }