/* TrueTools.org — Homepage styles
   Load on: index.html  ·  guides/index.html
   Contains: hero, cat-pills, tool-grid, .htc, feat-bar, why-section,
             home-sidebar, pop-items, scroll-reveal animations.
   ------------------------------------------------------------------ */

/* ── 19. HERO ─────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 60%, #134e4a 100%);
  color: #fff;
  padding: 4rem 0 4.5rem;
  text-align: center;
}
.hero h1 { color: #fff; font-size: clamp(2rem, 4vw, 3rem); }
.hero p { font-size: 1.125rem; color: rgba(255,255,255,.85); max-width: 56ch; margin: .75rem auto 2rem; }

/* Hero search bar — lives outside .hero to avoid overflow:hidden clipping */
.hero-search-wrap {
  margin-top: -1.75rem;      /* pulls it up, visually bridging from hero */
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 10;
  text-align: center;        /* ensures search bar is centered on all screens */
}

.hero-search {
  display: flex;
  max-width: 560px;
  margin: 0 auto;
  background: rgba(255,255,255,.80);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255,255,255,.60);
  border-radius: 999px;
  overflow: visible;
  box-shadow: var(--glass-shadow-lg);
  position: relative;
}
.hero-search input {
  flex: 1;
  border: none;
  background: transparent;
  padding: .875rem 1.25rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  outline: none;
  border-radius: 999px 0 0 999px;
}
.hero-search button {
  background: var(--teal-dk);
  color: #fff;
  border: none;
  padding: .875rem 1.5rem;
  border-radius: 0 999px 999px 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: .9375rem;
  transition: background .2s;
}
.hero-search button:hover { background: #134e4a; }
.hero-search:focus-within { box-shadow: 0 0 0 4px rgba(255,255,255,.18), var(--shadow-lg); transition: box-shadow .25s; }

#hero-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 200;
  display: none;
  text-align: left;
}
#hero-search-results.open { display: block; }

/* ── 22. HOME SECTIONS ────────────────────────────────────────────── */
.section-pad { padding-block: 3rem; }
.section-pad:nth-child(odd) { background: var(--bg); }
.section-pad:nth-child(even) { background: var(--surface); }

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.why-item { text-align: center; padding: 1.5rem; }
.why-icon { font-size: 2.5rem; margin-bottom: .875rem; }
.why-item h3 { font-size: 1.0625rem; margin-bottom: .5rem; }
.why-item p { font-size: .875rem; color: var(--ink-2); }

/* ── 31. HOMEPAGE LAYOUT HELPERS ──────────────────────────────────── */
/* Why-section 2-col layout (main content + ads aside) */
.why-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 1080px) {
  .why-layout { grid-template-columns: 1fr; }
  .why-layout > aside { display: none; }
}

/* Why section heading */
.why-heading { margin-bottom: 1.5rem; }

/* Tool link card subtitle line */
.tl-sub {
  font-size: .8rem;
  color: var(--ink-2);
  margin-top: .1rem;
}

/* ── 34. HERO POLISH ──────────────────────────────────────────────── */
/* Subtle grain texture on hero for depth */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  right: -150px;
  top: -200px;
  background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
}
.hero { position: relative; overflow: hidden; }

/* ══════════════════════════════════════════════════════════════════════
   HOMEPAGE v2 — tag-filtered tool grid
   ══════════════════════════════════════════════════════════════════════ */

/* Hero pill badge */
@keyframes hero-shimmer {
  0%, 100% { background-position: -200% 0; }
  50% { background-position: 200% 0; }
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: linear-gradient(90deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,.28) 50%, rgba(255,255,255,.12) 100%);
  background-size: 200% 100%;
  animation: hero-shimmer 4s ease-in-out infinite;
  border: 1.5px solid rgba(255,255,255,.3);
  color: #fff;
  padding: .35rem 1rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Hero stats strip */
