/* =========================================================
   NineClip Tools — Page-specific styles
   Homepage hero, sections, layouts, tool page layout
   ========================================================= */

/* ============== HERO ============== */
.hero {
  position: relative;
  padding: var(--space-20) 0 var(--space-16);
  background: var(--bg-base);
  overflow: hidden;
}
.hero::before { content: ""; position: absolute; inset: 0; background: var(--grad-hero); z-index: 0; }
.hero > .container { position: relative; z-index: 1; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-12);
  align-items: center;
}
.hero h1 {
  font-size: clamp(var(--fs-3xl), 6vw, var(--fs-5xl));
  font-weight: var(--fw-extrabold);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: var(--space-6);
}
.hero h1 .highlight {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  display: inline-block;
}
.hero h1 .highlight::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 8px;
  background: var(--grad-accent); opacity: 0.25; border-radius: var(--radius-full);
}
.hero .lead {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: var(--space-8);
  line-height: var(--lh-loose);
}
.hero-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4);
  margin-top: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-subtle);
}
.hero-stats .stat-value { font-size: var(--fs-2xl); }
.hero-stats .stat-label { font-size: var(--fs-xs); }

/* Hero animation: floating tool icons */
.hero-visual {
  position: relative;
  height: 460px;
  display: grid; place-items: center;
}
.float-icon {
  position: absolute;
  width: 84px; height: 84px;
  display: grid; place-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  color: var(--color-primary-600);
  animation: float-soft 6s ease-in-out infinite;
}
.float-icon svg { width: 38px; height: 38px; }
.float-icon.pdf  { top: 8%; left: 18%; color: var(--cat-pdf); background: rgba(220, 38, 38, .06); animation-delay: 0s; }
.float-icon.jpg  { top: 22%; right: 12%; color: var(--cat-image); background: rgba(37, 99, 235, .06); animation-delay: 0.8s; }
.float-icon.zip  { top: 48%; left: 6%; color: var(--cat-utility); background: rgba(20, 184, 166, .06); animation-delay: 1.4s; }
.float-icon.docx { top: 56%; right: 22%; color: var(--cat-document); background: rgba(124, 58, 237, .06); animation-delay: 2s; }
.float-icon.ai   { bottom: 10%; left: 30%; color: var(--cat-ai); background: rgba(6, 182, 212, .06); animation-delay: 2.6s; }
.float-icon.code { bottom: 18%; right: 8%; color: var(--cat-developer); background: rgba(249, 115, 22, .06); animation-delay: 3.2s; }
.float-icon-center {
  width: 130px; height: 130px;
  background: var(--grad-primary);
  color: #fff;
  font-size: var(--fs-xl); font-weight: var(--fw-extrabold);
  box-shadow: 0 20px 50px rgba(37, 99, 235, 0.35);
  position: relative; z-index: 2;
}
.float-icon-center::before {
  content: ""; position: absolute; inset: -8px;
  border-radius: inherit;
  background: var(--grad-primary);
  opacity: 0.2;
  filter: blur(20px);
  z-index: -1;
  animation: pulse-glow 3s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.08); }
}
@keyframes float-soft {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-14px) rotate(2deg); }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { height: 340px; order: -1; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .float-icon { width: 60px; height: 60px; }
  .float-icon svg { width: 28px; height: 28px; }
  .float-icon-center { width: 100px; height: 100px; font-size: var(--fs-lg); }
}

/* ============== SECTION HEADER ============== */
.section-header {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4);
  margin-bottom: var(--space-8);
}
.section-header .section-title { display: flex; flex-direction: column; gap: var(--space-2); }
.section-header h2 { font-size: var(--fs-2xl); margin: 0; }
.section-header .subtitle { color: var(--text-tertiary); font-size: var(--fs-md); }
.section-header .see-all {
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: var(--color-primary-600);
  display: inline-flex; align-items: center; gap: 4px;
  flex-shrink: 0;
}
.section-header .see-all:hover { color: var(--color-primary-700); }
.section-header .see-all svg { width: 14px; height: 14px; }

/* ============== CATEGORY SECTION ============== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-5);
}

/* ============== HOMEPAGE CONTENT SECTIONS ============== */
.content-strip { padding-block: var(--space-12); }
.content-strip + .content-strip { padding-top: 0; }

/* ============== TOOL PAGE LAYOUT ============== */
.tool-page { padding-top: var(--space-6); }
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-8);
  align-items: start;
}
.tool-main { min-width: 0; }
.tool-sidebar { position: sticky; top: calc(var(--header-h) + var(--space-4)); }
@media (max-width: 1024px) {
  .tool-layout { grid-template-columns: 1fr; }
  .tool-sidebar { position: static; }
}

.tool-header {
  display: flex; align-items: center; gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.tool-header .tool-icon-lg {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  background: var(--grad-primary);
  color: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.30);
  flex-shrink: 0;
}
.tool-header .tool-icon-lg svg { width: 32px; height: 32px; }
.tool-header h1 {
  font-size: var(--fs-3xl); margin: 0 0 4px 0;
  letter-spacing: -0.02em;
}
.tool-header .tool-meta {
  display: flex; gap: var(--space-2); flex-wrap: wrap;
  font-size: var(--fs-sm); color: var(--text-tertiary);
}

