/* ============================================================
   ToolNest — Premium All-in-One Tools Platform
   Design System & Global Styles
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Brand */
  --brand-50:  #eef4ff;
  --brand-100: #d9e6ff;
  --brand-200: #bcd3ff;
  --brand-300: #8eb6ff;
  --brand-400: #598dff;
  --brand-500: #3366ff;
  --brand-600: #1f49f5;
  --brand-700: #1838d8;
  --brand-800: #1a31ae;
  --brand-900: #1b3089;
  --accent:    #00d4b8;
  --accent-2:  #ff7a59;

  /* Light theme surfaces */
  --bg:        #f7f9fc;
  --bg-soft:   #eef2f9;
  --surface:   #ffffff;
  --surface-2: #f3f6fb;
  --border:    #e4e9f2;
  --border-strong: #cdd6e6;

  /* Text */
  --text:      #0f1729;
  --text-soft: #44506b;
  --text-mute: #6b7793;

  /* Feedback */
  --success: #14b87a;
  --warning: #f5a623;
  --danger:  #ef4350;

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.05);
  --shadow-md: 0 4px 12px rgba(16,24,40,.08), 0 2px 6px rgba(16,24,40,.05);
  --shadow-lg: 0 18px 40px -12px rgba(16,24,40,.22);
  --shadow-glow: 0 8px 30px -8px rgba(51,102,255,.45);
  --ring: 0 0 0 3px rgba(51,102,255,.28);

  /* Geometry */
  --radius-sm: 10px;
  --radius:    14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  /* Layout */
  --maxw: 1200px;
  --header-h: 68px;
  --gradient: linear-gradient(135deg, var(--brand-500), var(--brand-700) 60%, #6b3df5);
  --gradient-soft: linear-gradient(135deg, rgba(51,102,255,.10), rgba(107,61,245,.06));
}

[data-theme="dark"] {
  --bg:        #0a0e1a;
  --bg-soft:   #0f1424;
  --surface:   #121a2e;
  --surface-2: #18203a;
  --border:    #233153;
  --border-strong: #33446b;

  --text:      #eef2fb;
  --text-soft: #b6c1da;
  --text-mute: #8593b3;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 6px 16px rgba(0,0,0,.45);
  --shadow-lg: 0 22px 48px -14px rgba(0,0,0,.7);
  --shadow-glow: 0 8px 34px -8px rgba(51,102,255,.55);
  --gradient-soft: linear-gradient(135deg, rgba(51,102,255,.18), rgba(107,61,245,.12));
}

/* ---------- Reset ---------- */
*,*::before,*::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .3s ease, color .3s ease;
  overflow-x: hidden;
}
img,svg,video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input,select,textarea { font: inherit; color: inherit; }
ul { list-style: none; padding: 0; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.section { padding: 64px 0; }
.section-sm { padding: 40px 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--brand-600); background: var(--gradient-soft);
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border);
}
[data-theme="dark"] .eyebrow { color: var(--brand-300); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -.02em; margin: 14px 0 10px; }
.section-head p { color: var(--text-mute); font-size: 1.05rem; }
.text-grad { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 22px; border-radius: var(--radius-sm); font-weight: 600; font-size: .95rem;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s; white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { box-shadow: 0 10px 36px -6px rgba(51,102,255,.6); transform: translateY(-2px); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--brand-400); color: var(--brand-600); transform: translateY(-2px); }
.btn-soft { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-soft:hover { background: var(--bg-soft); }
.btn-lg { padding: 15px 30px; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .25s ease, background .3s;
}
.site-header.scrolled { box-shadow: var(--shadow-md); }
.nav { height: var(--header-h); display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 1.22rem; letter-spacing: -.02em; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; background: var(--gradient);
  display: grid; place-items: center; color: #fff; box-shadow: var(--shadow-glow); flex: none;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand b { color: var(--text); }
.brand span { color: var(--brand-500); }

.nav-menu { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 10px;
  font-weight: 500; font-size: .95rem; color: var(--text-soft); transition: color .15s, background .15s;
}
.nav-link:hover, .nav-item:hover .nav-link { color: var(--text); background: var(--surface-2); }
.nav-link .chev { width: 14px; height: 14px; transition: transform .2s; }
.nav-item:hover .nav-link .chev { transform: rotate(180deg); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* Mega menu */
.mega {
  position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%) translateY(8px);
  width: min(720px, 90vw); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 22px;
  display: grid; grid-template-columns: repeat(2,1fr); gap: 8px 26px;
  opacity: 0; visibility: hidden; transition: opacity .2s ease, transform .2s ease; z-index: 110;
}
.mega::before { content:""; position:absolute; top:-12px; left:0; right:0; height:12px; }
.nav-item:hover .mega, .nav-item:focus-within .mega { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.mega-col h4 {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-mute);
  margin: 6px 8px 8px; font-weight: 700;
}
.mega-link { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; transition: background .15s; }
.mega-link:hover { background: var(--surface-2); }
.mega-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--gradient-soft); display: grid; place-items: center; color: var(--brand-600); flex: none; }
[data-theme="dark"] .mega-ic { color: var(--brand-300); }
.mega-ic svg { width: 18px; height: 18px; }
.mega-link b { display: block; font-size: .9rem; font-weight: 600; color: var(--text); }
.mega-link small { color: var(--text-mute); font-size: .78rem; }

