:root {
  color-scheme: light;
  --bg: #fcfcfc;
  --text: #1b1b1b;
  --muted: #737373;
  --accent: #f7df9c;
  --on-accent: #1b1b1b;
  --border: #1b1b1b;
  --max: 640px;
  --font-body: "IBM Plex Serif", ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b1b1b;
  --text: #e6e6e6;
  --muted: #8f8f8f;
  --border: #e6e6e6;
}

@supports (color: oklch(0.99 0 0)) {
  :root {
    --bg: oklch(0.99 0 0);
    --text: oklch(0.15 0 0);
    --muted: oklch(0.5 0 0);
    --accent: oklch(0.9393 0.0482 88.81);
    --on-accent: oklch(0.15 0 0);
    --border: oklch(0.15 0 0);
  }

  :root[data-theme="dark"] {
  --bg: oklch(0.15 0 0);
  --text: oklch(0.93 0 0);
  --muted: oklch(0.62 0 0);
  --border: oklch(0.93 0 0);
  }
}

* { box-sizing: border-box; }

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

#sidenav {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  z-index: 5;
}
#sidenav a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text);
  flex-direction: row-reverse;
  padding: 0.35rem 0;
}
#sidenav a:hover { background: transparent; color: var(--text); }
#sidenav a:hover .sn-line { width: 26px; }
.sn-line {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  opacity: 0.3;
  transition: width 0.14s ease, opacity 0.14s ease;
}
#sidenav a.active .sn-line {
  width: 26px;
  opacity: 1;
}
.sn-label {
  font: 13px/1 var(--font-mono);
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  white-space: nowrap;
  pointer-events: none;
}
#sidenav:hover .sn-label,
#sidenav:focus-within .sn-label {
  opacity: 1;
  transform: translateX(0);
}
#sidenav:hover .sn-line,
#sidenav:focus-within .sn-line { opacity: 1; }

body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font-body);
  margin: 0;
  padding: 2rem 1.25rem 4rem;
}

main {
  max-width: var(--max);
  margin: 0 auto;
}

h1, h2 {
  font-weight: 700;
  line-height: 1.2;
}
h1 { font-size: 1.8rem; margin: 0 0 0.25rem; }
h2 {
  font-size: 1.3rem;
  margin: 2.5rem 0 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
}

p { margin: 0 0 1rem; }

.sep-dotted {
  border: none;
  height: 1rem;
  max-height: 1rem;
  margin: 0 0 0.5rem;
  background: radial-gradient(var(--muted) .5px, transparent 1px) 0 0 / 3px 3px, var(--bg);
}

section[id] { scroll-margin-top: 2rem; }

a {
  color: var(--text);
  text-underline-offset: 2px;
}
a:hover { background: var(--accent); color: var(--on-accent); }

code, pre, .mono, .badge, .ti-badge {
  font: 14px/1.4 var(--font-mono);
}

pre { margin: 0; }

.muted { color: var(--muted); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#hero {
  border: 1px solid var(--border);
  padding: 1rem;
  margin-bottom: 0;
  overflow: hidden;
}
#fractal-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font: 13px/1 var(--font-mono);
}
.fractal-label { font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.fractal-hint { font-style: italic; }
#fractal {
  font-size: clamp(7px, 1.7vw, 13px);
  width: 72ch;
  max-width: 100%;
  margin: 0 auto;
  white-space: pre;
  overflow: hidden;
  text-align: center;
  letter-spacing: 0;
}
#fractal-caption {
  text-align: center;
  margin: 0.75rem 0 0;
  color: var(--muted);
}
#fractal-blurb {
  margin: 0.5rem 0 2rem;
  font-size: 13.5px;
  line-height: 1.5;
}
header {
  margin-bottom: 0.5rem;
}
.name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.name-row h1 { margin: 0; }
.tagline { color: var(--muted); margin: 0.25rem 0 0; }

#theme-toggle {
  flex: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 0.4rem 0.7rem;
  font: 18px/1 var(--font-mono);
  cursor: pointer;
}
#theme-toggle:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.highlights { margin: 0; padding-left: 1rem; list-style-type: "▪  "; }
.highlights li { margin-bottom: 0.25rem; }
.highlights li::marker { color: var(--border); }

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0;
  border-left: 1px solid var(--border);
}
.timeline > li {
  padding: 0 0 1.5rem 1rem;
  position: relative;
}
.timeline > li::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 0.62rem;
  width: 7px;
  height: 7px;
  background: var(--border);
}
.ti-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.ti-co { font-weight: 700; }
.ti-badge {
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  font-size: 12px;
}
.ti-role { color: var(--muted); margin: 0.15rem 0 0.5rem; }
.timeline ul { margin: 0; padding-left: 1rem; list-style-type: "▪  "; }
.timeline li li { margin-bottom: 0.25rem; }
.timeline li li::marker { color: var(--border); }

.edu { margin: 0; padding-left: 1rem; list-style-type: "▪  "; }
.edu li { margin-bottom: 0.25rem; }
.edu li::marker { color: var(--border); }
.edu li:last-child { margin-bottom: 0; }
.badge {
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  font-size: 12px;
  margin-left: 0.25rem;
}

.skill-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.skill-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 0.55rem 0.9rem;
  font: 15px/1 var(--font-mono);
  cursor: pointer;
}
.skill-btn:hover,
.skill-btn[aria-expanded="true"] {
  background: var(--accent);
  color: var(--on-accent);
}
.skill-btn.lang {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

#popover {
  position: fixed;
  border: 2px solid var(--border);
  background: var(--bg);
  padding: 0.6rem 0.75rem;
  max-width: 280px;
  z-index: 10;
  font-size: 15px;
  line-height: 1.45;
}
#popover[hidden] { display: none; }
#popover-name { font-weight: 700; margin-bottom: 0.25rem; }
#popover-desc { color: var(--text); }

footer {
  margin-top: 2rem;
}
footer p { margin-bottom: 0.5rem; }

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

@media (max-width: 480px) {
  body { padding: 1.25rem 0.75rem 3rem; font-size: 16px; }
  #fractal { font-size: 7px; }
  h1 { font-size: 1.5rem; }
}

@media (max-width: 980px) {
  #sidenav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .skill-btn:hover, .skill-btn[aria-expanded="true"], #theme-toggle:hover {
    transform: none;
    box-shadow: none;
  }
}
