:root {
  --bg: #f5f1e8;
  --card: #ffffff;
  --text: #111111;
  --muted: #5f6b7a;
  --border: #e7ddcc;
  --accent: #c58b2a;
  --accent-hover: #a56f1d;
  --black-hover: #252525;
  --shadow: 0 18px 45px rgba(17, 17, 17, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px max(20px, calc((100vw - 1160px) / 2));
  background: rgba(245, 241, 232, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--text);
  color: #fff;
  font-size: 14px;
}

.header-link,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  background: var(--text);
  color: #fff;
  font-weight: 700;
  transition: background 0.2s ease, transform 0.2s ease;
}

.header-link:hover,
.primary-link:hover,
.primary-button:hover {
  background: var(--black-hover);
  transform: translateY(-1px);
}

.section {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 36px;
  align-items: center;
  min-height: 520px;
}

.hero-content h1,
.section-heading h2,
.split-section h2,
.cta-inner h2 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: 0;
}

.hero-content h1 {
  max-width: 680px;
  font-size: clamp(40px, 6vw, 72px);
}

.hero-text {
  max-width: 650px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 19px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-hover);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.hero-preview {
  padding: 26px;
}

.preview-top,
.strength-mini,
.strength-row,
.result-actions,
.button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preview-top span,
.strength-mini span,
.strength-row span {
  color: var(--muted);
}

.mini-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.preview-password {
  margin: 26px 0;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: #fbfaf7;
  font-family: "Courier New", monospace;
  font-size: 22px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.mini-progress,
.strength-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #efe7da;
}

.mini-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: #237a42;
}

.small {
  font-size: 14px;
}

.trust-note {
  margin: 18px 0 0;
  color: var(--muted);
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.86fr);
  gap: 24px;
  align-items: start;
}

.settings-card,
.result-card {
  padding: 26px;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h2,
.split-section h2,
.cta-inner h2 {
  font-size: clamp(28px, 4vw, 42px);
}

.centered {
  max-width: 680px;
  margin-inline: auto;
  text-align: center;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 26px;
}

.mode-button {
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.mode-button:hover,
.mode-button.is-active {
  border-color: var(--accent);
  background: #fff8eb;
}

.control-block {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fbfaf7;
}

.control-block > label {
  display: block;
  margin-bottom: 14px;
  font-weight: 800;
}

.length-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 14px;
  align-items: center;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.number-input {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
}

.hint,
.copy-status,
.strength-panel p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.checkbox-grid {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  color: var(--text);
}

.checkbox-grid input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.error-message {
  min-height: 24px;
  margin: 0 0 16px;
  color: #b42318;
  font-weight: 700;
}

.button-row {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 50px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  background: var(--text);
  color: #fff;
}

.secondary-button {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.secondary-button:hover,
.ghost-button:hover {
  border-color: var(--accent);
}

.ghost-button {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

.password-output {
  min-height: 132px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fbfaf7;
  font-family: "Courier New", monospace;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.result-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 18px 0 8px;
}

.strength-panel {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.strength-bar {
  margin-top: 12px;
}

.strength-bar span {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: #d92d20;
  transition: width 0.2s ease, background 0.2s ease;
}

.trust-box {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff8eb;
  color: var(--muted);
  font-size: 14px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.step-card {
  padding: 24px;
}

.step-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #fff8eb;
  color: var(--accent-hover);
  font-weight: 900;
}

.step-card h3 {
  margin: 18px 0 8px;
  font-size: 22px;
}

.step-card p,
.split-section p {
  margin: 0;
  color: var(--muted);
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 34px;
  align-items: center;
}

.split-section p {
  margin-top: 16px;
  font-size: 17px;
}

.use-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.use-card {
  min-height: 76px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  font-weight: 700;
}

.tips-card {
  padding: 30px;
}

.tips-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.tips-list li::marker {
  color: var(--accent);
}

.faq-list {
  display: grid;
  gap: 12px;
  max-width: 840px;
  margin: 0 auto;
}

details {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(17, 17, 17, 0.04);
}

summary {
  padding: 18px 20px;
  cursor: pointer;
  font-weight: 800;
}

details p {
  margin: 0;
  padding: 0 20px 20px;
  color: var(--muted);
}

.cta-section {
  padding-bottom: 70px;
}

.cta-inner {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 38px 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  text-align: center;
  box-shadow: var(--shadow);
}

.cta-inner p {
  margin: 0;
  color: var(--muted);
}

.site-footer {
  padding: 28px max(20px, calc((100vw - 1160px) / 2));
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-bottom: 12px;
}

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

.site-footer p {
  margin: 0;
}

@media (max-width: 900px) {
  .hero,
  .tool-grid,
  .split-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 44px;
  }

  .steps-grid,
  .tips-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .site-header {
    padding: 14px 16px;
  }

  .brand span:last-child {
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-link {
    min-height: 42px;
    padding: 0 12px;
    font-size: 14px;
  }

  .section {
    width: min(100% - 28px, 1160px);
    padding: 38px 0;
  }

  .hero-content h1 {
    font-size: 42px;
  }

  .settings-card,
  .result-card,
  .hero-preview,
  .tips-card {
    padding: 20px;
  }

  .mode-grid,
  .use-grid,
  .length-control {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .button-row > *,
  .result-actions > * {
    width: 100%;
  }

  .password-output {
    min-height: 110px;
  }
}
