:root {
  --bg: #fbfaf7;
  --fg: #1f1f1f;
  --muted: #6b6b6b;
  --rule: #e5e2dc;
  --link: #2d3a8c;
  --link-hover: #4f5fc4;
  --serif: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  --maxw: 640px;
}

html[data-theme="dark"] {
  --bg: #14141a;
  --fg: #e8e6e1;
  --muted: #8a8a8a;
  --rule: #25252a;
  --link: #a9b4f5;
  --link-hover: #c4cdff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(48px, 9vw, 96px) clamp(20px, 5vw, 32px) 96px;
}

header {
  margin-bottom: 56px;
}

h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 5.5vw, 2.625rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 28px;
  font-variation-settings: "opsz" 60;
}

p {
  margin: 0 0 16px;
  max-width: 60ch;
  font-variation-settings: "opsz" 14;
}

section {
  margin: 44px 0;
}

h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.375rem;
  letter-spacing: -0.005em;
  margin: 0 0 16px;
  font-variation-settings: "opsz" 24;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--link-hover); }

ul {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
}
ul li {
  padding: 4px 0;
}

/* Theme toggle - iOS-style switch, like dario */
.theme {
  position: fixed;
  top: 22px; right: 22px;
  background: transparent;
  border: 0;
  padding: 6px;
  cursor: pointer;
  z-index: 10;
}
.theme-track {
  display: inline-block;
  width: 36px; height: 20px;
  border-radius: 999px;
  background: var(--rule);
  position: relative;
  transition: background .2s ease;
}
.theme-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
  transition: transform .2s ease, background .2s ease;
}
html[data-theme="dark"] .theme-track { background: #4a4a52; }
html[data-theme="dark"] .theme-thumb { transform: translateX(16px); background: #f4f1eb; }
.theme:hover .theme-track { background: #d6d3cd; }
html[data-theme="dark"] .theme:hover .theme-track { background: #5a5a62; }

.mail-reveal {
  font: inherit;
  color: var(--link);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.mail-reveal:hover { color: var(--link-hover); }

::selection { background: var(--link); color: var(--bg); }

@media (max-width: 480px) {
  html, body { font-size: 17px; }
  section { margin: 36px 0; }
}
