/* ==========================================================================
   Flassword — Stylesheet
   Design system: blue primary, white surfaces, soft shadows, rounded cards.
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  /* Colors — light mode */
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #60a5fa;
  --color-accent: #06b6d4;
  --color-success: #16a34a;
  --color-warning: #f59e0b;
  --color-danger: #dc2626;

  --color-bg: #ffffff;
  --color-bg-secondary: #f6f8fb;
  --color-surface: #ffffff;
  --color-border: #e6eaf0;
  --color-text: #0f172a;
  --color-text-secondary: #4b5670;
  --color-text-muted: #8a93a6;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 0 4px rgba(37, 99, 235, 0.12);

  /* Typography — system-font stack: zero network requests, no FOUT/CLS risk */
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Layout */
  --max-width: 1180px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Dark mode ---------- */
html[data-theme="dark"] {
  --color-primary: #3b82f6;
  --color-primary-dark: #2563eb;
  --color-primary-light: #93c5fd;
  --color-bg: #0b1220;
  --color-bg-secondary: #0f172a;
  --color-surface: #111a2c;
  --color-border: #1f2a3d;
  --color-text: #eef2f8;
  --color-text-secondary: #a7b1c2;
  --color-text-muted: #6b7688;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 16px;
  transition: background var(--transition), color var(--transition);
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 var(--space-4);
  font-weight: 700;
  letter-spacing: -0.02em;
}
p { margin: 0 0 var(--space-4); color: var(--color-text-secondary); }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul, ol { padding-left: 1.25rem; color: var(--color-text-secondary); }
li { margin-bottom: var(--space-2); }
button { font-family: inherit; cursor: pointer; }
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--color-primary);
  color: #fff; padding: 0.75rem 1.25rem; border-radius: 0 0 8px 0; z-index: 1000;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.5rem; border-radius: var(--radius-full); font-weight: 600;
  font-size: 0.95rem; border: 1px solid transparent; transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-primary); color: #fff; box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--color-primary-dark); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary {
  background: var(--color-surface); color: var(--color-text); border-color: var(--color-border);
}
.btn-secondary:hover { border-color: var(--color-primary); text-decoration: none; color: var(--color-primary); }
.btn-ghost { background: transparent; color: var(--color-text-secondary); }
.btn-ghost:hover { color: var(--color-primary); text-decoration: none; }
.btn-block { width: 100%; }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--color-bg) 85%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem var(--space-6); max-width: var(--max-width); margin: 0 auto;
}
.brand{
display:flex;align-items:center;gap:14px;font-family:var(--font-display);
font-weight:800;color:var(--color-text);text-decoration:none;flex-shrink:0}
.brand:hover { text-decoration: none; }
.brand-tagline {
  font-family: var(--font-body, inherit); font-weight: 500; font-size: 0.72rem;
  letter-spacing: 0.01em; color: var(--color-text-muted); white-space: nowrap;
  margin-left: 0.35rem; padding-left: 0.65rem; border-left: 1px solid var(--color-border);
}
@media (max-width: 900px) {
  .brand-tagline { display: none; }
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
}
.nav-links {
  display: flex; align-items: center; gap: var(--space-8); list-style: none; margin: 0; padding: 0;
}
.nav-links a { color: var(--color-text-secondary); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--color-primary); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: var(--space-4); }
.theme-toggle {
  width: 40px; height: 40px; border-radius: var(--radius-full); border: 1px solid var(--color-border);
  background: var(--color-surface); display: flex; align-items: center; justify-content: center;
  color: var(--color-text-secondary); transition: all var(--transition);
}
.theme-toggle:hover { color: var(--color-primary); border-color: var(--color-primary); }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
.nav-toggle {
  display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--color-border);
  background: var(--color-surface); align-items: center; justify-content: center;
}

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-16) 0 var(--space-8);
  background:
    radial-gradient(60% 60% at 85% 0%, rgba(37,99,235,0.08), transparent 60%),
    radial-gradient(50% 50% at 10% 10%, rgba(6,182,212,0.06), transparent 60%);
}
.hero-inner { text-align: center; max-width: 760px; margin: 0 auto; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 700;
  color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  padding: 0.4rem 0.9rem; border-radius: var(--radius-full); margin-bottom: var(--space-6);
  letter-spacing: 0.02em;
}
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem); margin-bottom: var(--space-4);
}
.hero h1 .accent {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-desc { font-size: 1.15rem; max-width: 620px; margin: 0 auto var(--space-8); }
.hero-stats { display: flex; justify-content: center; gap: var(--space-8); flex-wrap: wrap; margin-top: var(--space-12); }
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--color-primary); }
.hero-stat span { font-size: 0.85rem; color: var(--color-text-muted); }

