/* ── Self-hosted fonts (variable, no external requests) ── */
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/sora.woff2?v=1') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('fonts/jetbrains-mono.woff2?v=1') format('woff2');
}

html { scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #13111c;
  color: #f0eeff;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Focus-visible (keyboard) rings ── */
a:focus-visible,
button:focus-visible,
input[type="range"]:focus-visible,
.char-pill:has(input:focus-visible) {
  outline: 2px solid #a78bfa;
  outline-offset: 3px;
}

/* ── Entrance animation ── */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0;
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.reveal-1 { animation-delay: 0.05s; }
.reveal-2 { animation-delay: 0.16s; }
.reveal-3 { animation-delay: 0.28s; }
.reveal-4 { animation-delay: 0.38s; }
.reveal-5 { animation-delay: 0.48s; }

/* ── Animated background ── */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(135deg, #13111c 0%, #1e1542 50%, #13111c 100%);
  overflow: hidden;
}
/* fine grain overlay for depth/texture */
.bg::after {
  content: '';
  position: absolute;
  inset: -50%;
  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.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: drift 12s ease-in-out infinite;
  will-change: transform;
}
.bg-blob-1 { width: 600px; height: 600px; background: #6d28d9; top: -200px; left: -150px; animation-delay: 0s; }
.bg-blob-2 { width: 500px; height: 500px; background: #2563eb; bottom: -150px; right: -100px; animation-delay: -5s; }
.bg-blob-3 { width: 350px; height: 350px; background: #7c3aed; top: 40%; left: 55%; animation-delay: -9s; }
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(40px, -30px) scale(1.06); }
  66%       { transform: translate(-25px, 25px) scale(0.96); }
}

/* ── Site nav ── */
.site-nav {
  position: sticky; top: 0; z-index: 10;
  width: 100%;
  display: flex; justify-content: center; gap: 2px;
  padding: 8px 20px;
  background: rgba(19,17,28,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.site-nav a {
  font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,0.38);
  text-decoration: none;
  padding: 5px 14px;
  border-radius: 20px;
  transition: all 0.18s;
  letter-spacing: 0.2px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.site-nav a:hover {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.07);
}

/* ── AdSense top ── */
.ad-top {
  position: relative; z-index: 1;
  width: 100%; max-width: 728px;
  height: 90px;
  margin: 20px auto 0;
}

/* ── Page layout ── */
.page {
  position: relative; z-index: 1;
  width: 100%; max-width: 580px;
  padding: 40px 20px 60px;
  flex: 1;
}

/* ── Header ── */
.site-header {
  text-align: center;
  margin-bottom: 36px;
}
.header-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 18px;
  box-shadow: 0 8px 32px rgba(124,58,237,0.45);
}
.site-header h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.05;
  background: linear-gradient(135deg, #fff 25%, #c4b5fd 75%, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.site-header p {
  font-size: 15px;
  color: rgba(255,255,255,0.45);
}

/* ── Main card ── */
.card {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05) inset;
}

/* ── Password display ── */
.password-display {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: 14px;
  padding: 20px 18px 18px;
  margin-bottom: 10px;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.password-display:focus-within {
  border-color: rgba(139,92,246,0.7);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15), 0 0 24px rgba(139,92,246,0.15);
}
.password-display-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-bottom: 8px;
}
.password-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.password-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'JetBrains Mono', 'Courier New', 'Menlo', monospace;
  font-size: 19px;
  font-weight: 700;
  color: #a78bfa;
  letter-spacing: 0.5px;
  word-break: break-all;
  cursor: text;
  -webkit-user-select: all;
  user-select: all;
  text-shadow: 0 0 20px rgba(167,139,250,0.4);
  caret-color: #a78bfa;
  min-width: 0;
}
@keyframes pwflash {
  0%   { color: #ede9fe; text-shadow: 0 0 28px rgba(196,181,253,0.9); }
  100% { color: #a78bfa; text-shadow: 0 0 20px rgba(167,139,250,0.4); }
}
.password-field.flash { animation: pwflash 0.5s ease-out; }
.btn-copy {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.18s;
  box-shadow: 0 4px 12px rgba(124,58,237,0.4);
  white-space: nowrap;
}
.btn-copy:hover { box-shadow: 0 6px 20px rgba(124,58,237,0.55); transform: translateY(-1px); }
.btn-copy:active { transform: scale(0.96); }
.btn-copy.copied {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 4px 12px rgba(5,150,105,0.4);
}

/* ── Strength ── */
.strength-section {
  margin-bottom: 28px;
  padding: 0 2px;
}
.strength-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.strength-detail {
  margin-top: 9px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.2px;
  min-height: 14px;
  transition: color 0.3s;
}
.strength-detail b {
  font-weight: 700;
  color: rgba(255,255,255,0.62);
}
.strength-bars { display: flex; gap: 5px; flex: 1; }
.strength-bar {
  height: 4px; flex: 1; border-radius: 2px;
  background: rgba(255,255,255,0.1);
  transition: background 0.3s;
}
.strength-label {
  font-size: 11px; font-weight: 700;
  width: 76px; text-align: right; flex-shrink: 0;
  letter-spacing: 0.3px;
}
.strength-1 .s1 { background: #ef4444; box-shadow: 0 0 6px #ef444466; }
.strength-2 .s1, .strength-2 .s2 { background: #f97316; box-shadow: 0 0 6px #f9731666; }
.strength-3 .s1, .strength-3 .s2, .strength-3 .s3 { background: #eab308; box-shadow: 0 0 6px #eab30866; }
.strength-4 .s1, .strength-4 .s2, .strength-4 .s3, .strength-4 .s4 { background: #22c55e; box-shadow: 0 0 6px #22c55e66; }
.strength-1 .strength-label { color: #ef4444; }
.strength-2 .strength-label { color: #f97316; }
.strength-3 .strength-label { color: #eab308; }
.strength-4 .strength-label { color: #22c55e; }

/* ── Divider ── */
.divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 0 0 24px;
}

/* ── Length slider ── */
.length-row {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.length-label {
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.6);
}
.length-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px; font-weight: 700;
  color: #a78bfa;
  background: rgba(139,92,246,0.15);
  border-radius: 6px;
  padding: 3px 10px;
  min-width: 42px;
  text-align: center;
}
.slider-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 26px;
}
.slider-tick { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: rgba(255,255,255,0.25); flex-shrink: 0; }
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.1);
  outline: none; cursor: pointer;
  touch-action: pan-y;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  border: 3px solid #13111c;
  box-shadow: 0 0 0 2px rgba(167,139,250,0.5), 0 2px 8px rgba(124,58,237,0.5);
  cursor: pointer;
  transition: box-shadow 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 4px rgba(167,139,250,0.3), 0 2px 12px rgba(124,58,237,0.6);
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  border: 3px solid #13111c;
  cursor: pointer;
}

/* ── Character pills ── */
.char-label {
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.6);
  margin-bottom: 12px;
}
.char-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 28px;
}
.char-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.18s;
  position: relative;
  overflow: hidden;
}
.char-pill::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(124,58,237,0), rgba(124,58,237,0));
  transition: background 0.2s;
}
.char-pill:hover { border-color: rgba(167,139,250,0.35); transform: translateY(-1px); }
.char-pill.active {
  background: rgba(124,58,237,0.2);
  border-color: rgba(124,58,237,0.55);
  box-shadow: 0 0 16px rgba(124,58,237,0.2);
}
/* visually hidden but focusable for keyboard users */
.char-pill input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
  margin: 0;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}
