﻿/* ============================================================
   FREE AI TEXT TOOLS — 2026 Minimal Design System
   Monochrome base · Single accent · Sharp type · Generous air
   Inspired by Linear, Vercel, Stripe
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg: #ffffff;
  --bg-2: #fafafa;
  --surface: #ffffff;
  --border: #eaeaea;
  --border-2: #d4d4d4;
  --text: #0a0a0a;
  --text-2: #525252;
  --text-3: #a3a3a3;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --success: #16a34a;
  --danger: #dc2626;
  --radius: 8px;
  --header-h: 56px;
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;
  --cat-counters: #2563eb;
  --cat-text: #7c3aed;
  --cat-convert: #0891b2;
  --cat-seo: #16a34a;
  --cat-code: #d97706;
  --accent-text: #ffffff;
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-2: #141414;
  --surface: #171717;
  --border: #262626;
  --border-2: #404040;
  --text: #fafafa;
  --text-2: #a3a3a3;
  --text-3: #525252;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-light: #1e3a5f;
  --success: #4ade80;
  --danger: #f87171;
  --cat-counters: #60a5fa;
  --cat-text: #a78bfa;
  --cat-convert: #22d3ee;
  --cat-seo: #4ade80;
  --cat-code: #fbbf24;
  --accent-text: #0a0a0a;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s, color 0.3s;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); }
::selection { background: var(--accent); color: var(--accent-text); }
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; top: -100%; left: 16px;
  background: var(--accent); color: var(--accent-text); padding: 8px 16px;
  border-radius: var(--radius); z-index: 10001;
  font-weight: 700; font-size: 13px;
}
.skip-link:focus { top: 16px; color: var(--accent-text); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  height: var(--header-h);
  background: rgba(255,255,255,0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}
[data-theme="dark"] .site-header {
  background: rgba(10,10,10,0.85);
}
.header-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}
.site-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 15px; color: var(--text);
  text-decoration: none; letter-spacing: -0.02em;
}
.site-logo:hover { color: var(--accent); }
.logo-mark {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--accent); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 12px;
}
.nav { display: flex; align-items: center; gap: 2px; }
.nav-link {
  padding: 6px 12px; border-radius: 6px;
  font-size: 14px; font-weight: 500;
  color: var(--text-2); transition: all 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--bg-2); }
.nav-link.active { color: var(--text); font-weight: 600; }
.nav-cta {
  margin-left: 6px; padding: 7px 16px;
  background: var(--text); color: var(--bg);
  border-radius: 6px; font-weight: 700; font-size: 13px;
  transition: opacity 0.15s;
}
.nav-cta:hover { opacity: 0.85; color: var(--bg); }
.theme-btn {
  width: 32px; height: 32px; border: 1px solid var(--border);
  background: transparent; border-radius: 6px;
  font-size: 16px; cursor: pointer; color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.theme-btn:hover { border-color: var(--border-2); color: var(--text); }
.menu-toggle {
  display: none; width: 36px; height: 36px; border: none;
  background: transparent; font-size: 22px; cursor: pointer;
  color: var(--text); border-radius: 6px;
  transition: all 0.15s;
  align-items: center; justify-content: center;
}
.menu-toggle:hover { background: var(--bg-2); }
.menu-toggle.open { transform: rotate(90deg); }

/* ============================================================
   HERO — Product-first, minimal, high contrast
   ============================================================ */
.hero {
  position: relative; z-index: 1;
  min-height: 480px;
  display: flex; align-items: center;
  overflow: hidden;
  margin-bottom: 64px;
  background: #0a0a0a;
}
.hero-content {
  position: relative; z-index: 2;
  text-align: center;
  padding: 96px 24px;
  width: 100%;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 900; line-height: 1.0;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
  color: #ffffff;
}
.hero-sub {
  font-size: 17px; color: #a3a3a3;
  max-width: 480px; margin: 0 auto 32px;
  line-height: 1.6;
}
.hero-search {
  max-width: 440px; margin: 0 auto; position: relative;
}
.hero-search input {
  width: 100%; padding: 14px 18px 14px 44px;
  border: 1px solid #333;
  border-radius: var(--radius);
  font-size: 15px; font-family: var(--font);
  background: #1a1a1a;
  color: #fff; outline: none;
  transition: border-color 0.15s;
}
.hero-search input:focus { border-color: var(--accent); }
.hero-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hero-search input::placeholder { color: #525252; }
.hero-search::before {
  content: ''; position: absolute; left: 16px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23525252' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") center/contain no-repeat;
  pointer-events: none;
}
.hero-search-results {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 6px;
  max-height: 280px; overflow-y: auto;
  display: none; z-index: 100;
}
.hero-search-results.open { display: block; }
.hero-search-results a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  color: var(--text); text-decoration: none;
  font-size: 13px; font-weight: 500;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.hero-search-results a:last-child { border-bottom: none; }
.hero-search-results a:hover { background: var(--accent-light); color: var(--text); }
.hero-search-results .sr-cat {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-3); min-width: 50px;
}
.hero-search-results .no-results {
  padding: 14px; text-align: center;
  font-size: 13px; color: var(--text-3);
}
.hero-cta {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 24px; padding: 12px 28px;
  background: var(--accent); color: var(--accent-text);
  border-radius: var(--radius); font-weight: 700; font-size: 14px;
  transition: opacity 0.15s;
}
.hero-cta:hover { opacity: 0.9; color: var(--accent-text); }