/* ---------- Generator Tool ---------- */
.tool-section { padding: var(--space-8) 0 var(--space-24); }
.tool-card {
  max-width: 780px; margin: 0 auto; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: var(--space-8);
}
.password-display {
  display: flex; align-items: center; gap: var(--space-3);
  background: var(--color-bg-secondary); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: var(--space-4) var(--space-6); margin-bottom: var(--space-6);
}
#passwordOutput, .output-text {
  flex: 1; font-family: var(--font-mono); font-size: 1.3rem; font-weight: 600;
  letter-spacing: 0.03em; background: transparent; border: none; color: var(--color-text);
  min-width: 0; overflow-x: auto; white-space: nowrap;
}
.icon-btn {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--radius-sm);
  background: var(--color-surface); border: 1px solid var(--color-border);
  color: var(--color-text-secondary); display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.icon-btn:hover { color: var(--color-primary); border-color: var(--color-primary); }
.icon-btn.is-active { color: var(--color-success); border-color: var(--color-success); }

/* Strength meter (signature element) */
.strength-meter { margin-bottom: var(--space-8); }
.strength-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem;
  font-size: 0.9rem; font-weight: 600;
}
.strength-label { color: var(--color-text-secondary); }
.strength-bits { color: var(--color-text-muted); font-family: var(--font-mono); font-size: 0.8rem; }
.strength-track {
  display: flex; gap: 6px; height: 8px;
}
.strength-seg {
  flex: 1; border-radius: var(--radius-full); background: var(--color-border);
  transition: background var(--transition);
}
.strength-seg.filled[data-level="weak"] { background: var(--color-danger); }
.strength-seg.filled[data-level="fair"] { background: var(--color-warning); }
.strength-seg.filled[data-level="good"] { background: var(--color-primary); }
.strength-seg.filled[data-level="strong"] { background: var(--color-success); }

.option-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border);
}
.option-row:last-of-type { border-bottom: none; }
.option-label { font-weight: 600; font-size: 0.95rem; }
.option-label small { display: block; font-weight: 400; color: var(--color-text-muted); font-size: 0.8rem; }
.length-value {
  font-family: var(--font-mono); font-weight: 700; color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  padding: 0.2rem 0.7rem; border-radius: var(--radius-full);
}
input[type="range"] {
  width: 100%; height: 6px; border-radius: var(--radius-full); background: var(--color-border);
  appearance: none; -webkit-appearance: none; margin: var(--space-3) 0 var(--space-2);
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--color-primary); box-shadow: var(--shadow-md); cursor: pointer; border: 3px solid #fff;
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: var(--color-primary);
  border: 3px solid #fff; box-shadow: var(--shadow-md); cursor: pointer;
}
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute; inset: 0; background: var(--color-border); border-radius: var(--radius-full);
  transition: background var(--transition); cursor: pointer;
}
.switch-track::before {
  content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform var(--transition); box-shadow: var(--shadow-sm);
}
.switch input:checked + .switch-track { background: var(--color-primary); }
.switch input:checked + .switch-track::before { transform: translateX(20px); }