.char-pill.shake { animation: shake 0.32s ease-in-out; }
.pill-dot {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
  font-size: 10px;
}
.char-pill.active .pill-dot {
  background: #7c3aed;
  border-color: #a78bfa;
  color: white;
}
.pill-text {
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.55);
  transition: color 0.18s;
  line-height: 1.2;
}
.pill-text span {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: -0.2px;
  color: rgba(255,255,255,0.3);
  margin-top: 2px;
}
.char-pill.active .pill-text { color: rgba(255,255,255,0.9); }
.char-pill.active .pill-text span { color: rgba(255,255,255,0.5); }

/* ── Generate button ── */
.btn-generate {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.18s;
  box-shadow: 0 6px 24px rgba(124,58,237,0.4);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-generate > * { position: relative; z-index: 1; }
/* light-sweep sheen */
.btn-generate::after {
  content: '';
  position: absolute;
  top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
  pointer-events: none;
}
.btn-generate:hover::after { left: 130%; }
.btn-generate:hover {
  box-shadow: 0 10px 32px rgba(124,58,237,0.55);
  transform: translateY(-2px);
}
.btn-generate:active { transform: scale(0.99) translateY(0); }
.btn-generate .spin-icon { display: inline-block; transition: transform 0.4s; }
.btn-generate:active .spin-icon { transform: rotate(180deg); }

/* ── Trust badges ── */
.badges {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.badge {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.3px;
}
.badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  flex-shrink: 0;
}

/* ── Info section ── */
.info {
  margin-top: 24px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 22px 24px;
}
.info.stacked { margin-top: 16px; }
.info h2 {
  font-size: 14px; font-weight: 700;
  color: rgba(255,255,255,0.6);
  margin-bottom: 10px;
  letter-spacing: 0.2px;
}
.info p {
  font-size: 13px; color: rgba(255,255,255,0.35);
  line-height: 1.75;
}
.info p + p { margin-top: 6px; }
.info code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(167,139,250,0.15);
  color: #a78bfa;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11.5px;
}

