/* CV page: the terminal's palette and type, set as a document. Prints as a clean A4 page. */

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono.woff2") format("woff2");
}
@font-face {
  font-family: "Martian Mono";
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
  src: url("fonts/martian-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Martian Mono";
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
  src: url("fonts/martian-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --void: #07060d;
  --text: #e7e4f0;
  --muted: #8e89a6;
  --faint: #5f5a78;
  --rule: #241f36;
  --accent: #a98bff;
  --mark: #ee4130;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --display: "Martian Mono", var(--mono);
  --date: 15ch;
}

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

html { background: var(--void); }
body {
  max-width: 86ch;
  margin: 0 auto;
  padding: 28px clamp(18px, 5vw, 48px) 56px;
  color: var(--text);
  background: var(--void);
  font: 400 14.5px / 1.7 var(--mono);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 0.25em; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 1px dashed var(--accent); outline-offset: 3px; }
code { color: var(--accent); font: inherit; }

/* ---------------- top bar ---------------- */

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
}
.bar a { color: var(--muted); }
.bar button {
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: transparent;
  color: var(--text);
  font: 600 12.5px / 1 var(--mono);
  cursor: pointer;
}
.bar button:hover { border-color: var(--accent); }

/* ---------------- header ---------------- */

.head { padding: 44px 0 30px; border-bottom: 1px solid var(--rule); }
.head h1 {
  margin: 0;
  font: 700 clamp(30px, 6vw, 44px) / 1.1 var(--display);
  font-stretch: 112.5%;
  letter-spacing: -0.03em;
}
.head .title { margin: 12px 0 0; color: var(--accent); font: 500 16px / 1.4 var(--display); }
.head .meta { margin: 10px 0 0; color: var(--muted); }
.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

/* ---------------- sections ---------------- */

section { padding: 30px 0 4px; }
h2 {
  margin: 0 0 16px;
  color: var(--accent);
  font: 600 14px / 1.3 var(--display);
  letter-spacing: -0.01em;
}
h3 { margin: 0; font: 700 14.5px / 1.5 var(--mono); }
h3 .org { color: var(--muted); font-weight: 400; }
h3.sub { margin: 22px 0 10px; color: var(--muted); font-weight: 600; }
p { margin: 0 0 12px; max-width: 78ch; }

.entry {
  display: grid;
  grid-template-columns: var(--date) 1fr;
  gap: 4px 18px;
  padding: 10px 0;
  break-inside: avoid;
}
.entry .when { margin: 0; color: var(--faint); font-size: 13px; padding-top: 1px; }
.entry ul { margin: 6px 0 0; padding-left: 2ch; }
.entry li { margin: 2px 0; }

.pairs {
  display: grid;
  grid-template-columns: var(--date) 1fr;
  gap: 8px 18px;
  margin: 0;
}
.pairs dt { color: var(--faint); font-size: 13px; padding-top: 1px; }
.pairs dd { margin: 0; }
.plain { margin: 0; padding: 0; list-style: none; }

.projects { margin: 0; padding: 0; list-style: none; }
.projects li { padding: 8px 0; break-inside: avoid; }
.projects p { margin: 2px 0 0; color: var(--muted); }

.quote { margin: 0 0 30px; }
.quote blockquote { margin: 0; padding-left: 2ch; border-left: 1px solid var(--rule); }
.quote blockquote p { margin: 0 0 10px; }
.quote blockquote p:last-child { margin-bottom: 0; }
.quote figcaption { margin-top: 10px; padding-left: 2ch; color: var(--faint); font-size: 13px; break-before: avoid; }
.quote figcaption .who { color: var(--muted); font-weight: 600; }

.foot { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--rule); color: var(--faint); font-size: 13px; }

@media (max-width: 640px) {
  .entry, .pairs { grid-template-columns: 1fr; gap: 2px; }
  .pairs dd { margin-bottom: 8px; }
}

/* ---------------- intro: "profiling" over a broken broadcast ----------------
   cv.js adds html.intro-on before the first paint and removes it when done.
   If the script never finishes, the page shows itself after 9s anyway. */

html.intro-on body { visibility: hidden; animation: intro-failsafe 0s 9s forwards; }
@keyframes intro-failsafe { to { visibility: visible; } }

