/* Animated background and the settings menu that controls it. */

.site-background {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.site-background[hidden] {
  display: none;
}

/* Let the background show through the main surfaces. */
:root {
  --shell: rgba(17, 17, 17, 0.4);
  --sidebar: rgba(13, 13, 13, 0.5);
  --shell-soft: rgba(23, 23, 23, 0.42);
}

.section-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)),
    rgba(12, 12, 12, 0.45);
}

.hero-stage {
  background:
    linear-gradient(rgba(99, 255, 171, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    radial-gradient(circle at top right, rgba(99, 255, 171, 0.08), transparent 34%),
    linear-gradient(160deg, rgba(18, 18, 18, 0.42), rgba(10, 10, 10, 0.52));
  background-size: 100% 24px, 24px 100%, auto, auto;
}

/* ---------- whoami typing ---------- */

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

.whoami-code.is-typing::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--accent);
  animation: whoami-caret 1s steps(1) infinite;
}

@keyframes whoami-caret {
  50% {
    opacity: 0;
  }
}

/* ---------- Settings menu ---------- */

.settings-menu {
  position: relative;
}

.settings-toggle {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.settings-toggle:hover,
.settings-toggle[aria-expanded="true"] {
  color: var(--accent);
  border-color: rgba(99, 255, 171, 0.24);
}

.settings-toggle:hover {
  transform: translateY(-1px);
}

.settings-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: min(330px, calc(100vw - 32px));
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(99, 255, 171, 0.14);
  background: rgba(10, 13, 11, 0.96);
  box-shadow: var(--shadow-lg);
}

.settings-panel[hidden] {
  display: none;
}

.settings-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.settings-group {
  display: grid;
  gap: 8px;
}

.settings-label {
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.settings-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.settings-option {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}

.settings-option:hover:not(:disabled) {
  color: var(--text);
  border-color: rgba(99, 255, 171, 0.2);
}

.settings-option[aria-pressed="true"] {
  color: #041008;
  border-color: transparent;
  background: linear-gradient(135deg, rgba(99, 255, 171, 0.9) 0%, rgba(42, 191, 115, 0.92) 100%);
}

.settings-option:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.settings-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.86rem;
  cursor: pointer;
}

.settings-switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.settings-note {
  color: var(--warning);
  font-size: 0.8rem;
  line-height: 1.45;
}

.settings-note[hidden] {
  display: none;
}

.settings-toggle:focus-visible,
.settings-option:focus-visible,
.settings-switch input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