/* ── Tips grid ── */
.section-heading {
  font-size: 14px; font-weight: 700;
  color: rgba(255,255,255,0.6);
  margin-bottom: 14px;
  letter-spacing: 0.2px;
}
.tips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tip-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 18px 16px;
  transition: border-color 0.2s;
}
.tip-card:hover { border-color: rgba(167,139,250,0.2); }
.tip-icon { font-size: 22px; margin-bottom: 10px; }
.tip-card h3 {
  font-size: 13px; font-weight: 700;
  color: rgba(255,255,255,0.75);
  margin-bottom: 5px;
}
.tip-card p {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  line-height: 1.65;
}

/* ── FAQ accordion ── */
.faq details {
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.faq details:last-child { border-bottom: none; }
.faq summary {
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.6);
  padding: 15px 0;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color 0.18s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  font-size: 20px; font-weight: 300;
  color: rgba(255,255,255,0.25);
  flex-shrink: 0;
  transition: transform 0.2s, color 0.18s;
  line-height: 1;
}
.faq details[open] > summary { color: rgba(255,255,255,0.9); }
.faq details[open] > summary::after { transform: rotate(45deg); color: #a78bfa; }
.faq-body {
  font-size: 13px;
  color: rgba(255,255,255,0.38);
  line-height: 1.75;
  padding-bottom: 15px;
}
.faq-body code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(167,139,250,0.15);
  color: #a78bfa;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11.5px;
}

/* ── AdSense bottom ── */
.ad-bottom {
  position: relative; z-index: 1;
  width: 100%; max-width: 728px;
  height: 90px;
  margin: 0 auto 28px;
}

footer {
  position: relative; z-index: 1;
  font-size: 12px;
  color: rgba(255,255,255,0.2);
  padding: 0 20px 32px;
  text-align: center;
}
.footer-date { opacity: 0.5; }

@media (max-width: 480px) {
  .page { padding: 20px 16px 40px; }
  .site-header { margin-bottom: 24px; }
  .site-header h1 { font-size: 26px; }
  .header-icon { width: 52px; height: 52px; font-size: 22px; margin-bottom: 12px; }
  .card { padding: 20px 16px; }
  .password-display { padding: 16px 14px 14px; }
  .password-field { font-size: 16px; }
  .btn-copy { padding: 9px 13px; font-size: 12px; }
  .strength-section { margin-bottom: 20px; }
  .slider-row { margin-bottom: 20px; }
  input[type="range"]::-webkit-slider-thumb { width: 24px; height: 24px; }
  input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; }
  .char-pills { grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 20px; }
  .char-pill { padding: 10px 10px; }
  .btn-generate { padding: 15px; }
  .badges { gap: 12px; }
  .info { padding: 18px 16px; }
  .tips-grid { gap: 8px; }
  .tip-card { padding: 14px 12px; }
  .tip-icon { font-size: 18px; margin-bottom: 7px; }
  .ad-top, .ad-bottom { height: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-blob { animation: none; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; animation: none; }
  .password-field.flash,
  .char-pill.shake { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
