/* ============================================
   mkpw — Instant Password Generator
   ============================================ */

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrainsMono-Latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrainsMono-Thin-Latin.woff2') format('woff2');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/SpaceGrotesk-Latin.woff2') format('woff2');
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/IBMPlexMono-SemiBold-Latin.woff2') format('woff2');
}

/* --- Design Tokens --- */
:root {
  --bg: #1A1A2E;
  --surface: #2E2E52;
  --accent: #E8C547;
  --text: #E0E0E0;
  --muted: #9999B0;
  --success: #66BB6A;
  --error: #EF5350;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  --font-sans: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-logo: 'IBM Plex Mono', var(--font-mono);

  /* Syntax highlighting */
  --syntax-upper: #E8C547;
  --syntax-lower: #C49030;
  --syntax-digit: #7EC8C8;
  --syntax-symbol: #E87B6B;

  /* Delight effects */
  --accent-dim: rgba(232, 197, 71, 0.22);
  --accent-glow: rgba(232, 197, 71, 0.08);

  /* Copy toast */
  --toast-bg: #66BB6A;
  --toast-fg: #0A1A0B;
  --toast-border: rgba(0, 0, 0, 0.18);
}

/* --- Light Mode Tokens --- */
:root.light {
  --bg: #F5F3EE;
  --surface: #E2DFD8;
  --accent: #9B7D0A;
  --text: #2A2A2E;
  --muted: #6B6B80;
  --success: #2E7D32;
  --error: #C62828;

  --syntax-upper: #9B7D0A;
  --syntax-lower: #8A6510;
  --syntax-digit: #1A7F7F;
  --syntax-symbol: #B5422E;

  --accent-dim: rgba(155, 125, 10, 0.14);
  --accent-glow: rgba(155, 125, 10, 0.07);

  --toast-bg: #2E7D32;
  --toast-fg: #F5F3EE;
  --toast-border: rgba(0, 0, 0, 0.12);
}

/* Light mode overrides for hardcoded values */

/* Backdrop: prismatic underflow — linear gradient shifted below text reads as
   reflection on a surface, not as colored stains. Thinner profile than dark mode. */
:root.light .logo-brand::before {
  transform: translate(-50%, 25%);
  width: 105%;
  height: 70%;
  background: linear-gradient(
    90deg,
    rgba(155, 125, 10, 0.28) 5%,
    rgba(138, 101, 16, 0.20) 28%,
    rgba(26, 127, 127, 0.22) 56%,
    rgba(181, 66, 46, 0.18) 80%,
    transparent 100%
  );
  filter: blur(16px);
  opacity: 1;
}

/* Per-letter: embossed drop shadow — white highlight lifts the letter,
   colored directional shadow grounds it. Replaces omnidirectional glow. */
:root.light .logo-text .syn-u {
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5),
    0 1px 3px rgba(155, 125, 10, 0.35),
    0 4px 14px rgba(155, 125, 10, 0.12);
}
:root.light .logo-text .syn-l {
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5),
    0 1px 3px rgba(138, 101, 16, 0.30),
    0 4px 14px rgba(138, 101, 16, 0.10);
}
:root.light .logo-text .syn-d {
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5),
    0 1px 3px rgba(26, 127, 127, 0.35),
    0 4px 14px rgba(26, 127, 127, 0.12);
}
:root.light .logo-text .syn-s {
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5),
    0 1px 3px rgba(181, 66, 46, 0.35),
    0 4px 14px rgba(181, 66, 46, 0.12);
}

:root.light .logo-tld.visible {
  opacity: 0.25;
}

:root.light .slogan {
  color: rgba(155, 125, 10, 0.55);
  text-shadow: 0 0 12px rgba(155, 125, 10, 0.08);
}

/* Light mode: soften row left border */
:root.light .password-row {
  border-left-color: var(--accent);
  border-left-width: 2px;
}

/* Light mode: DIY section containment */
:root.light .diy-section {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

/* Light mode: row action buttons */
:root.light .row-actions .btn-icon {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.06);
}

