/* Design tokens. Light is the default; dark is applied by media query unless the
   visitor forced light, and always when the visitor forced dark. */
:root {
  --bg: #ffffff;
  --bg-elevated: #f6f7f9;
  --fg: #1a1d21;
  --fg-muted: #5b6370;
  --border: #d9dde3;
  --accent: #0b5cad;
  --accent-contrast: #ffffff;
  --focus: #e08a00;
  --max-width: 60rem;
  --gutter: 1rem;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121417;
    --bg-elevated: #1b1f24;
    --fg: #e8eaed;
    --fg-muted: #a3abb6;
    --border: #2d333b;
    --accent: #6cb2ff;
    --accent-contrast: #0b1220;
    --focus: #ffb347;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #121417;
  --bg-elevated: #1b1f24;
  --fg: #e8eaed;
  --fg-muted: #a3abb6;
  --border: #2d333b;
  --accent: #6cb2ff;
  --accent-contrast: #0b1220;
  --focus: #ffb347;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
}

a { color: var(--accent); }

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

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 4vw, 1.75rem); margin-top: 2.5rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-muted); margin-top: 1rem; }

main, .topbar, .footer {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Top bar with language and theme switches */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.brand { font-weight: 600; text-decoration: none; color: var(--fg); }

.switches { display: flex; gap: 0.75rem; align-items: center; }

.switches a,
.switches button {
  font: inherit;
  font-size: 0.9rem;
  color: var(--fg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  text-decoration: none;
  cursor: pointer;
}

.switches button[aria-pressed="true"] { border-color: var(--accent); }

/* Hero */
.hero { padding-block: 2rem 1rem; }
.role { font-size: 1.15rem; color: var(--fg-muted); margin: 0 0 1rem; }
.intro p { margin: 0 0 0.75em; max-width: 65ch; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg-elevated);
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

/* Technologies */
.areas {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.area {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--bg-elevated);
}

.tech { list-style: none; margin: 0; padding: 0; }
.tech li { display: flex; flex-direction: column; padding-block: 0.35rem; border-top: 1px solid var(--border); }
.tech li:first-child { border-top: 0; }
.tech span { font-size: 0.9rem; color: var(--fg-muted); }

/* Career timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.25rem;
  border-left: 2px solid var(--border);
}

.position { position: relative; padding-bottom: 1.5rem; }

.position::before {
  content: "";
  position: absolute;
  left: calc(-1.25rem - 6px);
  top: 0.45rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.position time { font-size: 0.9rem; color: var(--fg-muted); }
.position .employer { font-weight: 400; color: var(--fg-muted); }
.position p { margin: 0.25rem 0 0; max-width: 65ch; }

/* Footer */
.footer { padding-block: 2rem; color: var(--fg-muted); border-top: 1px solid var(--border); margin-top: 3rem; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
