/* /cv/ in a browser.

   cv/index.html is generated by Shellfolio (`go run . -cv ...`) and is
   written for a terminal first: it is the résumé with colour codes, and its
   HTML head hides inside an escape sequence the terminal swallows. In a
   browser that leaves raw escape codes on the page, so everything stays
   hidden until cv.js has turned them into styled text. */

@import url("/fonts.css");

:root {
  --bg: #0b0b0a;
  --ink: #edebe4;
  --dim: rgba(237, 235, 228, 0.58);
  --faint: rgba(237, 235, 228, 0.34);
  --line: rgba(237, 235, 228, 0.14);
  --accent: #ff5227;
  --gutter: clamp(16px, 4vw, 48px);
  --term: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
}

html {
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  /* The escape sequence's opener lands in the page as stray text. Zero font
     size hides it until cv.js removes it, and hides it for good without JS. */
  font-size: 0;
}

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

noscript a {
  display: block;
  padding: var(--gutter);
  font: 15px/1.6 "Space Mono", var(--term);
  color: var(--accent);
}

#cv {
  visibility: hidden;
  margin: 0;
}

.cv-ready #cv {
  visibility: visible;
}

/* ---- the bar ---- */

.cv-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem 1.6rem;
  padding: 1.1rem var(--gutter);
  border-bottom: 1px solid var(--line);
  font: 12px/1.5 "Space Mono", var(--term);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.cv-bar a {
  color: var(--ink);
  text-decoration: none;
}

.cv-bar a:hover,
.cv-bar a:focus-visible {
  color: var(--accent);
}

.cv-bar__right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1.6rem;
}

.cv-copy {
  font: inherit;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  background: none;
  border: 1px solid var(--line);
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s;
}

.cv-copy:hover,
.cv-copy:focus-visible {
  border-color: var(--accent);
}

.cv-copy b {
  font-weight: 400;
  color: var(--accent);
}

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

/* ---- the text ---- */

.cv-text {
  padding: clamp(0.5rem, 2vw, 1.5rem) var(--gutter) 3rem;
  overflow-x: auto;
}

#cv {
  font-family: var(--term);
  /* cv.js sets the real size so the 78 columns fit the window. */
  font-size: 14px;
  line-height: 1.45;
  font-variant-ligatures: none;
}

.l {
  white-space: pre;
  min-height: 1.45em;
}

/* The figlet name: rows touch, the way they do in a terminal. Browsers
   place monospace glyphs on fractional pixels, which leaves hairline seams
   between the blocks; a hair of negative tracking closes them, and every row
   shifts by the same amount so the letters stay aligned. */
.l.fig {
  line-height: 1.02;
  min-height: 1.02em;
  letter-spacing: -0.04em;
}

.b {
  font-weight: 700;
}

.c202 {
  color: var(--accent);
}

.c245 {
  color: var(--dim);
}

#cv a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

#cv a:hover,
#cv a:focus-visible {
  border-bottom-color: currentColor;
}

.prompt::after {
  content: "";
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 0.1em;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

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

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