:root.light .row-actions .btn-icon:hover {
  background: var(--surface);
  border-color: rgba(0, 0, 0, 0.1);
}

:root.light .header-actions {
  background: rgba(0, 0, 0, 0.05);
}

:root.light .header-actions .btn-icon:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* Theme transition */
body {
  transition: background-color 0.2s, color 0.2s;
}

/* Theme toggle icon states */
.btn-theme .icon-moon { display: none; }
:root.light .btn-theme .icon-sun { display: none; }
:root.light .btn-theme .icon-moon { display: block; }

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Base --- */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
}

main {
  width: 100%;
  max-width: 720px;
  padding: 48px 0 32px;
}

/* --- Header --- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 40px;
}

.header-actions {
  display: flex;
  gap: 2px;
  align-items: center;
  background: var(--surface);
  border-radius: 20px;
  padding: 3px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  line-height: 1;
}

.logo-brand {
  position: relative;
  font-family: var(--font-logo);
  font-weight: 600;
  font-size: clamp(2rem, 6vw, 3rem);
  color: var(--accent);
  letter-spacing: 2px;
}

/* Multi-color glow backdrop behind the logo mark */
.logo-brand::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 110%;
  height: 300%;
  background: radial-gradient(
    ellipse 60% 80% at 15% 50%,
    rgba(232, 197, 71, 0.18) 0%,
    transparent 70%
  ),
  radial-gradient(
    ellipse 50% 70% at 40% 50%,
    rgba(126, 200, 200, 0.14) 0%,
    transparent 70%
  ),
  radial-gradient(
    ellipse 50% 70% at 65% 50%,
    rgba(232, 123, 107, 0.14) 0%,
    transparent 70%
  ),
  radial-gradient(
    ellipse 60% 80% at 90% 50%,
    rgba(196, 144, 48, 0.12) 0%,
    transparent 70%
  );
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}

.logo-prompt {
  color: var(--muted);
  letter-spacing: 0;
  position: relative;
  z-index: 1;
}

.logo-text {
  position: relative;
  z-index: 1;
}

