/* NB Tools v5 — YN-grade animated, glassy, responsive UI. Per-site palette injected. */
:root {
  --brand: #dc2626;
  --accent: #fecaca;
  --dark: #240707;
  --brand-ink: #0b1018;
  --brand-grad: linear-gradient(135deg, var(--accent), var(--brand));
  --text: #f6f8fc;
  --muted: #a7b1c5;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --panel: rgba(255, 255, 255, 0.05);
  --panel-2: rgba(255, 255, 255, 0.08);
  --ink-bg: rgba(0, 0, 0, 0.25);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --hero-radius: 28px;
  --section-radius: 22px;
  --card-radius: 16px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 110px; }
body {
  margin: 0;
  font-family: Pretendard, Inter, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--dark); /* fallback for browsers without color-mix() */
  background:
    radial-gradient(1100px 500px at 85% -5%, color-mix(in srgb, var(--brand), transparent 80%), transparent 60%),
    radial-gradient(900px 420px at -10% 30%, color-mix(in srgb, var(--accent), transparent 86%), transparent 55%),
    var(--dark);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* animated aurora layer */
body::before {
  content: "";
  position: fixed;
  inset: -30% -20%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(38% 32% at 22% 28%, color-mix(in srgb, var(--brand), transparent 84%), transparent 70%),
    radial-gradient(30% 28% at 78% 16%, color-mix(in srgb, var(--accent), transparent 86%), transparent 70%),
    radial-gradient(34% 30% at 62% 78%, color-mix(in srgb, var(--brand), transparent 88%), transparent 70%);
  filter: blur(48px) saturate(1.15);
  animation: nbAurora 26s ease-in-out infinite alternate;
}
@keyframes nbAurora {
  0% { transform: translate3d(-2%, -1%, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(2%, 2%, 0) rotate(3deg) scale(1.06); }
  100% { transform: translate3d(-1%, 1%, 0) rotate(-2deg) scale(1.02); }
}
/* film grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
::selection { background: color-mix(in srgb, var(--brand), transparent 40%); color: #fff; }

/* scroll reveal (classes applied by fx.js on app pages only) */
html.fx .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
html.fx .reveal.in { opacity: 1; transform: none; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--dark), transparent 25%);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.site-header.scrolled {
  background: color-mix(in srgb, var(--dark), transparent 8%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.nav-wrap { display: flex; align-items: center; gap: 20px; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 11px; min-width: max-content; }
.logo-mark {
  display: grid; place-items: center; width: 40px; height: 40px; position: relative;
  border-radius: 13px; background: var(--brand-grad); color: var(--brand-ink);
  font-weight: 900; letter-spacing: -0.02em; overflow: hidden;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--brand), transparent 58%), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.logo-mark::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.5) 48%, transparent 62%);
  transform: translateX(-120%);
  animation: nbShine 5.5s ease-in-out infinite;
}
@keyframes nbShine { 0%, 72% { transform: translateX(-120%); } 88%, 100% { transform: translateX(130%); } }
.brand strong { font-size: 15px; letter-spacing: -0.01em; }
.brand small { display: block; color: var(--muted); font-size: 11.5px; }
.nav {
  display: flex; gap: 4px; margin-left: auto; padding: 4px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.04);
}
.nav a {
  padding: 8px 14px; border-radius: 999px; color: var(--muted);
  font-size: 13px; font-weight: 700; white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.09); transform: translateY(-1px); }