/* ---- Stats ---- */
.stats-bar {
  display: flex; justify-content: center; gap: 56px;
  padding: 0 0 64px;
}
.stat { text-align: center; }
.stat-num {
  font-size: 32px; font-weight: 900; color: var(--text);
  letter-spacing: -0.03em;
}
.stats-bar .stat-label {
  font-size: 12px; color: var(--text-3); font-weight: 500;
  margin-top: 2px;
}

/* ============================================================
   IMAGE SECTIONS (hero banners on homepage)
   ============================================================ */
.img-section {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
  min-height: 200px;
  display: flex; align-items: flex-end;
}
.img-section-bg {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.4);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.img-section:hover .img-section-bg { transform: scale(1.02); }
.img-section-content {
  position: relative; z-index: 1;
  padding: 28px;
  width: 100%;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
}
.img-section-content h2 {
  font-size: 22px; font-weight: 800;
  color: #fff; margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.img-section-content p {
  font-size: 14px; color: rgba(255,255,255,0.7);
}

/* ---- Section Headers ---- */
.section-sub { font-size: 13px; color: var(--text-3); margin-bottom: 20px; font-weight: 500; }

/* ---- Tool Sections ---- */
.tool-section { margin-bottom: 64px; }
.tool-section .img-section {
  border-radius: var(--radius);
  overflow: hidden;
}

/* ============================================================
   TOOL GRID — Clean, no shadows, no border accents
   ============================================================ */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.tool-card {
  display: flex; flex-direction: column;
  padding: 20px;
  background: var(--surface);
  text-decoration: none; color: var(--text);
  transition: background 0.15s;
  position: relative;
}
.tool-card:hover { background: var(--bg-2); color: var(--text); }
.tool-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.01em; }
.tool-card p { font-size: 13px; color: var(--text-3); line-height: 1.45; flex: 1; }
.tool-card .card-arrow {
  position: absolute; top: 20px; right: 16px;
  color: var(--text-3); font-size: 14px;
  opacity: 0; transition: opacity 0.15s;
}
.tool-card:hover .card-arrow { opacity: 1; }
.tool-card .card-cat {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 6px; border-radius: 4px;
  margin-bottom: 8px;
  background: var(--bg-2); color: var(--text-3);
}

/* ---- Tool Header ---- */
.tool-header { margin-bottom: 24px; }
.tool-header h1 { font-size: 32px; font-weight: 900; letter-spacing: -0.03em; margin-bottom: 6px; }
.tool-header p { font-size: 15px; color: var(--text-2); }
.breadcrumb { font-size: 12px; color: var(--text-3); margin-bottom: 12px; }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 5px; }

/* ---- Layout ---- */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 24px; align-items: start;
}
.tool-main { min-width: 0; }

