/*
Theme Name: Pochitto Tool
Theme URI: https://pochitto-tool.site/
Author: Pochitto Team
Description: 無料で使える本格Webツール集。最高品質UI/UXのモダンツールサイトテーマ。
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pochitto-tool
*/

/* ============================================================
   0. CSS RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ============================================================
   1. DESIGN TOKENS (Light Mode)
   ============================================================ */
:root {
  /* --- Brand Colors --- */
  --c-primary: #2563eb;
  --c-primary-light: #3b82f6;
  --c-primary-dark: #1d4ed8;
  --c-primary-50: #eff6ff;
  --c-primary-100: #dbeafe;
  --c-primary-200: #bfdbfe;
  --c-accent: #06b6d4;
  --c-accent-light: #22d3ee;

  /* --- Semantic --- */
  --c-success: #10b981;
  --c-warning: #f59e0b;
  --c-error: #ef4444;

  /* --- Surface & Text --- */
  --c-bg: #f7f9fc;
  --c-bg-card: #ffffff;
  --c-bg-elevated: #ffffff;
  --c-bg-hero: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 50%, #faf5ff 100%);
  --c-bg-tool: #ffffff;
  --c-bg-result: linear-gradient(135deg, #f0f7ff 0%, #f5f3ff 100%);
  --c-bg-input: #ffffff;
  --c-border: #cbd5e1;
  --c-border-hover: #94a3b8;
  --c-border-focus: var(--c-primary);
  --c-text: #0f172a;
  --c-text-secondary: #475569;
  --c-text-muted: #94a3b8;
  --c-text-inverse: #ffffff;

  /* --- Glass Effect --- */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-blur: 20px;

  /* --- Typography --- */
  --font-main: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter', 'Noto Sans JP', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 1.875rem;
  --fs-4xl: 2.25rem;
  --fs-5xl: 3rem;

  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  --lh-tight: 1.3;
  --lh-normal: 1.6;
  --lh-relaxed: 1.8;
  --lh-loose: 2.0;

  /* --- Spacing --- */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;

  /* --- Radius --- */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-full: 9999px;

  /* --- Shadows --- */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.06), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.06), 0 8px 10px -6px rgba(0,0,0,0.04);
  --shadow-tool: 0 0 0 1px rgba(37,99,235,0.06), 0 4px 16px rgba(37,99,235,0.05);
  --shadow-tool-hover: 0 0 0 1px rgba(37,99,235,0.12), 0 12px 32px rgba(37,99,235,0.10);
  --shadow-focus: 0 0 0 3px rgba(37,99,235,0.2);
  --shadow-glow: 0 0 20px rgba(37,99,235,0.15);

  /* --- Transitions --- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 150ms;
  --t-base: 250ms;
  --t-slow: 400ms;

  /* --- Layout --- */
  --w-max: 1200px;
  --w-content: 800px;
  --w-narrow: 640px;
  --header-h: 64px;
}

/* ============================================================
   2. DARK MODE TOKENS
   ============================================================ */
[data-theme="dark"] {
  --c-bg: #0b1120;
  --c-bg-card: #131c31;
  --c-bg-elevated: #1a2540;
  --c-bg-hero: linear-gradient(135deg, #0b1120 0%, #131c31 50%, #1a1030 100%);
  --c-bg-tool: #131c31;
  --c-bg-result: linear-gradient(135deg, #111d35 0%, #1a1535 100%);
  --c-bg-input: #0f1829;
  --c-border: #1e3050;
  --c-border-hover: #2a4070;
  --c-text: #e8edf5;
  --c-text-secondary: #94a3b8;
  --c-text-muted: #64748b;
  --c-text-inverse: #0f172a;

  --glass-bg: rgba(19, 28, 49, 0.80);
  --glass-border: rgba(30, 48, 80, 0.6);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.3);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.3);
  --shadow-tool: 0 0 0 1px rgba(37,99,235,0.15), 0 4px 16px rgba(0,0,0,0.3);
  --shadow-tool-hover: 0 0 0 1px rgba(37,99,235,0.3), 0 12px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 30px rgba(37,99,235,0.2);
}

