/* QuickTools — colorful static toolkit */
:root {
  --bg: #f0f4ff;
  --bg-mid: #fdf4ff;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --cyan: #0891b2;
  --fuchsia: #c026d3;
  --amber: #d97706;
  --mint: #059669;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 8px rgba(79, 70, 229, 0.08), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 8px 28px rgba(79, 70, 229, 0.15), 0 4px 12px rgba(8, 145, 178, 0.1);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ad-bg: linear-gradient(135deg, #f8fafc 0%, #fae8ff 100%);
  --ad-border: #c4b5fd;
  --max-content: 720px;
  --header-h: 58px;
  --grad-hero: linear-gradient(120deg, #4f46e5 0%, #0891b2 45%, #a21caf 100%);
  --grad-btn: linear-gradient(135deg, #4f46e5 0%, #6366f1 40%, #0891b2 100%);
  --grad-btn-hover: linear-gradient(135deg, #4338ca 0%, #4f46e5 45%, #0e7490 100%);
  --card-accent-1: #6366f1;
  --card-accent-2: #0891b2;
  --card-accent-3: #db2777;
  --card-accent-4: #d97706;
  --card-accent-5: #059669;
  --card-accent-6: #7c3aed;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(ellipse 120% 80% at 100% -20%, rgba(192, 38, 211, 0.12), transparent 50%),
    radial-gradient(ellipse 100% 60% at 0% 100%, rgba(8, 145, 178, 0.14), transparent 45%),
    radial-gradient(ellipse 80% 50% at 50% 50%, rgba(79, 70, 229, 0.06), transparent 60%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid rgba(199, 210, 254, 0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  gap: 1rem;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.06);
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #22d3ee, #e879f9, #fbbf24, #6366f1);
  background-size: 200% 100%;
  opacity: 0.9;
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: -0.02em;
}
.brand:hover {
  text-decoration: none;
  color: var(--accent);
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35);
}
.brand-text {
  background: var(--grad-hero);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand:hover .brand-text {
  filter: brightness(1.05);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--text);
}
.nav-toggle span::before {
  top: -6px;
}
.nav-toggle span::after {
  top: 6px;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  align-items: center;
}
.site-nav a {
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 600;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--fuchsia);
  text-decoration: none;
}

.layout {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .layout--with-sidebar {
    grid-template-columns: 1fr 300px;
    align-items: start;
  }
}

.main-column {
  min-width: 0;
}

.sidebar {
  min-width: 0;
}

.ad-slot {
  background: #faf5ff;
  background-image: linear-gradient(145deg, rgba(238, 242, 255, 0.9) 0%, rgba(250, 232, 255, 0.95) 50%, rgba(224, 242, 254, 0.85) 100%);
  border: 1px dashed var(--ad-border);
  border-radius: var(--radius);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-align: center;
  padding: 1rem;
}
.ad-slot--leaderboard {
  min-height: 100px;
}
.ad-slot--rectangle {
  min-height: 250px;
}
.ad-slot--mobile {
  min-height: 60px;
}
.ad-slot p {
  margin: 0;
  max-width: 14rem;
}

.hero {
  text-align: center;
  padding: 1.75rem 1.25rem 1rem;
  margin: 0 auto 0.5rem;
  max-width: 42rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(238, 242, 255, 0.75) 40%, rgba(252, 231, 243, 0.5) 100%);
  border: 1px solid rgba(199, 210, 254, 0.5);
  box-shadow: var(--shadow);
}
.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.85rem, 4.5vw, 2.45rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: var(--grad-hero);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lead {
  margin: 0 auto;
  max-width: 36rem;
  color: #475569;
  font-size: 1.05rem;
}

.popular-tools {
  margin-top: 1.5rem;
  padding: 1.25rem 1rem 1.35rem;
  border-radius: var(--radius);
  background: linear-gradient(
    145deg,
    rgba(79, 70, 229, 0.07) 0%,
    rgba(255, 255, 255, 0.65) 42%,
    rgba(8, 145, 178, 0.06) 100%
  );
  border: 1px solid rgba(199, 210, 254, 0.55);
  box-shadow: var(--shadow);
}
.section-heading {
  margin: 0 0 0.4rem;
  font-size: clamp(1.2rem, 3vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #1e1b4b;
}
.section-lead {
  margin: 0 0 1rem;
  max-width: 40rem;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.45;
}
.tool-grid--popular {
  margin-top: 0.75rem;
}
section#tools .section-heading {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(199, 210, 254, 0.65);
}
section#tools .tool-grid {
  margin-top: 1rem;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.tool-card {
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(199, 210, 254, 0.55);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.25rem 1.15rem;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  overflow: hidden;
}
.tool-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--card-accent-1);
  border-radius: 4px 0 0 4px;
}
.tool-card:nth-child(6n + 2)::before {
  background: var(--card-accent-2);
}
.tool-card:nth-child(6n + 3)::before {
  background: var(--card-accent-3);
}
.tool-card:nth-child(6n + 4)::before {
  background: var(--card-accent-4);
}
.tool-card:nth-child(6n + 5)::before {
  background: var(--card-accent-5);
}
.tool-card:nth-child(6n)::before {
  background: var(--card-accent-6);
}
.tool-card:hover {
  border-color: #a5b4fc;
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.tool-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  font-weight: 700;
}
.tool-card h2 a {
  color: #1e1b4b;
}
.tool-card h2 a:hover {
  color: var(--cyan);
  text-decoration: none;
}
.tool-card p {
  margin: 0;
  font-size: 0.9rem;
  color: #64748b;
}