.logo-text span {
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.logo-tld {
  color: var(--accent);
  font-size: 0.6em;
  font-weight: 300;
  letter-spacing: 1px;
  margin-left: 3px;
  opacity: 0;
  transition: opacity 0.4s ease;
  vertical-align: baseline;
  position: relative;
  z-index: 1;
}

.logo-tld.visible {
  opacity: 0.30;
}

/* Logo syntax glow — triple-layer per letter */
.logo-text .syn-u {
  text-shadow:
    0 0 8px rgba(232, 197, 71, 0.7),
    0 0 25px rgba(232, 197, 71, 0.35),
    0 0 50px rgba(232, 197, 71, 0.15);
}
.logo-text .syn-l {
  text-shadow:
    0 0 8px rgba(196, 144, 48, 0.6),
    0 0 25px rgba(196, 144, 48, 0.3),
    0 0 50px rgba(196, 144, 48, 0.12);
}
.logo-text .syn-d {
  text-shadow:
    0 0 8px rgba(126, 200, 200, 0.7),
    0 0 25px rgba(126, 200, 200, 0.35),
    0 0 50px rgba(126, 200, 200, 0.15);
}
.logo-text .syn-s {
  text-shadow:
    0 0 8px rgba(232, 123, 107, 0.7),
    0 0 25px rgba(232, 123, 107, 0.35),
    0 0 50px rgba(232, 123, 107, 0.15);
}


.slogan {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(232, 197, 71, 0.48);
  letter-spacing: 0.5px;
  text-shadow: 0 0 20px rgba(232, 197, 71, 0.12);
  margin-top: 8px;
  min-height: 1.4em;
  flex-basis: 100%;
}

/* --- Password Rows --- */
.password-row {
  border-left: 2px solid var(--accent);
  padding: 16px 10px 16px 16px;
  border-bottom: none;
  transition: background-color 0.3s ease;
  border-radius: 0 4px 4px 0;
}

.password-row + .password-row {
  margin-top: 14px;
}

.password-row:hover {
  background-color: var(--accent-glow);
}

.password-row.copy-glow {
  box-shadow: 0 0 40px -5px rgba(232, 197, 71, 0.35);
  transition: box-shadow 0.4s ease;
}

.password-row.copy-glow .password-value span {
  filter: brightness(1.4);
  transition: filter 0.15s ease;
}

/* --- Mask Toggle --- */
.btn-mask .icon-eye-closed { display: none; }
.btn-mask[aria-pressed="true"] .icon-eye-open { display: none; }
.btn-mask[aria-pressed="true"] .icon-eye-closed { display: block; }

.masked .password-value span,
.masked .password-value {
  color: transparent;
  text-shadow: 0 0 8px var(--muted);
}

/* Light mode: must re-declare color:transparent to beat :root.light syntax
   color rules (specificity 0-4-0). This selector is 0-4-1 for spans. */
:root.light .masked .password-value span,
:root.light .masked .password-value {
  color: transparent;
  text-shadow: 0 0 10px rgba(42, 42, 46, 0.45);
}

/* Preserve loading state visibility when masked */
.masked .password-value.loading {
  color: var(--muted);
  text-shadow: none;
}

/* Suppress brightness boost on copy when masked */
.masked .password-row.copy-glow .password-value span {
  filter: none;
}

.row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.row-header {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.row-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.row-tagline {
  font-size: 0.6875rem;
  color: var(--muted);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.2;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.password-row:hover .row-tagline {
  opacity: 1;
}

.sfw-toggle {
  margin-left: auto;
  border: 1px solid var(--surface);
  background: none;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.5px;
  color: var(--muted);
  cursor: pointer;
  padding: 0.1875rem 0.5rem;
  line-height: 1;
  opacity: 0.5;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  border-radius: 12px;
  transition: opacity 0.2s, color 0.2s, border-color 0.2s;
}

.sfw-toggle.active {
  opacity: 0.8;
  color: var(--muted);
  text-decoration: none;
  border-color: var(--muted);
}

.sfw-toggle:hover {
  opacity: 1;
  border-color: var(--accent);
}

.sfw-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}

.diy-entropy {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--font-mono);
  text-align: center;
  margin-top: 0.5rem;
  display: block;
}

.shortcut-badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted);
  background: var(--surface);
  border-radius: 3px;
  padding: 1px 6px;
  line-height: 1.4;
  position: relative;
  cursor: default;
}

.shortcut-badge::after {
  content: attr(title);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 8px);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

/* Tooltip caret */
.shortcut-badge::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 4px);
  border: 4px solid transparent;
  border-top-color: var(--surface);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.shortcut-badge:hover::after,
.shortcut-badge:hover::before {
  opacity: 1;
}

.row-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- Password Text --- */
.password-text {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 4px 0;
  border-radius: 4px;
  transition: transform 0.15s ease-out;
}

.password-text:hover {
  opacity: 0.85;
}

.password-text:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}

.password-value {
  font-family: var(--font-mono);
  font-size: clamp(0.875rem, 2.2vw, 1.125rem);
  color: var(--accent);
  letter-spacing: 1px;
  word-break: break-all;
  display: block;
}

.password-value.loading {
  color: var(--muted);
  font-style: italic;
  letter-spacing: 0;
}

/* --- Syntax Highlighting --- */
.syn-u { color: var(--syntax-upper); }
.syn-l { color: var(--syntax-lower); }
.syn-d { color: var(--syntax-digit); }
.syn-s { color: var(--syntax-symbol); }

/* --- Password Privacy: thinner weight + reduced opacity --- */
/* Scoped to .password-value only — logo colors stay full strength */
.password-value {
  font-weight: 200;
}

.password-value .syn-u { color: rgba(232, 197, 71, 0.58); }
.password-value .syn-l { color: rgba(196, 144, 48, 0.58); }
.password-value .syn-d { color: rgba(126, 200, 200, 0.58); }
.password-value .syn-s { color: rgba(232, 123, 107, 0.58); }