.hero-stats-bar {
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.2);
  border-radius: var(--radius-lg);
  max-width: 480px;
  margin: 1.75rem auto 0;
  overflow: hidden;
}
.hero-stat-box {
  flex: 1;
  min-width: 110px;
  padding: .9rem 1.25rem;
  border-right: 1px solid rgba(255,255,255,.15);
  text-align: center;
}
.hero-stat-box:last-child { border-right: none; }
.hero-stat-n { font-family: 'Sora', sans-serif; font-size: 1.75rem; font-weight: 700; color: #fff; line-height: 1; }
.hero-stat-l { font-size: .72rem; color: rgba(255,255,255,.7); margin-top: .25rem; font-weight: 500; }

/* Features bar (contains feat-items + latest strip) */
.feat-bar {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.feat-bar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 1.25rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
}
.feat-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem .9rem;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1.5px solid var(--border);
  transition: all .22s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.feat-item:hover {
  border-color: var(--teal);
  background: var(--teal-lt);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13,148,136,.12);
}
.feat-ico {
  width: 40px; height: 40px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--teal-lt), rgba(13,148,136,.15));
  border: 1px solid rgba(13,148,136,.2);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.feat-ttl { font-size: .85rem; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.feat-dsc { font-size: .72rem; color: var(--ink-2); margin-top: .15rem; line-height: 1.4; }

.feat-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .28rem .65rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: .775rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: all .18s;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  white-space: nowrap;
}
.feat-chip:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-lt); text-decoration: none; }

/* Variant navigation (auto-rendered by _initVariantNav) */
/* min-height prevents CLS when variant nav is injected after idle by _initVariantNav() */
.variant-nav { margin: 1.5rem 0; min-height: 80px; }
.variant-nav-title { font-size: 1.1rem; font-weight: 700; font-family: var(--font-head); margin-bottom: .75rem; color: var(--ink); }
.variant-pills { display: flex; gap: .4rem; flex-wrap: wrap; }
.variant-current { background: var(--teal) !important; border-color: var(--teal) !important; color: #fff !important; cursor: default; box-shadow: 0 2px 10px rgba(13,148,136,.25); }

/* Home page layout */
.home-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  display: grid;
  grid-template-columns: 1fr 296px;
  gap: 2.5rem;
  align-items: start;
}

/* Browse section heading */
.browse-head { margin-bottom: 1.5rem; }
.browse-title { font-size: 1.5rem; margin-bottom: .3rem; }
.browse-sub   { font-size: .875rem; color: var(--ink-2); margin: 0; }