/* ============================================================
   3. BASE ELEMENTS
   ============================================================ */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background var(--t-base) ease, color var(--t-base) ease;
}

a {
  color: var(--c-primary);
  text-decoration: none;
  transition: color var(--t-fast) ease;
}
a:hover { color: var(--c-primary-dark); }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  color: var(--c-text);
  font-weight: var(--fw-bold);
}

::selection {
  background: var(--c-primary-200);
  color: var(--c-primary-dark);
}

:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* ============================================================
   4. CONTAINER
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--w-max);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.container-narrow {
  max-width: var(--w-content);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

/* ============================================================
   5. HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  transition: box-shadow var(--t-base) ease;
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--w-max);
  margin: 0 auto;
  padding: 0 var(--sp-6);
  gap: var(--sp-4);
}

/* --- Logo --- */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  flex-shrink: 0;
}

img.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  transition: transform var(--t-base) var(--ease-spring);
}

.site-logo:hover img.logo-icon {
  transform: scale(1.08) rotate(-3deg);
}

.footer-logo img.logo-icon {
  width: 32px;
  height: 32px;
}

.logo-text {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--c-text);
  letter-spacing: -0.02em;
}

/* --- Header Nav --- */
.header-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.header-nav a {
  display: flex;
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--c-text-secondary);
  border-radius: var(--r-sm);
  transition: all var(--t-fast) ease;
  white-space: nowrap;
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--c-primary);
  background: var(--c-primary-50);
}

/* --- Header Search --- */
.header-search {
  position: relative;
  flex-shrink: 0;
}

.header-search input {
  width: 200px;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm);
  font-family: var(--font-main);
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-full);
  color: var(--c-text);
  transition: all var(--t-base) var(--ease-out);
}

.header-search input:focus {
  width: 280px;
  border-color: var(--c-primary);
  box-shadow: var(--shadow-focus);
  outline: none;
}

/* --- Theme Toggle --- */
.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--c-text-secondary);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-fast) ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--c-primary-50);
  color: var(--c-primary);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: transform var(--t-base) var(--ease-spring);
}

.theme-toggle:hover svg {
  transform: rotate(15deg);
}

/* --- Mobile Menu Toggle --- */
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--c-text);
  border-radius: var(--r-sm);
  cursor: pointer;
}

/* ============================================================
   6. HERO SECTION
   ============================================================ */
.hero {
  background: var(--c-bg-hero);
  padding: var(--sp-16) 0 var(--sp-12);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(37,99,235,0.05) 0%, transparent 50%),
              radial-gradient(circle at 70% 50%, rgba(6,182,212,0.04) 0%, transparent 50%);
  pointer-events: none;
}

/* --- Hero Icons Row --- */
.hero-icons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-8);
}

.hero-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  text-decoration: none;
  padding: var(--sp-2);
  border-radius: var(--r-md);
  transition: all var(--t-base) var(--ease-spring);
}

.hero-icon-item:hover {
  background: rgba(255,255,255,0.6);
  transform: translateY(-3px);
}

[data-theme="dark"] .hero-icon-item:hover {
  background: rgba(255,255,255,0.08);
}

.hero-icon-item img {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
}

.hero-icon-item span {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-4);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--c-primary);
  background: var(--c-primary-50);
  border: 1px solid var(--c-primary-200);
  border-radius: var(--r-full);
  margin-bottom: var(--sp-6);
  letter-spacing: 0.03em;
}

.hero h1 {
  font-size: var(--fs-5xl);
  font-weight: var(--fw-extrabold);
  letter-spacing: -0.04em;
  margin-bottom: var(--sp-4);
  background: linear-gradient(135deg, var(--c-text) 0%, var(--c-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: var(--fs-lg);
  color: var(--c-text-secondary);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--sp-8);
}

/* --- Hero Search --- */
.hero-search {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
}

.hero-search input {
  width: 100%;
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--fs-md);
  font-family: var(--font-main);
  background: var(--c-bg-card);
  border: 2px solid var(--c-border);
  border-radius: var(--r-xl);
  color: var(--c-text);
  box-shadow: var(--shadow-lg);
  transition: all var(--t-base) var(--ease-out);
}