/* ---- Options Row (above card) ---- */
.tool-options-row {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 14px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tool-options-row:empty { display: none; }
.tool-options-row .tool-option { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tool-options-row .tool-option label { font-weight: 600; color: var(--text-2); font-size: 12px; white-space: nowrap; }
.tool-options-row .tool-option select,
.tool-options-row .tool-option input[type="text"],
.tool-options-row .tool-option input[type="number"],
.tool-options-row .tool-option input[type="url"],
.tool-options-row .tool-option input[type="date"] {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px; font-family: var(--font);
  background: var(--bg); color: var(--text);
  outline: none; transition: border-color 0.15s;
}
.tool-options-row .tool-option select:focus,
.tool-options-row .tool-option input:focus { border-color: var(--accent); }
.tool-options-row .tool-option textarea {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px; font-family: var(--mono);
  background: var(--bg); color: var(--text);
  resize: vertical; outline: none;
}
.tool-options-row .tool-option textarea:focus { border-color: var(--accent); }
.tool-options-row .tool-option input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }

/* ============================================================
   TOOL CARD — Clean input/output structure
   ============================================================ */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.tool-card-section { padding: 16px 20px; }
.tool-card-section + .tool-card-section,
.tool-card-section + .tool-card-actions { border-top: 1px solid var(--border); }
.tool-section-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); margin-bottom: 10px;
}
.tool-output-meta { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 11px; }

.tool-textarea {
  width: 100%; min-height: 160px;
  padding: 0;
  border: none;
  border-radius: 0;
  font-size: 13px; font-family: var(--mono);
  line-height: 1.6;
  background: transparent; color: var(--text);
  resize: vertical; outline: none;
}
.tool-textarea:focus { box-shadow: none; }
.tool-textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---- Card Actions (between input and output) ---- */
.tool-card-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}

/* ---- Output Section ---- */
.tool-output-section { min-height: 60px; }
.tool-output { min-height: 40px; }
.tool-output-actions {
  display: flex; gap: 8px; margin-top: 10px;
}
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border: none; border-radius: 6px;
  font-size: 13px; font-weight: 700; font-family: var(--font);
  cursor: pointer; transition: all 0.15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { opacity: 0.9; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-text); }
.btn-secondary {
  background: var(--bg-2); color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-2); color: var(--text); }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ---- Converter Upload Zone ---- */
.converter-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg-2);
}
.converter-upload-zone:hover,
.converter-upload-zone-hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-2));
}
.converter-upload-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.6; }
.converter-upload-text { font-size: 15px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.converter-upload-hint { font-size: 12px; color: var(--text-3); }
.converter-file-info {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.converter-file-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.converter-file-name {
  font-weight: 500;
  color: var(--text);
  font-size: 13px;
  word-break: break-all;
}
.converter-file-size {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}
.converter-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.converter-actions .btn { flex: none; }

/* ---- Output ---- */
.tool-output { margin-top: 0; min-height: 40px; }
.output-content {
  padding: 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px; line-height: 1.6;
  overflow-x: auto;
}
.output-content pre {
  font-family: var(--mono);
  white-space: pre-wrap; word-break: break-all;
  font-size: 12px; line-height: 1.5;
}
.code-block {
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
[data-theme="dark"] .code-block {
  background: #141414;
}
.code-block pre {
  padding: 14px;
  font-family: var(--mono);
  font-size: 12px; line-height: 1.5;
  color: #e5e5e5;
  white-space: pre-wrap; word-break: break-all;
  margin: 0;
}
.hl-tag { color: #3b82f6; }
.hl-attr { color: #a3a3a3; }
.hl-str { color: #4ade80; }

/* ---- Stats Grid ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stat-card {
  padding: 16px 10px;
  background: var(--surface);
  text-align: center;
}
.stat-number { font-size: 24px; font-weight: 900; color: var(--accent); letter-spacing: -0.03em; }
.stats-grid .stat-label {
  font-size: 10px; color: var(--text-3);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; margin-top: 2px;
}

/* ---- Table ---- */
.result-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.result-table th, .result-table td {
  padding: 8px 12px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.result-table th {
  font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-3); background: var(--bg-2);
}
.result-table tr:hover td { background: var(--accent-light); }

/* ============================================================
   SIDEBAR — Clean, no shadows
   ============================================================ */
.tool-sidebar { position: sticky; top: calc(var(--header-h) + 16px); }
.sidebar-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
}
.sidebar-widget h3 {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); margin-bottom: 10px;
}
.sidebar-widget p, .sidebar-widget #toolAbout {
  font-size: 13px; color: var(--text-2); line-height: 1.55;
}
.related-link {
  display: block; padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text); text-decoration: none;
}
.related-link:last-child { border-bottom: none; }
.related-link:hover { color: var(--accent); }

/* ---- Blog Sidebar ---- */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 32px; align-items: start;
}
.blog-sidebar {
  position: sticky; top: calc(var(--header-h) + 16px);
}
.blog-sidebar h3 {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); margin-bottom: 10px; margin-top: 20px;
}
.blog-sidebar h3:first-child { margin-top: 0; }

