/* ============================================================
   AIToolPilot — Main Stylesheet
   ============================================================ */

/* --- Reset & Base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand-primary: #6a11cb;
  --brand-secondary: #2575fc;
  --brand-accent: #ff6b35;
  --text-dark: #1a1a2e;
  --text-body: #444;
  --text-muted: #777;
  --bg-light: #f8f9ff;
  --bg-white: #fff;
  --border: #e2e8f0;
  --success: #22c55e;
  --error: #ef4444;
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --transition: .2s ease;
  --max-width: 860px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-body);
  background: var(--bg-light);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-primary); }
a:focus-visible { outline: 3px solid var(--brand-secondary); outline-offset: 2px; border-radius: 3px; }

/* --- Skip Link -------------------------------------------- */
.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--brand-primary); color: #fff;
  padding: .5rem 1rem; z-index: 9999;
  transition: top var(--transition);
}
.skip-link:focus { top: 0; }

/* --- Header / Nav ----------------------------------------- */
header {
  background: var(--bg-white);
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 1000;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--brand-primary);
  text-decoration: none;
  white-space: nowrap;
}
.nav-logo:hover { color: var(--brand-secondary); }

nav ul {
  display: flex;
  list-style: none;
  gap: .25rem;
  flex-wrap: wrap;
}

nav ul li a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 600;
  font-size: .9rem;
  padding: .4rem .75rem;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}
nav ul li a:hover { background: var(--bg-light); color: var(--brand-primary); }
nav ul li a:focus-visible { outline: 3px solid var(--brand-secondary); }

.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: .4rem; color: var(--text-dark);
}

