/* dstruis.eu — public CV
   Design goals: calm, modern, low cognitive load, WCAG 2.2 AAA contrast.
   Two themes (light/dark) both verified ≥7:1 for body text, ≥4.5:1 large. */

:root {
  --max: 880px;
  --radius: 14px;
  --gap: clamp(1rem, 2.5vw, 1.75rem);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter,
    Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, Consolas,
    monospace;
}

/* ---- Light theme (default) ------------------------------------------- */
:root,
[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f3f5f8; /* cards */
  --border: #d3dae2;
  --text: #14181d; /* 16:1 on --bg */
  --muted: #44505c; /* 8.1:1 on --bg  → AAA normal */
  --accent: #0a4f94; /* 8.0:1 on --bg  → AAA normal */
  --accent-soft: #e7eef7;
  --shadow: 0 1px 2px rgba(20, 24, 29, 0.06), 0 8px 24px rgba(20, 24, 29, 0.05);
}

/* ---- Dark theme ------------------------------------------------------ */
[data-theme="dark"] {
  --bg: #0e1116;
  --bg-soft: #161b22;
  --border: #2a323c;
  --text: #e9edf2; /* 15:1 on --bg */
  --muted: #b6c0cc; /* 9.2:1 on --bg  → AAA normal */
  --accent: #7cc4ff; /* 9.5:1 on --bg  → AAA normal */
  --accent-soft: #16263a;
  --shadow: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116;
    --bg-soft: #161b22;
    --border: #2a323c;
    --text: #e9edf2;
    --muted: #b6c0cc;
    --accent: #7cc4ff;
    --accent-soft: #16263a;
    --shadow: none;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration: underline;
}
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 3rem) clamp(1rem, 4vw, 1.5rem) 4rem;
}

/* ---- Top bar / theme toggle ----------------------------------------- */
.topbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
a.toggle {
  text-decoration: none;
}
a.toggle:hover {
  text-decoration: none;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
}
.toggle:hover {
  border-color: var(--accent);
}

/* ---- Header --------------------------------------------------------- */
header.hero h1 {
  font-size: clamp(2rem, 6vw, 2.9rem);
  line-height: 1.1;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}
header.hero .role {
  font-size: clamp(1.05rem, 3vw, 1.35rem);
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 0.5rem;
}
header.hero .headline {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text);
  max-width: 65ch;
  margin: 0 0 1.25rem;
}
header.hero .headline strong {
  color: var(--accent);
  font-weight: 600;
}
.quickfacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}
.quickfacts span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
}
.contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.97rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.contacts li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
}

/* ---- Sections ------------------------------------------------------- */
section {
  margin-top: clamp(2rem, 5vw, 3rem);
}
section > h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 1.1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ---- Experience timeline -------------------------------------------- */
.entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 1rem;
  padding: 0 0 1.5rem;
}
.entry:not(:last-child) {
  border-bottom: 1px dashed var(--border);
  margin-bottom: 1.5rem;
}
.entry h3 {
  margin: 0;
  font-size: 1.12rem;
}
.entry .org {
  color: var(--muted);
  font-weight: 500;
}
.entry .period {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.85rem;
  white-space: nowrap;
  text-align: right;
}
.entry .current {
  display: inline-block;
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  margin-left: 0.4rem;
  vertical-align: 1px;
}
.entry p {
  grid-column: 1 / -1;
  margin: 0.5rem 0 0;
  color: var(--muted);
  max-width: 70ch;
}
.entry ul {
  grid-column: 1 / -1;
  margin: 0.5rem 0 0;
  padding-left: 1.3rem;
  color: var(--muted);
  max-width: 70ch;
}
.entry ul li {
  margin-bottom: 0.35rem;
  line-height: 1.5;
}

/* ---- Skills --------------------------------------------------------- */
.skillgroup {
  margin-bottom: 1.25rem;
}
.skillgroup h3 {
  font-size: 0.98rem;
  margin: 0 0 0.6rem;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0;
  margin: 0;
  list-style: none;
}
.chips li {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.7rem;
  font-size: 0.9rem;
}
.chips li.current {
  background: var(--accent-soft);
  border-color: var(--accent);
  font-weight: 600;
  color: var(--accent);
}
.chips li.legacy {
  opacity: 0.6;
  font-size: 0.85rem;
}

/* ---- Courses grid --------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--gap);
}
.card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}
.card h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}
.card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.card li {
  margin-bottom: 0.25rem;
}

/* ---- Footer --------------------------------------------------------- */
.download-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.download-pdf:hover {
  transform: translateY(-1px);
  text-decoration: none;
}
footer {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

@media (max-width: 540px) {
  .entry {
    grid-template-columns: 1fr;
  }
  .entry .period {
    grid-column: 1;
    grid-row: auto;
    text-align: left;
    margin-top: 0.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