/* Category filter pills */
.cat-pills { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: 2rem; }
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .9rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
  box-shadow: var(--shadow);
  font-family: inherit;
}
.cat-pill:hover  { border-color: var(--teal); color: var(--teal); background: var(--teal-lt); }
.cat-pill.active { background: var(--teal-dk); border-color: var(--teal-dk); color: #fff; box-shadow: 0 2px 10px rgba(13,148,136,.25); }

/* Tool sections */
.tool-section { margin-bottom: 2.5rem; }
.tool-section.hidden { display: none !important; }
.tool-sec-head {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: 1.1rem;
  padding-bottom: .75rem;
  border-bottom: 1.5px solid var(--border);
}
.tool-sec-ico {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
}
.tool-sec-title { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.tool-sec-count {
  margin-left: auto;
  font-size: .72rem;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: .15rem .55rem;
  border-radius: 999px;
}

/* Tool grid */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }

/* Homepage tool card */
.htc {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1rem;
  position: relative;
  overflow: hidden;
  transition: all .2s ease;
  box-shadow: var(--shadow);
  content-visibility: auto;
  contain-intrinsic-size: auto 90px;
}
.htc::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--htc-accent, var(--teal));
  opacity: 0;
  transition: opacity .2s;
}
.htc:hover { border-color: var(--htc-accent, var(--teal)); box-shadow: var(--shadow-lg), 0 0 0 1px var(--htc-accent, var(--teal)); transform: translateY(-3px); }
.htc:hover::before { opacity: 1; }
.htc.hidden { display: none !important; }
.htc-ico  { font-size: 1.45rem; margin-bottom: .55rem; display: block; }
.htc-name { font-size: .875rem; font-weight: 700; color: var(--ink); line-height: 1.35; margin-bottom: .3rem; }
.htc-desc { font-size: .75rem; color: var(--ink-2); line-height: 1.45; }
.htc-badge {
  position: absolute;
  top: .55rem; right: .55rem;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .15rem .45rem;
  border-radius: 999px;
}
.htc-badge.b-hot  { background: #fef2f2; color: var(--rose);  border: 1px solid #fecdd3; }
.htc-badge.b-new  { background: var(--teal-lt); color: var(--teal); border: 1px solid var(--teal); }
.htc-badge.b-uk   { background: var(--sky-lt);  color: var(--sky);  border: 1px solid #bfdbfe; }
.htc-badge.b-usa  { background: var(--amber-lt); color: var(--amber); border: 1px solid #fde68a; }
.htc-badge.b-soon { background: var(--bg); color: var(--ink-2); border: 1px solid var(--border); }

/* Coming soon stub cards */
.htc-coming { opacity: .55; filter: grayscale(.3); cursor: default; }
.htc-coming:hover { transform: none !important; box-shadow: var(--shadow) !important; border-color: var(--border) !important; }
.htc-coming:hover::before { opacity: 0 !important; }

/* Section accent (top border colour per category) */
.sec-business .htc { --htc-accent: var(--rose); }
.sec-text      .htc { --htc-accent: var(--amber); }
.sec-lifestyle .htc { --htc-accent: var(--violet); }
.sec-finance   .htc { --htc-accent: var(--sky); }
.sec-health    .htc { --htc-accent: var(--lime); }
.sec-math      .htc { --htc-accent: var(--orange); }
.sec-web       .htc { --htc-accent: var(--pink); }
.sec-date      .htc { --htc-accent: var(--teal); }
.sec-developer .htc { --htc-accent: var(--indigo); }
.sec-home      .htc { --htc-accent: var(--cyan); }
.sec-image     .htc { --htc-accent: var(--emerald); }
.sec-engineering .htc { --htc-accent: var(--slate); }

/* Section icon backgrounds */
.sec-ico-business  { background: var(--rose-lt); }
.sec-ico-text      { background: var(--amber-lt); }
.sec-ico-lifestyle { background: var(--violet-lt); }
.sec-ico-finance   { background: var(--sky-lt); }
.sec-ico-health    { background: var(--lime-lt); }
.sec-ico-math      { background: var(--orange-lt); }
.sec-ico-web       { background: var(--pink-lt); }
.sec-ico-date      { background: var(--teal-lt); }

/* Home sidebar widgets */
.home-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }
.hsw { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.hsw-head {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: .4rem;
  background: var(--bg);
}
.hsw-body { padding: 1rem; }

/* Popular tools list */
.pop-list { display: flex; flex-direction: column; gap: .45rem; }
.pop-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .75rem;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--ink);
  transition: all .18s;
  font-size: .8rem;
  font-weight: 500;
}
.pop-item:hover { background: var(--teal-lt); border-color: var(--teal); color: var(--teal); }
.pop-rank { font-weight: 700; color: var(--ink-2); font-size: .7rem; width: 16px; flex-shrink: 0; }
.pop-ico  { font-size: 1rem; }
.pop-name { flex: 1; }

/* Suggest / newsletter inputs inside home sidebar */
.suggest-form  { display: flex; flex-direction: column; gap: .55rem; }
.suggest-note  { font-size: .75rem; color: var(--ink-2); line-height: 1.6; margin-bottom: .25rem; }
.suggest-input {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem .85rem;
  font-family: inherit;
  font-size: .83rem;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.suggest-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,148,136,.1); }
.suggest-input::placeholder { color: var(--ink-2); }

