/* ============================================================
   未来の道具箱 — Design System (Futuristic Imagination)
   Clean · precise · quietly futuristic. FI-blue monochrome chrome
   with a harmonised category accent set. Light theme, refined depth.
   ============================================================ */

:root {
  /* ---- Canvas & surfaces (cool neutrals) ---- */
  --bg:            #f6f8fc;
  --bg-dark:       #f6f8fc;   /* legacy alias */
  --bg-secondary:  #eef2f9;
  --bg-tertiary:   #e5ebf5;
  --bg-card:       #ffffff;
  --surface:       #ffffff;
  --card:          #ffffff;
  --bg-card-hover: #f4f8ff;
  --bg-input:      #f1f4fb;
  --glass-bg:      rgba(255, 255, 255, 0.72);

  /* ---- Ink ---- */
  --text:          #0f172a;
  --text-primary:  #0f172a;
  --text-secondary:#475569;
  --text-muted:    #64748b;
  --text-tertiary: #94a3b8;
  --text-dim:      #94a3b8;
  --muted:         #94a3b8;

  /* ---- Primary — FI blue ---- */
  --primary:       #2563eb;
  --primary-light: #3b82f6;
  --primary-dark:  #1d4ed8;
  --primary-bg:    rgba(37, 99, 235, 0.08);
  --primary-glow:  rgba(37, 99, 235, 0.16);
  --secondary:     #7c3aed;

  /* ---- Category accents (harmonised, modern) ---- */
  --cat-pdf:   #6366f1;  /* calc  — indigo  */
  --cat-image: #f59e0b;  /* image — amber   */
  --cat-video: #8b5cf6;  /* file  — violet  */
  --cat-ai:    #0891b2;  /* text  — cyan    */
  --cat-dev:   #10b981;  /* dev   — emerald */
  --cat-util:  #f43f5e;  /* util  — rose    */

  /* ---- Borders ---- */
  --border:       #e4e9f2;
  --border-color: #e4e9f2;
  --glass-border: rgba(15, 23, 42, 0.07);
  --border-glow:  rgba(37, 99, 235, 0.35);

  /* ---- Status ---- */
  --success: #10b981;
  --error:   #ef4444;

  /* ---- Radius ---- */
  --radius:    16px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  /* ---- Elevation (soft, layered, slate-tinted) ---- */
  --shadow-sm:   0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow:      0 2px 6px rgba(15, 23, 42, 0.05), 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-lg:   0 16px 50px rgba(15, 23, 42, 0.11);
  --shadow-glow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(1200px 520px at 50% -8%, rgba(37, 99, 235, 0.08) 0%, transparent 70%),
    radial-gradient(900px 500px at 100% 0%, rgba(139, 92, 246, 0.05) 0%, transparent 60%);
  background-attachment: fixed;
}

