/* NOFYI Tools V2 — main styles. Clean, fast, no external fonts. */
:root {
  --ink: #1c2733;
  --muted: #5b6b7b;
  --accent: #4f46e5;
  --accent-dark: #3730a3;
  --bg: #f6f8fb;
  --card: #ffffff;
  --line: #dde4ec;
  --error: #b91c1c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.screen-reader-text { position: absolute; left: -9999px; }

/* Header */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 24px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 8px; color: var(--ink); }
.brand-name { font-size: 26px; font-weight: 800; letter-spacing: 0.5px; }
.brand-tag { color: var(--muted); font-size: 13px; }
.main-nav .menu { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; }
.main-nav a { color: var(--ink); font-weight: 600; }
.header-search { margin-left: auto; display: flex; }
.header-search input[type="search"] { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; min-width: 200px; }

/* Hero + cards */
.hero { text-align: center; padding: 48px 20px 24px; }
.hero h1 { font-size: 36px; margin: 0 0 10px; }
.hero-sub { color: var(--muted); max-width: 640px; margin: 0 auto 20px; }
.hero-search { display: flex; justify-content: center; gap: 8px; }
.hero-search input[type="search"] { width: min(480px, 80vw); padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 16px; }
.hero-search button { padding: 12px 20px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; }
.hero-search button:hover { background: var(--accent-dark); }
.tool-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; list-style: none; margin: 0 0 24px; padding: 0; }
.tool-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.tool-card a { font-weight: 700; font-size: 16px; }
.tool-card p { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
.why-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.why-list li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }

/* Tool page */
.tool-page { padding-top: 28px; padding-bottom: 40px; }
.tool-head h1 { margin: 0 0 8px; font-size: 32px; }
.tool-summary { color: var(--muted); font-size: 17px; }
.tool-meta { color: var(--muted); font-size: 13px; }
.tool-workspace { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin: 20px 0 28px; }
.workspace-title { margin-top: 0; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.tool-unavailable { border: 1px dashed var(--line); border-radius: 10px; padding: 16px; background: #fffbeb; }
.tool-field { margin-bottom: 14px; }
.tool-label { display: block; font-weight: 600; margin-bottom: 6px; }
.tool-input { width: 100%; max-width: 520px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 16px; background: #fff; }
.tool-textarea { max-width: 100%; font-family: inherit; }
.tool-checks { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.tool-check { font-weight: 500; }
.tool-btn { padding: 11px 22px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; font-size: 15px; }
.tool-btn:hover { background: var(--accent-dark); }
.tool-btn-copy { background: #eef2ff; color: var(--accent-dark); margin-top: 10px; padding: 8px 14px; }
.tool-result { margin-top: 18px; }
.tool-result-table { border-collapse: collapse; width: 100%; max-width: 640px; }
.tool-result-table th, .tool-result-table td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.tool-result-table th { background: #f1f5f9; width: 45%; }
.tool-error { color: var(--error); font-weight: 600; }
.tool-note { color: var(--muted); font-size: 14px; }
.tool-password { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 18px; word-break: break-all; background: #f1f5f9; padding: 12px; border-radius: 8px; }
.tool-article h2 { margin-top: 32px; }
.tool-article table { border-collapse: collapse; }
.tool-article th, .tool-article td { border: 1px solid var(--line); padding: 8px 11px; }

/* Posts + pages */
.post-card, .post-page, .content-page { padding-top: 24px; padding-bottom: 32px; }
.post-meta { color: var(--muted); font-size: 13px; }

/* Footer */
.site-footer { background: var(--card); border-top: 1px solid var(--line); margin-top: 40px; }
.footer-inner { display: flex; gap: 40px; padding-top: 28px; padding-bottom: 8px; flex-wrap: wrap; }
.footer-brand { font-weight: 800; }
.footer-nav .menu { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-legal { color: var(--muted); font-size: 13px; padding-bottom: 20px; }

@media (max-width: 640px) {
  .hero h1 { font-size: 28px; }
  .header-search { margin-left: 0; width: 100%; }
  .header-search input[type="search"] { width: 100%; }
}
.tool-mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; background: #f1f5f9; padding: 12px; border-radius: 8px; white-space: pre-wrap; word-break: break-all; }
.tool-btn-secondary { background: #e2e8f0; color: var(--ink); margin-left: 8px; }
.tool-diff { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-top: 12px; }
.tool-diff > div { padding: 3px 10px; white-space: pre-wrap; word-break: break-word; }
.diff-add { background: #dcfce7; }
.diff-del { background: #fee2e2; }
.diff-same { background: #fff; color: var(--muted); }
.swatches { margin: 4px 0 14px; line-height: 2; }
.swatch { display: inline-block; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); vertical-align: middle; }
.md-preview { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.md-preview pre { background: #0f172a; color: #e2e8f0; padding: 10px; border-radius: 8px; overflow-x: auto; }
/* Custom logo: the uploaded logo image can be large — constrain it to the header. */
.custom-logo-link { display: inline-flex; align-items: center; line-height: 0; }
.custom-logo-link img, img.custom-logo { height: 40px; width: auto; max-width: 180px; object-fit: contain; }
.site-header .custom-logo-link img.custom-logo { height: 40px !important; width: auto !important; max-height: 40px !important; }

.md-preview blockquote { border-left: 3px solid var(--brand); margin: 8px 0; padding: 2px 12px; color: var(--ink-2); }

/* ===== Homepage redesign v2.1 — expert presentation + animation ===== */

/* Reveal-on-scroll (JS adds .in; visible without JS after .no-js fallback below) */
.hx-js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease var(--d, 0ms), transform .7s ease var(--d, 0ms); }
.hx-js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .hx-js .reveal { opacity: 1; transform: none; transition: none; }
  .hx-orb, .hx-hero { animation: none !important; }
}

/* Header polish: sticky + soft shadow */
.site-header { position: sticky; top: 0; z-index: 60; box-shadow: 0 1px 14px rgba(16, 24, 40, .07); }
.main-nav a { position: relative; padding: 4px 0; }
.main-nav a::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--accent); transition: width .25s ease; }
.main-nav a:hover::after { width: 100%; }
.main-nav a:hover { text-decoration: none; color: var(--accent-dark); }

/* Hero */
.hx-hero { position: relative; overflow: hidden; color: #fff; text-align: center;
  background: linear-gradient(120deg, #312e81, #4f46e5 38%, #2563eb 72%, #0891b2);
  background-size: 180% 180%; animation: hx-pan 16s ease infinite; }
@keyframes hx-pan { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.hx-orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; pointer-events: none; }
.hx-orb-a { width: 380px; height: 380px; background: #a78bfa; top: -140px; left: -100px; animation: hx-float 11s ease-in-out infinite; }
.hx-orb-b { width: 300px; height: 300px; background: #22d3ee; bottom: -150px; right: -60px; animation: hx-float 13s ease-in-out infinite reverse; }
@keyframes hx-float { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(34px, -26px) scale(1.08); } }
.hx-hero-in { position: relative; padding: 74px 20px 86px; }
.hx-badge { display: inline-block; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.35);
  padding: 6px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; letter-spacing: .2px; margin: 0 0 22px; backdrop-filter: blur(4px); }
.hx-hero h1 { font-size: clamp(34px, 5.6vw, 56px); line-height: 1.12; margin: 0 0 16px; font-weight: 800; letter-spacing: -.5px; }
.hx-grad { background: linear-gradient(90deg, #fde68a, #fca5a5, #fde68a); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: hx-shine 5s linear infinite; }
@keyframes hx-shine { to { background-position: 200% center; } }
.hx-sub { color: rgba(255,255,255,.88); font-size: 17.5px; max-width: 680px; margin: 0 auto 30px; }
.hx-search { display: flex; align-items: center; gap: 6px; max-width: 620px; margin: 0 auto; background: #fff;
  border-radius: 999px; padding: 6px 6px 6px 18px; box-shadow: 0 18px 40px rgba(15, 23, 42, .35); }
.hx-search-icon { width: 20px; height: 20px; color: #94a3b8; flex: none; }
.hx-search input[type="search"] { flex: 1; border: 0; outline: none; font-size: 16px; padding: 10px 4px; color: var(--ink); min-width: 0; background: transparent; }
.hx-search button { border: 0; background: var(--accent); color: #fff; font-weight: 700; font-size: 15.5px;
  padding: 12px 26px; border-radius: 999px; cursor: pointer; transition: background .2s ease, transform .2s ease; }
.hx-search button:hover { background: var(--accent-dark); transform: translateY(-1px); }
.hx-chips { margin: 24px 0 0; color: rgba(255,255,255,.75); font-size: 14px; }
.hx-chips a { display: inline-block; color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  padding: 5px 13px; border-radius: 999px; margin: 3px 3px; font-weight: 600; transition: background .2s ease, transform .2s ease; }
.hx-chips a:hover { background: rgba(255,255,255,.28); text-decoration: none; transform: translateY(-1px); }

/* Stats bar (overlaps hero) */
.hx-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: -38px; position: relative; z-index: 2; }
.hx-stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 14px; text-align: center;
  box-shadow: 0 12px 30px rgba(16, 24, 40, .10); }
.hx-stat-num { display: block; font-size: 32px; font-weight: 800; color: var(--accent-dark); line-height: 1.1; }
.hx-stat-label { color: var(--muted); font-size: 13.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }

/* Sections */
.hx-section { padding-top: 56px; padding-bottom: 8px; }
.hx-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.hx-head h2 { font-size: 29px; margin: 0 0 4px; letter-spacing: -.3px; }
.hx-head p { color: var(--muted); margin: 0; }
.hx-viewall { font-weight: 700; white-space: nowrap; }
.hx-band { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 56px; padding-bottom: 48px; }
.hx-band .hx-section { padding-top: 48px; }

/* Category cards */
.hx-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 16px; list-style: none; margin: 0; padding: 0; }
.hx-cat a { display: flex; flex-direction: column; gap: 3px; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 20px; height: 100%; color: var(--ink); position: relative;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.hx-cat a:hover { transform: translateY(-5px); box-shadow: 0 16px 34px rgba(16, 24, 40, .13); border-color: #c7cede; text-decoration: none; }
.hx-cat-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.hx-cat-icon svg { width: 24px; height: 24px; }
.hx-cat-name { font-weight: 700; font-size: 17px; }
.hx-cat-count { color: var(--muted); font-size: 13.5px; }
.hx-cat-arrow { position: absolute; top: 18px; right: 18px; color: #b6c2d2; font-size: 18px; transition: transform .25s ease, color .25s ease; }
.hx-cat a:hover .hx-cat-arrow { transform: translateX(4px); color: var(--accent); }

/* Tool cards */
.hx-tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; list-style: none; margin: 0; padding: 0; }
.hx-tool a { display: flex; flex-direction: column; gap: 6px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px 20px; height: 100%; color: var(--ink);
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease; }
.hx-tool a:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(16, 24, 40, .12); background: #fff; text-decoration: none; }
.hx-tool-name { font-weight: 700; font-size: 16px; }
.hx-tool-desc { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hx-tool-open { margin-top: auto; color: var(--accent); font-weight: 700; font-size: 14px; padding-top: 6px; }

/* Features + steps */
.hx-feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.hx-feat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px;
  transition: transform .25s ease, box-shadow .25s ease; }
.hx-feat:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(16, 24, 40, .11); }
.hx-feat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.hx-feat-icon svg { width: 25px; height: 25px; }
.hx-feat h3 { margin: 0 0 6px; font-size: 18px; }
.hx-feat p { margin: 0; color: var(--muted); font-size: 15px; }
.hx-steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 22px 0 0; padding: 0; }
.hx-steps li { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px dashed #c3cede; border-radius: 16px; padding: 18px 20px; }
.hx-step-num { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; }
.hx-steps strong { display: block; }
.hx-steps span { color: var(--muted); font-size: 14px; }
.hx-steps div span { display: block; }

/* Blog cards */
.hx-posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.hx-post a { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px; height: 100%; color: var(--ink); transition: transform .25s ease, box-shadow .25s ease; }
.hx-post a:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(16, 24, 40, .12); text-decoration: none; }
.hx-post-date { color: var(--accent); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.hx-post h3 { margin: 8px 0; font-size: 19px; line-height: 1.35; }
.hx-post p { color: var(--muted); margin: 0 0 10px; font-size: 15px; }

/* CTA band */
.hx-cta { margin-top: 60px; margin-bottom: 8px; text-align: center; color: #fff; border-radius: 22px; padding: 46px 24px;
  background: linear-gradient(120deg, #312e81, #4f46e5 55%, #2563eb); background-size: 160% 160%; animation: hx-pan 14s ease infinite;
  box-shadow: 0 20px 44px rgba(49, 46, 129, .35); }
.hx-cta h2 { margin: 0 0 6px; font-size: 28px; }
.hx-cta p { margin: 0 0 20px; color: rgba(255,255,255,.85); }
.hx-cta-btn { display: inline-block; background: #fff; color: var(--accent-dark); font-weight: 800; padding: 13px 30px;
  border-radius: 999px; transition: transform .2s ease, box-shadow .2s ease; }
.hx-cta-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 23, 42, .3); text-decoration: none; }

/* Footer: dark + roomy */
.site-footer { background: #0f172a; color: #cbd5e1; border-top: 0; margin-top: 56px; }
.site-footer a { color: #e2e8f0; }
.footer-brand { color: #fff; font-size: 17px; }
.footer-legal { color: #94a3b8; }
.footer-cat { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-cat-title { color: #fff; font-weight: 700; margin: 0 0 8px; }

@media (max-width: 760px) {
  .hx-stats { grid-template-columns: repeat(2, 1fr); margin-top: -30px; }
  .hx-hero-in { padding: 52px 16px 66px; }
  .hx-br { display: none; }
  .hx-search { border-radius: 18px; flex-wrap: wrap; padding: 10px; }
  .hx-search button { width: 100%; }
  .hx-section { padding-top: 42px; }
}

/* ===== v2.2: compact hero + more animation + interlink sections ===== */

/* Compact hero */
.hx-hero-in { padding: 46px 20px 58px; }
.hx-hero h1 { font-size: clamp(30px, 4.6vw, 46px); margin-bottom: 12px; }
.hx-badge { margin-bottom: 16px; animation: hx-pulse 3.2s ease-in-out infinite; }
@keyframes hx-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.25); } 50% { box-shadow: 0 0 0 7px rgba(255,255,255,0); } }
.hx-sub { font-size: 16.5px; margin-bottom: 22px; }
.hx-chips { margin-top: 16px; }
.hx-stats { margin-top: -30px; }

/* Load-in animation for hero elements (staggered via --d) */
.hx-load { opacity: 0; animation: hx-up .8s cubic-bezier(.2, .7, .25, 1) forwards; animation-delay: var(--d, 0ms); }
@keyframes hx-up { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* Scrolling tools ticker */
.hx-marquee { overflow: hidden; margin: 30px auto 0; max-width: 1080px; padding: 0 20px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.hx-track { display: flex; width: max-content; animation: hx-scroll 32s linear infinite; }
.hx-marquee:hover .hx-track { animation-play-state: paused; }
@keyframes hx-scroll { to { transform: translateX(-50%); } }
.hx-mq-item { display: inline-flex; align-items: center; white-space: nowrap; font-weight: 700; color: var(--muted); font-size: 15px; }
.hx-mq-item::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin: 0 26px; opacity: .65; }

/* Card micro-animations */
.hx-cat-icon { transition: transform .3s ease; }
.hx-cat a:hover .hx-cat-icon { transform: scale(1.1) rotate(-4deg); }
.hx-tool a { position: relative; overflow: hidden; }
.hx-tool a::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), #2563eb, #0891b2); transform: scaleX(0); transform-origin: left; transition: transform .35s ease; }
.hx-tool a:hover::before { transform: scaleX(1); }
.hx-stat { transition: transform .25s ease, box-shadow .25s ease; }
.hx-stat:hover { transform: translateY(-4px); box-shadow: 0 18px 38px rgba(16, 24, 40, .15); }
.hx-search button { background: linear-gradient(120deg, var(--accent), #2563eb); background-size: 160% 160%; transition: background-position .35s ease, transform .2s ease; }
.hx-search button:hover { background-position: 90% 50%; }

/* Interlink sections (tool pages + blog posts) */
.interlink { margin-top: 44px; }
.interlink h2 { font-size: 24px; margin: 0 0 16px; letter-spacing: -.2px; }
.interlink .hx-tool-grid, .interlink .hx-posts { margin-bottom: 8px; }
.post-tools-note { color: var(--muted); margin: -8px 0 16px; }

@media (prefers-reduced-motion: reduce) {
  .hx-load { animation: none; opacity: 1; }
  .hx-track, .hx-badge { animation: none !important; }
}
@media (max-width: 760px) {
  .hx-hero-in { padding: 36px 16px 50px; }
}