/* Icon buttons */
.icon-btn {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform .15s, border-color .15s, color .15s;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--brand-400); color: var(--brand-600); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }
.menu-toggle { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 70px 0 50px; overflow: hidden; }
.hero::before {
  content:""; position: absolute; inset: -40% -20% auto; height: 620px; z-index: -1;
  background:
    radial-gradient(620px 320px at 20% 0%, rgba(51,102,255,.20), transparent 70%),
    radial-gradient(540px 300px at 85% 10%, rgba(0,212,184,.16), transparent 70%);
  filter: blur(6px);
}
.hero-inner { text-align: center; max-width: 820px; margin-inline: auto; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.08; letter-spacing: -.03em; margin: 18px 0 18px; font-weight: 800; }
.hero p { font-size: clamp(1.02rem, 1.6vw, 1.22rem); color: var(--text-mute); max-width: 600px; margin-inline: auto; }
.hero-search { margin: 32px auto 18px; max-width: 620px; position: relative; }
.hero-search input {
  width: 100%; padding: 17px 56px 17px 52px; border-radius: 999px; font-size: 1.02rem;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md); transition: box-shadow .2s, border-color .2s;
}
.hero-search input:focus { border-color: var(--brand-400); box-shadow: var(--ring), var(--shadow-md); }
.hero-search .s-ic { position: absolute; left: 19px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--text-mute); }
.hero-search .s-key { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: .72rem; color: var(--text-mute); border: 1px solid var(--border); padding: 3px 8px; border-radius: 7px; background: var(--surface-2); }
.hero-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.hero-tag { font-size: .82rem; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-soft); transition: all .15s; }
.hero-tag:hover { border-color: var(--brand-400); color: var(--brand-600); transform: translateY(-2px); }
.hero-stats { display: flex; justify-content: center; gap: 40px; margin-top: 40px; flex-wrap: wrap; }
.hero-stat b { display: block; font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; }
.hero-stat span { color: var(--text-mute); font-size: .88rem; }

/* Search dropdown */
.search-results {
  position: absolute; top: calc(100% + 10px); left: 0; right: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px; max-height: 360px; overflow-y: auto; z-index: 50; text-align: left; display: none;
}
.search-results.open { display: block; animation: pop .18s ease; }
.sr-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; transition: background .12s; }
.sr-item:hover, .sr-item.active { background: var(--surface-2); }
.sr-ic { width: 36px; height: 36px; border-radius: 9px; background: var(--gradient-soft); display: grid; place-items: center; color: var(--brand-600); flex: none; }
[data-theme="dark"] .sr-ic { color: var(--brand-300); }
.sr-ic svg { width: 18px; height: 18px; }
.sr-item b { font-size: .92rem; font-weight: 600; }
.sr-item small { display: block; color: var(--text-mute); font-size: .78rem; }
.sr-cat { margin-left: auto; font-size: .72rem; color: var(--text-mute); background: var(--surface-2); padding: 4px 9px; border-radius: 999px; }
.sr-empty { padding: 22px; text-align: center; color: var(--text-mute); }