.tool-interface {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-8);
}
.tool-interface .tool-result {
  margin-top: var(--space-6);
  padding: var(--space-5);
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  display: none;
}
.tool-interface .tool-result.show { display: block; animation: fade-in var(--dur-base) var(--ease-out); }
.tool-interface .tool-actions {
  display: flex; gap: var(--space-3); flex-wrap: wrap;
  margin-top: var(--space-6);
}

/* GEO sections */
.geo-section {
  padding: var(--space-8) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.geo-section:last-child { border-bottom: none; }
.geo-section h2 {
  font-size: var(--fs-xl);
  margin-bottom: var(--space-4);
  display: flex; align-items: center; gap: var(--space-3);
}
.geo-section h2 .section-num {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--color-primary-50); color: var(--color-primary-600);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm); font-weight: var(--fw-bold);
}
.geo-section h3 { font-size: var(--fs-md); margin-top: var(--space-6); margin-bottom: var(--space-3); }

.tldr-box, .key-takeaways-box {
  background: var(--grad-primary-soft);
  border: 1px solid var(--color-primary-100);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.tldr-box ul, .key-takeaways-box ul { margin: 0; padding-left: 1.2em; }
.tldr-box li, .key-takeaways-box li { padding: var(--space-1) 0; }

.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width: 640px) { .pros-cons { grid-template-columns: 1fr; } }
.pros-cons .col {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}
.pros-cons .col.pros { border-top: 3px solid var(--color-success); }
.pros-cons .col.cons { border-top: 3px solid var(--color-danger); }
.pros-cons h4 { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); font-size: var(--fs-md); }
.pros-cons ul { margin: 0; padding-left: 1.2em; }
.pros-cons li { padding: var(--space-1) 0; font-size: var(--fs-sm); color: var(--text-secondary); }

/* Related tools strip */
.related-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3);
}
.related-strip .related-card {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none; color: inherit;
  transition: all var(--dur-fast) var(--ease-out);
}
.related-strip .related-card:hover { background: var(--bg-soft); border-color: var(--color-primary-300); transform: translateX(2px); }
.related-strip .related-card .icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--color-primary-50); color: var(--color-primary-600);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.related-strip .related-card .icon svg { width: 16px; height: 16px; }
.related-strip .related-card .name { font-size: var(--fs-sm); font-weight: var(--fw-medium); }

/* ============== CATEGORY PAGE ============== */
.category-hero {
  padding: var(--space-12) 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}
.category-hero .cat-icon-lg {
  width: 80px; height: 80px;
  display: grid; place-items: center;
  background: var(--grad-primary);
  color: #fff;
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-5);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.30);
}
.category-hero .cat-icon-lg svg { width: 40px; height: 40px; }
.category-hero h1 { font-size: var(--fs-3xl); margin-bottom: var(--space-3); }
.category-hero p { font-size: var(--fs-md); color: var(--text-secondary); max-width: 720px; }

.category-filters {
  display: flex; gap: var(--space-2); flex-wrap: wrap;
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.filter-chip {
  padding: var(--space-2) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
  font-size: var(--fs-sm); font-weight: var(--fw-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.filter-chip:hover { background: var(--bg-soft); }
.filter-chip.active { background: var(--grad-primary); color: #fff; border-color: transparent; }

/* ============== ABOUT / CONTENT PAGES ============== */
.page-hero {
  padding: var(--space-16) 0 var(--space-10);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  text-align: center;
}
.page-hero h1 { font-size: var(--fs-4xl); margin-bottom: var(--space-4); }
.page-hero p { font-size: var(--fs-md); color: var(--text-secondary); max-width: 680px; margin-inline: auto; }

.content-page { padding: var(--space-12) 0; max-width: 880px; margin-inline: auto; }
.content-page h2 { margin-top: var(--space-12); margin-bottom: var(--space-4); }
.content-page h3 { margin-top: var(--space-8); margin-bottom: var(--space-3); }
.content-page p { color: var(--text-secondary); line-height: var(--lh-loose); margin-bottom: var(--space-4); }
.content-page ul, .content-page ol { color: var(--text-secondary); line-height: var(--lh-loose); margin-bottom: var(--space-4); }
.content-page li { margin-bottom: var(--space-2); }

/* ============== 404 ============== */
.not-found { padding: var(--space-20) 0; text-align: center; }
.not-found h1 { font-size: var(--fs-6xl); color: var(--color-primary-600); margin-bottom: var(--space-4); }
.not-found p { font-size: var(--fs-md); color: var(--text-secondary); max-width: 480px; margin: 0 auto var(--space-8); }

/* ============== ANIMATIONS ============== */
.fade-up { opacity: 0; transform: translateY(20px); transition: all var(--dur-slow) var(--ease-out); }
.fade-up.in-view { opacity: 1; transform: translateY(0); }