/* ==================== HEADER ==================== */
.header {
  background: var(--glass-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.logo:hover .logo-icon {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.4);
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(145deg, var(--primary-light) 0%, var(--primary-dark) 100%);
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-text {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo-text span {
  color: var(--text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
  transition: width 0.25s ease;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a:hover::after {
  width: 100%;
}

/* ==================== HERO ==================== */
.hero {
  text-align: center;
  padding: 5rem 2rem 3.5rem;
  max-width: 880px;
  margin: 0 auto;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 640px;
  height: 420px;
  max-width: 100%;
  background: radial-gradient(ellipse, var(--primary-glow) 0%, transparent 68%);
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--primary-bg);
  border: 1px solid rgba(37, 99, 235, 0.22);
  padding: 0.5rem 1.1rem;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 1.75rem;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.08;
  margin-bottom: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--text);
  position: relative;
  z-index: 1;
}

.hero-title .highlight {
  background: linear-gradient(120deg, var(--primary) 0%, var(--primary-light) 55%, var(--secondary) 120%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.18rem;
  margin: 0 auto 2.5rem;
  max-width: 600px;
  position: relative;
  z-index: 1;
}

/* Search Box */
.search-container {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 60px;
  padding: 0.4rem 0.4rem 0.4rem 0.5rem;
  box-shadow: var(--shadow);
  transition: all 0.25s;
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow), var(--shadow);
}

.search-icon {
  padding: 0 1rem;
  color: var(--text-tertiary);
  display: flex;
}

.search-input {
  flex: 1;
  border: none;
  padding: 0.8rem 0;
  font-size: 1rem;
  background: transparent;
  outline: none;
  color: var(--text);
  font-family: inherit;
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-btn {
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  color: #fff;
  border: none;
  padding: 0.8rem 1.9rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: all 0.25s;
}

.search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.42);
}

/* ==================== MAIN CONTENT ==================== */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem 2rem;
}

/* ==================== CATEGORY CARDS ==================== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3.5rem;
}

.category-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s, border-color 0.35s;
  position: relative;
}

.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, transparent 0%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: background 0.35s;
}

.category-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.category-card:hover::before {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.category-card-header {
  padding: 1.75rem 1.75rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.category-card-header::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  opacity: 0.16;
  transform: translate(32%, -34%);
  transition: transform 0.4s ease;
}

.category-card:hover .category-card-header::before {
  transform: translate(24%, -30%) scale(1.08);
}

.category-card-header.calc  { background: linear-gradient(140deg, rgba(99, 102, 241, 0.14) 0%, transparent 78%); }
.category-card-header.calc::before  { background: var(--cat-pdf); }
.category-card-header.image { background: linear-gradient(140deg, rgba(245, 158, 11, 0.14) 0%, transparent 78%); }
.category-card-header.image::before { background: var(--cat-image); }
.category-card-header.file  { background: linear-gradient(140deg, rgba(139, 92, 246, 0.14) 0%, transparent 78%); }
.category-card-header.file::before  { background: var(--cat-video); }
.category-card-header.text  { background: linear-gradient(140deg, rgba(8, 145, 178, 0.14) 0%, transparent 78%); }
.category-card-header.text::before  { background: var(--cat-ai); }
.category-card-header.dev   { background: linear-gradient(140deg, rgba(16, 185, 129, 0.14) 0%, transparent 78%); }
.category-card-header.dev::before   { background: var(--cat-dev); }
.category-card-header.util  { background: linear-gradient(140deg, rgba(244, 63, 94, 0.14) 0%, transparent 78%); }
.category-card-header.util::before  { background: var(--cat-util); }

.category-icon {
  width: 52px;
  height: 52px;
  background: var(--bg-card);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 1;
}

.category-card-header.calc  .category-icon svg { color: var(--cat-pdf); }
.category-card-header.image .category-icon svg { color: var(--cat-image); }
.category-card-header.file  .category-icon svg { color: var(--cat-video); }
.category-card-header.text  .category-icon svg { color: var(--cat-ai); }
.category-card-header.dev   .category-icon svg { color: var(--cat-dev); }
.category-card-header.util  .category-icon svg { color: var(--cat-util); }

.category-icon svg {
  width: 26px;
  height: 26px;
  color: var(--primary);
}

.category-count {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  background: var(--bg-card);
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 1;
}

.category-card-body {
  padding: 1.25rem 1.75rem 1.75rem;
}

.category-title {
  font-size: 1.18rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
}

.category-title svg {
  width: 19px;
  height: 19px;
  color: var(--text-tertiary);
  transition: all 0.3s;
}

.category-card:hover .category-title svg {
  transform: translateX(5px);
  color: var(--primary);
}

.category-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ==================== TOOL GRID ==================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.35rem;
  padding-top: 1rem;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.9rem;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  display: flex;
  gap: 0.95rem;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s, border-color 0.25s;
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.tool-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.tool-card:hover::before {
  transform: scaleX(1);
}

.tool-icon {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.45rem;
  position: relative;
  background: var(--bg-secondary);
}

.tool-icon.calc  { background: linear-gradient(140deg, rgba(99, 102, 241, 0.16), rgba(99, 102, 241, 0.04)); }
.tool-icon.image { background: linear-gradient(140deg, rgba(245, 158, 11, 0.16), rgba(245, 158, 11, 0.04)); }
.tool-icon.file  { background: linear-gradient(140deg, rgba(139, 92, 246, 0.16), rgba(139, 92, 246, 0.04)); }
.tool-icon.text  { background: linear-gradient(140deg, rgba(8, 145, 178, 0.16), rgba(8, 145, 178, 0.04)); }
.tool-icon.dev   { background: linear-gradient(140deg, rgba(16, 185, 129, 0.16), rgba(16, 185, 129, 0.04)); }
.tool-icon.util  { background: linear-gradient(140deg, rgba(244, 63, 94, 0.16), rgba(244, 63, 94, 0.04)); }

.tool-content {
  flex: 1;
  min-width: 0;
}

.tool-name {
  font-weight: 700;
  font-size: 0.98rem;
  margin-bottom: 0.2rem;
  color: var(--text);
}

.tool-category {
  font-size: 0.68rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tool-category.calc  { color: var(--cat-pdf); }
.tool-category.image { color: var(--cat-image); }
.tool-category.file  { color: var(--cat-video); }
.tool-category.text  { color: var(--cat-ai); }
.tool-category.dev   { color: var(--cat-dev); }
.tool-category.util  { color: var(--cat-util); }

.tool-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==================== TOOL PAGE ==================== */
.tool-page {
  padding: 2.5rem 2rem;
  max-width: 820px;
  margin: 0 auto;
}

.tool-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  border: 1px solid var(--border);
}