/* ---------- Category filter chips ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 34px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-weight: 500; font-size: .9rem;
  color: var(--text-soft); transition: all .15s; box-shadow: var(--shadow-sm);
}
.chip:hover { transform: translateY(-2px); border-color: var(--brand-400); }
.chip.active { background: var(--gradient); color: #fff; border-color: transparent; box-shadow: var(--shadow-glow); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- Tool grid + cards ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 18px; }
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
  overflow: hidden;
}
.tool-card::after {
  content:""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, rgba(51,102,255,.5), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .2s;
}
.tool-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: transparent; }
.tool-card:hover::after { opacity: 1; }
.tool-card .tc-ic {
  width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center;
  background: var(--gradient-soft); color: var(--brand-600); flex: none;
}
[data-theme="dark"] .tool-card .tc-ic { color: var(--brand-300); }
.tool-card .tc-ic svg { width: 26px; height: 26px; }
.tool-card h3 { font-size: 1.06rem; font-weight: 700; letter-spacing: -.01em; }
.tool-card p { color: var(--text-mute); font-size: .88rem; line-height: 1.5; flex: 1; }
.tool-card .tc-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.tool-card .tc-cat { font-size: .74rem; color: var(--text-mute); }
.tool-card .tc-go { margin-left: auto; color: var(--brand-500); display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; font-weight: 600; transition: gap .15s; }
.tool-card:hover .tc-go { gap: 8px; }
.badge { position: absolute; top: 16px; right: 16px; font-size: .68rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.badge-hot { background: rgba(255,122,89,.16); color: var(--accent-2); }
.badge-new { background: rgba(0,212,184,.16); color: #06a890; }
.badge-trend { background: rgba(51,102,255,.14); color: var(--brand-600); }
[data-theme="dark"] .badge-trend { color: var(--brand-300); }

/* Category overview cards */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 18px; }
.cat-card {
  display: flex; gap: 16px; padding: 24px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--brand-300); }
.cat-card .cc-ic { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: var(--shadow-md); }
.cat-card .cc-ic svg { width: 28px; height: 28px; }
.cat-card h3 { font-size: 1.1rem; }
.cat-card p { color: var(--text-mute); font-size: .86rem; margin-top: 3px; }
.cat-card .cc-count { font-size: .78rem; color: var(--brand-500); font-weight: 600; margin-top: 8px; }

/* ---------- Feature band ---------- */
.feature-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 18px; }
.feature { display: flex; gap: 14px; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.feature .f-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--gradient-soft); display: grid; place-items: center; color: var(--brand-600); flex: none; }
[data-theme="dark"] .feature .f-ic { color: var(--brand-300); }
.feature h4 { font-size: 1rem; margin-bottom: 3px; }
.feature p { color: var(--text-mute); font-size: .86rem; }

/* ---------- CTA ---------- */
.cta-band { background: var(--gradient); border-radius: var(--radius-xl); padding: 56px 40px; text-align: center; color: #fff; position: relative; overflow: hidden; }
.cta-band::before { content:""; position:absolute; inset:0; background: radial-gradient(500px 200px at 80% 0%, rgba(255,255,255,.18), transparent 60%); }
.cta-band h2 { font-size: clamp(1.6rem,3vw,2.3rem); position: relative; }
.cta-band p { opacity: .9; margin: 12px auto 26px; max-width: 480px; position: relative; }
.cta-band .btn-ghost { background: #fff; color: var(--brand-700); border: none; position: relative; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 56px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 32px; }
.footer-brand p { color: var(--text-mute); font-size: .9rem; margin: 14px 0 18px; max-width: 280px; }
.footer-col h5 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-mute); margin-bottom: 14px; font-weight: 700; }
.footer-col a { display: block; padding: 5px 0; color: var(--text-soft); font-size: .9rem; transition: color .15s, padding .15s; }
.footer-col a:hover { color: var(--brand-500); padding-left: 4px; }
.socials { display: flex; gap: 10px; }
.socials a { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); transition: all .15s; }
.socials a:hover { color: var(--brand-500); border-color: var(--brand-400); transform: translateY(-2px); }
.socials svg { width: 18px; height: 18px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--text-mute); font-size: .85rem; flex-wrap: wrap; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--text-mute); padding: 18px 0 2px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--brand-500); }
.breadcrumb .sep { opacity: .5; }
.breadcrumb [aria-current] { color: var(--text); font-weight: 600; }

