:root {
  --brand: #f97316;
  --brand-dark: #ea580c;
  --brand-light: #fff7ed;
  --ink: #1a1a2e;
  --ink-soft: #2d2d44;
  --muted: #64748b;
  --bg: #fafafa;
  --card: #ffffff;
  --border: #e5e7eb;
  --radius: 14px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,.08);
  --shadow-lg: 0 16px 40px rgba(0,0,0,.12);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ── Header ── */
.site-header { background: var(--ink); color: #fff; padding: 0 24px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 12px rgba(0,0,0,.15); }
.header-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; color: #fff; flex-shrink: 0; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 36px; height: 36px; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 20px; color: #fff; box-shadow: 0 2px 8px rgba(249,115,22,.4); }
.main-nav { display: flex; gap: 4px; }
.main-nav a { color: #cbd5e1; padding: 8px 14px; border-radius: 8px; font-size: 15px; font-weight: 500; transition: background .15s, color .15s; }
.main-nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
/* Categories dropdown (desktop) */
.nav-drop { position: relative; }
.nav-drop-btn { background: none; border: none; color: #cbd5e1; padding: 8px 14px; border-radius: 8px; font-size: 15px; font-weight: 500; cursor: pointer; font-family: inherit; display: flex; align-items: center; gap: 6px; }
.nav-drop-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-drop-btn .caret { font-size: 11px; }
.nav-drop-menu { display: none; position: absolute; top: 100%; left: 0; background: #fff; border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.22); min-width: 240px; padding: 8px; z-index: 300; }
.nav-drop-menu a { display: flex; align-items: center; gap: 10px; color: var(--ink); padding: 10px 12px; border-radius: 8px; font-size: 15px; }
.nav-drop-menu a:hover { background: #f1f5f9; color: var(--brand); text-decoration: none; }
.nav-drop-menu .di { font-size: 18px; }
.nav-drop.expanded .nav-drop-menu { display: block; }
@media(hover:hover){ .nav-drop:hover .nav-drop-menu { display: block; } }
.search-toggle { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; padding: 8px 10px; border-radius: 8px; flex-shrink: 0; line-height: 1; }
.search-toggle:hover { background: rgba(255,255,255,.08); }
.search-expand { display: none; max-width: 1200px; margin: 0 auto; padding: 0 24px 14px; gap: 8px; }
.search-expand.open { display: flex; }
.search-expand input { flex: 1; padding: 11px 16px; border: 1px solid #334155; border-radius: 10px; background: #0f172a; color: #fff; font-size: 15px; outline: none; }
.search-expand input:focus { border-color: var(--brand); }
.search-expand input::placeholder { color: #64748b; }
.search-expand button { background: var(--brand); border: none; color: #fff; padding: 11px 20px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 15px; }
.search-expand button:hover { background: var(--brand-dark); }
.hamburger { display: none; background: none; border: none; color: #fff; font-size: 26px; cursor: pointer; padding: 6px 10px; border-radius: 8px; line-height: 1; }
.hamburger:hover { background: rgba(255,255,255,.08); }

/* ── Hero ── */
.hero { background: linear-gradient(135deg, #1a1a2e 0%, #3d2310 60%, #1a1a2e 100%); color: #fff; padding: 88px 24px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -60px; right: -60px; width: 300px; height: 300px; background: radial-gradient(circle, rgba(249,115,22,.25), transparent 70%); border-radius: 50%; }
.hero h1 { font-size: 46px; font-weight: 800; margin-bottom: 14px; line-height: 1.2; position: relative; }
.hero h1 .accent { color: var(--brand); }
.hero p { font-size: 19px; color: #cbd5e1; max-width: 640px; margin: 0 auto 30px; position: relative; }
.hero-search { max-width: 560px; margin: 0 auto; display: flex; box-shadow: 0 8px 30px rgba(0,0,0,.3); border-radius: 12px; overflow: hidden; position: relative; }
.hero-search input { flex: 1; padding: 16px 20px; border: none; font-size: 16px; outline: none; min-width: 0; }
.hero-search button { background: var(--brand); color: #fff; border: none; padding: 16px 32px; font-size: 16px; font-weight: 700; cursor: pointer; transition: background .15s; flex-shrink: 0; }
.hero-search button:hover { background: var(--brand-dark); }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 56px 0; }
.section-title { font-size: 28px; font-weight: 800; margin-bottom: 8px; letter-spacing: -.5px; }
.section-sub { color: var(--muted); margin-bottom: 28px; font-size: 16px; }

/* ── Category cards ── */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.cat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; transition: transform .2s, box-shadow .2s, border-color .2s; }
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #fed7aa; text-decoration: none; }
.cat-card .icon { font-size: 36px; margin-bottom: 12px; display: block; }
.cat-card h3 { font-size: 19px; margin-bottom: 6px; color: var(--ink); }
.cat-card p { color: var(--muted); font-size: 14px; }

/* ── Tool cards ── */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.tool-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; display: flex; gap: 14px; align-items: flex-start; transition: transform .2s, box-shadow .2s, border-color .2s; }
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #fed7aa; text-decoration: none; }
.tool-card .t-icon { font-size: 30px; flex-shrink: 0; }
.tool-card h3 { font-size: 16px; color: var(--ink); margin-bottom: 4px; }
.tool-card p { font-size: 13px; color: var(--muted); }

/* ── Tool pages ── */
.tool-hero { background: linear-gradient(180deg, #fff, var(--brand-light)); border-bottom: 1px solid var(--border); padding: 52px 24px 40px; text-align: center; }
.tool-hero h1 { font-size: 34px; font-weight: 800; margin-bottom: 10px; letter-spacing: -.5px; }
.tool-hero p { color: var(--muted); max-width: 640px; margin: 0 auto; font-size: 16px; }
.tool-workspace { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; margin: 32px auto; max-width: 800px; box-shadow: var(--shadow-sm); }
.tool-content { max-width: 800px; margin: 0 auto; padding-bottom: 48px; }
.tool-content h2 { font-size: 22px; margin: 36px 0 12px; letter-spacing: -.3px; }
.tool-content p, .tool-content li { color: #334155; margin-bottom: 10px; }
.tool-content ul, .tool-content ol { padding-left: 22px; }
.tool-content table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; }
.tool-content th, .tool-content td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.tool-content th { background: #f8fafc; font-weight: 700; }

/* ── Forms ── */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.field input[type="text"], .field input[type="number"], .field textarea, .field select { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 9px; font-size: 15px; outline: none; font-family: inherit; transition: border-color .15s, box-shadow .15s; background: #fff; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(249,115,22,.15); }
.field input[type="range"] { width: 100%; accent-color: var(--brand); }
.field-row { display: flex; gap: 16px; }
.field-row .field { flex: 1; min-width: 0; }
.check-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 15px; }
.check-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.btn { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; border: none; padding: 13px 28px; border-radius: 9px; font-size: 16px; font-weight: 700; cursor: pointer; display: inline-block; transition: transform .1s, box-shadow .2s; box-shadow: 0 4px 14px rgba(249,115,22,.3); }
.btn:hover { box-shadow: 0 6px 20px rgba(249,115,22,.45); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-secondary { background: #e2e8f0; color: var(--ink); box-shadow: none; }
.btn-secondary:hover { background: #cbd5e1; box-shadow: none; }
.btn-block { display: block; width: 100%; text-align: center; }
.result-box { background: #f8fafc; border: 1px dashed var(--border); border-radius: 9px; padding: 20px; margin-top: 20px; font-size: 15px; }
.result-box .big { font-size: 28px; font-weight: 800; color: var(--brand-dark); }
.output-text { background: #f8fafc; border: 1px solid var(--border); border-radius: 9px; padding: 16px; font-family: ui-monospace, monospace; font-size: 15px; word-break: break-all; margin: 12px 0; min-height: 54px; }
.qr-output { text-align: center; margin: 20px 0; }
.qr-output img, .qr-output canvas { border: 1px solid var(--border); border-radius: 9px; padding: 12px; background: #fff; display: inline-block; }

/* ── FAQ ── */
.faq { border-bottom: 1px solid var(--border); padding: 16px 0; }
.faq h3 { font-size: 17px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 600; }
.faq h3::after { content: '+'; font-size: 22px; color: var(--brand); flex-shrink: 0; transition: transform .2s; }
.faq.open h3::after { content: '−'; }
.faq .a { display: none; padding-top: 10px; color: #475569; }
.faq.open .a { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ── Footer ── */
.site-footer { background: var(--ink); color: #94a3b8; padding: 56px 24px 24px; margin-top: 40px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: #fff; margin-bottom: 14px; font-size: 15px; }
.site-footer a { color: #94a3b8; font-size: 14px; display: block; margin-bottom: 8px; transition: color .15s; }
.site-footer a:hover { color: var(--brand); text-decoration: none; }
.footer-bottom { max-width: 1200px; margin: 32px auto 0; padding-top: 20px; border-top: 1px solid #334155; text-align: center; font-size: 13px; }

/* ── Ad placeholders ── */
.ad-slot { background: #f1f5f9; border: 1px dashed #cbd5e1; border-radius: 8px; text-align: center; padding: 24px; color: #94a3b8; font-size: 13px; margin: 28px auto; max-width: 800px; }

/* ── Benefits / misc ── */
.benefits { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }

/* ═══════════ Responsive ═══════════ */
@media (max-width: 900px) {
  .main-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--ink); flex-direction: column; padding: 12px 24px 20px; box-shadow: 0 12px 24px rgba(0,0,0,.25); gap: 2px; }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 14px; font-size: 16px; border-radius: 8px; }
  .hamburger { display: block; }
  .header-inner { justify-content: flex-start; }
  .logo { margin-right: auto; }
  .search-toggle { order: 5; }
  .hamburger { order: 6; }
  /* mobile: categories accordion */
  .nav-drop { width: 100%; }
  .nav-drop-btn { width: 100%; justify-content: space-between; padding: 12px 14px; font-size: 16px; color: #cbd5e1; }
  .nav-drop-menu { position: static; display: none; box-shadow: none; background: rgba(255,255,255,.06); border-radius: 8px; margin: 2px 0 6px; padding: 4px; min-width: 0; }
  .nav-drop-menu a { color: #cbd5e1; padding: 10px 12px; font-size: 15px; }
  .nav-drop-menu a:hover { background: rgba(255,255,255,.08); color: #fff; }
  .nav-drop.expanded .nav-drop-menu { display: block; }
  .nav-drop.expanded .nav-drop-btn .caret { transform: rotate(180deg); display: inline-block; }
  .search-expand { padding: 0 16px 12px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .hero { padding: 60px 20px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; }
  .hero-search { flex-direction: column; border-radius: 12px; }
  .hero-search input { padding: 14px 18px; border-radius: 12px 12px 0 0; }
  .hero-search button { padding: 14px; border-radius: 0 0 12px 12px; }
  .section { padding: 40px 0; }
  .section-title { font-size: 24px; }
  .tool-hero { padding: 36px 20px 28px; }
  .tool-hero h1 { font-size: 27px; }
  .tool-workspace { padding: 22px 18px; margin: 24px auto; border-radius: 12px; }
  .field-row { flex-direction: column; gap: 0; }
  .btn { width: 100%; text-align: center; padding: 14px 20px; }
  .cat-grid { grid-template-columns: 1fr; }
  .cat-card { padding: 22px; }
  .tool-grid { grid-template-columns: 1fr; }
  .result-box .big { font-size: 24px; }
  .tool-content h2 { font-size: 20px; }
  .tool-content table { font-size: 14px; display: block; overflow-x: auto; }
  .ad-slot { margin: 20px auto; padding: 18px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .site-header { padding: 0 16px; }
  .logo { font-size: 19px; }
  .logo-mark { width: 32px; height: 32px; font-size: 18px; }
  .hero h1 { font-size: 27px; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .tool-workspace { padding: 18px 14px; }
  .faq h3 { font-size: 16px; }
}
