:root {
  --bg: #eef3f6;
  --bg-deep: #dfe8ee;
  --surface: #ffffff;
  --surface-2: #f7fafc;
  --text: #0b1220;
  --muted: #5b6b7c;
  --border: rgba(15, 35, 55, 0.1);
  --accent: #0f766e;
  --accent-2: #ea580c;
  --accent-soft: rgba(15, 118, 110, 0.12);
  --accent-dark: #0b5f59;
  --ink: #0b1220;
  --shadow: 0 1px 2px rgba(11, 18, 32, 0.04), 0 12px 32px rgba(11, 18, 32, 0.06);
  --shadow-lg: 0 20px 50px rgba(11, 18, 32, 0.1);
  --radius: 18px;
  --radius-sm: 12px;
  --max: 1080px;
  --font-display: "Outfit", "Segoe UI", sans-serif;
  --font: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --cat-calculators: #0f766e;
  --cat-finance: #0369a1;
  --cat-pdf: #c2410c;
  --cat-image: #be185d;
  --cat-date: #0e7490;
  --cat-text: #3f6212;
  --cat-developer: #334155;
  --cat-converters: #0f766e;
  --cat-health: #059669;
  --cat-generators: #b45309;
  --cat-color: #9d174d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 420px at 8% -8%, rgba(15, 118, 110, 0.18), transparent 55%),
    radial-gradient(700px 380px at 92% 0%, rgba(234, 88, 12, 0.12), transparent 50%),
    linear-gradient(180deg, #f5f8fa 0%, var(--bg) 40%, #e8eef3 100%);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(15, 35, 55, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 35, 55, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px) saturate(1.2);
  background: rgba(245, 248, 250, 0.82);
  border-bottom: 1px solid var(--border);
}

.site-header-inner,
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 18px;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 1.2rem;
  text-decoration: none;
}
.brand span {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
}
.brand:hover { text-decoration: none; }

.nav-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  justify-content: flex-end;
}
.nav-links a {
  color: var(--muted);
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.hero {
  padding: 42px 0 22px;
}
.hero-compact { padding-top: 28px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.1rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
  max-width: 14ch;
}
.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 54ch;
  font-size: 1.08rem;
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.hero-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.hero-stat span { color: var(--accent); font-family: var(--font-display); }

.search-box {
  margin: 24px 0 8px;
  display: flex;
  gap: 8px;
  max-width: 640px;
}
.search-box input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 1.02rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.88rem;
  color: var(--muted);
  margin: 18px 0 8px;
}
.breadcrumbs a { color: var(--muted); font-weight: 700; }
.breadcrumbs .sep { opacity: 0.45; }
.breadcrumbs .current { color: var(--text); font-weight: 800; }

.section { padding: 22px 0 10px; }
.section-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--card-accent, var(--accent));
  box-shadow: 0 16px 36px rgba(11, 18, 32, 0.12);
  background: #fff;
  text-decoration: none;
}
.card:hover h3 {
  color: var(--card-accent, var(--accent-dark));
}
.card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .meta {
  margin-top: auto;
  padding-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--card-accent, var(--accent));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
}
.card .meta::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.tool-layout {
  display: grid;
  gap: 18px;
  padding-bottom: 56px;
}

.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.tool-panel { padding: 22px; }

.tool-intro h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.8vw, 2.25rem);
  letter-spacing: -0.035em;
}
.tool-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 62ch;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}
.field label {
  font-size: 0.9rem;
  font-weight: 700;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.45;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.field-hint {
  font-size: 0.82rem;
  color: var(--muted);
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hero h1 { max-width: none; }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
button,
.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}
button:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #0d9488 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.25);
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #eef2f5; }

.results { display: grid; gap: 10px; }
.result-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 14px 16px;
  background: linear-gradient(180deg, #f8fbfc, #f3f7f9);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.result-item .label { color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.result-item .value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  text-align: right;
  word-break: break-word;
}

.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

.content-block h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}
.content-block p,
.content-block li {
  color: var(--muted);
  font-size: 0.95rem;
}
.content-block ol,
.content-block ul {
  margin: 0;
  padding-left: 1.2rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.35);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: space-between;
}
.site-footer a { color: var(--muted); font-weight: 700; }

.hidden { display: none !important; }
.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
}

.dropzone {
  border: 2px dashed rgba(15, 118, 110, 0.35);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f0fdfa, #ecfeff);
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.dropzone strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
}
.dropzone .hint { color: var(--muted); font-size: 0.9rem; }
.dropzone input[type="file"] { display: none; }

.file-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.file-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.92rem;
}
.file-list .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.file-list .size { color: var(--muted); white-space: nowrap; font-size: 0.85rem; }
.file-list button {
  border: 0;
  background: transparent;
  color: #b91c1c;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
}

.status-line {
  margin-top: 12px;
  font-size: 0.92rem;
  color: var(--muted);
}
.status-line.error { color: #b91c1c; font-weight: 700; }
.status-line.ok { color: var(--accent-dark); font-weight: 700; }

.progress {
  margin-top: 10px;
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #14b8a6);
  transition: width 0.2s ease;
}

.download-links {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.download-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}
.download-links a:hover { background: #99f6e4; }

.color-swatch {
  width: 100%;
  height: 72px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: 4px 0 14px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
}

.qr-wrap {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  padding: 18px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 30% 20%, rgba(15,118,110,0.08), transparent 45%),
    #f8fafc;
  border: 1px solid var(--border);
}
.qr-wrap canvas {
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero, .section, .tool-layout > .panel {
  animation: rise-in 0.45s ease both;
}
.section:nth-of-type(2) { animation-delay: 0.05s; }
.section:nth-of-type(3) { animation-delay: 0.1s; }

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