/* ---------- Tool page layout ---------- */
.tool-hero { padding: 26px 0 8px; }
.tool-hero .th-top { display: flex; align-items: flex-start; gap: 18px; }
.tool-hero .th-ic { width: 60px; height: 60px; border-radius: 16px; background: var(--gradient); color: #fff; display: grid; place-items: center; flex: none; box-shadow: var(--shadow-glow); }
.tool-hero .th-ic svg { width: 30px; height: 30px; }
.tool-hero h1 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); letter-spacing: -.02em; line-height: 1.15; }
.tool-hero .lede { color: var(--text-mute); font-size: 1.05rem; margin-top: 8px; max-width: 720px; }
.tool-layout { display: grid; grid-template-columns: 1fr 320px; gap: 30px; align-items: start; padding-top: 28px; }
.tool-main { min-width: 0; }
.tool-side { position: sticky; top: calc(var(--header-h) + 18px); display: flex; flex-direction: column; gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm); }
.panel h3 { font-size: 1.05rem; margin-bottom: 14px; }
.side-card h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-mute); margin-bottom: 12px; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 9px 8px; border-radius: 10px; transition: background .12s; }
.side-link:hover { background: var(--surface-2); }
.side-link .sl-ic { width: 32px; height: 32px; border-radius: 8px; background: var(--gradient-soft); display: grid; place-items: center; color: var(--brand-600); flex: none; }
[data-theme="dark"] .side-link .sl-ic { color: var(--brand-300); }
.side-link .sl-ic svg { width: 16px; height: 16px; }
.side-link b { font-size: .88rem; font-weight: 600; }

/* ---------- Upload / dropzone ---------- */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 44px 24px;
  text-align: center; background: var(--surface-2); transition: border-color .2s, background .2s; cursor: pointer;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--brand-500); background: var(--gradient-soft); }
.dropzone .dz-ic { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; background: var(--surface); display: grid; place-items: center; color: var(--brand-500); box-shadow: var(--shadow-md); }
.dropzone .dz-ic svg { width: 32px; height: 32px; }
.dropzone h3 { font-size: 1.15rem; margin-bottom: 6px; }
.dropzone p { color: var(--text-mute); font-size: .9rem; }
.dropzone .browse { color: var(--brand-500); font-weight: 600; text-decoration: underline; }
.dz-meta { display: flex; justify-content: center; gap: 18px; margin-top: 16px; font-size: .78rem; color: var(--text-mute); }
.file-list { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.file-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.file-item .fi-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--gradient-soft); display: grid; place-items: center; color: var(--brand-600); flex: none; }
.file-item .fi-meta { min-width: 0; flex: 1; }
.file-item .fi-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item .fi-size { font-size: .78rem; color: var(--text-mute); }
.file-item .fi-rm { width: 32px; height: 32px; border-radius: 8px; color: var(--text-mute); display: grid; place-items: center; transition: color .15s, background .15s; }
.file-item .fi-rm:hover { color: var(--danger); background: rgba(239,67,80,.1); }
.file-thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; }

/* Progress */
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 16px; border: 1px solid var(--border); }
.progress .bar { height: 100%; width: 0; background: var(--gradient); border-radius: inherit; transition: width .25s ease; }
.progress-label { display: flex; justify-content: space-between; font-size: .82rem; color: var(--text-mute); margin-top: 8px; }