.tool-header {
  text-align: center;
  margin-bottom: 2.25rem;
}

.tool-header-icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 1.35rem;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  position: relative;
  color: #fff;
}

.tool-header-icon::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 27px;
  background: inherit;
  opacity: 0.28;
  filter: blur(14px);
  z-index: -1;
}

.tool-header-icon.calc  { background: linear-gradient(140deg, var(--cat-pdf) 0%, #818cf8 100%); }
.tool-header-icon.image { background: linear-gradient(140deg, var(--cat-image) 0%, #fbbf24 100%); }
.tool-header-icon.file  { background: linear-gradient(140deg, var(--cat-video) 0%, #a78bfa 100%); }
.tool-header-icon.text  { background: linear-gradient(140deg, var(--cat-ai) 0%, #22d3ee 100%); }
.tool-header-icon.dev   { background: linear-gradient(140deg, var(--cat-dev) 0%, #34d399 100%); }
.tool-header-icon.util  { background: linear-gradient(140deg, var(--cat-util) 0%, #fb7185 100%); }

.tool-page-title {
  font-size: 1.95rem;
  font-weight: 800;
  margin-bottom: 0.65rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.tool-page-desc {
  color: var(--text-muted);
  font-size: 1.02rem;
}

/* ==================== FORMS ==================== */
.form-group {
  margin-bottom: 1.6rem;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
  color: var(--text);
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="url"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="time"],
textarea,
select {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s;
  background: var(--bg-input);
  color: var(--text);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

textarea {
  min-height: 160px;
  resize: vertical;
}

select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.2rem;
  padding-right: 3rem;
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.9rem;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.32);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.42);
}

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

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

.btn-full {
  width: 100%;
}

.btn svg {
  width: 20px;
  height: 20px;
}

/* ==================== DROP ZONE ==================== */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 3.25rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: var(--bg-input);
  position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.drop-zone-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 1.15rem;
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  color: #fff;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.32);
}

.drop-zone-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.drop-zone-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==================== RESULT ==================== */
.result-area {
  margin-top: 2rem;
  padding: 1.6rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.result-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.result-value {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--primary) 0%, var(--cat-ai) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1.25rem;
  text-align: center;
}

.result-item {
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.result-item-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.result-item-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==================== FOOTER ==================== */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  padding: 3.25rem 2rem;
  margin-top: 4.5rem;
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.footer-tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.75rem;
  margin-bottom: 1.75rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

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

.tool-card,
.category-card {
  animation: fadeInUp 0.45s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .header { padding: 0.7rem 1rem; }
  .hero { padding: 3rem 1rem 2.25rem; }
  .hero-title { font-size: 2.4rem; letter-spacing: -0.02em; }
  .hero-subtitle { font-size: 1rem; }
  .category-grid { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-container { padding: 1.5rem; border-radius: var(--radius); }
  main { padding: 1.25rem 1rem; }
  .nav-links { gap: 1rem; }
  .section-title { font-size: 1.2rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }
  .search-btn { padding: 0.7rem 1.2rem; }
  .tool-header-icon { width: 70px; height: 70px; font-size: 1.9rem; }
  .nav-links a { font-size: 0.82rem; }
}

/* ==================== FAQ SECTION ==================== */
.faq-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.faq-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
}

.faq-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.7rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1rem 1.25rem;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s;
}

.faq-question:hover {
  background: var(--bg-tertiary);
}

.faq-question::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--primary);
  transition: transform 0.25s;
}

.faq-item.open .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.faq-item.open .faq-answer {
  padding: 0 1.25rem 1rem;
  max-height: 500px;
}

.faq-answer p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

/* ==================== PREMIUM BADGE ==================== */
.premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #422006;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.premium-badge svg {
  width: 12px;
  height: 12px;
}

/* ==================== HOW TO USE ==================== */
.how-to-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.how-to-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.how-to-steps {
  display: grid;
  gap: 1rem;
}

.how-to-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-number {
  width: 32px;
  height: 32px;
  background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  color: var(--text);
}

.step-content p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==================== RELATED TOOLS ==================== */
.related-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.9rem;
}

.related-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.related-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.related-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  flex-shrink: 0;
}

.related-card-icon.calc { background: linear-gradient(140deg, var(--cat-pdf), #818cf8); }
.related-card-icon.text { background: linear-gradient(140deg, var(--cat-video), #a78bfa); }
.related-card-icon.util { background: linear-gradient(140deg, var(--cat-util), #fb7185); }
.related-card-icon.dev  { background: linear-gradient(140deg, var(--cat-dev), #34d399); }
.related-card-icon.image { background: linear-gradient(140deg, var(--cat-image), #fbbf24); }
.related-card-icon.file  { background: linear-gradient(140deg, var(--cat-ai), #22d3ee); }

.related-card-content {
  min-width: 0;
}

.related-card-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== PRIVACY BADGE ==================== */
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  font-size: 0.85rem;
  color: #059669;
  font-weight: 600;
  margin-top: 0.75rem;
}

.privacy-badge-icon {
  font-size: 1rem;
}

/* ==================== AD SPACE ==================== */
.ad-space {
  width: 100%;
  min-height: 250px;
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
  position: relative;
}

.ad-space-label {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* PC only - side ad rails */
@media (min-width: 1024px) {
  .ad-space {
    min-height: 280px;
    max-width: 336px;
    margin: 1.5rem auto;
  }

  .tool-page-with-ads {
    display: grid;
    grid-template-columns: 1fr minmax(auto, 800px) 1fr;
    gap: 2rem;
    max-width: 1400px;
    padding: 3rem 1rem;
  }

  .tool-page-with-ads > .ad-space:first-child,
  .tool-page-with-ads > .ad-space:last-of-type {
    position: sticky;
    top: 100px;
    height: fit-content;
    margin: 0;
  }

  .tool-page-with-ads > .tool-container,
  .tool-page-with-ads > .related-section {
    grid-column: 2;
  }
}

/* Mobile - hide side ads */
@media (max-width: 1023px) {
  .tool-page > .ad-space:first-child,
  .tool-page > .ad-space:last-of-type,
  .tool-page-with-ads > .ad-space:first-child,
  .tool-page-with-ads > .ad-space:last-of-type {
    display: none;
  }
}