.tool-actions { display: flex; gap: var(--space-4); margin-top: var(--space-8); }
.tool-note {
  display: flex; align-items: center; gap: 0.5rem; margin-top: var(--space-6);
  font-size: 0.85rem; color: var(--color-text-muted); justify-content: center;
}

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--color-text); color: var(--color-bg); padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full); font-weight: 600; font-size: 0.9rem; opacity: 0;
  transition: all var(--transition); pointer-events: none; z-index: 999; box-shadow: var(--shadow-lg);
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Generic section layout ---------- */
.section { padding: var(--space-24) 0; }
.section-alt { background: var(--color-bg-secondary); }
.section-head { max-width: 640px; margin: 0 auto var(--space-12); text-align: center; }
.section-head h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
.section-head p { font-size: 1.05rem; }

.grid {
  display: grid; gap: var(--space-6);
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: var(--space-8); box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm); display: flex; align-items: center;
  justify-content: center; background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  color: var(--color-primary); margin-bottom: var(--space-4);
}
.card h3 { font-size: 1.15rem; margin-bottom: var(--space-2); }
.card p { margin-bottom: 0; font-size: 0.95rem; }

/* How it works */
.steps { counter-reset: step; }
.step { display: flex; gap: var(--space-6); align-items: flex-start; padding: var(--space-6) 0; }
.step:not(:last-child) { border-bottom: 1px solid var(--color-border); }
.step-num {
  counter-increment: step; flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%;
  background: var(--color-bg-secondary); border: 1px solid var(--color-border); display: flex;
  align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700;
  color: var(--color-primary);
}
.step-num::before { content: counter(step); }
.step h3 { margin-bottom: 0.3rem; font-size: 1.05rem; }
.step p { margin-bottom: 0; }

/* FAQ */
.faq-item {
  border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: var(--space-4);
  overflow: hidden; background: var(--color-surface);
}
.faq-question {
  width: 100%; text-align: left; background: none; border: none; padding: var(--space-6);
  display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 1rem;
  color: var(--color-text);
}
.faq-question .plus { transition: transform var(--transition); color: var(--color-primary); flex-shrink: 0; margin-left: var(--space-4); }
.faq-item.is-open .faq-question .plus { transform: rotate(45deg); }
.faq-answer {
  max-height: 0; overflow: hidden; transition: max-height var(--transition), padding var(--transition);
  padding: 0 var(--space-6);
}
.faq-item.is-open .faq-answer { max-height: 500px; padding: 0 var(--space-6) var(--space-6); }

/* Articles / related */
.article-card { display: flex; flex-direction: column; height: 100%; }
.article-thumb {
  aspect-ratio: 16/9; border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  margin-bottom: var(--space-4); display: flex; align-items: center; justify-content: center; color: #fff;
  font-family: var(--font-display); font-weight: 700; opacity: 0.9;
}
.article-meta { font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 0.4rem; }
.article-card h3 { font-size: 1.05rem; }
.article-card a.stretched { color: var(--color-text); }
.read-more { font-weight: 600; font-size: 0.9rem; margin-top: auto; }

/* CTA */
.cta {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border-radius: var(--radius-lg); padding: var(--space-16) var(--space-8); text-align: center; color: #fff;
}
.cta h2 { color: #fff; }
.cta p { color: rgba(255,255,255,0.85); max-width: 520px; margin: 0 auto var(--space-8); }
.cta .btn-secondary { background: #fff; color: var(--color-primary); border-color: transparent; }
.cta .btn-secondary:hover { background: rgba(255,255,255,0.9); }

/* Footer */
.site-footer { background: var(--color-bg-secondary); border-top: 1px solid var(--color-border); padding: var(--space-16) 0 var(--space-8); }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: var(--space-8); margin-bottom: var(--space-12); }
.footer-brand p { max-width: 320px; font-size: 0.9rem; }
.footer-col h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); margin-bottom: var(--space-4); }
.footer-col ul { list-style: none; padding: 0; }
.footer-col a { color: var(--color-text-secondary); font-size: 0.9rem; }
.footer-col a:hover { color: var(--color-primary); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-4);
  padding-top: var(--space-8); border-top: 1px solid var(--color-border); font-size: 0.85rem; color: var(--color-text-muted);
}
.footer-socials { display: flex; gap: var(--space-3); }
.footer-socials a {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center; color: var(--color-text-secondary);
}
.footer-socials a:hover { color: var(--color-primary); border-color: var(--color-primary); }

