/* Theme Toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.theme-toggle:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon { display: none; }

html:not(.light) .theme-toggle .icon-sun { display: block; }
html.light .theme-toggle .icon-moon { display: block; }

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

::selection {
  background: var(--accent-dim);
  color: var(--text-primary);
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 400; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); font-weight: 500; letter-spacing: -0.01em; }
h3 { font-size: clamp(1.3rem, 2vw, 1.7rem); font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-family: var(--font-body); color: var(--accent); }

p { max-width: 65ch; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
a:hover { border-bottom-color: var(--accent); }

.mono { font-family: var(--font-mono); font-size: 0.88em; }
.dim { color: var(--text-secondary); }
.accent { color: var(--accent); }

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
}

.container--narrow {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
}

section {
  padding: clamp(3rem, 7vh, 5.5rem) 0;
  position: relative;
  overflow: hidden;
}

.section-divider {
  width: 60px;
  height: 1px;
  background: var(--accent-dim);
  margin: 0 auto 2rem;
}