/* ---------- promo strips (marquee on app pages) ---------- */
.promo-strip {
  margin-top: 20px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 18px; background: var(--panel);
  overflow: hidden; position: relative;
}
.promo-strip::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand), transparent 92%), transparent 30%, transparent 70%, color-mix(in srgb, var(--accent), transparent 92%));
}
.section-label, .section-head span, .eyebrow {
  color: var(--accent); font-size: 11.5px; font-weight: 900;
  letter-spacing: 0.1em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow::before, .section-label::before {
  content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--brand-grad);
}
.promo-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr);
  gap: 10px; overflow-x: auto; padding-top: 10px; scrollbar-width: thin;
}
.promo-row.marquee {
  display: flex; width: max-content; overflow: visible; padding-right: 10px;
  animation: nbMarquee var(--marquee-time, 36s) linear infinite;
}
.promo-row.marquee a { min-width: 190px; }
.promo-strip:hover .promo-row.marquee { animation-play-state: paused; }
@keyframes nbMarquee { to { transform: translateX(-50%); } }
.promo-row a, .deal-grid a {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel-2); font-weight: 700; font-size: 13.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative;
  transition: border-color 0.2s ease, transform 0.2s var(--ease-out), background 0.2s ease, box-shadow 0.2s ease;
}
.promo-row a:hover, .deal-grid a:hover {
  border-color: color-mix(in srgb, var(--brand), transparent 25%);
  background: color-mix(in srgb, var(--brand), transparent 86%);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--brand), transparent 82%);
}
.recruit { margin-top: 10px; }

/* ---------- hero ---------- */
.hero { padding: 56px 0 22px; position: relative; }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(340px, 1fr);
  gap: 36px; align-items: center;
}
.hero h1 {
  margin: 14px 0; font-size: clamp(32px, 4.6vw, 60px);
  line-height: 1.12; letter-spacing: -0.025em; font-weight: 900;
  word-break: keep-all; overflow-wrap: break-word;
  color: #fff;
}
@supports (-webkit-background-clip: text) {
  .hero h1 {
    background: linear-gradient(160deg, #fff 55%, color-mix(in srgb, var(--accent), #fff 25%) 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  }
}
.hero p { max-width: 640px; color: var(--muted); font-size: 16.5px; line-height: 1.75; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.hero-stats {
  display: flex; gap: 26px; flex-wrap: wrap; margin-top: 28px; padding-top: 20px;
  border-top: 1px solid var(--line);
}
.hero-stats > div { display: grid; gap: 2px; }
.hero-stats b { font-size: 26px; font-weight: 900; letter-spacing: -0.02em; color: var(--accent); }
@supports (-webkit-background-clip: text) {
  .hero-stats b { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
}
.hero-stats span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 22px; border-radius: 999px; position: relative; overflow: hidden;
  border: 1px solid var(--line-strong); font-weight: 800; font-size: 14.5px;
  cursor: pointer; color: var(--text); background: transparent;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease, background 0.2s ease;
}
.btn.primary {
  background: var(--brand-grad); color: var(--brand-ink); border: 0;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--brand), transparent 55%);
}
.btn.primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 25%, rgba(255, 255, 255, 0.45) 48%, transparent 65%);
  transform: translateX(-130%);
  animation: nbShine 4.6s ease-in-out infinite;
}
.btn.primary:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 18px 44px color-mix(in srgb, var(--brand), transparent 45%); }
.btn.ghost { background: rgba(255, 255, 255, 0.06); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-2px); }
.hero-art {
  position: relative; min-height: 380px; isolation: isolate;
  border: 1px solid var(--line); border-radius: var(--hero-radius);
  background:
    radial-gradient(circle at 28% 18%, color-mix(in srgb, var(--accent), transparent 70%), transparent 44%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: conic-gradient(from 210deg at 70% 30%, transparent 70%, color-mix(in srgb, var(--accent), transparent 78%) 85%, transparent 100%);
  animation: nbSlowSpin 30s linear infinite;
  opacity: 0.55;
}
@keyframes nbSlowSpin { to { transform: rotate(360deg); } }
.art-card {
  position: absolute; border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22); backdrop-filter: blur(4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}
.art-card.one { inset: 42px 80px 150px 42px; border-radius: 18px; animation: nbDrift 9s ease-in-out infinite; }
.art-card.two { right: 44px; bottom: 58px; width: 46%; height: 36%; border-radius: 999px; animation: nbDrift 11s ease-in-out 0.8s infinite reverse; }
.art-card.three { left: 68px; bottom: 60px; width: 36%; height: 28%; border-radius: 12px; animation: nbDrift 8s ease-in-out 1.6s infinite; }
@keyframes nbDrift {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(0, -9px, 0) rotate(0.6deg); }
}

