/* Tuverla — Password Generator
   Palette: ink charcoal + brass accent, cipher-machine mood
*/

@font-face {
  font-family: 'PlexMono';
  src: local('IBM Plex Mono');
}

:root {
  --ink-900: #0d1117;
  --ink-800: #141a22;
  --ink-700: #1c232d;
  --ink-600: #2a3340;
  --line: #2f3948;
  --text-hi: #e9ecf1;
  --text-mid: #a7b0bd;
  --text-low: #6b7686;
  --brass: #c8973f;
  --brass-hi: #e0b563;
  --good: #4c9a6a;
  --warn: #d9822b;
  --bad: #c0524a;
  --radius: 6px;
  --mono: 'IBM Plex Mono', 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --sans: 'IBM Plex Sans', -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink-900);
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(200,151,63,0.07), transparent 60%),
    radial-gradient(ellipse 700px 400px at 100% 10%, rgba(200,151,63,0.04), transparent 60%);
  color: var(--text-hi);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brass-hi); }

.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--text-hi);
}

.brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 8px rgba(200,151,63,0.7);
}

.lang-switch {
  display: flex;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 12px;
}

.lang-switch a {
  padding: 6px 10px;
  text-decoration: none;
  color: var(--text-mid);
  background: var(--ink-800);
}

.lang-switch a.active {
  color: var(--ink-900);
  background: var(--brass);
  font-weight: 600;
}

/* Hero / Tool */
.hero {
  padding: 48px 0 20px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass-hi);
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(28px, 4.2vw, 40px);
  line-height: 1.15;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.sub {
  color: var(--text-mid);
  font-size: 16px;
  max-width: 52ch;
  margin: 0 0 32px;
}

/* Password panel */
.panel {
  background: linear-gradient(180deg, var(--ink-700), var(--ink-800));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.03);
}

.display-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 22px;
}

.pw-display {
  flex: 1;
  min-width: 0;
  background: var(--ink-900);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  font-family: var(--mono);
  font-size: clamp(16px, 3vw, 22px);
  letter-spacing: 0.04em;
  color: var(--brass-hi);
  display: flex;
  align-items: center;
  overflow-x: auto;
  white-space: nowrap;
  user-select: all;
}

.pw-display .ch {
  display: inline-block;
  transition: opacity 0.05s;
}

.pw-display .ch.rolling {
  color: var(--text-low);
}

.icon-btn {
  flex: 0 0 auto;
  width: 54px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-mid);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.icon-btn:hover { color: var(--brass-hi); border-color: var(--brass); }
.icon-btn.copied { color: var(--good); border-color: var(--good); }

/* Strength dial */
.strength-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.dial {
  flex: 0 0 auto;
  width: 92px;
  height: 52px;
}

.strength-text {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-mid);
}

.strength-text .label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

/* Controls */
.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.length-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-mid);
}

.length-row output {
  color: var(--brass-hi);
  font-weight: 600;
  width: 28px;
  text-align: right;
}

input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: var(--ink-600);
  border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--brass);
  cursor: pointer;
  border: 2px solid var(--ink-900);
  box-shadow: 0 0 0 2px var(--brass);
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-mid);
  transition: border-color 0.15s, color 0.15s;
  user-select: none;
}

.toggle input { accent-color: var(--brass); }

.toggle:has(input:checked) {
  border-color: var(--brass);
  color: var(--text-hi);
}

.generate-btn {
  margin-top: 4px;
  padding: 14px;
  background: var(--brass);
  color: var(--ink-900);
  border: none;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.generate-btn:hover { background: var(--brass-hi); }
.generate-btn:active { transform: scale(0.99); }

/* Ad slots */
.ad-slot {
  margin: 32px 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-low);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Content sections */
.content {
  padding: 36px 0;
  border-top: 1px solid var(--line);
}

.content h2 {
  font-size: 20px;
  margin: 0 0 14px;
  color: var(--text-hi);
}

.content p {
  color: var(--text-mid);
  font-size: 15px;
  margin: 0 0 16px;
}

.faq-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.faq-item h3 {
  font-size: 15px;
  margin: 0 0 6px;
  color: var(--text-hi);
}

.faq-item p {
  margin: 0;
  font-size: 14px;
}

footer {
  padding: 28px 0 50px;
  color: var(--text-low);
  font-size: 12px;
  font-family: var(--mono);
  border-top: 1px solid var(--line);
}

footer a { color: var(--text-low); }

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

@media (max-width: 480px) {
  .toggle-grid { grid-template-columns: 1fr 1fr; }
  .strength-row { flex-wrap: wrap; }
}