/* ---- FAQ ---- */
.faq-section { margin-top: 64px; }
.faq-section h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 16px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px; overflow: hidden;
  background: var(--surface);
}
.faq-item[open] { border-color: var(--accent); }
.faq-question {
  padding: 14px 16px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  color: var(--text);
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question span { font-size: 11px; color: var(--text-3); transition: transform 0.2s; }
.faq-item[open] .faq-question span { transform: rotate(180deg); }
.faq-answer { padding: 0 16px 14px; font-size: 13px; color: var(--text-2); line-height: 1.6; }

/* ---- Blog ---- */
.blog-preview { margin-top: 64px; }
.blog-preview h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.blog-card {
  padding: 20px;
  background: var(--surface);
  text-decoration: none; color: var(--text);
  transition: background 0.15s;
  display: flex; flex-direction: column;
}
.blog-card:hover { background: var(--bg-2); color: var(--text); }
.blog-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; line-height: 1.3; letter-spacing: -0.01em; }
.blog-card p { font-size: 13px; color: var(--text-3); line-height: 1.45; flex: 1; }
.blog-card-img {
  width: 100%; height: 160px; object-fit: cover;
  border-radius: 6px; margin-bottom: 12px;
}
.blog-meta { font-size: 12px; color: var(--text-3); margin-top: 10px; }
.blog-post { max-width: 660px; }
.blog-hero-img { width: 100%; border-radius: var(--radius); margin-bottom: 24px; max-height: 340px; object-fit: cover; }
.blog-content { font-size: 15px; line-height: 1.75; }
.blog-content h2 { font-size: 20px; font-weight: 700; margin: 28px 0 10px; letter-spacing: -0.01em; }
.blog-content p { margin-bottom: 14px; color: var(--text-2); }
.blog-content img { width: 100%; border-radius: var(--radius); margin: 24px 0; }
.tool-link {
  display: block; padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text); text-decoration: none;
}
.tool-link:hover { color: var(--accent); }

/* ---- Search ---- */
.tools-search { margin-bottom: 20px; }
.tools-search input {
  width: 100%; max-width: 360px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px; font-family: var(--font);
  background: var(--surface); color: var(--text);
  outline: none; margin-bottom: 12px;
  transition: border-color 0.15s;
}
.tools-search input:focus { border-color: var(--accent); }
.tools-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-pill {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px; font-weight: 600; font-family: var(--font);
  background: transparent; color: var(--text-3);
  cursor: pointer; transition: all 0.15s;
}
.filter-pill:hover { border-color: var(--border-2); color: var(--text-2); }
.filter-pill.active {
  background: var(--text); color: var(--bg);
  border-color: var(--text);
}

/* ---- Page Content ---- */
.page-content { max-width: 660px; padding: 48px 0 64px; }
.page-content h1 { font-size: 32px; font-weight: 900; letter-spacing: -0.03em; margin-bottom: 12px; }
.page-content h2 { font-size: 20px; font-weight: 700; margin: 24px 0 8px; letter-spacing: -0.01em; }
.page-content p, .page-content li { font-size: 15px; color: var(--text-2); line-height: 1.7; margin-bottom: 10px; }
.page-content ul { padding-left: 20px; margin-bottom: 12px; }
.page-content li { margin-bottom: 4px; }
.page-content strong { color: var(--text); }

/* ============================================================
   FOOTER — Dense, minimal
   ============================================================ */
.site-footer { margin-top: 80px; border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding: 40px 0 24px; }
.footer-col h4 {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); margin-bottom: 12px;
}
.footer-col a {
  display: block; padding: 3px 0;
  font-size: 13px; color: var(--text-3); text-decoration: none;
}
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 0; text-align: center;
  font-size: 12px; color: var(--text-3);
}

/* ---- Cookie Banner ---- */
.cookie-banner {
  position: fixed; bottom: 18px; left: 18px; right: 18px;
  max-width: 420px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: none; align-items: center; gap: 14px;
  z-index: 9999;
}
.cookie-banner.show { display: flex; }
.cookie-banner p { font-size: 13px; color: var(--text-2); margin: 0; flex: 1; }
.cookie-banner .btn-group { display: flex; gap: 6px; flex-shrink: 0; }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: 18px; left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--text); color: var(--bg);
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 13px; font-weight: 700;
  z-index: 10000;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---- Reveal ---- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---- Back to Top ---- */