.hero-search input::placeholder {
  color: var(--c-text-muted);
}

.hero-search input:focus {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-lg), var(--shadow-focus);
  outline: none;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--sp-8);
  margin-top: var(--sp-8);
}

.hero-stat {
  text-align: center;
}

.hero-stat-number {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-extrabold);
  color: var(--c-primary);
}

.hero-stat-label {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-top: var(--sp-1);
}

/* ============================================================
   7. CATEGORY SECTION
   ============================================================ */
.section {
  padding: var(--sp-16) 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-8);
}

.section-title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
}

.section-link {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--c-primary);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

/* --- Category Grid --- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
  background: var(--c-bg-card);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-xl);
  text-decoration: none;
  transition: all var(--t-base) var(--ease-out);
}

.category-card:hover {
  border-color: var(--c-primary-200);
  box-shadow: var(--shadow-tool-hover);
  transform: translateY(-4px);
}

.category-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-3);
  transition: transform var(--t-base) var(--ease-spring);
}

.category-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--r-md);
}

.category-card:hover .category-icon {
  transform: scale(1.1);
}

.category-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  margin-bottom: var(--sp-1);
}

.category-count {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

/* ============================================================
   8. TOOL GRID
   ============================================================ */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-5);
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--sp-6);
  background: var(--c-bg-card);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-xl);
  text-decoration: none;
  transition: all var(--t-base) var(--ease-out);
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-primary) 0%, var(--c-accent) 100%);
  opacity: 0;
  transition: opacity var(--t-base) ease;
}

.tool-card:hover {
  border-color: var(--c-primary-200);
  box-shadow: var(--shadow-tool-hover);
  transform: translateY(-4px);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: var(--c-primary-50);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-4);
}

.tool-card-title {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  margin-bottom: var(--sp-2);
}

.tool-card-desc {
  font-size: var(--fs-sm);
  color: var(--c-text-secondary);
  line-height: var(--lh-relaxed);
  flex-grow: 1;
}

.tool-card-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--c-border);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

.tool-card-tag {
  display: inline-flex;
  padding: var(--sp-1) var(--sp-2);
  background: var(--c-primary-50);
  color: var(--c-primary);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
}

/* ============================================================
   9. TOOL PAGE (Single Tool)
   ============================================================ */
.tool-page {
  max-width: var(--w-content);
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-6);
}

.tool-header {
  text-align: center;
  margin-bottom: var(--sp-10);
}

.tool-header h1 {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-extrabold);
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-3);
}

.tool-description {
  font-size: var(--fs-md);
  color: var(--c-text-secondary);
  line-height: var(--lh-relaxed);
}

/* --- Tool Card (Container) --- */
.tool-container {
  background: var(--c-bg-tool);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-2xl);
  padding: var(--sp-8);
  box-shadow: var(--shadow-tool);
  margin-bottom: var(--sp-8);
}

/* --- Tool Inputs --- */
.tool-input-group {
  margin-bottom: var(--sp-5);
}

.tool-input-group label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  margin-bottom: var(--sp-2);
}

.tool-input-group .input-hint {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-top: var(--sp-1);
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="date"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-base);
  font-family: var(--font-main);
  color: var(--c-text);
  background: var(--c-bg-input);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  transition: all var(--t-fast) ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-focus);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 140px;
  line-height: var(--lh-relaxed);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/* --- Options Row --- */
.tool-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.tool-option {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--c-text-secondary);
  cursor: pointer;
}

.tool-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--c-primary);
  cursor: pointer;
}

/* --- Primary Button --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--fs-base);
  font-family: var(--font-main);
  font-weight: var(--fw-semibold);
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast) ease;
  line-height: 1;
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(37,99,235,0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-lg {
  width: 100%;
  padding: var(--sp-4) var(--sp-6);
  font-size: var(--fs-md);
  border-radius: var(--r-lg);
}

.btn-secondary {
  color: var(--c-text-secondary);
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
}

.btn-secondary:hover {
  border-color: var(--c-primary-200);
  color: var(--c-primary);
  background: var(--c-primary-50);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--r-sm);
}

.btn-group {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

/* --- Result Area --- */
.tool-result {
  background: var(--c-bg-result);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  margin-top: var(--sp-6);
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--t-base) var(--ease-out);
  pointer-events: none;
}