/* --- Buttons --------------------------------------------- */
.cta-button {
  display: inline-block;
  background: var(--bg-white);
  color: var(--brand-primary);
  padding: .7rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  font-size: .95rem;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.cta-button:hover { background: #f0e8ff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.cta-button:focus-visible { outline: 3px solid var(--brand-secondary); outline-offset: 2px; }
.cta-button:active { transform: translateY(0); }

.cta-button.secondary {
  background: transparent;
  color: #fff;
  border-color: #fff;
}
.cta-button.secondary:hover { background: rgba(255,255,255,.15); }

.try-button {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: #fff;
  border: none;
  padding: .85rem 2rem;
  font-size: 1rem;
  margin-top: 1.5rem;
}
.try-button:hover { background: linear-gradient(135deg, #5a0db5, #1a65ec); color: #fff; }

.affiliate-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: linear-gradient(135deg, var(--brand-accent), #e85d04);
  color: #fff;
  padding: .85rem 2rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  transition: filter var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.affiliate-btn:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,107,53,.35); color: #fff; }
.affiliate-btn:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 2px; }
.affiliate-btn .affiliate-badge {
  font-size: .7rem;
  background: rgba(255,255,255,.25);
  padding: .1rem .4rem;
  border-radius: 4px;
  font-weight: 600;
}

/* --- Hero ------------------------------------------------- */
.hero {
  text-align: center;
  padding: 5rem 1.5rem 4rem;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  color: #fff;
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; margin-bottom: 1rem; line-height: 1.2; }
.subheadline { font-size: clamp(1rem, 2vw, 1.2rem); margin-bottom: 2rem; opacity: .9; max-width: 640px; margin-left: auto; margin-right: auto; }
.hero-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-bottom: 2.5rem; }
.hero-bullets { text-align: left; max-width: 560px; margin: 0 auto; list-style: none; }
.hero-bullets li { margin-bottom: .75rem; display: flex; align-items: flex-start; gap: .5rem; font-size: .95rem; }
.hero-bullets li strong { color: #ffeb3b; }

/* --- Section Wrapper -------------------------------------- */
.section-wrap {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 2.5rem 2rem;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.section-wrap h2 { text-align: center; margin-bottom: 1.75rem; font-size: 1.5rem; color: var(--text-dark); }

/* --- How It Works ----------------------------------------- */
.how-it-works { max-width: var(--max-width); margin: 2rem auto; padding: 2.5rem 2rem; background: var(--bg-white); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.how-it-works h2 { text-align: center; margin-bottom: 2rem; font-size: 1.5rem; color: var(--text-dark); }
.how-it-works ol { counter-reset: step; list-style: none; }
.how-it-works li { counter-increment: step; margin-bottom: 1.75rem; display: flex; align-items: flex-start; gap: 1rem; }
.how-it-works li::before {
  content: counter(step);
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: #fff; min-width: 2.2rem; height: 2.2rem;
  line-height: 2.2rem; border-radius: 50%;
  text-align: center; font-weight: 700; font-size: .9rem; flex-shrink: 0;
}
.how-it-works h3 { margin-bottom: .3rem; color: var(--text-dark); font-size: 1.05rem; }

/* --- Starter Stack ---------------------------------------- */
.starter-stack { max-width: var(--max-width); margin: 2rem auto; padding: 2.5rem 2rem; background: var(--bg-white); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.starter-stack h2, .starter-stack h3 { text-align: center; margin-bottom: 1.5rem; color: var(--text-dark); }
.starter-stack h2 { font-size: 1.5rem; }
.starter-stack h3 { font-size: 1.1rem; color: var(--text-muted); margin-top: -.75rem; }
.stack-items { list-style: none; }
.stack-items li { margin-bottom: 1rem; padding: 1rem 1.25rem; border-left: 4px solid var(--brand-primary); background: #f9f8ff; border-radius: 0 var(--radius) var(--radius) 0; }
.stack-items h4 { margin-bottom: .25rem; font-size: 1rem; }
.stack-items h4 a { color: var(--brand-primary); text-decoration: none; font-weight: 700; }
.stack-items h4 a:hover { text-decoration: underline; }

/* --- Audience --------------------------------------------- */
.audience { max-width: var(--max-width); margin: 2rem auto; padding: 2.5rem 2rem; background: var(--bg-white); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.audience h2 { text-align: center; margin-bottom: 1.5rem; font-size: 1.5rem; color: var(--text-dark); }
.audience-list { list-style: none; text-align: center; }
.audience-list li { display: inline-block; background: #ede9fe; color: var(--brand-primary); padding: .6rem 1.25rem; margin: .35rem; border-radius: 20px; font-size: .9rem; font-weight: 600; }

/* --- Newsletter ------------------------------------------- */
.newsletter {
  text-align: center;
  padding: 4rem 1.5rem;
  background: linear-gradient(135deg, #ff9a9e, #fad0c4);
  color: var(--text-dark);
}
.newsletter h2 { margin-bottom: .75rem; font-size: 1.6rem; }
.newsletter-copy { margin: 0 auto 2rem; max-width: 560px; font-size: 1rem; }
.newsletter-form { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.newsletter-form input[type="email"] {
  padding: .75rem 1rem; width: 280px; max-width: 100%;
  border: 2px solid rgba(0,0,0,.15); border-radius: var(--radius);
  font-size: 1rem; background: #fff;
  transition: border-color var(--transition);
}
.newsletter-form input[type="email"]:focus { outline: none; border-color: var(--brand-primary); }
.newsletter-form button {
  padding: .75rem 1.5rem;
  background: var(--text-dark); color: #fff;
  border: none; border-radius: var(--radius);
  cursor: pointer; font-weight: 700; font-size: 1rem;
  transition: background var(--transition), transform var(--transition);
}
.newsletter-form button:hover { background: #333; transform: translateY(-1px); }
.newsletter-form button:focus-visible { outline: 3px solid var(--brand-primary); outline-offset: 2px; }
.newsletter-msg { margin-top: 1rem; font-weight: 600; font-size: .95rem; min-height: 1.4em; }
.newsletter-msg.success { color: #166534; }
.newsletter-msg.error { color: #991b1b; }

/* --- Footer ----------------------------------------------- */
footer {
  background: var(--text-dark);
  color: #ccc;
  padding: 3rem 1.5rem 1.5rem;
  font-size: .9rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: .75rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .4rem; }
.footer-col ul li a { color: #aaa; text-decoration: none; transition: color var(--transition); }
.footer-col ul li a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #333; padding-top: 1.25rem; text-align: center; color: #777; font-size: .85rem; }
.footer-bottom a { color: #999; text-decoration: none; }
.footer-bottom a:hover { color: #fff; }

/* ============================================================
   REVIEW PAGES
   ============================================================ */

.review-header {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 2.5rem 2rem;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.review-header h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); color: var(--text-dark); margin-bottom: .5rem; }
.review-subtitle { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 1rem; }
.review-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem 1.5rem; margin-bottom: .5rem; }
.review-meta span { font-size: .95rem; font-weight: 600; }
.rating { color: #d97706; }
.price { color: var(--brand-primary); }
.best-for { color: var(--text-muted); }

.review-content {
  max-width: var(--max-width);
  margin: 0 auto 2rem;
  padding: 2.5rem 2rem;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.review-content h2 {
  font-size: 1.35rem; color: var(--text-dark);
  margin: 2rem 0 .75rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--bg-light);
}
.review-content h2:first-child { margin-top: 0; }
.review-content p { margin-bottom: 1rem; }
.review-content ul, .review-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.review-content li { margin-bottom: .4rem; }

.feature-list { list-style: none; padding: 0; }
.feature-list li { padding: .6rem .75rem; border-left: 3px solid var(--brand-primary); background: #f9f8ff; margin-bottom: .5rem; border-radius: 0 var(--radius) var(--radius) 0; }

.pricing-table { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 1rem 0 1.5rem; }
.pricing-tier {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.pricing-tier:hover { border-color: var(--brand-primary); box-shadow: var(--shadow-md); }
.pricing-tier.featured { border-color: var(--brand-primary); background: #f9f8ff; }
.pricing-tier h3 { font-size: 1rem; color: var(--text-dark); margin-bottom: .5rem; }
.pricing-tier .price { font-size: 1.3rem; font-weight: 800; color: var(--brand-primary); margin-bottom: .75rem; }
.pricing-tier ul { list-style: none; padding: 0; text-align: left; font-size: .9rem; }
.pricing-tier ul li { padding: .3rem 0; border-bottom: 1px solid var(--border); }
.pricing-tier ul li:last-child { border-bottom: none; }
.pricing-tier ul li::before { content: "✓ "; color: var(--success); font-weight: 700; }

.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
.pros, .cons { padding: 1.25rem; border-radius: var(--radius); }
.pros { background: #f0fdf4; border: 1px solid #bbf7d0; }
.cons { background: #fef2f2; border: 1px solid #fecaca; }
.pros h3 { color: #166534; margin-bottom: .75rem; font-size: 1rem; }
.cons h3 { color: #991b1b; margin-bottom: .75rem; font-size: 1rem; }
.pros ul, .cons ul { list-style: none; padding: 0; }
.pros ul li { padding: .3rem 0; font-size: .9rem; }
.pros ul li::before { content: "✓ "; color: var(--success); font-weight: 700; }
.cons ul li { padding: .3rem 0; font-size: .9rem; }
.cons ul li::before { content: "✗ "; color: var(--error); font-weight: 700; }

.verdict-box {
  background: linear-gradient(135deg, #f9f8ff, #ede9fe);
  border: 2px solid var(--brand-primary);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
}
.verdict-box .verdict-score { font-size: 2.5rem; font-weight: 800; color: var(--brand-primary); }
.verdict-box .verdict-label { font-size: .85rem; color: var(--text-muted); margin-bottom: .5rem; }
.verdict-box p { font-size: .95rem; }

.related-posts { max-width: var(--max-width); margin: 0 auto 2rem; padding: 2rem; background: var(--bg-white); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.related-posts h2 { font-size: 1.2rem; color: var(--text-dark); margin-bottom: 1rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.related-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; text-decoration: none; color: var(--text-body); transition: box-shadow var(--transition), border-color var(--transition); display: block; }
.related-card:hover { box-shadow: var(--shadow-md); border-color: var(--brand-primary); color: var(--text-body); }
.related-card h3 { font-size: .95rem; color: var(--text-dark); margin-bottom: .3rem; }
.related-card p { font-size: .85rem; color: var(--text-muted); }

/* ============================================================
   BLOG PAGES
   ============================================================ */

.blog-hero { text-align: center; padding: 3.5rem 1.5rem 2.5rem; background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary)); color: #fff; }
.blog-hero h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: .5rem; }
.blog-hero p { opacity: .9; max-width: 560px; margin: 0 auto; }

.blog-grid { max-width: 1100px; margin: 2rem auto; padding: 0 1.5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.blog-card { background: var(--bg-white); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow var(--transition), transform var(--transition); display: flex; flex-direction: column; }
.blog-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.blog-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.blog-card-meta { font-size: .8rem; color: var(--text-muted); margin-bottom: .5rem; display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.blog-card-meta .tag { background: #ede9fe; color: var(--brand-primary); padding: .15rem .5rem; border-radius: 4px; font-weight: 600; }
.blog-card h2 { font-size: 1.1rem; color: var(--text-dark); margin-bottom: .5rem; line-height: 1.4; }
.blog-card p { font-size: .9rem; color: var(--text-muted); flex: 1; margin-bottom: 1rem; }
.blog-card a.read-more { font-size: .9rem; font-weight: 700; color: var(--brand-primary); text-decoration: none; }
.blog-card a.read-more:hover { text-decoration: underline; }

.post-header { max-width: var(--max-width); margin: 2rem auto; padding: 2.5rem 2rem; background: var(--bg-white); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.post-header h1 { font-size: clamp(1.5rem, 3vw, 2rem); color: var(--text-dark); margin-bottom: .75rem; line-height: 1.3; }
.post-meta { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .85rem; color: var(--text-muted); margin-bottom: 1rem; align-items: center; }
.post-meta .tag { background: #ede9fe; color: var(--brand-primary); padding: .15rem .5rem; border-radius: 4px; font-weight: 600; }
.reading-time { display: inline-flex; align-items: center; gap: .3rem; }

.post-body { max-width: var(--max-width); margin: 0 auto 2rem; padding: 2.5rem 2rem; background: var(--bg-white); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.post-body h2 { font-size: 1.3rem; color: var(--text-dark); margin: 2rem 0 .75rem; padding-bottom: .4rem; border-bottom: 2px solid var(--bg-light); }
.post-body h3 { font-size: 1.1rem; color: var(--text-dark); margin: 1.5rem 0 .5rem; }
.post-body p { margin-bottom: 1.1rem; }
.post-body ul, .post-body ol { padding-left: 1.5rem; margin-bottom: 1.1rem; }
.post-body li { margin-bottom: .4rem; }
.post-body blockquote { border-left: 4px solid var(--brand-primary); padding: .75rem 1.25rem; background: #f9f8ff; margin: 1.5rem 0; border-radius: 0 var(--radius) var(--radius) 0; font-style: italic; color: var(--text-muted); }
.post-body a { color: var(--brand-primary); }
.post-body a:hover { text-decoration: underline; }

/* ============================================================
   STATIC PAGES
   ============================================================ */

.page-hero { text-align: center; padding: 3rem 1.5rem 2rem; background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary)); color: #fff; }
.page-hero h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.page-content { max-width: 760px; margin: 2rem auto 3rem; padding: 2.5rem 2rem; background: var(--bg-white); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.page-content h2 { font-size: 1.25rem; color: var(--text-dark); margin: 2rem 0 .75rem; }
.page-content h2:first-child { margin-top: 0; }
.page-content p { margin-bottom: 1rem; }
.page-content ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.page-content li { margin-bottom: .4rem; }
.page-content a { color: var(--brand-primary); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  nav ul { display: none; flex-direction: column; width: 100%; padding: .5rem 0 1rem; }
  nav ul.open { display: flex; }
  nav ul li a { display: block; padding: .6rem 1rem; }

  .hero { padding: 3.5rem 1rem 3rem; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .cta-button { width: 220px; text-align: center; }

  .pros-cons { grid-template-columns: 1fr; }
  .pricing-table { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }

  .section-wrap, .how-it-works, .starter-stack, .audience,
  .review-header, .review-content, .related-posts,
  .post-header, .post-body, .page-content { padding: 1.5rem 1rem; }

  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
  .review-meta { flex-direction: column; align-items: center; gap: .4rem; }
  .newsletter-form input[type="email"] { width: 100%; }
  .newsletter-form button { width: 100%; }
}
