/* ─────────────────────────────────────────────────────────
   FreeAITools.dev — Directory Website
   Clean minimal, editorial grid
   Font: Plus Jakarta Sans
───────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --white:  #ffffff;
  --off:    #f8f8f7;
  --ink:    #0d0d0c;
  --ink2:   #2c2b28;
  --ink3:   #585652;
  --ink4:   #9a9890;
  --line:   #e5e3de;
  --line2:  #f0ede8;
  --green:  #16a34a;
  --font:   'Plus Jakarta Sans', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--white);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 2rem; }

/* ─── Nav ──────────────────────────────────────────────── */
.nav {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 56px;
}
.logo { font-size: 0.95rem; font-weight: 800; letter-spacing: -0.3px; }
.logo-dot { color: var(--ink4); font-weight: 400; }
.nav-links { display: flex; gap: 1.75rem; }
.nav-links a { font-size: 0.82rem; font-weight: 500; color: var(--ink3); transition: color 0.12s; }
.nav-links a:hover { color: var(--ink); }
.nav-gh {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; font-weight: 600;
  background: var(--ink); color: #fff;
  padding: 0.4rem 0.9rem; border-radius: 5px;
  transition: background 0.12s;
}
.nav-gh:hover { background: var(--ink2); }

/* ─── Ad ───────────────────────────────────────────────── */
.ad-bar {
  background: var(--off); border-bottom: 1px solid var(--line);
  text-align: center; padding: 5px;
}
.ad-mid { text-align: center; padding: 1.25rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0; }
.ad-label {
  display: inline-block; font-size: 0.62rem; color: var(--ink4);
  letter-spacing: 1px; border: 1px dashed var(--line);
  padding: 4px 18px; border-radius: 2px; text-transform: uppercase;
}

/* ─── Hero ─────────────────────────────────────────────── */
.hero {
  border-bottom: 1px solid var(--line);
  background: var(--off);
}
.hero-inner {
  max-width: 1080px; margin: 0 auto;
  padding: 4rem 2rem 3.5rem;
}
.hero-tag {
  display: inline-block;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--green);
  background: #f0fdf4; border: 1px solid #bbf7d0;
  padding: 3px 10px; border-radius: 3px;
  margin-bottom: 1.25rem;
}
.hero-inner h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800; letter-spacing: -2px; line-height: 1.05;
  color: var(--ink); max-width: 700px;
  margin-bottom: 1rem;
}
.hero-sub {
  font-size: 0.97rem; color: var(--ink3);
  max-width: 580px; line-height: 1.7;
  margin-bottom: 2rem;
}
.hero-stats { display: flex; align-items: center; gap: 1.5rem; }
.stat { display: flex; flex-direction: column; }
.stat strong { font-size: 1.5rem; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.stat span { font-size: 0.72rem; color: var(--ink4); margin-top: 1px; }
.stat-div { width: 1px; height: 28px; background: var(--line); }

/* ─── How strip ────────────────────────────────────────── */
.how-strip {
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.how-inner {
  max-width: 1080px; margin: 0 auto;
  padding: 0.9rem 2rem;
  display: flex; align-items: center; gap: 1rem;
  overflow-x: auto;
}
.how-step { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--ink3); white-space: nowrap; }
.how-n {
  width: 20px; height: 20px;
  background: var(--ink); color: #fff;
  border-radius: 50%; font-size: 0.65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.how-arrow { color: var(--ink4); font-size: 0.75rem; }

/* ─── Categories ───────────────────────────────────────── */
.categories { border-bottom: 1px solid var(--line); }
.cat-tabs {
  max-width: 1080px; margin: 0 auto;
  padding: 0 2rem;
  display: flex; gap: 0; overflow-x: auto;
}
.cat-tab {
  padding: 0.85rem 1.25rem;
  background: none; border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font);
  font-size: 0.82rem; font-weight: 600;
  color: var(--ink4); cursor: pointer;
  white-space: nowrap;
  transition: color 0.12s, border-color 0.12s;
  margin-bottom: -1px;
}
.cat-tab:hover { color: var(--ink); }
.cat-tab.active { color: var(--ink); border-bottom-color: var(--ink); }

/* ─── Tools grid ───────────────────────────────────────── */
.tools-section { padding: 2.5rem 0 1rem; }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1px;
}
.tool-card {
  background: var(--white);
  padding: 1.5rem;
  display: flex; flex-direction: column;
  gap: 0.5rem;
  transition: background 0.12s;
  cursor: pointer;
}
.tool-card:hover { background: var(--off); }

.tool-card-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 0.25rem;
}
.tool-icon { font-size: 1.4rem; line-height: 1; }
.tool-badges { display: flex; gap: 0.35rem; }
.badge {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.5px;
  padding: 2px 7px; border-radius: 3px; text-transform: uppercase;
}
.badge-cat { background: var(--line2); color: var(--ink3); border: 1px solid var(--line); }

.tool-card h3 {
  font-size: 0.95rem; font-weight: 700;
  color: var(--ink); letter-spacing: -0.2px;
}
.tool-card p {
  font-size: 0.82rem; color: var(--ink3); line-height: 1.6;
  flex: 1;
}
.tool-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 0.5rem; padding-top: 0.75rem;
  border-top: 1px solid var(--line2);
}
.tool-meta { display: flex; gap: 0.75rem; align-items: center; }
.tool-lang {
  font-size: 0.65rem; font-weight: 600;
  background: #fffbeb; color: #92400e;
  border: 1px solid #fde68a;
  padding: 1px 6px; border-radius: 3px;
}
.tool-gh-link { font-size: 0.75rem; font-weight: 600; color: var(--ink3); transition: color 0.12s; }
.tool-card:hover .tool-gh-link { color: var(--ink); }

