/* Lynx-style terminal theme for ivda.dev. Pure CSS, no build step. */

:root {
  --bg: #000;
  --fg: #c0c0c0;        /* lightgray: normal text */
  --bright: #fff;       /* bold / headings */
  --link: #5c5cff;      /* blue: links */
  --num: #55ff55;       /* link numbers */
  --sel-fg: #ffff55;    /* yellow on blue: current link */
  --sel-bg: #0000aa;
  --lh: 1.4em;
  color-scheme: dark;
}

/* Fira Code (SIL Open Font License 1.1, see /fonts/FiraCode-OFL.txt) */
@font-face {
  font-family: "Fira Code";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/fira-code-400.woff2") format("woff2");
}
@font-face {
  font-family: "Fira Code";
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/fira-code-700.woff2") format("woff2");
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Fira Code", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 16px;
  line-height: var(--lh);
}

body {
  min-height: 100vh;
  padding: calc(4 * var(--lh)) 1ch var(--lh);
}

/* Title line, right aligned like Lynx's top row */
.titlebar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--lh);
  padding: 0 1ch;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--bg);
  z-index: 2;
}

main {
  max-width: 80ch;
  margin: 0 auto;
  padding: var(--lh) 1ch 0;
}
main p:not(.meta) { text-align: justify; }

h1, h2, h3 {
  font-size: 1em;
  font-weight: bold;
  color: var(--bright);
  margin: 0 0 var(--lh);
}
h1 { margin: 0 0 var(--lh); }
h1:has(+ .tagline) { margin: 0; }
.titlebar a { color: inherit; font-weight: normal; }
h3 { color: var(--fg); }
strong { color: var(--bright); }

/* Masthead: name, tagline, one-line section menu */
.masthead { margin-bottom: var(--lh); }
.tagline { margin: 0 0 var(--lh); }
ul.menu {
  list-style: none;
  margin: 0;
  padding: 0 0 calc(var(--lh) / 2);
  display: flex;
  flex-wrap: wrap;
  column-gap: 2ch;
  border-bottom: 1px dashed #555;
}
a.current { color: var(--bright); text-decoration: underline; text-underline-offset: 3px; }
a.current:focus { color: var(--sel-fg); }
a.home { color: inherit; }

p, pre { margin: 0 0 var(--lh); }
pre { font: inherit; white-space: pre-wrap; }

ul.links, ul.plain {
  list-style: none;
  margin: 0 0 var(--lh);
  padding: 0 0 0 2ch;
}
ul.links li::before, ul.plain li::before { content: "* "; }

/* Links */
a {
  color: var(--link);
  font-weight: bold;
  text-decoration: none;
  outline: none;
}
a:hover { text-decoration: underline; }
a .num { color: var(--num); font-weight: normal; }

/* Current (focused) link: Lynx's highlighted selection */
a:focus {
  color: var(--sel-fg);
  background: var(--sel-bg);
  text-decoration: none;
}
a:focus .num { color: var(--sel-fg); }

/* The selected link's URL shows on the status line */
a .url { display: none; }
a:focus .url {
  display: block;
  position: fixed;
  left: 0;
  right: 0;
  top: var(--lh);
  height: var(--lh);
  padding: 0 1ch;
  background: var(--bg);
  color: var(--fg);
  font-weight: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 3;
}

/* Status line + two help lines, under the title line */
.statusbar {
  position: fixed;
  inset: var(--lh) 0 auto 0;
  border-bottom: 1px solid #333;
  background: var(--bg);
  z-index: 2;
}
.statusbar > div {
  height: var(--lh);
  padding: 0 1ch;
  white-space: pre;
  overflow: hidden;
}
.statusbar a {
  color: inherit;
  font-weight: normal;
}

/* Blinking block cursor after the status message */
.status::after {
  content: "";
  display: inline-block;
  width: 1ch;
  height: 1em;
  margin-left: 1ch;
  vertical-align: text-bottom;
  background: var(--fg);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

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

@media (max-width: 480px) {
  html, body { font-size: 14px; }
}

/* Links handled by scripts/lynx.js (href moved to data-href) */
a[role="link"] { cursor: pointer; }

/* Touch screens: no keyboard, so drop the status and key-hint lines */
@media (hover: none) and (pointer: coarse) {
  .statusbar, a:focus .url { display: none; }
  body { padding-top: var(--lh); }
}

/* Skills: label column + list, like a terminal table */
dl.skills {
  display: grid;
  grid-template-columns: 14ch 1fr;
  row-gap: calc(var(--lh) / 3);
  margin: 0 0 var(--lh);
  padding-left: 2ch;
}
dl.skills dt { color: var(--num); }
dl.skills dd { margin: 0; }
h3 { margin-bottom: 0; }

/* Experience: dates/location line under each role */
.meta { margin: 0 0 calc(var(--lh) / 2); color: #888; }
ul.plain li { position: relative; padding-left: 2ch; text-align: justify; }
ul.plain li::before { position: absolute; left: 0; }
h3 + p, h3 + dl, h3 + ul.links, h3 + ul.plain { margin-top: calc(var(--lh) / 2); }
p:has(+ ul.links) { margin-bottom: calc(var(--lh) / 2); }

/* Top-right logo: i.v(&:da) — bold green letters, dim syntax */
.titlebar a.logo { color: #666; }
.titlebar a.logo b { color: var(--num); font-weight: 700; }
.titlebar a.logo:hover { text-decoration: none; }

/* Key hints: keys in green so they stand out */
.statusbar kbd { font: inherit; color: var(--num); font-weight: 700; }