.page-tool {
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(199, 210, 254, 0.55);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  max-width: var(--max-content);
}
.page-tool::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1rem;
  right: 1rem;
  height: 3px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, #6366f1, #22d3ee, #e879f9);
  opacity: 0.85;
}
.page-tool h1 {
  margin: 0.35rem 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, #312e81 0%, #0e7490 55%, #86198f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-tool .subtitle {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}

input[type="text"],
input[type="number"],
input[type="url"],
input[type="color"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  font: inherit;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  margin-bottom: 1rem;
  min-height: 44px;
}
textarea {
  min-height: 140px;
  resize: vertical;
}

input[type="range"] {
  width: 100%;
  margin-bottom: 1rem;
  accent-color: #6366f1;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #818cf8;
  outline-offset: 1px;
  border-color: #6366f1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.65rem 1.1rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s, transform 0.1s;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: var(--grad-btn);
  color: #fff;
  box-shadow: 0 2px 12px rgba(79, 70, 229, 0.35);
}
.btn-primary:hover {
  background: var(--grad-btn-hover);
  box-shadow: 0 4px 16px rgba(8, 145, 178, 0.35);
}
.btn-secondary {
  background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #334155;
  border: 1px solid #cbd5e1;
}
.btn-secondary:hover {
  background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.output-box {
  background: linear-gradient(135deg, #eef2ff 0%, #ecfeff 100%);
  border: 1px solid #a5b4fc;
  border-radius: var(--radius-sm);
  border-left-width: 4px;
  border-left-color: #6366f1;
  padding: 0.75rem 1rem;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  font-size: 0.875rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 1rem;
  min-height: 3rem;
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.stat {
  background: linear-gradient(160deg, #faf5ff 0%, #f0f9ff 100%);
  border: 1px solid #ddd6fe;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  min-width: 100px;
}
.stat strong {
  display: block;
  font-size: 1.25rem;
  background: var(--grad-hero);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat span {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.site-footer {
  border-top: 1px solid rgba(199, 210, 254, 0.7);
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  background: linear-gradient(180deg, #faf5ff 0%, #ffffff 35%, #f0fdf4 100%);
}
.site-footer p {
  margin: 0.25rem 0;
}

.breadcrumb {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.breadcrumb a {
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s, opacity 0.2s;
  }
  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    background: linear-gradient(180deg, #ffffff 0%, #faf5ff 100%);
  }
  .site-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (min-width: 769px) {
  .site-nav ul {
    justify-content: flex-end;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.show-md {
  display: none;
}
@media (min-width: 900px) {
  .show-md {
    display: block;
  }
}

.hide-md {
  display: block;
}
@media (min-width: 900px) {
  .hide-md {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .tool-card:hover {
    transform: none;
  }
}