:root.light .password-value .syn-u { color: rgba(155, 125, 10, 0.58); }
:root.light .password-value .syn-l { color: rgba(138, 101, 16, 0.58); }
:root.light .password-value .syn-d { color: rgba(26, 127, 127, 0.58); }
:root.light .password-value .syn-s { color: rgba(181, 66, 46, 0.58); }

.password-row.copied .password-text {
  transform: scale(1.02);
}

/* --- Row Actions --- */
.row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

/* Row action buttons get a visible resting state */
.row-actions .btn-icon {
  background: rgba(46, 46, 82, 0.5);
  border-color: rgba(255, 255, 255, 0.04);
}

.row-actions .btn-icon:hover {
  color: var(--text);
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.08);
}

/* Header actions already have a pill background */
.header-actions .btn-icon {
  border-radius: 17px;
}

.header-actions .btn-icon:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.btn-icon:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}

.icon {
  width: 20px;
  height: 20px;
}

/* Copy button states */
.btn-copy .icon-check,
.btn-copy .icon-x {
  display: none;
}

.btn-copy.success .icon-copy { display: none; }
.btn-copy.success .icon-check { display: block; color: var(--success); }

.btn-copy.fail .icon-copy { display: none; }
.btn-copy.fail .icon-x { display: block; color: var(--error); }

/* --- DIY Section --- */
.diy-section {
  margin-top: 48px;
  padding: 24px;
  border-top: none;
  background: rgba(46, 46, 82, 0.25);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.section-label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.diy-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.control-label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.6875rem;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}

/* --- Slider --- */
.slider-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

input[type="range"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
  border-radius: 2px;
}

input[type="range"]::-moz-range-progress {
  background: var(--accent);
  border-radius: 2px;
  height: 4px;
}

input[type="range"]::-moz-range-track {
  background: var(--surface);
  border-radius: 2px;
  height: 4px;
}

.length-readout {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
  min-width: 3ch;
  text-align: right;
}

/* --- Toggle Pills --- */
.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toggle-pill {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  padding: 6px 12px;
  border: 1px solid var(--surface);
  border-radius: 20px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.toggle-pill[aria-checked="true"] {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.toggle-pill:hover {
  border-color: var(--accent);
}

.toggle-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}

.toggle-pill.shake {
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* --- DIY Output --- */
.diy-output {
  border-left: 2px solid var(--accent);
  padding: 12px 0 12px 16px;
}


/* --- Pro Tip --- */
.pro-tip {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
  padding: 16px;
  margin-top: 24px;
  background: var(--surface);
  border-radius: 6px;
  animation: fadeIn 0.3s ease-out;
}

.pro-tip.dismissing {
  animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

/* --- Copy Toast --- */
.copy-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 8px);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--toast-fg);
  background: var(--toast-bg);
  border: 1px solid var(--toast-border);
  border-radius: 8px;
  padding: 8px 16px;
  z-index: 1400;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  white-space: nowrap;
  max-width: calc(100vw - 24px);
}

.copy-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.copy-toast.dismissing {
  transition-duration: 0.2s;
}

/* --- Info Modal --- */
.info-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.info-modal.visible {
  opacity: 1;
}

.info-modal[hidden] {
  display: none;
}

.info-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.info-card {
  position: relative;
  background: var(--surface);
  border: none;
  border-radius: 12px;
  padding: 32px;
  max-width: 420px;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 24px 80px rgba(0, 0, 0, 0.5);
}

.info-card .btn-info-close {
  position: absolute;
  top: 20px;
  right: 20px;
}

.info-hero {
  font-family: var(--font-logo);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--accent);
  letter-spacing: 2px;
  margin: 0 0 6px;
  line-height: 1.2;
}

.info-hero-prompt {
  color: var(--muted);
  letter-spacing: 0;
}

.info-tagline {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 28px;
}

