/* wiets.dev — design tokens & base styles */

:root {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --text: #1b1b23;
  --text-muted: #5b5b68;
  --border: #e4e4ec;
  --accent: #5046e5;
  --accent-soft: #eceafd;
  --accent-contrast: #ffffff;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Consolas, Menlo, monospace;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;

  --radius: 10px;
  --max-width: 40rem;
  --transition: 160ms ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14141a;
    --surface: #1c1c24;
    --text: #eceef2;
    --text-muted: #9a9aa8;
    --border: #2a2a35;
    --accent: #8c82ff;
    --accent-soft: #262244;
    --accent-contrast: #14141a;
  }
}

:root[data-theme="light"] {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --text: #1b1b23;
  --text-muted: #5b5b68;
  --border: #e4e4ec;
  --accent: #5046e5;
  --accent-soft: #eceafd;
  --accent-contrast: #ffffff;
}

:root[data-theme="dark"] {
  --bg: #14141a;
  --surface: #1c1c24;
  --text: #eceef2;
  --text-muted: #9a9aa8;
  --border: #2a2a35;
  --accent: #8c82ff;
  --accent-soft: #262244;
  --accent-contrast: #14141a;
}

:root[data-theme="colour"] {
  --bg: linear-gradient(160deg, #ffe3ec 0%, #ffd9c2 45%, #d9c8ff 100%);
  --surface: rgba(255, 255, 255, 0.72);
  --text: #2b1d3d;
  --text-muted: #6b5a7d;
  --border: rgba(43, 29, 61, 0.14);
  --accent: #c23b6b;
  --accent-soft: rgba(194, 59, 107, 0.12);
  --accent-contrast: #ffffff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -3rem;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: top var(--transition);
  z-index: 100;
}

.skip-link:focus {
  top: var(--space-2);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

h1, h2, h3 {
  line-height: 1.2;
  font-weight: 650;
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-4) var(--space-2) var(--space-5);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page > main {
  flex: 1;
}

/* --- top bar: monogram + theme toggle --- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.mark {
  width: 34px;
  height: 34px;
  color: var(--accent);
  overflow: visible;
}

.mark path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-reduced-motion: no-preference) {
  .mark path {
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
    animation: draw-mark 900ms 150ms ease forwards;
  }
}

@keyframes draw-mark {
  to {
    stroke-dashoffset: 0;
  }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

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

/* --- links list --- */

.links {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.links a {
  font-weight: 600;
}

.links .hint {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.9em;
}

/* --- footer + webring, deliberately quiet --- */

.site-footer {
  margin-top: var(--space-5);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.webring {
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

.webring a {
  color: var(--text-muted);
  font-weight: 500;
}

.webring a:hover {
  color: var(--accent);
}

.webring .sep {
  margin: 0 0.4em;
  opacity: 0.6;
}

#sig {
  margin: 0;
  font-family: var(--font-mono);
}
