/* =====================================================
   PDF Tools – Ultra Modern SaaS UI (ONE FILE)
   Light UI • Responsive • Animated • User Friendly
   ===================================================== */

/* ---------------- ROOT VARIABLES ---------------- */
:root {
  /* Brand (Light) */
  --blue: #2563eb;
  --red: #dc2626;

  --gradient-main: linear-gradient(135deg, #2563eb, #dc2626);

  /* Soft UI colors */
  --soft-blue: #eff6ff;
  --soft-red: #fff1f2;

  /* Backgrounds */
  --bg-main: #ffffff;
  --bg-soft: #f8fafc;
  --bg-card: #ffffff;

  /* Text */
  --text-main: #020617;
  --text-muted: #64748b;

  /* Borders & radius */
  --border: #e5e7eb;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;

  /* Shadows */
  --shadow-sm: 0 6px 16px rgba(0,0,0,.05);
  --shadow-md: 0 16px 40px rgba(0,0,0,.08);
  --shadow-lg: 0 30px 80px rgba(0,0,0,.12);

  /* Motion */
  --transition-fast: 160ms ease;
  --transition: 300ms cubic-bezier(.4,0,.2,1);
}

/* ---------------- DARK MODE (AUTO) ---------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-main: #020617;
    --bg-soft: #020617;
    --bg-card: #020617;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #1e293b;
  }
}

/* ---------------- RESET ---------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- TYPOGRAPHY ---------------- */
h1, h2, h3 {
  font-weight: 800;
  letter-spacing: -0.025em;
}

h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
h3 { font-size: 1.2rem; }

p {
  color: var(--text-muted);
  max-width: 65ch;
}

/* ---------------- LAYOUT ---------------- */
.container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1rem;
}

.section {
  padding-block: clamp(2.5rem, 6vw, 5.5rem);
}

/* ---------------- HEADER ---------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg-main) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.header.scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo {
  font-weight: 900;
  font-size: 1.1rem;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------------- NAVIGATION ---------------- */
.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  color: var(--text-muted);
  font-weight: 500;
  position: relative;
  transition: color var(--transition-fast);
}

.nav a:hover,
.nav a.active {
  color: var(--blue);
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--gradient-main);
  transform: scaleX(0);
  transition: transform var(--transition);
}

.nav a:hover::after {
  transform: scaleX(1);
}

/* ---------------- HERO ---------------- */
.hero {
  text-align: center;
  background: linear-gradient(180deg, var(--soft-blue), #ffffff);
}

.hero p {
  margin-inline: auto;
}

/* ---------------- BUTTONS ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .9rem 1.7rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform var(--transition), box-shadow var(--transition);
}

.btn-primary {
  background: var(--gradient-main);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--blue);
  color: var(--blue);
}

.btn-outline:hover {
  background: var(--blue);
  color: white;
}

/* ================= GRID SYSTEM ================= */
.grid {
  display: grid;
  gap: 1.8rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}


/* =================================================
   TOOL CARDS – AUTO RESPONSIVE & LIGHT
   ================================================= */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}


/* Card */
.tool-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem 1.5rem;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

/* Hover only on desktop */
@media (hover: hover) {
  .tool-card:hover {
    background: var(--bg-soft);
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
  }
}

/* Icon */
.tool-icon {
  width: 56px;
  height: 56px;
  margin-inline: auto;
  margin-bottom: 1rem;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--soft-blue), var(--soft-red));
  color: var(--blue);
}

/* Title */
.tool-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: .3rem;
}

/* Description */
.tool-desc {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex-grow: 1;
}

/* CTA */
.tool-action {
  margin-top: 1rem;
  font-weight: 600;
  color: var(--blue);
}

.tool-action::after {
  content: " →";
  transition: transform var(--transition);
}

@media (hover: hover) {
  .tool-card:hover .tool-action::after {
    transform: translateX(4px);
  }
}

/* ---------------- FORMS ---------------- */
input,
textarea,
select {
  width: 100%;
  padding: .9rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37,99,235,.15);
}

/* Upload */
.file-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem;
  text-align: center;
  background: var(--bg-soft);
  transition: border-color var(--transition), background var(--transition);
}

.file-upload:hover {
  border-color: var(--red);
  background: var(--soft-red);
}

/* ---------------- FOOTER ---------------- */
footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 3.5rem 0 2rem;
  text-align: center;
}

footer p {
  font-size: .85rem;
}

/* ---------------- UTILITIES ---------------- */
.text-center { text-align: center; }
.hidden { display: none !important; }

/* ---------------- MOBILE OPTIMIZATION ---------------- */
@media (max-width: 640px) {
  .tool-card {
    padding: 1.5rem 1.3rem;
  }

  .tool-icon {
    width: 50px;
    height: 50px;
    font-size: 1.35rem;
  }

  .tool-title {
    font-size: 1rem;
  }

  .tool-desc {
    font-size: .88rem;
  }
}

/* ---------------- ACCESSIBILITY ---------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------------- PRINT ---------------- */
@media print {
  header, footer { display: none; }
}