/* mascot */
.nb-mascot {
  position: absolute; right: clamp(16px, 4vw, 42px); top: clamp(16px, 3vw, 34px); z-index: 5;
  width: clamp(118px, 17vw, 178px); aspect-ratio: 1; perspective: 900px;
  pointer-events: none; filter: drop-shadow(0 24px 42px rgba(0, 0, 0, 0.34));
}
.nb-mascot-orb {
  position: absolute; inset: 10%; display: grid; place-items: center;
  border-radius: 42% 58% 54% 46% / 54% 46% 58% 42%;
  background: var(--brand-grad);
  box-shadow: inset 14px 14px 28px rgba(255, 255, 255, 0.26), inset -18px -20px 34px rgba(0, 0, 0, 0.3),
    0 28px 72px color-mix(in srgb, var(--accent), transparent 68%);
  transform-style: preserve-3d;
  animation: nbFloat 5.8s ease-in-out infinite, nbMorph 10s ease-in-out infinite;
}
.nb-mascot-orb::before {
  content: ""; position: absolute; inset: 13% 16% auto 19%; height: 28%; border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.03));
  transform: translateZ(34px) rotate(-14deg);
}
.nb-mascot-face {
  position: relative; z-index: 2; display: grid; place-items: center;
  min-width: 48%; min-height: 38%; padding: 8px 12px; border-radius: 999px;
  color: var(--brand-ink); background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.4); font-weight: 900;
  font-size: clamp(16px, 2.4vw, 26px); line-height: 1; transform: translateZ(44px);
}
.nb-mascot-ring {
  position: absolute; inset: -13%; border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  animation: nbSlowSpin 16s linear infinite;
}
.nb-mascot-shadow {
  position: absolute; left: 50%; bottom: 3%; width: 62%; height: 16px; border-radius: 999px;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.48), transparent 72%);
  filter: blur(3px); transform: translateX(-50%);
  animation: nbShadowPulse 5.8s ease-in-out infinite;
}
@keyframes nbShadowPulse { 0%, 100% { transform: translateX(-50%) scaleX(1); opacity: 1; } 50% { transform: translateX(-50%) scaleX(0.82); opacity: 0.7; } }
@keyframes nbFloat {
  0%, 100% { transform: translateY(0) rotateX(0) rotateY(0); }
  50% { transform: translateY(-10px) rotateX(5deg) rotateY(-7deg); }
}
@keyframes nbMorph {
  0%, 100% { border-radius: 42% 58% 54% 46% / 54% 46% 58% 42%; }
  50% { border-radius: 58% 42% 46% 54% / 45% 58% 42% 55%; }
}

/* ---------- sections ---------- */
.latest-posts, .channel-hub, .tools-section, .affiliate-deals {
  margin: 30px auto; padding: 26px; position: relative;
  border: 1px solid var(--line); border-radius: var(--section-radius); background: var(--panel);
}
.tools-section::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, color-mix(in srgb, var(--brand), transparent 45%), transparent 30%, transparent 70%, color-mix(in srgb, var(--accent), transparent 55%));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.section-head a { color: var(--muted); font-size: 13px; font-weight: 700; transition: color 0.15s ease, transform 0.15s ease; }
.section-head a:hover { color: var(--accent); transform: translateX(2px); }
.section-head small { color: var(--muted); }

/* blog cards */
.blog-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.blog-mini {
  display: grid; gap: 8px; align-content: start; min-height: 180px; padding: 10px;
  border: 1px solid var(--line); border-radius: var(--card-radius); background: var(--panel-2);
}
.blog-thumb, .thumb {
  display: grid; place-items: center; gap: 6px; min-height: 96px; padding: 14px;
  text-align: center; border-radius: 12px; position: relative; overflow: hidden;
  background: linear-gradient(150deg, color-mix(in srgb, var(--brand), transparent 55%), rgba(0, 0, 0, 0.38));
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.blog-thumb::after, .thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.22) 50%, transparent 65%);
  transform: translateX(-130%); transition: transform 0.7s var(--ease-out);
}
.blog-mini:hover .blog-thumb::after, .blog-mini:hover .thumb::after { transform: translateX(130%); }
.blog-thumb strong, .thumb strong { font-size: 15px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; position: relative; z-index: 1; }
.blog-thumb small, .thumb small { font-size: 10px; color: var(--muted); position: relative; z-index: 1; }
.thumb span { color: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; position: relative; z-index: 1; }
.blog-meta { color: var(--accent); font-size: 11.5px; font-weight: 800; }
.blog-mini b { font-size: 14.5px; line-height: 1.4; font-weight: 700; }
.blog-mini time, .blog-mini small { color: var(--muted); font-size: 12px; }
.blog-mini p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