/* ---------- Article / Legal page layout ---------- */
.page-header { padding: var(--space-16) 0 var(--space-8); text-align: center; }
.breadcrumbs { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: var(--space-4); }
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs .sep { margin: 0 0.4rem; }
.prose-layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: var(--space-12); align-items: start; padding-bottom: var(--space-24); }
.prose { max-width: 720px; }
.prose h2 { margin-top: var(--space-12); font-size: 1.6rem; }
.prose h3 { margin-top: var(--space-8); font-size: 1.2rem; }
.prose p, .prose li { font-size: 1rem; }
.prose img { border-radius: var(--radius-md); margin: var(--space-6) 0; }
.article-featured {
  aspect-ratio: 21/9; border-radius: var(--radius-lg);
  width: 100%; height: auto; object-fit: cover; object-position: center;
  margin-bottom: var(--space-8); background: var(--color-bg-secondary);
}
.article-meta-row { display: flex; gap: var(--space-6); flex-wrap: wrap; font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: var(--space-8); }
.toc { background: var(--color-bg-secondary); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-6); margin-bottom: var(--space-8); }
.toc h2 { font-size: 1rem; margin-bottom: var(--space-3); }
.toc ol { padding-left: 1.1rem; margin: 0; }
.toc a { color: var(--color-text-secondary); font-size: 0.9rem; }
.tip-box, .faq-box {
  background: color-mix(in srgb, var(--color-primary) 6%, var(--color-bg));
  border-left: 3px solid var(--color-primary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-4) var(--space-6); margin: var(--space-6) 0;
}
.tip-box strong { color: var(--color-primary); }
.sidebar { position: sticky; top: 100px; }
.sidebar .card { margin-bottom: var(--space-6); }
.author-box { display: flex; gap: var(--space-4); align-items: center; }
.author-avatar {
  width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  flex-shrink: 0;
}
.author-box strong { display: block; font-size: 0.95rem; }
.author-box span { font-size: 0.8rem; color: var(--color-text-muted); }

/* 404 page */
.error-page { text-align: center; padding: var(--space-24) 0; }
.error-code {
  font-family: var(--font-display); font-size: clamp(5rem, 18vw, 9rem); font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1;
}

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.reveal { opacity: 0; }
.reveal.is-visible { animation: fadeInUp 600ms ease forwards; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .prose-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
@media (max-width: 720px) {
  .nav-links, .nav-actions .btn { display: none; }
  .nav-toggle { display: flex; }
  .nav.is-open .nav-links {
    display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column;
    background: var(--color-surface); padding: var(--space-6); border-bottom: 1px solid var(--color-border);
    gap: var(--space-4); box-shadow: var(--shadow-md);
  }
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .tool-actions { flex-direction: column; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

.brand-mark{width:46px;height:46px;border-radius:12px;box-shadow:0 8px 18px rgba(37,99,235,.22);}
.brand-text{display:flex;flex-direction:column;line-height:1.1}
.brand-name{font-size:1.28rem;font-weight:800}
.brand-tagline{font-size:.72rem;font-weight:500;color:var(--color-text-muted);margin-top:2px;border:none;padding:0;white-space:nowrap}
.nav-links{gap:1.5rem!important}
.site-header{min-height:72px}
.btn-primary{padding:.8rem 1.3rem}
@media(max-width:1100px){.brand-tagline{display:none}}