.intro {
  position: fixed;
  inset: 0;
  z-index: 10;
  visibility: visible;
  overflow: hidden;
  background: var(--void);
  color: var(--text);
  font: 400 13.5px / 1.6 var(--mono);
  transition: opacity 0.6s ease;
}
.intro.out { opacity: 0; }
.intro canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.11;
  image-rendering: pixelated;
}
.intro::after { /* scanlines and a vignette */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.32) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.6));
}
.intro.burst canvas { opacity: 0.3; }
.intro.burst .intro-chyron,
.intro.burst .intro-title {
  transform: translateX(-7px);
  text-shadow: 2px 0 rgba(238, 65, 48, 0.75), -2px 0 rgba(120, 200, 255, 0.6);
}

.intro-bug {
  position: absolute;
  top: 22px;
  left: 26px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font: 700 12px / 1 var(--mono);
}
.intro-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  background: #9b1919;
  color: #fff;
}
.intro-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: intro-pulse 1s steps(1) infinite;
}
@keyframes intro-pulse { 50% { opacity: 0.25; } }

.intro-console {
  position: absolute;
  top: 40%;
  left: 50%;
  width: min(600px, 86vw);
  transform: translate(-50%, -50%);
}
.intro-title {
  margin: 0 0 18px;
  font: 700 clamp(20px, 3.4vw, 30px) / 1.2 var(--display);
  font-stretch: 112.5%;
  letter-spacing: -0.02em;
}
.intro-caret {
  display: inline-block;
  width: 0.5em;
  height: 0.95em;
  margin-left: 6px;
  vertical-align: -0.1em;
  background: var(--accent);
  animation: intro-pulse 0.9s steps(1) infinite;
}
.intro-log { min-height: 8em; }
.intro-row { margin: 0; white-space: pre; }
.intro-k { color: var(--faint); }
.intro-v { color: var(--accent); }
.intro-bar { height: 2px; margin-top: 16px; background: var(--rule); }
.intro-bar i { display: block; width: 0; height: 100%; background: var(--accent); }

.intro-chyron {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10vh;
  display: flex;
  align-items: stretch;
  border-block: 1px solid var(--rule);
  background: rgba(7, 6, 13, 0.88);
}
.intro-tag {
  flex: none;
  padding: 11px 16px;
  color: #fff;
  font: 700 12.5px / 1.4 var(--mono);
}
.intro-tag.tone-red { background: #9b1919; }
.intro-tag.tone-amber { background: #8a5a12; }
.intro-tag.tone-accent { background: #4b3a99; }
.intro-strip {
  min-width: 0;
  padding: 10px 18px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 15px;
}
.intro-where { margin-right: 1.5ch; color: var(--muted); }
.intro-skip {
  position: absolute;
  right: 26px;
  bottom: 18px;
  margin: 0;
  color: var(--faint);
  font-size: 12px;
}

@media (max-width: 640px) {
  .intro-chyron { flex-direction: column; bottom: 12vh; }
  .intro-tag { padding: 6px 14px; }
  .intro-strip { white-space: normal; }
  .intro-row { white-space: pre-wrap; font-size: 12px; }
}

/* ---------------- print: white A4, nothing interactive ---------------- */

@page { size: A4; margin: 14mm 15mm; }
@media print {
  :root { --text: #111; --muted: #444; --faint: #666; --rule: #ccc; --accent: #3d2a99; }
  html, body { background: #fff; }
  body { max-width: none; padding: 0; font-size: 9pt; line-height: 1.42; }
  .bar, .foot, .intro { display: none !important; }
  html.intro-on body { visibility: visible; animation: none; }
  .head { padding: 0 0 10px; }
  .head h1 { font-size: 22pt; }
  .head .title { margin-top: 8px; font-size: 10.5pt; }
  .head .meta, .contact { margin-top: 6px; }
  section { padding: 10px 0 0; }
  h2 { margin-bottom: 6px; font-size: 10pt; break-after: avoid; }
  h3 { font-size: 9pt; }
  h3.sub { margin: 10px 0 6px; }
  p { margin-bottom: 7px; }
  .entry { padding: 3px 0; }
  .entry ul { margin-top: 2px; }
  .entry li { margin: 0; }
  .pairs { gap: 4px 18px; }
  .projects li { padding: 3px 0; }
  .quote { margin-bottom: 14px; }
  .quote blockquote p { margin-bottom: 5px; }
  .entry .when, .pairs dt, .quote figcaption { font-size: 8.5pt; }
  a { text-decoration: none; }
}