/* channels */
.channel-hub h2, .tools-head h2 { margin: 8px 0 0; word-break: keep-all; font-size: clamp(24px, 3.4vw, 36px); letter-spacing: -0.02em; }
.channel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.channel {
  position: relative; display: grid; gap: 6px; align-content: center; min-height: 130px; padding: 18px 18px 18px 22px;
  border: 1px solid var(--line); border-radius: var(--card-radius); background: var(--panel-2); overflow: hidden;
}
.channel::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ch, var(--brand)); opacity: 0.9; transition: width 0.25s var(--ease-out); }
.channel:hover::before { width: 7px; }
.channel::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--ch, var(--brand)), transparent 72%);
  opacity: 0.12; transition: opacity 0.25s ease, transform 0.4s var(--ease-out);
}
.channel:hover::after { opacity: 0.3; transform: scale(1.25); }
.channel b { font-size: 15.5px; }
.channel span, .channel small { color: var(--muted); font-size: 12.5px; }
.channel small { color: var(--ch, var(--accent)); font-weight: 700; }
.youtube { --ch: #ff0033; }
.instagram { --ch: #e1306c; }
.tiktok { --ch: #25f4ee; }

/* ---------- tools ---------- */
.tools-head { text-align: center; margin-bottom: 22px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.tool-card {
  display: flex; align-items: center; gap: 13px; min-height: 88px; padding: 14px 15px;
  text-align: left; color: var(--text); font: inherit; position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--card-radius); background: var(--panel-2);
  cursor: pointer;
}
.tool-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent), transparent 25%), transparent 40%, transparent 65%, color-mix(in srgb, var(--brand), transparent 30%));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.25s ease;
}
.tool-card:hover::before, .tool-card.is-active::before { opacity: 1; }
.tool-card strong { font-size: 14.5px; letter-spacing: -0.01em; }
.tool-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.tool-card.is-active {
  border-color: transparent;
  background: color-mix(in srgb, var(--brand), transparent 85%);
  box-shadow: 0 14px 38px color-mix(in srgb, var(--brand), transparent 75%);
}
.t-ico {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px;
  border-radius: 13px; background: var(--brand-grad); color: var(--brand-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 16px color-mix(in srgb, var(--brand), transparent 68%);
  transition: transform 0.3s var(--ease-out);
}
.tool-card:hover .t-ico { transform: translateY(-3px) rotate(-4deg) scale(1.06); }
.tool-card.is-active .t-ico { animation: nbIconPop 0.45s var(--ease-out); }
@keyframes nbIconPop { 0% { transform: scale(0.8); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.t-ico svg { width: 23px; height: 23px; }

/* workspace */
.workspace { margin-top: 20px; }
.workspace-panel {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 16px;
  padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--ink-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.ws-form, .ws-result { display: grid; gap: 14px; align-content: start; min-width: 0; }
.ws-head { display: flex; gap: 13px; align-items: center; }
.ws-ico {
  display: grid; place-items: center; flex: none; width: 46px; height: 46px;
  border-radius: 14px; background: var(--brand-grad); color: var(--brand-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 22px color-mix(in srgb, var(--brand), transparent 58%);
  animation: nbBreath 4.5s ease-in-out infinite;
}
@keyframes nbBreath { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.ws-ico svg { width: 24px; height: 24px; }
.ws-head h3 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.ws-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.tool-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.field label em { font-style: normal; color: var(--accent); font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; font: inherit; font-size: 14px;
  border: 1px solid var(--line); border-radius: 11px;
  background: rgba(0, 0, 0, 0.28); color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.field textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand); /* fallback */
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12); /* fallback */
  border-color: color-mix(in srgb, var(--brand), transparent 20%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand), transparent 80%);
  background: rgba(0, 0, 0, 0.38);
}
.field input::placeholder, .field textarea::placeholder { color: rgba(167, 177, 197, 0.55); }
.run-row { display: flex; gap: 9px; flex-wrap: wrap; }
.run-row .btn { flex: 1 1 auto; }
.run-row .btn.primary { flex: 2 1 auto; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.tool-actions button {
  min-height: 34px; padding: 0 13px; font: inherit; font-size: 12.5px; font-weight: 700;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, 0.05); color: var(--muted); cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.tool-actions button:hover { border-color: var(--brand); color: var(--text); transform: translateY(-1px); }
.ws-result-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ws-result-head span { color: var(--accent); font-size: 12px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
#resultBox {
  position: relative; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
  min-height: 260px; max-height: 560px; overflow-y: auto; margin: 0; padding: 18px;
  border-radius: 13px; background: rgba(0, 0, 0, 0.32); border: 1px solid var(--line);
  font-family: inherit; font-size: 13.8px; line-height: 1.7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
#resultBox.flash { animation: nbFlash 0.5s ease; }
@keyframes nbFlash {
  0% { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand), transparent 72%); }
  100% { border-color: var(--line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
}
.history-panel { display: grid; gap: 7px; }
.history-panel strong { color: var(--accent); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.history-panel button {
  display: flex; justify-content: space-between; gap: 12px; min-height: 40px; padding: 0 13px;
  font: inherit; font-size: 13px; font-weight: 700; text-align: left; align-items: center;
  border: 1px solid var(--line); border-radius: 11px;
  background: rgba(255, 255, 255, 0.045); color: var(--text); cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.history-panel button:hover { border-color: var(--brand); transform: translateX(3px); }
.history-panel small { color: var(--muted); font-weight: 400; flex: none; }

/* deals & footer */
.deal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.aff-disclosure { color: var(--muted); font-size: 12px; margin-top: 14px; }
.footer { border-top: 1px solid var(--line); padding: 30px 0; margin-top: 50px; color: var(--muted); font-size: 12.5px; position: relative; }
.footer::before { content: ""; position: absolute; top: -1px; left: 0; width: 100%; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--brand), transparent 30%), transparent); }
.footer .container { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* AdSense slots */
.ad-slot { margin: 22px auto; min-height: 90px; }
.ad-slot ins { border-radius: 12px; overflow: hidden; }

/* blog article pages (build output) */
article { max-width: 780px; margin: 0 auto; }
article h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.25; letter-spacing: -0.02em; }
article h2 { margin-top: 34px; font-size: 21px; letter-spacing: -0.01em; position: relative; padding-left: 14px; }
article h2::before { content: ""; position: absolute; left: 0; top: 0.28em; width: 4px; height: 1em; border-radius: 3px; background: var(--brand-grad); }
article p { color: #d5dbe7; line-height: 1.8; }
article .thumb { min-height: 200px; margin: 18px 0; }
article ul { color: #d5dbe7; line-height: 1.8; }

/* hover lift */
.tool-card, .blog-mini, .channel { transition: transform 0.22s var(--ease-out), border-color 0.2s ease, box-shadow 0.25s ease, background 0.2s ease; }
.tool-card:hover, .blog-mini:hover, .channel:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.32);
}
.tool-card:hover { border-color: color-mix(in srgb, var(--brand), transparent 40%); }

/* theme variants (per-site body class) */
.theme-rankboard, .theme-code, .theme-dashboard { --hero-radius: 12px; --section-radius: 12px; --card-radius: 10px; }
.theme-paper, .theme-seal { --hero-radius: 8px; --section-radius: 10px; --card-radius: 8px; }
.theme-story, .theme-party, .theme-moodboard { --hero-radius: 34px; --section-radius: 28px; --card-radius: 22px; }
.theme-party .art-card { transform: rotate(-4deg); }
.theme-map .hero-art::before {
  content: ""; position: absolute; inset: 32px; pointer-events: none;
  background:
    linear-gradient(90deg, transparent 48%, rgba(255, 255, 255, 0.1) 49% 51%, transparent 52%),
    linear-gradient(0deg, transparent 48%, rgba(255, 255, 255, 0.1) 49% 51%, transparent 52%);
  background-size: 80px 80px;
}
.theme-code .hero-art { background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 26px 26px; }
.theme-calculator .hero-art::before, .theme-price .hero-art::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1.6px);
  background-size: 26px 26px;
}
.theme-wellness .hero-art, .theme-recipe .hero-art { border-radius: 46% 54% 52% 48% / 42% 46% 54% 58%; }
.theme-story .blog-mini { border-style: dashed; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .workspace-panel { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav-wrap { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; overflow-x: auto; margin-left: 0; justify-content: flex-start; }
  .hero { padding-top: 36px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { min-height: 260px; }
  .hero-stats { gap: 18px; }
  .blog-strip, .channel-grid {
    grid-template-columns: none; grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 82vw); overflow-x: auto; padding-bottom: 6px;
  }
  .tool-form { grid-template-columns: 1fr; }
  .latest-posts, .channel-hub, .tools-section, .affiliate-deals { padding: 18px; }
  .footer .container { display: grid; }
}

/* ---------- print ---------- */
@media print {
  body { background: #fff; color: #111; }
  body::before, body::after { display: none !important; }
  .site-header, .promo-strip, .hero, .latest-posts, .channel-hub, .affiliate-deals,
  .footer, .tool-grid, .tool-actions, .run-row, .history-panel, .tools-head, .ws-head p, .ad-slot { display: none !important; }
  .tools-section, .workspace-panel, .ws-form, .ws-result { display: block !important; border: 0 !important; background: #fff !important; box-shadow: none !important; padding: 0 !important; }
  .tool-form { display: none !important; }
  #resultBox { color: #111 !important; background: #fff !important; border: 0 !important; max-height: none; box-shadow: none !important; }
  .ws-result-head { display: none !important; }
  .ws-head h3 { color: #111; }
  .ws-ico { display: none !important; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  body::before, .nb-mascot-orb, .nb-mascot-ring, .nb-mascot-shadow, .art-card,
  .hero-art::after, .logo-mark::after, .btn.primary::after { animation: none !important; }
  .promo-row.marquee { animation: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .tool-card, .blog-mini, .channel, .btn, .promo-row a, .deal-grid a, .t-ico { transition: none !important; }
  #resultBox.flash { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- v6: rich results, confetti, loading, particles ---------- */
#resultBox.rich { white-space: normal; display: grid; gap: 12px; align-content: start; }
.res-sec {
  padding: 14px 15px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  animation: nbResIn 0.5s var(--ease-out) both;
}
.res-sec:nth-child(2) { animation-delay: 0.07s; }
.res-sec:nth-child(3) { animation-delay: 0.14s; }
.res-sec:nth-child(4) { animation-delay: 0.21s; }
.res-sec:nth-child(5) { animation-delay: 0.28s; }
@keyframes nbResIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.res-sec h4 {
  margin: 0 0 8px; font-size: 13px; letter-spacing: 0.04em;
  color: var(--accent); display: flex; align-items: center; gap: 7px;
}
.res-sec h4::before { content: ""; width: 7px; height: 7px; border-radius: 3px; background: var(--brand-grad); flex: none; }
.res-p { animation: nbResIn 0.5s var(--ease-out) both; }
em.res-num { font-style: normal; font-weight: 800; color: #fff; background: color-mix(in srgb, var(--brand), transparent 78%); padding: 0 5px; border-radius: 6px; }
.res-li { position: relative; padding-left: 14px; }
.res-li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.res-note { margin-top: 6px; padding: 8px 11px; border-radius: 9px; font-size: 12.5px; color: var(--muted); background: rgba(0, 0, 0, 0.25); border-left: 3px solid color-mix(in srgb, var(--accent), transparent 40%); }
.res-check { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; cursor: pointer; }
.res-check input { accent-color: var(--brand); margin-top: 3px; }
.res-check:has(input:checked) span { text-decoration: line-through; opacity: 0.55; }
.res-table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); }
.res-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.res-table th { text-align: left; padding: 8px 11px; background: color-mix(in srgb, var(--brand), transparent 84%); color: #fff; font-weight: 800; white-space: nowrap; }
.res-table td { padding: 7px 11px; border-top: 1px solid var(--line); }
.res-table tbody tr:hover { background: rgba(255, 255, 255, 0.04); }

/* confetti */
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.confetti i {
  position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px;
  animation: nbConfetti 1.2s ease-in forwards;
}
@keyframes nbConfetti {
  0% { transform: translateY(0) rotate(0) scale(1); opacity: 1; }
  100% { transform: translateY(420px) rotate(540deg) scale(0.8); opacity: 0; }
}

/* run button loading */
.btn.loading { pointer-events: none; opacity: 0.85; }
.btn.loading::before {
  content: ""; width: 15px; height: 15px; margin-right: 8px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--brand-ink), transparent 60%); border-top-color: var(--brand-ink);
  animation: nbSpin 0.7s linear infinite;
}
@keyframes nbSpin { to { transform: rotate(360deg); } }

/* hero particles + tilt */
.hero-art { transform-style: preserve-3d; transition: transform 0.25s ease-out; will-change: transform; }
.hero-art .nb-dot {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: color-mix(in srgb, var(--accent), #fff 30%);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent), transparent 30%);
  animation: nbDot 7s ease-in-out infinite;
  opacity: 0.7;
}
@keyframes nbDot {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: 0.35; }
  50% { transform: translate3d(6px, -16px, 0); opacity: 0.85; }
}
@media (prefers-reduced-motion: reduce) {
  .res-sec, .res-p { animation: none !important; }
  .confetti, .hero-art .nb-dot { display: none !important; }
  .hero-art { transform: none !important; }
}

/* ---------- v7: visualizations ---------- */
.res-viz {
  display: grid; gap: 8px; justify-items: center; padding: 16px 14px 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  animation: nbResIn 0.5s var(--ease-out) both;
}
.res-viz svg { width: min(230px, 70%); height: auto; overflow: visible; }
.viz-big { font-size: 17px; font-weight: 900; fill: var(--text); }
.viz-sub { font-size: 8.5px; fill: var(--muted); }
.viz-needle { transform: rotate(-90deg); transition: transform 1.1s cubic-bezier(0.34, 1.4, 0.44, 1); }
.viz-arc { transition: stroke-dashoffset 1.1s var(--ease-out); }
.viz-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.viz-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.viz-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.viz-prog-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; }
.viz-prog-head b { font-size: 19px; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.viz-prog-head span { color: var(--muted); font-size: 12px; }
.viz-prog { width: 100%; height: 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); overflow: hidden; }
.viz-prog-fill {
  display: block; width: 0; height: 100%; border-radius: 999px;
  background: var(--brand-grad);
  box-shadow: 0 0 14px color-mix(in srgb, var(--brand), transparent 40%);
  transition: width 1.1s var(--ease-out);
}
.viz-prog-fill.done { background: linear-gradient(135deg, #34d399, #10b981); }
@media (prefers-reduced-motion: reduce) {
  .viz-needle, .viz-arc, .viz-prog-fill { transition: none !important; }
}

/* ---------- v7: light theme ---------- */
.theme-toggle {
  display: grid; place-items: center; width: 36px; height: 36px; margin-left: 6px;
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, 0.05); color: var(--text); font-size: 16px;
  transition: transform 0.2s var(--ease-out), border-color 0.2s ease;
}
.theme-toggle:hover { transform: rotate(20deg) scale(1.08); border-color: var(--brand); }
html[data-theme="light"] {
  --text: #131a24;
  --muted: #5a6474;
  --line: rgba(15, 28, 50, 0.13);
  --line-strong: rgba(15, 28, 50, 0.22);
  --panel: rgba(255, 255, 255, 0.66);
  --panel-2: rgba(255, 255, 255, 0.92);
  --ink-bg: rgba(255, 255, 255, 0.55);
  --shadow: 0 24px 70px rgba(25, 40, 70, 0.14);
}
html[data-theme="light"] body {
  background: #eef2f8;
  background:
    radial-gradient(1100px 500px at 85% -5%, color-mix(in srgb, var(--brand), transparent 84%), transparent 60%),
    radial-gradient(900px 420px at -10% 30%, color-mix(in srgb, var(--accent), transparent 88%), transparent 55%),
    #eef2f8;
}
html[data-theme="light"] body::after { opacity: 0.035; }
html[data-theme="light"] .site-header { background: rgba(255, 255, 255, 0.75); }
html[data-theme="light"] .site-header.scrolled { background: rgba(255, 255, 255, 0.92); box-shadow: 0 10px 34px rgba(25, 40, 70, 0.12); }
html[data-theme="light"] .nav { background: rgba(15, 28, 50, 0.04); }
html[data-theme="light"] .nav a:hover { color: #000; background: rgba(15, 28, 50, 0.07); }
html[data-theme="light"] .btn.ghost { background: rgba(15, 28, 50, 0.05); }
html[data-theme="light"] .btn.ghost:hover { background: rgba(15, 28, 50, 0.1); }
html[data-theme="light"] .hero h1 { color: #10161f; }
@supports (-webkit-background-clip: text) {
  html[data-theme="light"] .hero h1 {
    background: linear-gradient(160deg, #10161f 55%, color-mix(in srgb, var(--brand), #10161f 35%) 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  }
}
html[data-theme="light"] .art-card { background: rgba(255, 255, 255, 0.55); border-color: rgba(15, 28, 50, 0.1); box-shadow: 0 20px 50px rgba(25, 40, 70, 0.12); }
html[data-theme="light"] .field input, html[data-theme="light"] .field select, html[data-theme="light"] .field textarea {
  background: #fff; color: var(--text);
}
html[data-theme="light"] .field input:focus, html[data-theme="light"] .field select:focus, html[data-theme="light"] .field textarea:focus { background: #fff; }
html[data-theme="light"] .field input::placeholder, html[data-theme="light"] .field textarea::placeholder { color: rgba(90, 100, 116, 0.6); }
html[data-theme="light"] #resultBox { background: #fff; }
html[data-theme="light"] .res-sec, html[data-theme="light"] .res-viz { background: rgba(15, 28, 50, 0.03); }
html[data-theme="light"] em.res-num { color: #0d1420; background: color-mix(in srgb, var(--brand), transparent 82%); }
html[data-theme="light"] .res-note { background: rgba(15, 28, 50, 0.045); }
html[data-theme="light"] .res-table th { color: #0d1420; }
html[data-theme="light"] .viz-prog { background: rgba(15, 28, 50, 0.08); }
html[data-theme="light"] .tool-actions button { background: rgba(15, 28, 50, 0.04); }
html[data-theme="light"] .history-panel button { background: rgba(15, 28, 50, 0.035); }
html[data-theme="light"] .workspace-panel { background: rgba(255, 255, 255, 0.5); }
html[data-theme="light"] article p, html[data-theme="light"] article ul { color: #333c49; }
html[data-theme="light"] .blog-thumb, html[data-theme="light"] .thumb {
  background: linear-gradient(150deg, color-mix(in srgb, var(--brand), transparent 30%), color-mix(in srgb, var(--brand), #223 35%));
}
html[data-theme="light"] .blog-thumb strong, html[data-theme="light"] .thumb strong { color: #fff; }
html[data-theme="light"] .thumb span { color: #fff; }
html[data-theme="light"] .blog-thumb small, html[data-theme="light"] .thumb small { color: rgba(255, 255, 255, 0.75); }
html[data-theme="light"] .channel::after { opacity: 0.08; }
html[data-theme="light"] .footer { color: var(--muted); }
html[data-theme="light"] ::selection { background: color-mix(in srgb, var(--brand), transparent 65%); color: #10161f; }
