/* Shared flat arcade theme for the home page and the content pages:
   solid colours, square corners, bevelled edges, hard shadows. */
@font-face { font-family: 'VT323'; src: url('../fonts/vt323-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DejaVu Sans'; src: url('../fonts/dejavu-sans-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DejaVu Sans'; src: url('../fonts/dejavu-sans-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'DejaVu Sans'; src: url('../fonts/dejavu-sans-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  /* The display font, VT323: header, buttons, links and headings (the game's own text uses
     js/game/fonts.js). It has one weight. Its capitals are small for its size, so display sizes are
     written at the size the layout wants and multiplied by --display-scale. */
  --display: 'VT323', 'Courier New', monospace;
  --display-scale: 1.3;
  /* Body text: DejaVu Sans, an open font close to Verdana. */
  --ui: 'DejaVu Sans', sans-serif;
  --side-w: 190px;   /* the column beside the game that holds "this is annoying" */
  --side-gap: 16px;
  --panel-h: 72px;   /* height of that panel when it sits under the game instead */
}

/* ---------------------------------------------------------------- colours
   The page colours ("soft neon"). The game's own colours are in js/game/themes.js. */
:root {
  --bg: #05071a;
  --panel: #0a0e2c;
  --line: #2b3350;
  --ink: #04060f;
  --accent: #33c4e8;
  --gold: #eac241;
  --shadow: #173d7c;
  --text: #dbe3f7;
  --dim: #8b96b8;
  --soft: #a9b4d4;
  --foot: #6f7a9c;
  --link: var(--accent);
  --link-hover: #ffffff;
  --focus: var(--gold);
  --wordmark: var(--accent);
  --wordmark-shadow: var(--shadow);
  --wordmark-hover: #77d6f0;
  --filename: var(--gold);
  --btn-bg: #33c4e8; --btn-fg: #04060f; --btn-hi: #a8e6f5; --btn-lo: #166074; --btn-hover: #77d6f0;
  --btn2-bg: #c9ced8; --btn2-fg: #04060f; --btn2-hi: #ffffff; --btn2-lo: #6b7280; --btn2-hover: #e3e7ee;
  --frame-line: var(--line);
  --ann-bg: var(--panel); --ann-fg: var(--soft); --ann-border: var(--line); --ann-hover: var(--accent);
  --dlg-bg: var(--panel); --dlg-border: #ffffff; --dlg-title-bg: var(--gold); --dlg-title-fg: var(--ink);
  --dlg-file: #ffffff; --dlg-file-shadow: var(--shadow); --dlg-desc: var(--soft); --dlg-hint: var(--soft); --dlg-icon: var(--gold);
  --card-bg: var(--panel); --card-border: var(--line); --card-text: var(--text); --card-h1: #ffffff;
  --card-h1-shadow: var(--shadow); --card-h2: var(--accent); --card-dim: var(--dim); --card-when: var(--gold);
  --card-strong: #ffffff; --card-link: var(--accent); --card-link-hover: #ffffff; --note: var(--gold);
  --hard-shadow: rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.6 var(--ui); }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------------------------------------------------------------- wordmark */
.wordmark {
  font: 400 calc(26px * var(--display-scale))/1 var(--display);
  letter-spacing: 1px;
  white-space: nowrap;
  color: var(--wordmark);
  text-shadow: 3px 3px 0 var(--wordmark-shadow);
  text-decoration: none;
  text-transform: uppercase;
}
.wordmark span { display: inline-block; white-space: nowrap; }
a.wordmark:hover { color: var(--wordmark-hover); }

/* ---------------------------------------------------------------- buttons: flat, square, bevelled */
.btn {
  appearance: none;
  display: inline-block;
  border: 2px solid;
  border-color: var(--btn-hi) var(--btn-lo) var(--btn-lo) var(--btn-hi);
  border-radius: 0;
  padding: 8px 14px;
  font: 400 calc(12px * var(--display-scale))/1 var(--display);
  letter-spacing: .6px;
  color: var(--btn-fg);
  background: var(--btn-bg);
  box-shadow: 0 0 0 1px var(--ink);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.btn:hover { background: var(--btn-hover); color: var(--btn-fg); }
.btn:active { border-color: var(--btn-lo) var(--btn-hi) var(--btn-hi) var(--btn-lo); }
.btn.grey { background: var(--btn2-bg); color: var(--btn2-fg); border-color: var(--btn2-hi) var(--btn2-lo) var(--btn2-lo) var(--btn2-hi); }
.btn.grey:hover { background: var(--btn2-hover); }
.btn.grey:active { border-color: var(--btn2-lo) var(--btn2-hi) var(--btn2-hi) var(--btn2-lo); }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------------------------------------------------------------- home page: one screen, never scrolls */
body.home {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  overscroll-behavior: none;
}
.topbar {
  flex: none;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
}
.top-buttons { display: flex; gap: 8px; }
#pause-btn { display: none; }
@media (pointer: coarse) { #pause-btn { display: inline-block; } }

#stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px 16px;
}
/* Game in the middle, "this is annoying" in a column on its right, an empty column on its left
   to keep the game centred. js/main.js sizes the game and picks .layout-side or .layout-bottom. */
.play {
  display: grid;
  grid-template-columns: var(--side-w) auto var(--side-w);
  column-gap: var(--side-gap);
  align-items: end;
}
#frame { position: relative; box-shadow: 0 0 0 2px var(--frame-line), 0 0 0 3px var(--ink); }
#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
/* Links over the found files in the game's scoreboard (the game draws the names; see main.js).
   The layer lets clicks through to the game; only the links themselves take them. */
.hud-links { position: absolute; inset: 0; pointer-events: none; }
.hud-link { position: absolute; pointer-events: auto; border-bottom: 2px solid transparent; }
.hud-link[hidden] { display: none; }
.hud-link:hover { border-bottom-color: var(--gold); }

.side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.annoying {
  appearance: none;
  border: 1px solid var(--ann-border);
  border-radius: 0;
  padding: 7px 12px;
  font: 400 calc(13px * var(--display-scale))/1.3 var(--display);
  letter-spacing: .5px;
  color: var(--ann-fg);
  background: var(--ann-bg);
  cursor: pointer;
  white-space: nowrap;
}
.annoying:hover { color: var(--ann-hover); }
.annoying[aria-expanded='true'] { color: var(--ann-hover); }
.links {
  visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  font: 400 calc(13px * var(--display-scale))/1.4 var(--display);
  letter-spacing: .5px;
  white-space: nowrap;
}
.links.shown { visibility: visible; }
.links a { text-decoration: none; }
.links a:hover { text-decoration: underline; }

/* Narrow screens: the panel goes under the game, links in a row. */
body.layout-bottom .play { grid-template-columns: auto; row-gap: var(--side-gap); justify-items: center; }
body.layout-bottom .play-spacer { display: none; }
body.layout-bottom .side { align-items: center; height: var(--panel-h); }
body.layout-bottom .links { flex-direction: row; gap: 18px; }

@media (max-width: 560px) {
  :root { --side-gap: 10px; }
  .topbar { height: 48px; padding: 0 10px; }
  .wordmark { font-size: calc(14px * var(--display-scale)); line-height: 1.15; white-space: normal; }
  #stage { padding: 0 8px 8px; }
  body.layout-bottom .links { gap: 12px; font-size: calc(12px * var(--display-scale)); letter-spacing: 0; }
}
@media (max-height: 520px) {
  .topbar { height: 40px; }
  .wordmark { font-size: calc(16px * var(--display-scale)); }
  .annoying { padding: 5px 10px; font-size: calc(12px * var(--display-scale)); }
}

/* Phones held sideways: header in a column on the left, game, then the panel on the right. */
@media (orientation: landscape) and (max-height: 500px) {
  :root { --side-w: 118px; --side-gap: 10px; }
  body.home { display: grid; grid-template-columns: 136px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .topbar { height: auto; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 12px; padding: 12px 8px; }
  .wordmark { font-size: calc(13px * var(--display-scale)); line-height: 1.25; white-space: normal; }
  .top-buttons { flex-direction: column; align-items: flex-start; }
  #stage { padding: 0 8px 0 0; }
  .play { grid-template-columns: auto var(--side-w); align-items: center; }
  .links { font-size: calc(11px * var(--display-scale)); gap: 8px; letter-spacing: 0; }
  .annoying { font-size: calc(11px * var(--display-scale)); padding: 5px 8px; white-space: normal; max-width: 100%; text-align: left; }
  .btn { font-size: calc(10px * var(--display-scale)); }
  .play-spacer { display: none; }
  .credit { left: 8px; bottom: 8px; max-width: 120px; font-size: 12px; }
}

/* Small two-line credit in the bottom-left corner of the home screen. */
.credit {
  position: fixed;
  left: 16px;
  bottom: 12px;
  margin: 0;
  max-width: calc(var(--side-w) - 8px);
  font: 13px/1.3 var(--ui);
  color: var(--dim);
}
.credit span { display: block; }
@media (max-width: 560px) { .credit { left: 10px; bottom: 8px; font-size: 12px; } }

.noscript { position: fixed; inset: auto 0 0 0; margin: 0; padding: 10px; text-align: center; background: #000; }

/* ---------------------------------------------------------------- "file recovered" dialog */
.dialog {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.dialog[hidden] { display: none; }
.dlg-panel {
  width: min(460px, 94%);
  background: var(--dlg-bg);
  border: 2px solid var(--dlg-border);
  box-shadow: 0 0 0 2px var(--ink), 8px 8px 0 0 var(--hard-shadow);
}
.dlg-titlebar {
  font: 400 calc(13px * var(--display-scale))/1 var(--display);
  letter-spacing: 2px;
  color: var(--dlg-title-fg);
  background: var(--dlg-title-bg);
  border-bottom: 2px solid var(--ink);
  padding: 7px 10px;
}
.dlg-body { display: flex; gap: 16px; align-items: center; padding: 20px 20px 6px; }
.dlg-icon {
  flex: none;
  width: 34px;
  height: 42px;
  clip-path: polygon(0 0, 70% 0, 100% 24%, 100% 100%, 0 100%);
  background:
    repeating-linear-gradient(180deg, transparent 0 6px, rgba(0, 0, 0, .45) 6px 8px) 6px 15px / 22px 22px no-repeat,
    var(--dlg-icon);
}
.dlg-file { font: 400 calc(22px * var(--display-scale))/1.1 var(--display); color: var(--dlg-file); text-shadow: 2px 2px 0 var(--dlg-file-shadow); word-break: break-all; }
.dlg-desc { color: var(--dlg-desc); margin-top: 4px; font-size: 15px; }
.dlg-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; padding: 16px 20px 8px; }
.dlg-buttons .btn { font-size: calc(13px * var(--display-scale)); padding: 10px 16px; }
.dlg-hint { text-align: center; font: 400 calc(10px * var(--display-scale))/1.4 var(--display); letter-spacing: 1px; color: var(--dlg-hint); padding: 4px 10px 14px; }
@media (max-width: 560px) {
  .dlg-body { padding: 14px 14px 4px; }
  .dlg-file { font-size: calc(16px * var(--display-scale)); }
  .dlg-hint { display: none; }
}

/* ---------------------------------------------------------------- content pages */
.page { max-width: 820px; margin: 0 auto; padding: 24px 16px 48px; font-size: 14px; } /* DejaVu reads large; 14px is plenty */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--line);
}
.page-head .wordmark { font-size: calc(22px * var(--display-scale)); }
.page-head .file-name { font: 400 calc(12px * var(--display-scale))/1 var(--display); color: var(--filename); letter-spacing: 1.5px; display: block; margin-top: 8px; }
.panel {
  border: 2px solid var(--card-border);
  background: var(--card-bg);
  color: var(--card-text);
  padding: 22px 26px;
  box-shadow: 6px 6px 0 0 var(--hard-shadow);
}
/* Links in panels are coloured; buttons that happen to be links keep their own (dark) text. */
.panel a:not(.btn) { color: var(--card-link); }
.panel a:not(.btn):hover { color: var(--card-link-hover); }
.page h1 { font: 400 calc(26px * var(--display-scale))/1.2 var(--display); margin: 0 0 6px; color: var(--card-h1); text-shadow: 3px 3px 0 var(--card-h1-shadow); }
.page h2 {
  font: 400 calc(15px * var(--display-scale))/1.3 var(--display);
  text-transform: uppercase; /* so section headings can be typed normally in content/*.md */
  letter-spacing: 1.5px;
  color: var(--card-h2);
  margin: 26px 0 10px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--card-dim);
}
.page h2:first-of-type { margin-top: 18px; }
.page .lede { color: var(--card-dim); margin: 0; }
.page ul { padding-left: 20px; }
.page li { margin: 4px 0; }
.entry { display: grid; grid-template-columns: 136px 1fr; gap: 4px 16px; margin: 10px 0; }
.entry .when { color: var(--card-when); font: 13px/22.4px var(--ui); } /* line = 14px × 1.6, so dates sit level with the text */
.entry .what strong { color: var(--card-strong); }
/* An entry's name, exactly as typed (capitals for organisations, as in the PDF), then each role
   with its description and bullets. */
.panel .org { margin: 0; font-weight: 700; letter-spacing: .5px; color: var(--card-strong); }
.panel .role { margin: 0; font-weight: 700; color: var(--card-strong); }
.entry .what p, .item p { margin: 0; }
.entry .what .role ~ .role { margin-top: 14px; }
.entry .what ul { margin: 4px 0 6px; }
.item { margin: 10px 0 14px; }
/* Citations, with a hanging indent like the PDF. Long words may break so nothing runs off a phone. */
.page .refs { list-style: none; padding: 0; margin: 10px 0 0; }
.nowrap { white-space: nowrap; } /* number ranges stay on one line */
.refs li { margin: 0 0 12px; padding-left: 2em; text-indent: -2em; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .panel { padding: 18px 16px; }
  .entry { grid-template-columns: 1fr; gap: 0; }
}
/* While a page's text file loads, keep the footer from jumping up and back down. */
.panel[data-content]:not([data-ready]) { min-height: 60vh; }
.page-foot { margin-top: 22px; text-align: center; font: 12px/1.6 var(--ui); letter-spacing: .5px; color: var(--foot); }
/* 404 page */
.page-404 { text-align: center; padding-top: 8vh; }
.page-404 .panel { margin-top: 24px; }
.page h1.big-404 { font-size: calc(clamp(110px, 24vw, 230px) * var(--display-scale)); font-weight: 400; line-height: 1; margin: 6px 0 14px; text-shadow: 8px 8px 0 var(--card-h1-shadow); }
.page .lost { font: 400 calc(18px * var(--display-scale))/1.6 var(--display); letter-spacing: 2px; color: #ff9aa6; margin: 0 0 12px; }
.btn.big { font-size: calc(15px * var(--display-scale)); padding: 12px 20px; }
.email-box { font: 700 18px/1.4 var(--ui); color: var(--card-strong); }

/* ---------------------------------------------------------------- printing the CV: plain black on white */
@media print {
  body { background: #fff !important; color: #000; font: 11pt/1.45 Georgia, 'Times New Roman', serif; }
  .page { max-width: none; padding: 0; }
  .page-head .btn, .page-foot { display: none !important; }
  .page-head { border-color: #000; }
  .wordmark, .page h1 { color: #000; text-shadow: none; font-family: Georgia, serif; text-transform: none; }
  .panel { border: 0; box-shadow: none; background: none; padding: 0; }
  .page h2 { color: #000; border-color: #000; font-family: Georgia, serif; }
  .entry .when, .page-head .file-name { color: #000; font-family: Georgia, serif; }
  .page .lede { color: #333; }
  a { color: #000; text-decoration: none; }
  .panel, .panel a, .entry .what strong, .panel .org, .panel .role, .email-box { color: #000 !important; }
}