.back-to-top {
  position: fixed; bottom: 24px; right: 24px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--text); color: var(--bg);
  border: none; cursor: pointer;
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 999;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { transform: scale(1.1); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:focus-visible, .filter-pill:focus-visible, .theme-btn:focus-visible, .menu-toggle:focus-visible, .back-to-top:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.1s !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .tool-layout { grid-template-columns: 1fr; }
  .tool-sidebar { position: static; }
  .blog-layout { grid-template-columns: 1fr; }
  .blog-sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- Bottom Sheet (Mobile) ---- */
.bottom-sheet {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  z-index: 998;
}
.bottom-sheet-inner {
  display: flex; gap: 6px; justify-content: center;
}
.btn-sheet {
  flex: 1; justify-content: center; min-width: 0;
  padding: 8px 6px; font-size: 12px;
  white-space: nowrap;
}

/* ---- Copy Success Animation ---- */
.btn-copy-success {
  background: var(--success) !important;
  color: #fff !important;
  border-color: var(--success) !important;
  transform: scale(1.05);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-copy-success:active { transform: scale(0.95); }

/* ---- Category Section ---- */
.category-section { margin-bottom: 40px; }
.category-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.category-header h2 { font-size: 1.1rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.category-header a { font-size: .85rem; color: var(--accent); font-weight: 600; }

@media (max-width: 768px) {
  :root { --header-h: 52px; }
  .nav { display: none; }
  .nav.open {
    display: flex; flex-direction: column;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 10px 20px; gap: 2px;
  }
  .nav.open .nav-cta { margin-left: 0; margin-top: 6px; }
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
  .hero { min-height: 380px; }
  .hero h1 { font-size: 40px; }
  .hero-content { padding: 64px 20px; }
  .stats-bar { gap: 32px; flex-wrap: wrap; }
  .stat-num { font-size: 24px; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 16px; }
  .footer-grid .footer-col:first-child { grid-column: 1 / -1; }
  .cookie-banner { flex-direction: column; text-align: center; }
  .tool-card-section { padding: 14px 16px; }
  .tool-card-actions { padding: 10px 16px; }
  .bottom-sheet { display: block; }
  .tool-textarea { min-height: 140px; margin-bottom: 0; }
  .site-footer { padding-bottom: 70px; }
  .tool-options-row { padding: 10px 14px; gap: 8px; }
  .tool-options-row .tool-option { flex-wrap: wrap; }
  .img-section { min-height: 160px; }
  .back-to-top { bottom: 16px; right: 16px; width: 38px; height: 38px; }
  .blog-layout { grid-template-columns: 1fr; gap: 24px; }
  .blog-post { max-width: 100%; padding: 0; }
  .blog-hero-img { border-radius: var(--radius); margin-bottom: 16px; max-height: 300px; }
  .blog-card-img { height: 180px; border-radius: 6px; }
  .blog-content { font-size: 15px; line-height: 1.75; }
  .blog-content h2 { font-size: 18px; margin: 24px 0 10px; }
  .blog-content p { margin-bottom: 12px; }
  .blog-content img { width: 100%; border-radius: var(--radius); margin: 20px 0; max-height: none; }
  #toolBlogPosts { grid-template-columns: 1fr !important; }
}
@media (max-width: 480px) {
  .hero h1 { font-size: 32px; }
  .tool-header h1 { font-size: 24px; }
  .tool-card-actions { flex-wrap: wrap; }
  .tool-card-actions .btn { flex: 1; justify-content: center; }
  .blog-hero-img { max-height: 260px; }
  .blog-card-img { height: 160px; }
  .blog-content { font-size: 14px; }
  .blog-content h2 { font-size: 17px; }
  .blog-content img { margin: 16px 0; }
}

@media print {
  .site-header, .site-footer, .cookie-banner, .back-to-top, .tool-sidebar,
  .blog-sidebar, .hero, .tool-card-actions, .bottom-sheet, .theme-btn, .menu-toggle, .hero-search,
  .filter-pills, .tools-search, .blog-preview, .faq-section { display: none !important; }
  body { background: #fff; color: #000; }
  .tool-layout, .blog-layout { grid-template-columns: 1fr; }
  a { color: #000; text-decoration: underline; }
  .code-block { background: #fff; color: #000; border: 1px solid #ccc; }
  .code-block pre { color: #000; }
  .tool-output, .output-content, .result-table, .code-block, .faq-item { break-inside: avoid; }
  .img-section { display: none !important; }
  * { box-shadow: none !important; }
}