.more-soon {
  text-align: center; padding: 1.5rem;
  font-size: 0.85rem; color: var(--ink4);
}
.more-soon a { color: var(--ink3); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ─── Why free ─────────────────────────────────────────── */
.why-section { border-top: 1px solid var(--line); background: var(--off); }
.why-section .container { padding-top: 4rem; padding-bottom: 4rem; }
.why-divider { width: 2px; height: 28px; background: var(--ink); margin-bottom: 0.5rem; }
.why-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 2px; color: var(--ink4); text-transform: uppercase; margin-bottom: 0.75rem; }
.why-section h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800;
  letter-spacing: -1px; max-width: 640px; margin-bottom: 0.75rem;
}
.why-sub { font-size: 0.92rem; color: var(--ink3); max-width: 580px; line-height: 1.7; margin-bottom: 2.5rem; }
.why-cols { display: grid; grid-template-columns: repeat(3,1fr); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.why-col { padding: 1.5rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.why-col h4 { font-size: 0.88rem; font-weight: 700; margin-bottom: 0.4rem; }
.why-col p { font-size: 0.82rem; color: var(--ink3); line-height: 1.6; }

/* ─── Footer ───────────────────────────────────────────── */
.footer { border-top: 1px solid var(--line); }
.footer-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; justify-content: space-between; gap: 3rem;
  padding: 3rem 2rem; flex-wrap: wrap;
}
.footer-logo { display: block; font-size: 0.92rem; font-weight: 800; margin-bottom: 0.35rem; }
.footer-inner > div > p { font-size: 0.78rem; color: var(--ink4); line-height: 1.5; }
.footer-nav { display: flex; gap: 3rem; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 0.45rem; min-width: 140px; }
.footer-col strong { font-size: 0.75rem; font-weight: 700; color: var(--ink2); margin-bottom: 0.2rem; }
.footer-col a { font-size: 0.78rem; color: var(--ink4); }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  max-width: 1080px; margin: 0 auto;
  padding: 0.9rem 2rem 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.72rem; color: var(--ink4);
}

/* ─── Tool page ─────────────────────────────────────────── */
.tool-page { max-width: 1080px; margin: 0 auto; padding: 3rem 2rem 4rem; display: grid; grid-template-columns: 1fr 300px; gap: 3rem; align-items: flex-start; }
.tool-page-main h1 { font-size: clamp(1.8rem,4vw,2.8rem); font-weight: 800; letter-spacing: -1.5px; margin-bottom: 0.75rem; }
.tool-page-lead { font-size: 1rem; color: var(--ink3); max-width: 600px; line-height: 1.7; margin-bottom: 2rem; border-left: 2px solid var(--ink); padding-left: 1rem; }
.tool-page-main h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.3px; margin: 2rem 0 0.75rem; }
.tool-page-main p { font-size: 0.9rem; color: var(--ink2); line-height: 1.75; margin-bottom: 0.75rem; }
.tool-page-main ul { padding-left: 1.25rem; margin-bottom: 1rem; }
.tool-page-main li { font-size: 0.88rem; color: var(--ink2); line-height: 1.7; margin-bottom: 0.3rem; }
.tool-page-main code { font-size: 0.82em; background: var(--off); border: 1px solid var(--line); padding: 2px 6px; border-radius: 3px; }
.tool-page-main pre { background: var(--ink); color: #e8e4de; border-radius: 6px; padding: 1.25rem; font-size: 0.8rem; line-height: 1.6; overflow-x: auto; margin-bottom: 1rem; }

.gh-cta { background: var(--ink); color: #fff; border-radius: 6px; padding: 1.5rem; margin: 2rem 0; }
.gh-cta h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; }
.gh-cta p { font-size: 0.83rem; color: rgba(255,255,255,0.65); margin-bottom: 1rem; }
.gh-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: #fff; color: var(--ink);
  padding: 0.6rem 1.25rem; border-radius: 5px;
  font-size: 0.85rem; font-weight: 700;
  transition: background 0.12s;
}
.gh-btn:hover { background: var(--off); }

.tool-sidebar { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-box { background: var(--off); border: 1px solid var(--line); border-radius: 6px; padding: 1.25rem; }
.sidebar-box h4 { font-size: 0.78rem; font-weight: 700; color: var(--ink3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.75rem; }
.sidebar-box ul { list-style: none; }
.sidebar-box li { font-size: 0.82rem; color: var(--ink3); padding: 0.3rem 0; border-bottom: 1px solid var(--line2); }
.sidebar-box li:last-child { border-bottom: none; }
.sidebar-box li::before { content: '✓ '; color: var(--green); font-weight: 700; }
.sidebar-ad { text-align: center; }
.ad-rect { width: 100%; height: 250px; background: var(--off); border: 1px dashed var(--line); border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 0.65rem; color: var(--ink4); letter-spacing: 1px; }
.related-tools a { display: block; font-size: 0.82rem; color: var(--ink3); padding: 0.4rem 0; border-bottom: 1px solid var(--line2); }
.related-tools a:last-child { border-bottom: none; }
.related-tools a:hover { color: var(--ink); }

.faq-list { margin-top: 0.5rem; }
.faq-q { border-top: 1px solid var(--line); padding: 1rem 0; }
.faq-q h3 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.35rem; }
.faq-q p { font-size: 0.85rem; color: var(--ink3); line-height: 1.6; }

/* ─── Responsive ───────────────────────────────────────── */
@media (max-width: 860px) {
  .tool-page { grid-template-columns: 1fr; }
  .tool-sidebar { position: static; }
  .why-cols { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hero-stats { flex-wrap: wrap; }
}
