:root {
  --bg: #f0eee6;
  --text: #1f1e1d;
  --link: #1f1e1d;
  --muted: rgba(31, 30, 29, 0.65);
}

/* Dark mode when :root[data-theme="dark"] is set */
:root[data-theme="dark"] {
  --bg: #1f1e1d;
  --text: #f0eee6;
  --link: #f0eee6;
  --muted: rgba(240, 238, 230, 0.7);
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font: 16px/1.55 Arial, Helvetica, sans-serif;
}

/* ===== Layout ===== */

.wrap {
  max-width: 680px;
  margin: 60px auto;
  padding: 0 24px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
}

section {
  margin-bottom: 40px;
}

h1 {
  font-size: 22px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
}

h2 {
  font-size: 18px;
  margin: 32px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
}

p {
  margin: 0 0 16px;
}

a {
  color: var(--link);
  text-underline-offset: 2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===== Toggle Switch ===== */

.theme-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.switch {
  width: 44px;
  height: 24px;
  background: transparent;
  border: 1.5px solid var(--text);
  border-radius: 999px;
  display: inline-block;
  position: relative;
  transition: border-color 0.25s ease;
  box-sizing: border-box;
}

.knob {
  width: 18px;
  height: 18px;
  background: var(--text);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.25s ease;
}

/* Dark state: slide knob right */
:root[data-theme="dark"] .knob {
  transform: translateX(22px);
}

.theme-toggle:focus-visible .switch {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