/* Privacy notice */
.privacy-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: rgba(20,184,122,.08); border: 1px solid rgba(20,184,122,.22); font-size: .85rem; color: var(--text-soft); margin-top: 18px; }
.privacy-note svg { width: 20px; height: 20px; color: var(--success); flex: none; margin-top: 1px; }

/* Alerts */
.alert { display: flex; gap: 10px; padding: 13px 15px; border-radius: 11px; font-size: .88rem; margin-top: 14px; align-items: flex-start; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.alert-error { background: rgba(239,67,80,.1); border: 1px solid rgba(239,67,80,.25); color: var(--danger); }
.alert-success { background: rgba(20,184,122,.1); border: 1px solid rgba(20,184,122,.25); color: #0c9b66; }

/* ---------- Calculator / converter UI ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 7px; color: var(--text-soft); }
.field .hint { font-weight: 400; color: var(--text-mute); font-size: .8rem; }
.input, select.input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px solid var(--border); transition: border-color .15s, box-shadow .15s;
}
.input:focus, select.input:focus { border-color: var(--brand-400); box-shadow: var(--ring); }
.input-group { display: flex; gap: 10px; }
.input-group .input { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { padding: 8px 16px; border-radius: 999px; font-size: .85rem; font-weight: 600; color: var(--text-soft); transition: all .15s; }
.seg button.active { background: var(--surface); color: var(--brand-600); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .seg button.active { color: var(--brand-300); }

.result-card { margin-top: 20px; padding: 24px; border-radius: var(--radius-lg); background: var(--gradient-soft); border: 1px solid var(--border); }
.result-main { font-size: 2.4rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.result-main small { font-size: 1rem; font-weight: 500; color: var(--text-mute); }
.result-label { color: var(--text-mute); font-size: .9rem; margin-bottom: 6px; }
.result-rows { margin-top: 18px; display: grid; gap: 10px; }
.result-row { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.result-row:last-child { border-bottom: none; }
.result-row b { font-weight: 700; }
.gauge { height: 12px; border-radius: 999px; margin: 18px 0 8px; background: linear-gradient(90deg,#3aa0ff,#14b87a 35%,#f5a623 65%,#ef4350); position: relative; }
.gauge .pin { position: absolute; top: -5px; width: 4px; height: 22px; border-radius: 4px; background: var(--text); transform: translateX(-50%); transition: left .4s ease; }

/* ---------- Content blocks (SEO) ---------- */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.5rem; letter-spacing: -.01em; margin: 36px 0 14px; }
.prose h3 { font-size: 1.18rem; margin: 26px 0 10px; }
.prose p { color: var(--text-soft); margin-bottom: 14px; }
.prose ul.bullets { margin: 0 0 16px; display: grid; gap: 10px; }
.prose ul.bullets li { position: relative; padding-left: 28px; color: var(--text-soft); }
.prose ul.bullets li::before { content:""; position: absolute; left: 0; top: 7px; width: 18px; height: 18px; border-radius: 50%; background: var(--gradient-soft); }
.prose ul.bullets li::after { content:"✓"; position: absolute; left: 4px; top: 4px; font-size: .7rem; color: var(--brand-600); font-weight: 800; }

.steps { counter-reset: step; display: grid; gap: 16px; margin: 8px 0 20px; }
.step { display: flex; gap: 16px; }
.step::before { counter-increment: step; content: counter(step); width: 38px; height: 38px; border-radius: 11px; background: var(--gradient); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.step h4 { font-size: 1rem; margin-bottom: 2px; }
.step p { color: var(--text-mute); font-size: .9rem; margin: 0; }

/* FAQ accordion */
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; background: var(--surface); }
.faq-q { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 20px; text-align: left; font-weight: 600; font-size: 1rem; }
.faq-q .pm { width: 22px; height: 22px; flex: none; transition: transform .25s; color: var(--brand-500); }
.faq-item.open .faq-q .pm { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a p { padding: 0 20px 18px; color: var(--text-soft); font-size: .94rem; }

/* ---------- Blog ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 22px; }
.post-card { display: flex; flex-direction: column; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.post-cover { height: 168px; background: var(--gradient); position: relative; display: grid; place-items: center; color: #fff; }
.post-cover svg { width: 54px; height: 54px; opacity: .9; }
.post-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-tag { font-size: .74rem; font-weight: 700; color: var(--brand-500); text-transform: uppercase; letter-spacing: .04em; }
.post-body h3 { font-size: 1.12rem; line-height: 1.3; }
.post-body p { color: var(--text-mute); font-size: .88rem; flex: 1; }
.post-meta { display: flex; gap: 12px; color: var(--text-mute); font-size: .8rem; margin-top: 6px; }

/* ---------- Misc ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 13px 22px; border-radius: 12px; font-weight: 500; font-size: .9rem; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all .25s; z-index: 200; display: flex; gap: 10px; align-items: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.divider { height: 1px; background: var(--border); margin: 28px 0; border: none; }
.muted { color: var(--text-mute); }
.center { text-align: center; }
.hidden { display: none !important; }
.scroll-top { position: fixed; right: 24px; bottom: 24px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; transform: translateY(12px); z-index: 90; }
.scroll-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ---------- Animations ---------- */
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
.reveal { opacity: 0; }
.reveal.in { animation: fadeUp .6s cubic-bezier(.2,.7,.3,1) forwards; }
.stagger > * { opacity: 0; }
.stagger.in > * { animation: fadeUp .55s cubic-bezier(.2,.7,.3,1) forwards; }
.stagger.in > *:nth-child(2){animation-delay:.05s}.stagger.in > *:nth-child(3){animation-delay:.1s}
.stagger.in > *:nth-child(4){animation-delay:.15s}.stagger.in > *:nth-child(5){animation-delay:.2s}
.stagger.in > *:nth-child(6){animation-delay:.25s}.stagger.in > *:nth-child(7){animation-delay:.3s}
.stagger.in > *:nth-child(8){animation-delay:.35s}.stagger.in > *:nth-child(n+9){animation-delay:.4s}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } .reveal,.stagger>* { opacity: 1 !important; } }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .tool-layout { grid-template-columns: 1fr; }
  .tool-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .tool-side .panel { flex: 1 1 260px; }
}
@media (max-width: 860px) {
  .nav-menu { display: none; }
  .menu-toggle { display: grid; }
  .hero-stats { gap: 26px; }
}
@media (max-width: 620px) {
  .section { padding: 46px 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; }
  .grid-2 { grid-template-columns: 1fr; }
  .cta-band { padding: 40px 22px; }
  .hero-stat b { font-size: 1.5rem; }
}