.info-promises {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.info-item {
  padding: 10px 0 10px 16px;
  border-left: 2px solid var(--muted);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.info-item:nth-child(1) { border-left-color: var(--syntax-upper); }
.info-item:nth-child(2) { border-left-color: var(--syntax-digit); }
.info-item:nth-child(3) { border-left-color: var(--syntax-symbol); }
.info-item:nth-child(4) { border-left-color: var(--syntax-lower); }

.info-modal.visible .info-item {
  animation: infoItemReveal 0.35s ease forwards;
}

.info-modal.visible .info-item:nth-child(1) { animation-delay: 0.05s; }
.info-modal.visible .info-item:nth-child(2) { animation-delay: 0.10s; }
.info-modal.visible .info-item:nth-child(3) { animation-delay: 0.15s; }
.info-modal.visible .info-item:nth-child(4) { animation-delay: 0.20s; }

@keyframes infoItemReveal {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.info-item-label {
  display: block;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.info-item:nth-child(1) .info-item-label { color: var(--syntax-upper); }
.info-item:nth-child(2) .info-item-label { color: var(--syntax-digit); }
.info-item:nth-child(3) .info-item-label { color: var(--syntax-symbol); }
.info-item:nth-child(4) .info-item-label { color: var(--syntax-lower); }

.info-item-desc {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.info-source-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.5px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.info-modal.visible .info-source-link {
  animation: infoItemReveal 0.3s ease forwards;
  animation-delay: 0.28s;
}

.info-source-link:hover {
  color: var(--accent);
}

.btn-info-close:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
}

:root.light .info-backdrop {
  background: rgba(0, 0, 0, 0.25);
}

:root.light .info-card {
  background: #FFFFFF;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 24px 80px rgba(0, 0, 0, 0.15);
}

/* --- Footer --- */
footer {
  width: 100%;
  max-width: 720px;
  text-align: center;
  padding: 40px 16px 48px;
  font-size: 0.8125rem;
  color: var(--muted);
  border-top: 1px solid var(--surface);
  margin-top: 16px;
}

.footer-links {
  font-size: 0.75rem;
}

.footer-trust {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-trust .icon {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

footer p + p {
  margin-top: 4px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
}

/* --- Screen Reader Only --- */
.sr-announcer {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Scramble Animation --- */
.password-value.scrambling {
  opacity: 0.7;
}

/* --- Boot Sequence --- */
.boot-hidden {
  opacity: 0;
  transform: translateY(4px);
}

.boot-reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* --- Slogan Transitions --- */
.slogan-fade-out {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.slogan-fade-in {
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .password-text.pulse,
  .password-row.copied .password-text {
    transform: none;
  }

  .info-item,
  .info-source-link {
    opacity: 1;
    transform: none;
  }
}

/* --- Mobile --- */
@media (max-width: 480px) {
  main {
    padding-top: 32px;
  }

  .site-header {
    margin-bottom: 28px;
  }

  .password-row {
    padding: 12px 8px 12px 12px;
  }

  .password-value {
    font-size: 0.75rem;
    letter-spacing: 0px;
  }

  .shortcut-badge {
    display: none;
  }

  .row-actions .btn-icon {
    width: 44px;
    height: 44px;
  }

  .row-actions .btn-icon .icon {
    width: 18px;
    height: 18px;
  }

  .header-actions .btn-icon {
    width: 44px;
    height: 44px;
  }

  .toggle-pill {
    padding: 10px 12px;
  }

  .sfw-toggle {
    font-size: 0.625rem;
  }

  .diy-section {
    padding: 16px;
  }

  .copy-toast {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    font-size: 0.75rem;
  }
}

/* --- Narrow mobile (iPhone SE / 12 Pro) --- */
@media (max-width: 430px) {
  .password-value {
    font-size: 0.8125rem;
    letter-spacing: 0px;
    font-weight: 400;
  }
  /* Restore full-opacity syntax colors on narrow screens to prevent
     compounding illegibility with smaller font size */
  .password-value .syn-u { color: var(--syntax-upper); }
  .password-value .syn-l { color: var(--syntax-lower); }
  .password-value .syn-d { color: var(--syntax-digit); }
  .password-value .syn-s { color: var(--syntax-symbol); }
}

/* --- Touch device: hide shortcut badges --- */
@media (hover: none) {
  .shortcut-badge {
    display: none;
  }
}