.tool-result.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
}

.result-item {
  padding: var(--sp-4);
  background: var(--c-bg-card);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
}

.result-label {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-1);
}

.result-value {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--c-text);
}

.result-value.primary {
  color: var(--c-primary);
}

.result-value.accent {
  color: var(--c-accent);
}

.result-details {
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--c-border);
}

.result-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--sp-3);
}

.result-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-bg-card);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
}

.result-detail-label {
  color: var(--c-text-secondary);
}

.result-detail-value {
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

/* --- Chart --- */
.tool-chart {
  max-height: 320px;
  margin-top: var(--sp-5);
}

/* ============================================================
   10. ARTICLE CONTENT (SEO Text below tool)
   ============================================================ */
.article-content {
  background: var(--c-bg-card);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-2xl);
  padding: var(--sp-10);
  line-height: var(--lh-loose);
  margin-bottom: var(--sp-8);
}

.article-content h2 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 2px solid var(--c-primary-100);
}

.article-content h2:first-child {
  margin-top: 0;
}

.article-content h3 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-3);
}

.article-content p {
  margin-bottom: var(--sp-4);
  color: var(--c-text-secondary);
}

.article-content ul,
.article-content ol {
  margin-bottom: var(--sp-4);
  padding-left: var(--sp-6);
}

.article-content li {
  margin-bottom: var(--sp-2);
  color: var(--c-text-secondary);
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--sp-5);
  font-size: var(--fs-sm);
}

.article-content th,
.article-content td {
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-border);
  text-align: left;
}

.article-content th {
  background: var(--c-primary-50);
  font-weight: var(--fw-semibold);
}

/* ============================================================
   11. FAQ ACCORDION
   ============================================================ */
.faq-section {
  margin-bottom: var(--sp-8);
}

.faq-item {
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-3);
  overflow: hidden;
  background: var(--c-bg-card);
  transition: border-color var(--t-fast) ease;
}

.faq-item.open {
  border-color: var(--c-primary-200);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-main);
  gap: var(--sp-3);
}

.faq-question:hover {
  background: rgba(37,99,235,0.08);
  color: var(--c-primary);
}

[data-theme="dark"] .faq-question:hover {
  background: rgba(37,99,235,0.15);
  color: var(--c-primary-light);
}

[data-theme="dark"] .faq-item.open {
  background: var(--c-bg-elevated);
}

.faq-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--c-text-muted);
  transition: transform var(--t-base) var(--ease-out);
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
  color: var(--c-primary);
}

.faq-answer {
  display: none;
  padding: 0 var(--sp-5) var(--sp-5);
  font-size: var(--fs-sm);
  color: var(--c-text-secondary);
  line-height: var(--lh-relaxed);
}

.faq-item.open .faq-answer {
  display: block;
  animation: fadeSlideIn var(--t-base) var(--ease-out);
}

/* ============================================================
   12. RELATED TOOLS
   ============================================================ */
.related-tools {
  margin-bottom: var(--sp-8);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-4);
}

.related-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--c-bg-card);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-lg);
  text-decoration: none;
  transition: all var(--t-base) var(--ease-out);
}

.related-card:hover {
  border-color: var(--c-primary-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.related-card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--c-primary-50);
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

.related-card-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
}

/* ============================================================
   13. BREADCRUMB
   ============================================================ */