/* ---------- Mobile slide menu ---------- */
.mobile-menu { position: fixed; inset: 0; z-index: 150; visibility: hidden; }
.mobile-menu.open { visibility: visible; }
.mobile-menu .mm-backdrop { position: absolute; inset: 0; background: rgba(8,12,22,.5); opacity: 0; transition: opacity .25s; backdrop-filter: blur(2px); }
.mobile-menu.open .mm-backdrop { opacity: 1; }
.mobile-menu .mm-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 86vw); background: var(--surface); box-shadow: var(--shadow-lg); padding: 20px; transform: translateX(100%); transition: transform .28s cubic-bezier(.3,.8,.3,1); overflow-y: auto; }
.mobile-menu.open .mm-panel { transform: translateX(0); }
.mm-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.mm-group { border-top: 1px solid var(--border); padding: 6px 0; }
.mm-group > a, .mm-acc-head { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 13px 6px; font-weight: 600; font-size: 1rem; }
.mm-acc-body { display: none; padding-bottom: 8px; }
.mm-acc.open .mm-acc-body { display: block; }
.mm-acc-head .chev { transition: transform .2s; width: 18px; height: 18px; }
.mm-acc.open .mm-acc-head .chev { transform: rotate(180deg); }
.mm-acc-body a { display: block; padding: 9px 14px; color: var(--text-soft); font-size: .92rem; border-radius: 8px; }
.mm-acc-body a:hover { background: var(--surface-2); color: var(--brand-500); }
