:root {
  /* Inter webfont (self-hosted). Place files at /assets/fonts/ per README. */
}

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter-Italic-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
:root {
  /* Light theme defaults */
  --bg: #f7f9fc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --danger: #dc2626;
  --good: #16a34a;
  --warn: #d97706;
  --border: #e2e8f0;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

[data-theme="dark"] {
  /* Dark mode removed */
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, system-ui, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background: radial-gradient(1000px 600px at 10% -10%, #e6eef9, var(--bg));
  color: var(--text);
}
/* Text selection */
::selection { background: rgba(37,99,235,0.28); color: #0f172a; }

.bg-decor { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.blob { position: absolute; filter: blur(50px); opacity: 0.3; transform: translateZ(0); }
.b1 { width: 420px; height: 420px; background: #93c5fd; top: -120px; left: -80px; border-radius: 50%; }
.b2 { width: 520px; height: 520px; background: #a7f3d0; bottom: -160px; right: -140px; border-radius: 50%; }
.b3 { width: 380px; height: 380px; background: #fde68a; top: 30%; left: 60%; border-radius: 50%; }

.container { max-width: 900px; margin: 0 auto; padding: 24px; }

.site-header {
  position: sticky; top: 0; z-index: 1000;
  border-bottom: 0;
  background: rgba(0,0,0,0.82);
  backdrop-filter: saturate(180%) blur(20px);
}
[data-theme="dark"] .site-header { background: rgba(0,0,0,0.86); }
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.nav { display: flex; align-items: center; gap: 12px; }
.site-nav { display: flex; gap: 12px; align-items: center; }
.site-nav a { position: relative; color: rgba(255,255,255,0.8); text-decoration: none; padding: 0 10px; height: 44px; display: flex; align-items: center; font-size: 14px; }
.site-nav a:hover, .site-nav a:focus-visible { color: #ffffff; }
.site-nav a::after { display: none; }
.site-nav a.active { color: #ffffff; }
.menu-btn { display: none; background: transparent; border: none; padding: 6px 8px; color: var(--muted); font-size: 20px; }
.menu-btn { color: rgba(255,255,255,0.8); }
.menu-btn:hover { color: #ffffff; }
@media (max-width: 720px) {
  .site-nav { position: absolute; left: 0; right: 0; top: 56px; background: rgba(0,0,0,0.94); border-top: 1px solid rgba(255,255,255,0.08); box-shadow: 0 12px 24px rgba(0,0,0,0.4); padding: 8px 16px; display: none; flex-direction: column; gap: 4px; }
  .site-nav a { padding: 12px 0; }
  .site-nav a::after { left: 0; right: 0; bottom: 0; }
  .site-nav.open { display: flex; }
  .menu-btn { display: inline-flex; }
}
.brand { font-size: 14px; margin: 0; letter-spacing: 0.2px; display: inline-flex; gap: 8px; align-items: center; color: rgba(255,255,255,0.9); }
.brand::after { content: ""; display: inline-block; width: 1px; height: 24px; margin-left: 12px; background: rgba(255,255,255,0.18); }
.brand-link { display: inline-flex; align-items: center; gap: 8px; color: rgba(255,255,255,0.9); text-decoration: none; border-bottom: none; }
.brand-link:link,
.brand-link:visited,
.brand-link:hover,
.brand-link:active { text-decoration: none; border-bottom: none; color: #ffffff; }
.brand-icon { filter: drop-shadow(0 1px 4px rgba(0,0,0,0.4)); }
.nav-link { color: var(--muted); text-decoration: none; }
.nav-link:hover { color: var(--text); }
.btn-ghost { display: inline-flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: rgba(255,255,255,0.8); }
.btn-ghost:hover { color: #ffffff; }
.icon { width: 18px; height: 18px; fill: currentColor; display: inline-block; }
.hide-sm { display: inline; }
@media (max-width: 560px) {
  .hide-sm { display: none; }
  /* Ensure action button labels remain visible on small screens */
  .output-actions .hide-sm { display: inline; }
}

/* Right-align nav on desktop */
@media (min-width: 721px) {
  .header-inner { position: relative; justify-content: flex-start; }
  .nav { margin-left: auto; }
  .site-nav { position: static; left: auto; transform: none; }
}

.generator-card {
  margin-top: 24px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 18px 50px rgba(2,6,23,0.08);
  transition: box-shadow 200ms ease, transform 120ms ease;
}
.generator-card:hover { box-shadow: 0 22px 64px rgba(2,6,23,0.12); }
[data-theme="dark"] .generator-card { background: linear-gradient(180deg, #101826, #0e1521); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }

.tabs { display: flex; gap: 8px; margin-bottom: 8px; }
.tab {
  appearance: none; border: 1px solid var(--border); background: #f8fbff; color: var(--muted);
  padding: 8px 12px; border-radius: 10px; cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease, border-color 160ms ease, transform 100ms ease;
}
.tab:hover { background: #f1f6ff; }
.tab:active { transform: translateY(1px); }
.tab.active { background: var(--card); color: var(--text); border-color: #93c5fd; box-shadow: 0 6px 14px rgba(147,197,253,0.45); }
.tab .tab-link { color: inherit; text-decoration: none; display: inline-block; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
/* Inputs: consistent focus and hover states */
input[type="text"], input[type="number"], select, textarea {
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
input[type="text"]:hover, input[type="number"]:hover, select:hover, textarea:hover { border-color: #b6c8e6; }
input[type="text"]:focus-visible, input[type="number"]:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(147,197,253,0.28);
}

.mode-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin: 8px 0 16px; }
.seg { appearance: none; background: transparent; color: var(--muted); border: none; padding: 8px 12px; cursor: pointer; }
.seg.active { background: var(--card); color: var(--text); }

.output-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.output { 
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-family: var(--mono); font-size: 18px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.output.masked { -webkit-text-security: disc; text-security: disc; }
/* Fallback mask for browsers without text-security */
@supports not (-webkit-text-security: disc) {
  .output.masked { filter: blur(6px); }
}
.output:focus-visible { outline: none; border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(147,197,253,0.35); }
.tab-panel .output { font-size: 18px; }
.mono { font-family: var(--mono); }

.output-actions { display: flex; gap: 8px; }
.btn { appearance: none; border: 1px solid var(--border); background: linear-gradient(180deg, #eef2ff, #e8eefc); color: var(--text); padding: 10px 12px; border-radius: 10px; cursor: pointer; transition: box-shadow 160ms ease, transform 100ms ease, border-color 160ms ease; }
[data-theme="dark"] .btn { background: #0f1a2a; }
.btn:hover { border-color: #35517a; box-shadow: 0 6px 14px rgba(2,6,23,0.08); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--accent), var(--accent-strong)); border-color: transparent; color: #ffffff; box-shadow: 0 10px 24px rgba(37,99,235,0.28); }
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 8px 22px rgba(37,99,235,0.38); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
[data-theme="dark"] .btn-primary { box-shadow: 0 4px 14px rgba(77,163,255,0.28); }
[data-theme="dark"] .btn-primary:hover { box-shadow: 0 8px 22px rgba(77,163,255,0.38); }
.btn-icon { padding: 10px; width: 40px; display: inline-grid; place-items: center; }
/* CTA group removed */

.options { margin-top: 16px; display: grid; gap: 12px; }
.intro { margin-bottom: 12px; }
.intro h2 { margin: 0 0 8px; font-size: 22px; }
.intro p { margin: 0; color: var(--muted); }
.privacy-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: 12px; color: var(--text); border: 1px solid var(--border); background: rgba(37,99,235,0.06); }
.badge::before { content: "✓"; color: var(--accent-strong); font-weight: 700; }
[data-theme="dark"] .badge { background: rgba(77,163,255,0.08); }
.intro-card { margin-top: 24px; }
.clean-list { list-style: none; padding: 0; margin: 0; }
.toc a {
  display: inline-block; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: #f6f9ff; color: var(--text); text-decoration: none; font-size: 13px;
}
.toc a:hover, .toc a:focus-visible { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(147,197,253,0.22); }

.faq { display: grid; gap: 10px; }
.faq details { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; transition: border-color 160ms ease, box-shadow 160ms ease; }
.faq details[open] { border-color: #93c5fd; box-shadow: 0 6px 18px rgba(147,197,253,0.18); }
.faq summary { cursor: pointer; font-weight: 650; color: var(--text); font-size: 15px; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '\25BE'; float: right; color: var(--muted); transition: transform 160ms ease; }
.faq details[open] summary::after { transform: rotate(180deg); }
.faq p, .faq li { color: var(--muted); }
.simple-options { border-top: 1px dashed var(--border); padding-top: 16px; }
.advanced { border-top: 1px dashed var(--border); padding-top: 16px; }
.advanced[hidden] { display: none !important; }
.btn-link { background: none; border: none; color: var(--accent); padding: 0; text-align: left; cursor: pointer; width: max-content; }
.btn-link:hover { text-decoration: underline; }

.field { display: grid; gap: 6px; }
label { color: var(--muted); font-size: 14px; }
label > span { font-weight: 500; color: var(--text); }
input[type="text"], input[type="number"], select { background: var(--card); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 10px 12px; }
textarea { background: var(--card); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 10px 12px; width: 100%; resize: vertical; }
input[type="number"] { max-width: 120px; }
input[type="range"] { width: 100%; }
/* Range slider styling */
input[type="range"] { -webkit-appearance: none; height: 6px; background: linear-gradient(180deg, #eaf1fb, #dfe9f7); border-radius: 999px; border: 1px solid var(--border); }
input[type="range"]:focus { outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #ffffff; border: 1px solid #93c5fd; box-shadow: 0 2px 6px rgba(2,6,23,0.18); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #ffffff; border: 1px solid #93c5fd; box-shadow: 0 2px 6px rgba(2,6,23,0.18); cursor: pointer; }
input[type="range"]::-moz-range-track { height: 6px; background: linear-gradient(180deg, #eaf1fb, #dfe9f7); border-radius: 999px; border: 1px solid var(--border); }
/* Native controls polish */
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent-strong); }
select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238892a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }

.grid { display: grid; gap: 8px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

.checkbox { display: inline-flex; align-items: center; gap: 8px; }
.checkbox input { width: 18px; height: 18px; }

/* Info icon tooltip trigger */
.info-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border: 1px solid #93c5fd;
  background: #e8f0ff;
  border-radius: 50%;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  user-select: none;
}
.info-icon:hover, .info-icon:focus-visible { color: #0b3ea8; border-color: #60a5fa; }

/* Tooltip bubble using data-tooltip */
.info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: 150%;
  transform: translateX(-50%) translateY(6px);
  background: rgba(13, 20, 32, 0.96);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.14);
  padding: 8px 10px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  font-size: 12px;
  line-height: 1.4;
  max-width: 260px;
  width: max-content;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 1500;
  white-space: normal;
}
.info-icon::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 138%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(13, 20, 32, 0.96) transparent transparent transparent;
  opacity: 0;
  transition: opacity 160ms ease;
  z-index: 1501;
}
.info-icon:hover::after, .info-icon:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.info-icon:hover::before, .info-icon:focus-visible::before { opacity: 1; }

.strength { display: grid; gap: 8px; }
.strength-bar { height: 12px; background: linear-gradient(180deg, #f0f4fb, #e9eef7); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.strength-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #ef4444, #f59e0b 35%, #22c55e 70%, #06b6d4); transition: width 240ms cubic-bezier(0.22, 1, 0.36, 1); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3); will-change: width; }
.strength-fill.animate { animation: fillPulse 280ms ease-out; }
@keyframes fillPulse { 0% { filter: brightness(1.08); } 100% { filter: brightness(1); } }
.strength-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }

.note { color: var(--muted); font-size: 14px; }
.warning { color: #b91c1c; background: #fff1f2; border: 1px solid #fecdd3; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.checksum { color: var(--muted); font-size: 13px; }

.site-footer { margin-top: 16px; color: var(--muted); font-size: 14px; }
.support { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bmc-button { display: inline-flex; align-items: center; gap: 8px; background: #ffdd00; color: #0f172a; border-radius: 999px; padding: 8px 14px; text-decoration: none; font-weight: 600; border: 1px solid #e6c800; }
.bmc-button:hover { filter: brightness(1.05); }
.bmc-icon { font-size: 18px; }

/* Subtle inline support CTA */
.support-inline { margin-top: 6px; color: var(--muted); font-size: 13px; }
.support-inline.center { text-align: center; }
.bmc-mini { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; text-decoration: none; font-weight: 600; background: rgba(255, 221, 0, 0.18); border: 1px solid rgba(255, 221, 0, 0.5); color: #0f172a; }
.bmc-mini, .bmc-mini:hover { text-decoration: none !important; }
.bmc-mini:hover { filter: brightness(1.04); }

@media (max-width: 560px) {
  .output-row { grid-template-columns: 1fr; gap: 6px; }
  .output-actions { justify-content: stretch; gap: 6px; }
  .output-actions .btn { width: 100%; padding: 10px; }
  .tabs { gap: 6px; }
  .tab { padding: 8px 10px; }
  .options { gap: 10px; }
}

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: rgba(13, 20, 32, 0.92);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.22);
  padding: 10px 14px; border-radius: 10px; box-shadow: 0 6px 30px rgba(0,0,0,0.3);
  opacity: 0; transition: opacity 160ms ease, transform 160ms ease;
  z-index: 2000;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }


/* ---- Blog / Prose styles ---- */
.prose {
  max-width: 760px;
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.7;
}
.prose h1, .prose h2, .prose h3, .prose h4 { line-height: 1.25; margin: 22px 0 10px; }
.prose h1 { font-size: 32px; }
.prose h2 { font-size: 26px; margin-top: 26px; }
.prose h3 { font-size: 20px; }
.prose p { margin: 12px 0; color: var(--text); }
.prose ul, .prose ol { margin: 8px 0 12px 22px; }
.prose li { margin: 6px 0; }
.prose a { color: var(--accent-strong); text-decoration: none; }
.prose a:hover { text-decoration: underline; }
.prose figure { margin: 8px 0 14px; }
.prose img { max-width: 100%; border-radius: 12px; border: 1px solid var(--border); display: block; }
.prose figcaption { color: var(--muted); font-size: 13px; margin-top: 6px; }
.prose blockquote { border-left: 3px solid var(--border); padding-left: 12px; color: var(--muted); margin: 12px 0; }
.post-meta { color: var(--muted); font-size: 14px; }

.blog-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.post-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; box-shadow: 0 10px 30px rgba(2,6,23,0.06); display: grid; gap: 10px; }
.post-card .thumb { width: 100%; height: 160px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); background: #f3f6fb; }
.post-card h3 { margin: 0; font-size: 18px; }
.post-card p { margin: 0; color: var(--muted); }
.post-card .read { width: max-content; }
