:root {
  --bg: #0e1512;
  --bg-grad: radial-gradient(1200px 620px at 12% -8%, rgba(95, 207, 142, 0.13), transparent 62%),
    radial-gradient(900px 520px at 92% 4%, rgba(94, 159, 232, 0.08), transparent 60%);
  --surface: #161f1c;
  --surface-2: #1b2723;
  --raised: #22302b;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --text: #f2f6f4;
  --text-2: rgba(242, 246, 244, 0.66);
  --text-3: rgba(242, 246, 244, 0.44);
  --accent: #5fcf8e;
  --accent-2: #46a171;
  --accent-soft: rgba(95, 207, 142, 0.12);
  --accent-line: rgba(95, 207, 142, 0.34);
  --info: #5e9fe8;
  --info-soft: rgba(94, 159, 232, 0.12);
  --warn: #de9255;
  --warn-soft: rgba(222, 146, 85, 0.14);
  --danger: #e97366;
  --danger-soft: rgba(233, 115, 102, 0.14);
  --mono: "Menlo", "Consolas", "SFMono-Regular", ui-monospace, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.28), 0 8px 24px rgba(0, 0, 0, 0.22);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.34), 0 22px 60px rgba(0, 0, 0, 0.4);
  --maxw: 1120px;
}

* {
  box-sizing: border-box;
}

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

body {
  background-color: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 650;
}

h1 {
  font-size: clamp(2rem, 4.4vw, 2.9rem);
}

h2 {
  font-size: clamp(1.5rem, 2.6vw, 1.85rem);
}

h3 {
  font-size: 1.15rem;
}

h4 {
  font-size: 1rem;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font: inherit;
  color: inherit;
}

code,
kbd,
pre {
  font-family: var(--mono);
  font-size: 0.875rem;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

#leaf-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.app-root {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.noscript {
  position: fixed;
  inset: auto 16px 16px 16px;
  z-index: 40;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text-2);
}

/* ---------- text helpers ---------- */

.muted {
  color: var(--text-2);
}

.dim {
  color: var(--text-3);
}

.mono {
  font-family: var(--mono);
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 620;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.lede {
  font-size: 1.05rem;
  color: var(--text-2);
  max-width: 62ch;
}

.nowrap {
  white-space: nowrap;
}

.center {
  text-align: center;
}

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

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 560;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, opacity 0.16s ease;
}

.btn:hover:not(:disabled) {
  background: var(--raised);
  border-color: var(--border-strong);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
  border-color: transparent;
  color: #08130d;
  font-weight: 640;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #6fdc9c 0%, #4bad7b 100%);
  border-color: transparent;
}

.btn-ghost {
  background: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.btn-danger {
  background: var(--danger-soft);
  border-color: rgba(233, 115, 102, 0.4);
  color: #ffb9b1;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(233, 115, 102, 0.22);
}

.btn-sm {
  min-height: 36px;
  padding: 7px 13px;
  font-size: 0.85rem;
}

.btn-lg {
  min-height: 52px;
  padding: 14px 26px;
  font-size: 1.02rem;
}

.btn-block {
  width: 100%;
}

.btn .icon {
  flex: none;
}

/* ---------- form ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > label {
  font-size: 0.82rem;
  font-weight: 580;
  color: var(--text-2);
}

.input {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.input::placeholder {
  color: var(--text-3);
}

.input:hover {
  border-color: var(--border-strong);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: rgba(0, 0, 0, 0.34);
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.field-error {
  min-height: 1.1em;
  font-size: 0.79rem;
  color: #ffb0a7;
}

.field-hint {
  font-size: 0.79rem;
  color: var(--text-3);
}

.input-affix {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-affix .input {
  flex: 1;
}