.breadcrumb {
  padding: var(--sp-4) 0;
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

.breadcrumb a {
  color: var(--c-text-muted);
}

.breadcrumb a:hover {
  color: var(--c-primary);
}

.breadcrumb .sep {
  margin: 0 var(--sp-2);
}

/* ============================================================
   14. FOOTER
   ============================================================ */
.site-footer {
  background: var(--c-text);
  color: var(--c-text-muted);
  padding: var(--sp-16) 0 var(--sp-8);
}

[data-theme="dark"] .site-footer {
  background: #060a14;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-10);
  max-width: var(--w-max);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.footer-brand {
  max-width: 300px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  text-decoration: none;
}

.footer-logo .logo-icon {
  width: 32px;
  height: 32px;
  font-size: var(--fs-sm);
}

.footer-logo .logo-text {
  color: #ffffff;
  font-size: var(--fs-md);
}

.footer-desc {
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: var(--c-text-muted);
}

.footer-heading {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: #ffffff;
  margin-bottom: var(--sp-4);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--sp-2);
}

.footer-links a {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  transition: color var(--t-fast) ease;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  max-width: var(--w-max);
  margin: var(--sp-10) auto 0;
  padding: var(--sp-6) var(--sp-6) 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

/* ============================================================
   15. TOAST NOTIFICATION
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: var(--sp-3) var(--sp-6);
  background: var(--c-primary);
  color: #ffffff;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  border-radius: var(--r-full);
  box-shadow: 0 4px 20px rgba(37,99,235,0.4);
  opacity: 0;
  pointer-events: none;
  transition: all var(--t-base) var(--ease-out);
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   16. ANIMATIONS
   ============================================================ */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ============================================================
   17. UTILITY CLASSES
   ============================================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-primary { color: var(--c-primary); }
.text-muted { color: var(--c-text-muted); }
.mt-4 { margin-top: var(--sp-4); }
.mt-8 { margin-top: var(--sp-8); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-8 { margin-bottom: var(--sp-8); }

/* ============================================================
   18. RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 1024px) {
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-3);
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --header-h: 56px;
  }

  .header-nav { display: none; }
  .header-search { display: none; }
  .menu-toggle { display: flex; }

  /* Mobile Nav Overlay */
  .header-nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--c-bg);
    padding: var(--sp-6);
    gap: var(--sp-2);
    z-index: 999;
    animation: fadeIn var(--t-fast) ease;
    overflow-y: auto;
  }

  .header-nav.open a {
    font-size: var(--fs-md);
    padding: var(--sp-3) var(--sp-4);
  }

  .hero {
    padding: var(--sp-10) 0 var(--sp-8);
  }

  .hero h1 {
    font-size: var(--fs-3xl);
  }

  .hero p {
    font-size: var(--fs-base);
  }

  .hero-stats {
    gap: var(--sp-5);
  }

  .hero-stat-number {
    font-size: var(--fs-xl);
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-3);
  }

  .category-card {
    padding: var(--sp-4) var(--sp-3);
  }

  .category-icon {
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
  }

  .tool-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
  }

  .tool-container {
    padding: var(--sp-5);
    border-radius: var(--r-xl);
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .result-details-grid {
    grid-template-columns: 1fr 1fr;
  }

  .article-content {
    padding: var(--sp-6);
    border-radius: var(--r-xl);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-8);
  }

  .section {
    padding: var(--sp-10) 0;
  }

  .btn-group {
    flex-direction: column;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .hero h1 {
    font-size: var(--fs-2xl);
  }

  .hero-search input {
    padding: var(--sp-3) var(--sp-4) var(--sp-3) 44px;
    font-size: var(--fs-sm);
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-details-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .cc-result-big {
    flex-direction: row !important;
    align-items: baseline !important;
    gap: var(--sp-2) !important;
  }

  .cc-result-number {
    font-size: var(--fs-4xl) !important;
  }

  .cc-result-sub {
    flex-direction: column !important;
    gap: var(--sp-1) !important;
  }

  .cc-result-sub-divider {
    display: none !important;
  }

  .cc-details-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ============================================================
   19. CHARACTER COUNT TOOL
   ============================================================ */

/* --- Result Bar (above input) --- */
.cc-result-bar {
  position: relative;
  background: var(--c-bg-card);
  border: 1.5px solid var(--c-border);
  border-bottom: none;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  padding: var(--sp-8);
  overflow: hidden;
}

.cc-result-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--c-primary) 0%, var(--c-accent) 50%, #8b5cf6 100%);
}

.cc-result-bar::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(37,99,235,0.03) 0%, transparent 60%);
  pointer-events: none;
}

[data-theme="dark"] .cc-result-bar::after {
  background: linear-gradient(180deg, rgba(37,99,235,0.06) 0%, transparent 60%);
}

