/*
Theme Name: AI Tools Hub Phase A
Theme URI: https://example.invalid/ai-tools-hub
Author: Local Learning Build
Description: English AI directory shell and homepage layout prototype.
Version: 0.1.0
Text Domain: ai-tools-hub-phase-a
*/
:root {
  --ink: #20243a;
  --muted: #7b8094;
  --line: #e9ebf2;
  --panel: #fff;
  --canvas: #f7f8fc;
  --purple: #7358e8;
  --blue: #4d78ef;
  --sidebar-width: 220px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar-width); background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; transition: transform .22s ease; }
.brand { height: 68px; display: flex; align-items: center; gap: 10px; padding: 0 21px; border-bottom: 1px solid #f0f1f5; color: #20233b; font-size: 18px; font-weight: 700; letter-spacing: -.55px; white-space: nowrap; }
.brand b { color: #6f58df; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.sidebar-scroll { padding: 19px 11px 16px; overflow-y: auto; }
.sidebar-label { margin: 0 10px 10px; color: #9ca1b1; font-size: 10px; font-weight: 750; letter-spacing: 1.1px; }
.category-nav { display: grid; gap: 3px; }
.category-link { min-height: 37px; display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 8px; color: #51576c; font-size: 12px; font-weight: 550; }
.category-link:hover, .category-link.is-active { background: #f0edff; color: #6549d6; }
.category-icon { width: 18px; text-align: center; flex: none; color: #69748a; font-size: 16px; line-height: 1; }
.category-link.is-active .category-icon { color: #7055e7; }
.category-submenu { display: none; gap: 2px; padding: 1px 0 5px 39px; }
.category-group:hover .category-submenu, .category-group:focus-within .category-submenu, .category-group.is-open .category-submenu { display: grid; }
.category-submenu a { padding: 5px 7px; border-radius: 6px; color: #858a9b; font-size: 10px; line-height: 1.25; }
.category-submenu a:hover { color: #6549d6; background: #f5f3ff; }
.category-link.has-submenu[aria-expanded="true"] .category-chevron { transform: rotate(90deg); }
.category-name { min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category-chevron { color: #9ca1b1; font-size: 20px; line-height: 16px; }
.sidebar-note { display: flex; gap: 8px; align-items: center; margin: 22px 10px 5px; color: #9297a7; font-size: 10px; }
.note-dot { width: 7px; height: 7px; border-radius: 50%; background: #58c5a7; box-shadow: 0 0 0 3px #e5f8f1; }
.main-column { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { height: 68px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 28px; border-bottom: 1px solid rgba(230,232,240,.9); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.topbar-left, .top-navigation, .topbar-actions { display: flex; align-items: center; }
.topbar-left { gap: 21px; min-width: 0; }
.menu-toggle { width: 30px; height: 34px; padding: 8px 5px; border: 0; background: none; display: grid; align-content: center; gap: 4px; cursor: pointer; }
.menu-toggle span { width: 18px; height: 2px; border-radius: 2px; background: #666c80; }
.top-navigation { gap: clamp(12px, 2vw, 30px); white-space: nowrap; }
.top-link { color: #555b6e; font-size: 12px; font-weight: 560; }
.top-link:hover, .top-link.is-current { color: #654dd7; }
.tiny-chevron { color: #999db0; margin-left: 2px; }
.topbar-actions { gap: 12px; }
.top-icon { color: #60667c; font-size: 22px; font-weight: 400; }
.avatar { width: 29px; height: 29px; border: 1px solid #e7e8f0; border-radius: 50%; display: grid; place-items: center; color: #6b55dc; background: #f5f2ff; font-size: 11px; font-weight: 700; }
.main-content { width: min(100%, 1540px); margin: 0 auto; padding: 0 27px 45px; }
.hero { min-height: 354px; padding: 40px 20px 30px; display: flex; flex-direction: column; align-items: center; text-align: center; background: radial-gradient(ellipse at 50% 4%, rgba(127,101,245,.11), transparent 53%); }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid #e8e2ff; border-radius: 999px; color: #7057d8; background: rgba(255,255,255,.75); font-size: 9px; font-weight: 750; letter-spacing: 1.15px; }
.badge-spark { font-size: 12px; }
.hero-brand { margin-top: 12px; display: flex; align-items: center; gap: 9px; color: #252744; font-size: 26px; font-weight: 800; letter-spacing: -1px; }
.hero-mark { width: 37px; height: 37px; }
.hero h1 { margin: 10px 0 5px; color: #22243d; font-size: clamp(25px, 2.4vw, 34px); line-height: 1.13; letter-spacing: -1.2px; }
.hero-subtitle { margin: 3px 0 18px; color: #7d8193; font-size: 12px; }
.search-tabs { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 9px; }
.search-tab { position: relative; padding: 7px 13px 8px; border: 0; border-radius: 7px; color: #777c90; background: transparent; font-size: 11px; cursor: pointer; }
.search-tab.is-selected { color: #6248d1; background: #f0edff; font-weight: 700; }
.hero-search { width: min(100%, 760px); height: 49px; display: flex; align-items: center; gap: 12px; padding: 5px 6px 5px 17px; border: 1px solid #e7e7f0; border-radius: 13px; background: #fff; box-shadow: 0 8px 25px rgba(44,44,82,.08); }
.search-symbol { color: #868ba0; font-size: 23px; line-height: 1; }
.hero-search input { width: 100%; min-width: 0; height: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.hero-search input::placeholder { color: #a6aabb; }
.hero-search button { display: flex; align-items: center; justify-content: center; gap: 12px; height: 37px; padding: 0 15px; border: 0; border-radius: 9px; color: #fff; background: linear-gradient(110deg, #775ce8, #5279ee); font-size: 11px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.hero-search button b { font-size: 15px; }
.quick-searches { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 10px; color: #969aac; font-size: 10px; }
.quick-searches a { color: #73798e; }
.quick-searches a:hover { color: var(--purple); }
.portal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 5px 0 17px; }
.portal-card { min-height: 84px; display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid rgba(233,235,243,.8); border-radius: 12px; transition: transform .18s ease, box-shadow .18s ease; }
.portal-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(32,36,58,.08); }
.portal-lilac { background: #f0edff; }.portal-mint { background: #e9f7f1; }.portal-peach { background: #fff1e7; }.portal-blue { background: #eaf3ff; }
.portal-icon { width: 37px; height: 37px; flex: none; display: grid; place-items: center; border-radius: 11px; color: #7056dc; background: rgba(255,255,255,.75); font-size: 18px; }
.portal-mint .portal-icon { color: #3f9e82; }.portal-peach .portal-icon { color: #df8d56; }.portal-blue .portal-icon { color: #5279df; }
.portal-card > span:nth-child(2) { min-width: 0; flex: 1; }
.portal-card strong, .portal-card small { display: block; }
.portal-card strong { color: #33374d; font-size: 12px; font-weight: 700; }
.portal-card small { margin-top: 3px; color: #82879a; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-arrow { color: #9a9db0; font-size: 14px; }
.ad-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 20px; }
.ad-banner { min-height: 83px; position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-radius: 11px; color: #fff; }
.ad-banner-one { background: linear-gradient(105deg, #5149c7, #9a6be7 61%, #e5a4d8); }
.ad-banner-two { background: linear-gradient(105deg, #267e9a, #39b1a9 58%, #9bcf9d); }
.ad-banner::after { content: ""; position: absolute; z-index: -1; width: 155px; height: 155px; right: 90px; top: -92px; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; box-shadow: 0 0 0 16px rgba(255,255,255,.07), 0 0 0 32px rgba(255,255,255,.05); }
.ad-label { position: absolute; top: 8px; left: 12px; padding: 2px 5px; border-radius: 4px; color: rgba(255,255,255,.87); background: rgba(27,25,71,.22); font-size: 7px; font-weight: 800; letter-spacing: .7px; }
.ad-art { width: 38px; height: 38px; flex: none; margin-top: 8px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.4); border-radius: 12px; background: rgba(255,255,255,.16); font-size: 21px; }
.ad-copy { min-width: 0; flex: 1; margin-top: 8px; }
.ad-copy strong, .ad-copy small { display: block; }
.ad-copy strong { font-size: 13px; }.ad-copy small { margin-top: 2px; color: rgba(255,255,255,.8); font-size: 9px; }
.ad-cta { margin-top: 8px; padding: 6px 9px; border: 1px solid rgba(255,255,255,.45); border-radius: 7px; font-size: 9px; white-space: nowrap; }
.tool-section, .category-preview { padding: 19px 0 22px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.section-heading h2, .category-section-heading h2 { margin: 6px 0 1px; color: #2d3045; font-size: 18px; line-height: 1.2; letter-spacing: -.4px; }
.section-heading p, .category-section-heading p { margin: 3px 0 0; color: #9296a7; font-size: 10px; }
.section-pill { display: inline-flex; gap: 5px; align-items: center; padding: 4px 8px; border-radius: 999px; color: #694fd8; background: #efecff; font-size: 8px; font-weight: 800; letter-spacing: .45px; }
.flame { color: #e77869; }.section-pill-blue { color: #4874d8; background: #eaf1ff; }
.view-more { flex: none; margin-bottom: 2px; color: #73798c; font-size: 10px; }.view-more span { padding-left: 4px; color: #6e55dc; }
.card-skeleton-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 9px; }
.card-skeleton { min-width: 0; height: 57px; display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid #eceef4; border-radius: 9px; background: #fff; }
.card-skeleton i { width: 29px; height: 29px; flex: none; border-radius: 9px; background: linear-gradient(140deg, #eeebff, #e8f2ff); }
.skeleton-lines { min-width: 0; flex: 1; display: grid; gap: 7px; }
.skeleton-lines b, .skeleton-lines em { display: block; height: 6px; border-radius: 8px; background: #e9ebf2; }
.skeleton-lines b { width: 65%; }.skeleton-lines em { width: 92%; height: 4px; background: #f0f1f5; }
.latest-section { padding-top: 15px; }
.category-section-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
.category-title-icon { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid #eae5ff; border-radius: 10px; color: #7159dc; background: #f2efff; font-size: 17px; }
.category-section-heading > div:nth-child(2) { flex: 1; }.category-section-heading h2 { margin: 0; }.category-section-heading p { margin-top: 2px; }
.more-categories { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; padding: 18px 0 30px; border-top: 1px solid var(--line); }
.category-chip { display: flex; align-items: center; gap: 9px; min-height: 43px; padding: 9px 11px; border: 1px solid #eceef4; border-radius: 8px; background: #fff; color: #62687d; font-size: 10px; }
.category-chip span { color: #725be0; font-size: 15px; }.category-chip b { margin-left: auto; color: #a3a6b4; font-size: 13px; }
.site-footer { padding: 25px 0 18px; border-top: 1px solid var(--line); color: #9296a6; text-align: center; }
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 7px; color: #454a60; font-size: 13px; font-weight: 750; }
.footer-mark { color: #775de7; font-size: 16px; }.site-footer p { margin: 6px 0 11px; font-size: 10px; }
.site-footer nav { display: flex; justify-content: center; gap: 18px; margin-bottom: 14px; font-size: 9px; }.site-footer small { font-size: 9px; }
.fallback-content { min-height: 400px; padding-top: 50px; }
@media (max-width: 1250px) {
  .topbar { padding-right: 19px; padding-left: 18px; }.topbar-left { gap: 13px; }.top-navigation { gap: 15px; }.top-link { font-size: 11px; }
  .main-content { padding-right: 19px; padding-left: 19px; }.card-skeleton-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width: 950px) {
  :root { --sidebar-width: 0px; }.sidebar { width: 245px; transform: translateX(-100%); box-shadow: 14px 0 35px rgba(30,35,65,.12); }
  .sidebar.is-open { transform: translateX(0); }.main-column { margin-left: 0; }.top-navigation { gap: 16px; overflow-x: auto; scrollbar-width: none; }.top-navigation::-webkit-scrollbar { display:none; }
  .topbar { padding: 0 18px; }.portal-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.card-skeleton-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .topbar { height: 58px; padding: 0 13px; gap: 8px; }.topbar-left { gap: 10px; }.menu-toggle { width: 27px; }.top-navigation { display: none; }.topbar-actions { margin-left: auto; }
  .topbar::before { content: "AI Tools Hub"; position: absolute; left: 53px; color: #292d43; font-size: 15px; font-weight: 750; letter-spacing: -.45px; }
  .top-icon { font-size: 21px; }.avatar { width: 27px; height: 27px; }
  .main-content { padding: 0 13px 30px; }.hero { min-height: 0; padding: 26px 0 19px; }
  .hero-badge { padding: 4px 9px; font-size: 8px; }.hero-brand { margin-top: 10px; font-size: 22px; }.hero-mark { width: 31px; height: 31px; }
  .hero h1 { margin-top: 12px; font-size: 27px; letter-spacing: -.9px; }.desktop-break { display: none; }.hero-subtitle { max-width: 300px; margin: 7px 0 14px; font-size: 11px; }
  .search-tabs { width: 100%; gap: 1px; margin-bottom: 8px; }.search-tab { padding: 7px 10px; font-size: 10px; }
  .hero-search { height: 47px; gap: 8px; padding-left: 12px; border-radius: 11px; }.hero-search input { font-size: 11px; }.hero-search button { width: 38px; flex: none; padding: 0; }.hero-search button span { display:none; }.hero-search button b { font-size: 17px; }
  .quick-searches { flex-wrap: wrap; gap: 7px 10px; margin-top: 9px; font-size: 9px; }
  .portal-grid { gap: 8px; margin: 3px 0 13px; }.portal-card { min-height: 70px; gap: 8px; padding: 9px; border-radius: 9px; }.portal-icon { width: 29px; height: 29px; border-radius: 8px; font-size: 15px; }.portal-card strong { font-size: 10px; }.portal-card small { font-size: 8px; }.portal-arrow { display:none; }
  .ad-grid { grid-template-columns: 1fr; gap: 8px; margin-bottom: 13px; }.ad-banner { min-height: 72px; padding: 11px 12px; gap: 10px; }.ad-art { width: 31px; height: 31px; font-size: 17px; }.ad-copy strong { font-size: 11px; }.ad-copy small { font-size: 8px; }.ad-cta { padding: 5px 7px; font-size: 8px; }
  .tool-section, .category-preview { padding: 15px 0 17px; }.section-heading h2, .category-section-heading h2 { font-size: 16px; }.section-heading p, .category-section-heading p { font-size: 9px; }.card-skeleton-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }.card-skeleton { height: 52px; gap: 7px; padding: 7px; }.card-skeleton i { width: 25px; height: 25px; }
  .more-categories { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; padding-top: 14px; }.category-chip { min-height: 39px; gap: 6px; padding: 8px; font-size: 9px; }.category-title-icon { width: 31px; height: 31px; }.site-footer { padding-top: 19px; }.site-footer nav { gap: 13px; }
}

/* Desktop homepage rhythm: compact search hero, editorial preview tiles, slim banners. */
@media (min-width: 951px) {
  body.home .hero { min-height: 0; padding: 12px 20px 14px; }
  body.home .hero-brand { margin-top: 20px; }
  body.home .hero h1 { margin: 5px 0 2px; font-size: 22px; line-height: 1.2; letter-spacing: -.5px; }
  body.home .desktop-break { display: none; }
  body.home .hero-subtitle { margin: 2px 0 8px; }
  body.home .hero-search { width: min(100%, 800px); }
  body.home .portal-grid { margin: 5px 0 24px; }
  body.home .portal-card {
    position: relative;
    min-height: 204px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: 38px 1fr;
    align-items: center;
    gap: 10px;
    padding: 13px;
    overflow: hidden;
  }
  body.home .portal-card > span:nth-child(2) { grid-column: 2; grid-row: 1; }
  body.home .portal-card strong { padding-right: 12px; }
  body.home .portal-arrow { position: absolute; top: 10px; right: 12px; }
  body.home .portal-card::after {
    content: "";
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: stretch;
    min-height: 126px;
    border: 1px solid rgba(255,255,255,.82);
    border-radius: 9px;
    background-color: rgba(255,255,255,.74);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  }
  body.home .portal-lilac::after {
    background:
      linear-gradient(140deg,#d9d7ff,#b9c7ff) 10px 10px / 38% calc(100% - 20px) no-repeat,
      linear-gradient(#9298bd,#9298bd) right 12px top 18px / 38% 7px no-repeat,
      linear-gradient(#c1c5d9,#c1c5d9) right 12px top 35px / 48% 4px no-repeat,
      linear-gradient(#d4d7e5,#d4d7e5) right 12px top 47px / 42% 4px no-repeat,
      linear-gradient(#ececff,#f7f8ff);
  }
  body.home .portal-mint::after {
    background:
      radial-gradient(circle at 22% 48%,#7fcab3 0 13px,transparent 14px),
      radial-gradient(circle at 42% 48%,#a6d8c8 0 13px,transparent 14px),
      radial-gradient(circle at 62% 48%,#75bdaa 0 13px,transparent 14px),
      linear-gradient(#d9eee7,#d9eee7) 18% 78% / 68% 5px no-repeat,
      linear-gradient(#eff9f5,#f8fcfa);
  }
  body.home .portal-peach::after {
    background:
      linear-gradient(145deg,#ffd9bd,#ffb988) 10px 10px / 34% calc(100% - 20px) no-repeat,
      linear-gradient(140deg,#f1e6ff,#d4cbff) 50% 10px / 25% calc(100% - 20px) no-repeat,
      linear-gradient(90deg,#ecedf5,#ecedf5) right 10px top 22px / 16% 6px no-repeat,
      linear-gradient(#fff7f0,#fffdfb);
  }
  body.home .portal-blue::after {
    background:
      linear-gradient(135deg,#c8dcff,#9cbaff) 10px 13px / 27px 27px no-repeat,
      linear-gradient(135deg,#d6f0e8,#9ad6c5) 10px 52px / 27px 27px no-repeat,
      linear-gradient(#9ca4be,#9ca4be) 49px 20px / 43% 6px no-repeat,
      linear-gradient(#d0d4e1,#d0d4e1) 49px 34px / 54% 4px no-repeat,
      linear-gradient(#9ca4be,#9ca4be) 49px 60px / 38% 6px no-repeat,
      linear-gradient(#d0d4e1,#d0d4e1) 49px 74px / 48% 4px no-repeat,
      linear-gradient(#f0f5ff,#fbfcff);
  }
  body.home .ad-grid { margin-bottom: 46px; }
  body.home .promo-placement { min-height: 52px; padding: 8px 14px; }
  body.home .promo-art, body.home .promo-copy, body.home .promo-cta { margin-top: 0; }
  body.home .promo-art { width: 32px; height: 32px; border-radius: 9px; font-size: 17px; }
  body.home .promo-label { display: none; }
}