/* Why TrueTools section */
.why-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3.5rem 0;
  text-align: center;
}
.why-section h2 { margin-bottom: .5rem; }
.why-sub { color: var(--ink-2); font-size: 1rem; max-width: 52ch; margin: 0 auto 0; }
.why-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
  text-align: left;
}
.why-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-top: 3px solid var(--teal);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform .25s, box-shadow .25s;
}
.why-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.why-card:nth-child(1) { border-top-color: var(--teal); }
.why-card:nth-child(2) { border-top-color: var(--rose); }
.why-card:nth-child(3) { border-top-color: var(--sky); }
.why-card:nth-child(4) { border-top-color: var(--amber); }
.why-card:nth-child(5) { border-top-color: var(--violet); }
.why-card:nth-child(6) { border-top-color: var(--lime); }
.why-card-ico { font-size: 1.75rem; margin-bottom: .7rem; }
.why-card h3  { font-size: 1rem; margin-bottom: .35rem; }
.why-card p   { font-size: .84rem; color: var(--ink-2); line-height: 1.6; margin: 0; }

/* Dark mode — homepage additions */
[data-theme="dark"] .feat-bar         { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.10); }
[data-theme="dark"] .feat-item        { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.10); }
[data-theme="dark"] .feat-item:hover  { background: rgba(20,184,166,.12); border-color: rgba(20,184,166,.3); }
[data-theme="dark"] .feat-ico         { background: rgba(20,184,166,.15); border-color: rgba(20,184,166,.25); }
[data-theme="dark"] .hsw-head         { background: rgba(255,255,255,.04); border-bottom-color: rgba(255,255,255,.08); }
[data-theme="dark"] .pop-item         { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.08); }
[data-theme="dark"] .pop-item:hover   { background: rgba(20,184,166,.14); }
[data-theme="dark"] .suggest-input    { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); }
[data-theme="dark"] .tool-sec-count   { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.08); }
[data-theme="dark"] .htc-badge.b-hot  { background: rgba(251,113,133,.14);  border-color: rgba(251,113,133,.28); }
[data-theme="dark"] .htc-badge.b-uk   { background: rgba(56,189,248,.14);   border-color: rgba(56,189,248,.28); }
[data-theme="dark"] .htc-badge.b-usa  { background: rgba(251,191,36,.13);   border-color: rgba(251,191,36,.26); }
[data-theme="dark"] .why-section      { background: rgba(255,255,255,.04); }
[data-theme="dark"] .why-card         { background: rgba(255,255,255,.06); }
[data-theme="dark"] .feat-chip        { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }

/* Responsive — homepage */
@media (max-width: 1080px) {
  .home-wrap { grid-template-columns: 1fr; }
  .home-sidebar { display: grid; grid-template-columns: 1fr 1fr; }
  .feat-bar-inner { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .home-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .feat-bar-inner { grid-template-columns: 1fr 1fr; }
  .cat-pills { gap: .3rem; }
  .cat-pill  { font-size: .75rem; padding: .35rem .7rem; }
}

/* ── Homepage sidebar inner glass ─────────────────────────────────── */
.hsw-head { background: rgba(255,255,255,.28); border-bottom-color: rgba(255,255,255,.40); }

/* ── Pop items — glass ────────────────────────────────────────────── */
.pop-item {
  background: rgba(255,255,255,.42);
  border-color: rgba(255,255,255,.58);
}
.pop-item:hover { background: rgba(13,148,136,.14); border-color: var(--teal); }

/* ── Why section — glass surface ──────────────────────────────────── */
.why-section {
  background: rgba(255,255,255,.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ── Features bar — glass surface ─────────────────────────────────── */
.feat-bar {
  background: rgba(255,255,255,.42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: rgba(255,255,255,.5);
}
.feat-item {
  background: rgba(255,255,255,.55);
  border-color: rgba(255,255,255,.6);
  box-shadow: 0 1px 4px rgba(0,0,0,.04), inset 0 1px 0 rgba(255,255,255,.5);
}

/* ── SCROLL REVEAL — CSS-driven card entrance animation ────────────── */
.htc-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .38s ease, transform .38s ease, border-color .2s, box-shadow .2s;
}
.htc-reveal.visible { opacity: 1; transform: translateY(0); }
.sec-reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .4s ease, transform .4s ease;
}
.sec-reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .htc-reveal, .sec-reveal { opacity: 1; transform: none; transition: none; }
}