.cc-result-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.cc-result-big {
  display: flex;
  flex-direction: column;
}

.cc-result-number {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: var(--fw-extrabold);
  line-height: 1;
  letter-spacing: -0.04em;
  transition: color var(--t-fast) ease;
}

.cc-result-number.primary {
  background: linear-gradient(135deg, var(--c-primary) 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cc-result-unit {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  font-weight: var(--fw-medium);
  margin-top: var(--sp-2);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cc-result-sub {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--c-text-secondary);
}

.cc-result-sub-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
}

.cc-result-sub strong {
  font-family: var(--font-mono);
  font-weight: var(--fw-bold);
  color: var(--c-text);
  font-size: var(--fs-xl);
}

.cc-result-sub-divider {
  color: var(--c-border);
  font-size: var(--fs-lg);
}

/* --- Input Wrap --- */
.cc-input-wrap {
  position: relative;
}

.cc-input-wrap textarea {
  width: 100%;
  min-height: 300px;
  padding: var(--sp-6);
  font-size: var(--fs-md);
  font-family: var(--font-main);
  color: var(--c-text);
  background: var(--c-bg-input);
  border: 1.5px solid var(--c-border);
  border-top: none;
  border-radius: 0 0 var(--r-2xl) var(--r-2xl);
  resize: vertical;
  line-height: var(--lh-relaxed);
  transition: border-color var(--t-base) ease, box-shadow var(--t-base) ease;
}

.cc-input-wrap textarea:focus {
  border-color: var(--c-primary);
  box-shadow: 0 4px 20px rgba(37,99,235,0.08);
  outline: none;
}

[data-theme="dark"] .cc-input-wrap textarea:focus {
  box-shadow: 0 4px 20px rgba(37,99,235,0.15);
}

.cc-input-wrap textarea::placeholder {
  color: var(--c-text-muted);
  font-size: var(--fs-base);
}

.cc-input-actions {
  position: absolute;
  bottom: var(--sp-4);
  right: var(--sp-4);
  display: flex;
  gap: var(--sp-2);
}

.cc-input-actions .btn-icon {
  width: 38px;
  height: 38px;
  background: var(--c-bg-card);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text-muted);
  opacity: 0.6;
  transition: all var(--t-base) var(--ease-out);
  backdrop-filter: blur(8px);
}

.cc-input-actions .btn-icon:hover {
  opacity: 1;
  color: var(--c-primary);
  border-color: var(--c-primary);
  background: var(--c-primary-50);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.15);
}

/* --- Details (collapsible) --- */
.cc-details {
  margin-top: var(--sp-6);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-xl);
  background: var(--c-bg-card);
  overflow: hidden;
  transition: border-color var(--t-base) ease;
}

.cc-details[open] {
  border-color: var(--c-primary-200);
}

.cc-details summary {
  padding: var(--sp-4) var(--sp-6);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-text-secondary);
  cursor: pointer;
  user-select: none;
  transition: all var(--t-fast) ease;
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.cc-details summary::-webkit-details-marker {
  display: none;
}

.cc-details summary::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform var(--t-base) var(--ease-out);
}

.cc-details[open] summary::before {
  transform: rotate(90deg);
}

.cc-details summary:hover {
  color: var(--c-primary);
  background: rgba(37,99,235,0.04);
}

[data-theme="dark"] .cc-details summary:hover {
  background: rgba(37,99,235,0.08);
}

.cc-details-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--c-border);
  border-top: 1px solid var(--c-border);
}

.cc-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-4);
  background: var(--c-bg-card);
  text-align: center;
}

.cc-detail span {
  color: var(--c-text-muted);
  font-size: var(--fs-xs);
}

.cc-detail strong {
  font-family: var(--font-mono);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--c-text);
}

.cc-detail strong {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--c-text);
}

@media (max-width: 768px) {
  .cc-result-bar {
    padding: var(--sp-4) var(--sp-5);
  }

  .cc-result-number {
    font-size: var(--fs-4xl);
  }

  .cc-details-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cc-input-wrap textarea {
    min-height: 220px;
  }
}
