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

:root {
  --page-bg: #f8fafc;
  --page-text: #0f172a;
  --hero-bg:
    radial-gradient(
      ellipse 80% 60% at 50% 0%,
      rgba(37, 99, 235, 0.18) 0%,
      rgba(37, 99, 235, 0.04) 60%,
      transparent 100%
    ),
    linear-gradient(180deg, #edf2fa 0%, #f8fafc 100%);
  --hero-border: #c7d4e6;
  --icon-bg: rgba(37, 99, 235, 0.12);
  --icon-border: rgba(37, 99, 235, 0.3);
  --muted-text: #475569;
  --panel-bg: #ffffff;
  --panel-border: #dbe3ef;
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --disabled-bg: #94a3b8;
  --warning-text: #9a5b00;
  --warning-bg: rgba(217, 119, 6, 0.1);
  --warning-border: rgba(217, 119, 6, 0.25);
  --error-text: #dc2626;
  --progress-bg: #e2e8f0;
  --footer-bg: #eef3f8;
  --footer-heading: #334155;
  --footer-link: #2563eb;
  --footer-copy: #64748b;
}

body.theme-dark {
  --page-bg: #0f172a;
  --page-text: #e2e8f0;
  --hero-bg:
    radial-gradient(
      ellipse 80% 50% at 50% 0%,
      rgba(59, 130, 246, 0.15) 0%,
      transparent 70%
    ),
    linear-gradient(180deg, #111827 0%, #0f172a 100%);
  --hero-border: #1e293b;
  --icon-bg: rgba(59, 130, 246, 0.1);
  --icon-border: rgba(59, 130, 246, 0.2);
  --muted-text: #94a3b8;
  --panel-bg: #1e293b;
  --panel-border: #334155;
  --input-bg: #0f172a;
  --input-border: #475569;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --disabled-bg: #475569;
  --warning-text: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.08);
  --warning-border: rgba(251, 191, 36, 0.25);
  --error-text: #f87171;
  --progress-bg: #334155;
  --footer-bg: #0b1120;
  --footer-heading: #64748b;
  --footer-link: #93c5fd;
  --footer-copy: #475569;
}

body {
  font-family: "Montserrat", sans-serif;
  background: var(--page-bg);
  color: var(--page-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 30;
  padding: 0.65rem 0.85rem;
  color: #ffffff;
  background: var(--primary);
  border-radius: 6px;
  transform: translateY(-160%);
  transition: transform 0.15s;
}

.skip-link:focus {
  transform: translateY(0);
}

.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;
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 20;
  width: auto;
  min-width: 6.75rem;
  padding: 0.55rem 0.75rem;
  margin: 0;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}

.hero {
  width: 100%;
  padding: 3rem 1rem 2rem;
  text-align: center;
  background: var(--hero-bg);
  border-bottom: 1px solid var(--hero-border);
  margin-bottom: 2rem;
}

.hero-inner {
  max-width: 520px;
  margin: 0 auto;
}

.hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: var(--icon-bg);
  border: 1px solid var(--icon-border);
  border-radius: 16px;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: 0;
}

.subtitle {
  color: var(--muted-text);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 420px;
  margin: 0 auto;
}

.container {
  width: 100%;
  max-width: 520px;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

.container:focus {
  outline: none;
}

.control-group {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

fieldset.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

legend {
  font-weight: 600;
  padding: 0 0.25rem;
  margin-bottom: 0.35rem;
}

label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
}

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

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--primary);
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  font-size: 0.7rem;
  font-weight: 700;
  font-style: italic;
  color: var(--muted-text);
  border: 1.5px solid var(--input-border);
  border-radius: 50%;
  cursor: help;
  vertical-align: middle;
  margin-left: 0.25rem;
  position: relative;
}

.info-icon:hover {
  color: var(--page-text);
  border-color: var(--primary);
}

.seed-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding-left: 1.6rem;
}

.seed-row label {
  flex-shrink: 0;
  cursor: default;
}

input[type="number"] {
  width: 120px;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  background: var(--input-bg);
  color: var(--page-text);
  border: 1px solid var(--input-border);
  border-radius: 4px;
}

.select-label {
  margin-bottom: 0.35rem;
  cursor: default;
}

select {
  width: 100%;
  padding: 0.5rem 0.6rem;
  font-size: 0.95rem;
  background: var(--input-bg);
  color: var(--page-text);
  border: 1px solid var(--input-border);
  border-radius: 4px;
}

input[type="number"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

label:has(input:disabled) {
  color: var(--muted-text);
  cursor: not-allowed;
}

button {
  width: 100%;
  padding: 0.85rem;
  margin-top: 0.5rem;
  margin-bottom: 30px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

button:hover {
  background: var(--primary-hover);
}

button:disabled {
  background: var(--disabled-bg);
  cursor: not-allowed;
}

.heavy-warning {
  margin-top: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--warning-text);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 6px;
  text-align: center;
}

.status {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted-text);
}

.status.status-error {
  color: var(--error-text);
}

.progress-wrap {
  margin-top: 0.75rem;
  height: 6px;
  background: var(--progress-bg);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.2s;
}

.site-footer {
  width: 100%;
  margin-top: 4rem;
  border-top: 1px solid var(--hero-border);
  background: var(--footer-bg);
}

.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
}

.footer-section {
  margin-bottom: 1.5rem;
}

.footer-section h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--footer-heading);
  margin-bottom: 0.4rem;
}

.footer-section p {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted-text);
}

.footer-section a {
  color: var(--footer-link);
  text-decoration: none;
}

.footer-section a:hover {
  text-decoration: underline;
}

.footer-copy {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hero-border);
  font-size: 0.78rem;
  color: var(--footer-copy);
  text-align: center;
}
