/* Lilex, SIL Open Font License 1.1 (fonts/OFL.txt) */
@font-face {
  font-family: "Lilex";
  src: url("/fonts/lilex-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Lilex";
  src: url("/fonts/lilex-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --text: #1f2328;
  --body: #31373d;
  --muted: #59636e;
  --faint: #d1d9e0;
  --accent: #2a453d;
  --grid: rgba(31, 35, 40, 0.055);
  --beam: 0.08;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --text: #e6edf3;
    --body: #c9d1d9;
    --muted: #8b949e;
    --faint: #30363d;
    --accent: #80b2a3;
    --grid: rgba(230, 237, 243, 0.045);
    --beam: 0.11;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 400 15px/1.55 "Lilex", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Oscilloscope backdrop: a 10 x 8 division graticule with a sine trace. */
.scope {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px);
  background-size: 10vw 12.5vh;
}
/* Minor ticks along the centre axes: five per division. */
.scope::before, .scope::after { content: ""; position: absolute; }
.scope::before {
  left: 0; right: 0; top: calc(50% - 4px); height: 9px;
  background: repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 2vw);
}
.scope::after {
  top: 0; bottom: 0; left: calc(50% - 4px); width: 9px;
  background: repeating-linear-gradient(var(--grid) 0 1px, transparent 1px 2.5vh);
}
.scope-track {
  position: absolute;
  left: 0;
  top: 30vh;
  width: 100%;
  height: 40vh;
  opacity: var(--beam);
}
.scope-track svg { display: block; width: 100%; height: 100%; overflow: visible; }
.glow, .beam { fill: none; stroke: var(--accent); vector-effect: non-scaling-stroke; stroke-linecap: round; }
.glow { stroke-width: 5; opacity: 0.22; }
.beam { stroke-width: 1.5; }

main, footer {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 20px;
}

main { padding-top: 40px; }

::selection { background: var(--accent); color: var(--bg); }

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

h1, h2, h3 { color: var(--text); font-weight: 700; margin: 0; }

/* Intro */
h1 {
  font-size: 46px;
  line-height: 1.1;
  letter-spacing: -1px;
}

.subtitle {
  margin: 10px 0 0;
  font-size: 16px;
  color: var(--muted);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--faint);
  font-size: 14px;
}

.links { display: flex; flex-wrap: wrap; gap: 6px 26px; }
.links a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.icon { flex: none; color: var(--text); }

.status { margin: 0; color: var(--text); }
.status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 9px;
  vertical-align: 1px;
  background: var(--accent);
  animation: blink 2.4s ease-in-out infinite;
}

@keyframes blink { 50% { opacity: 0.25; } }

@media (prefers-reduced-motion: reduce) {
  .status::before { animation: none; }
}

/* Sections */
section { margin-top: 26px; }

h2 {
  font-size: 21px;
  padding-bottom: 5px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--faint);
}

p { margin: 0; }

.entry + .entry { margin-top: 18px; }

.head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px 16px;
}

h3 { font-size: 17px; line-height: 1.4; }
h3 .dim { font-size: 14px; }
.name { text-decoration: none; }
.name:hover { text-decoration: underline; }

.when { font-size: 13px; color: var(--muted); white-space: nowrap; }
.sub, .tags { margin-top: 4px; font-size: 14px; color: var(--muted); }
.dim { color: var(--muted); font-weight: 400; }
.sub .dim { white-space: nowrap; }

ul { list-style: none; margin: 8px 0 0; padding: 0; }
li { position: relative; padding-left: 22px; }
li + li { margin-top: 4px; }
li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  background: var(--accent);
}

/* Skills */
.skills {
  display: grid;
  grid-template-columns: 210px 1fr;
  margin: 0;
}
.skills dt, .skills dd {
  margin: 0;
  padding: 7px 0;
  border-bottom: 1px solid var(--faint);
}
.skills dt { color: var(--accent); font-size: 14px; font-weight: 700; padding-right: 16px; }

/* GitHub stats, written in at deploy time by scripts/github_stats.py */
.stats {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  align-items: end;
  gap: 16px 56px;
  margin: 0;
}
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.3; color: var(--text); }


.langs-title { margin-top: 20px; font-size: 14px; }
.langs { margin-top: 8px; font-size: 13px; }
.lang {
  display: grid;
  grid-template-columns: 110px 1fr 56px;
  align-items: center;
  gap: 12px;
}
.lang + .lang { margin-top: 2px; }
.lang svg { display: block; width: 100%; height: 6px; }
.lang rect { fill: var(--accent); }
.lang .dim { text-align: right; }
.updated { margin-top: 12px; font-size: 12px; color: var(--muted); }

footer {
  margin-top: 32px;
  padding-bottom: 28px;
  font-size: 13px;
  color: var(--muted);
}
footer p { padding-top: 16px; border-top: 1px solid var(--faint); }

@media (max-width: 640px) {
  main { padding-top: 28px; }
  h1 { font-size: 34px; }
  .meta { flex-direction: column; }
  section { margin-top: 22px; }
  .skills { grid-template-columns: 1fr; }
  .skills dt { padding-bottom: 0; border-bottom: 0; }
  .skills dd { padding-top: 2px; }
  .stats dd { font-size: 21px; }
  .lang { grid-template-columns: 90px 1fr 50px; }
}

/* Printing the page gives a clean one-column resume. */
@media print {
  @page { margin: 14mm 16mm; }
  :root {
    --bg: #ffffff; --text: #000000; --body: #1f2328; --muted: #4b5259;
    --faint: #c8ced4; --accent: #2a453d;
  }
  body { font-size: 10pt; line-height: 1.5; }
  main { padding-top: 0; max-width: none; }
  h1 { font-size: 26pt; }
  section { margin-top: 18pt; }
  h2 { font-size: 13pt; margin-bottom: 8pt; padding-bottom: 4pt; break-after: avoid; }
  .entry { break-inside: avoid; }
  .entry + .entry { margin-top: 10pt; }
  a { text-decoration: none; }
  footer, .scope, .github { display: none; }
  .status::before { animation: none; }
}
