:root {
  --ink: #12231c;
  --muted: #3d5549;
  --paper: #e7f1ea;
  --panel: rgba(255, 252, 247, 0.78);
  --line: rgba(18, 35, 28, 0.12);
  --accent: #0f7a55;
  --accent-deep: #0a5a3e;
  --warn: #b45309;
  --good: #047857;
  --bad: #b91c1c;
  --shadow: 0 18px 50px rgba(18, 35, 28, 0.12);
  --radius: 18px;
  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 700px at 12% -10%, #9fd6bb 0%, transparent 55%),
    radial-gradient(900px 600px at 95% 15%, #f3d9a4 0%, transparent 50%),
    radial-gradient(800px 500px at 50% 110%, #7eb8c9 0%, transparent 55%),
    linear-gradient(160deg, #dff0e6 0%, #eef3ea 45%, #d7e8ef 100%);
  animation: drift 18s ease-in-out infinite alternate;
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(18, 35, 28, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 35, 28, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 85%);
}

@keyframes drift {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to { transform: scale(1.05) translate3d(-1.5%, 1%, 0); }
}

.shell {
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(3.5rem, 12vh, 7rem) 0 2rem;
}

.brand-block {
  margin-bottom: 1.75rem;
  animation: rise 0.8s ease both;
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 16vw, 7.5rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.06em;
  color: var(--ink);
}

h1 {
  margin: 1rem 0 0.75rem;
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4.5vw, 2.45rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.lede {
  margin: 0;
  max-width: 36ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.tool {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  animation: rise 0.9s ease 0.12s both;
}

.output-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: stretch;
}

.password {
  display: block;
  min-height: 3.4rem;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fffdf8;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: clamp(1rem, 2.8vw, 1.2rem);
  letter-spacing: 0.02em;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.controls {
  display: grid;
  gap: 1rem;
  margin-top: 1.1rem;
}

.length {
  display: grid;
  gap: 0.45rem;
  font-weight: 500;
}

.length input {
  width: 100%;
  accent-color: var(--accent);
}

.options {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
}

.options label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
}

.strength {
  margin-top: 1rem;
}

.strength-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(18, 35, 28, 0.08);
  overflow: hidden;
}

.strength-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--bad);
  transition: width 0.35s ease, background-color 0.35s ease;
}

#strengthLabel {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.cta,
.ghost {
  font: inherit;
  cursor: pointer;
  border-radius: 12px;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.cta {
  width: 100%;
  margin-top: 1.15rem;
  padding: 0.95rem 1.2rem;
  border: 0;
  background: var(--accent);
  color: #f4fff9;
  font-weight: 600;
  font-size: 1.05rem;
}

.cta:hover {
  background: var(--accent-deep);
}

.cta:active,
.ghost:active {
  transform: translateY(1px) scale(0.99);
}

.ghost {
  padding: 0 1rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
}

.ghost:hover {
  border-color: rgba(15, 122, 85, 0.45);
  background: rgba(15, 122, 85, 0.06);
}

.ghost.copied {
  border-color: var(--good);
  color: var(--good);
}

.footer {
  width: min(720px, calc(100% - 2rem));
  margin: 2.5rem auto 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
  animation: rise 1s ease 0.22s both;
}

.footer a {
  color: var(--accent-deep);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(10, 90, 62, 0.35);
}

.footer a:hover {
  border-bottom-color: var(--accent-deep);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

@media (max-width: 560px) {
  .output-row {
    grid-template-columns: 1fr;
  }

  .ghost {
    min-height: 2.8rem;
  }
}
