/* ickza.top - laid out as a disassembly listing, same look as the GitHub profile */

@font-face {
  font-family: "JetBrains Mono";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2");
}

:root {
  --bg: #0e1217;
  --band: #141a21;
  --line: #262e38;
  --text: #c9d1d9;
  --dim: #5d6875;
  --bytes: #7f8b98;
  --mnem: #7cb7ff;
  --label: #ff9e7a;
  --string: #e8bb5a;
  --note: #7fa883;
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/24px "JetBrains Mono", ui-monospace, Consolas, monospace;
  font-variant-ligatures: none;
  overflow-wrap: break-word;
}

::selection { background: rgba(124, 183, 255, .3); }

/* 840px wide inside the gutters, the same 88-column grid as the profile */
.wrap {
  max-width: 872px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}

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

.logo {
  display: flex;
  color: var(--text);
  font-size: clamp(40px, 12vw, 60px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -1px;
  text-decoration: none;
}
.logo:hover { color: var(--text); }
.logo::after {
  content: "ickza.top";
  margin-left: auto;
  color: var(--bytes);
  font-size: 15px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0;
}

.cursor {
  align-self: center;
  width: .43em;
  height: .77em;
  margin-left: .1em;
  background: var(--label);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.tagline { margin: 8px 0 0; color: var(--note); }
.tagline::before { content: "; "; }

/* filled in by fx.js */
.hex { margin-top: 12px; white-space: pre; overflow: hidden; color: var(--bytes); }
.hex .pad { color: var(--dim); }
.hex .as { margin-left: 1ch; color: var(--string); }
.hex .sel { background: rgba(232, 187, 90, .28); }
.ad { display: inline-block; width: 11ch; color: var(--dim); }

/* ---------- menu ---------- */

nav.menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 14px;
}
nav.menu a {
  padding: 5px 13px;
  color: var(--text);
  text-decoration: none;
  background: var(--band);
  border: 1px solid var(--line);
  border-radius: 6px;
}
nav.menu a b { color: var(--mnem); font-weight: 400; }
nav.menu a:hover { border-color: var(--mnem); }
nav.menu a[aria-current="page"] { background: var(--line); border-color: var(--bytes); }

/* ---------- panels ---------- */

.panel {
  margin: 0 0 16px;
  padding: 16px 23px 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}

/* IDA's banner: ; =============== S U B R O U T I N E ===========... */
.panel > h2:not(.sub) {
  display: flex;
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--bytes);
  font: inherit;
  letter-spacing: 1ch;
  text-transform: uppercase;
  white-space: pre;
}
.panel > h2:not(.sub)::before,
.panel > h2:not(.sub)::after { color: var(--dim); letter-spacing: 0; }
.panel > h2:not(.sub)::before { content: "; =============== "; }
.panel > h2:not(.sub)::after {
  content: "========================================================================================";
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
}

.panel p { margin: 0 0 12px; }
.panel p:last-child { margin-bottom: 0; }

h1 {
  margin: 0 0 4px;
  color: var(--label);
  font-size: 22px;
  line-height: 32px;
}

a { color: var(--mnem); }
a:hover { color: var(--label); }
a:focus-visible { outline: 2px solid var(--mnem); outline-offset: 2px; }

.hi { color: var(--label); font-weight: 700; }

/* comments */
.dim { color: var(--note); }
.dim::before { content: "; "; }

/* about reads as a proc: label, comment lines, endp */
.proc { color: var(--label); font-weight: 700; }
.proc b { color: var(--mnem); font-weight: 400; }
.about p:not(.proc) { padding-left: 2ch; text-indent: -2ch; color: var(--note); }
.about p:not(.proc)::before { content: "; "; }

/* strings in .rdata: address, bytes or label, db, string, comment.
   fx.js adds the address and bytes */
ul.rows { list-style: none; margin: 0; padding: 0; }
ul.rows li {
  display: grid;
  grid-template-columns: 11ch 17ch 5ch 1fr auto;
}
ul.rows li > * { grid-row: 1; }
ul.rows li::before { content: "db"; grid-row: 1; grid-column: 3; color: var(--mnem); }
ul.rows .ad { grid-column: 1; }
ul.rows .by { grid-column: 2; color: var(--bytes); }
ul.rows li > a { grid-column: 4; color: var(--string); text-decoration: none; }
ul.rows li > a:hover { color: var(--label); text-decoration: underline; }
ul.rows li > a::before { content: "\""; }
ul.rows li > a::after { content: "\",0"; }
ul.rows li > span:last-of-type { grid-column: 5; margin-left: 2ch; color: var(--note); white-space: nowrap; }
ul.rows li > span:last-of-type::before { content: "; "; }

ul.refs .by { display: none; }
ul.refs li > span:last-of-type { grid-column: 2; margin-left: 0; color: var(--label); font-weight: 700; }
ul.refs li > span:last-of-type::before { content: none; }

/* ---------- blog posts ---------- */

.post-meta { color: var(--note); margin: 0 0 18px; }
.post-meta::before { content: "; "; }

h2.sub {
  display: flex;
  margin: 26px 0 10px;
  color: var(--note);
  font-size: 15px;
  line-height: 24px;
}
h2.sub::before { content: ";"; flex: none; width: 2ch; }
h2.sub::after {
  content: "----------------------------------------------------------------------------------------";
  flex: 1 1 0;
  min-width: 0;
  margin-left: 1ch;
  overflow: hidden;
  color: var(--dim);
  font-weight: 400;
  white-space: nowrap;
}

code, pre { font-family: inherit; font-size: 14px; }
code {
  padding: 1px 5px;
  color: var(--string);
  background: var(--band);
  border-radius: 3px;
}
pre.code {
  margin: 0 0 12px;
  padding: 12px 14px;
  overflow-x: auto;
  color: var(--text);
  line-height: 22px;
  background: var(--band);
  border: 1px solid var(--line);
  border-radius: 6px;
}
pre.code code { padding: 0; color: inherit; background: none; }

img { max-width: 100%; height: auto; }

figure.shot { margin: 18px 0 22px; }
figure.shot img { display: block; border: 1px solid var(--line); border-radius: 6px; }
figure.shot figcaption { margin-top: 6px; color: var(--note); font-size: 14px; }
figure.shot figcaption::before { content: "; "; }

/* ---------- status bar ---------- */

footer.site {
  padding: 7px 23px;
  color: var(--bytes);
  text-align: right;
  font-size: 14px;
  background: var(--band);
  border: 1px solid var(--line);
  border-radius: 6px;
}
footer.site::before {
  content: "AU: idle";
  float: left;
  margin-right: 16px;
  padding-left: 16px;
  background: radial-gradient(circle at 4px 50%, var(--note) 4px, transparent 4.5px);
}
footer.site .heart { color: var(--label); }

/* ---------- small screens ---------- */

@media (max-width: 800px) {
  .panel { padding: 12px 15px 14px; }
  .panel > h2:not(.sub)::before { content: "; ===== "; }
  footer.site { padding: 7px 15px; }

  /* the address and ascii panes don't fit, so the hex pane scales to the width */
  .ad, .hex .as, ul.rows .by, ul.rows li::before { display: none; }
  .hex { font-size: min(15px, calc((100vw - 64px) / 29.6)); }

  ul.rows li { grid-template-columns: 1fr; margin-bottom: 8px; }
  ul.rows li:last-child { margin-bottom: 0; }
  ul.rows li > a { grid-column: 1; grid-row: 2; }
  ul.rows li > span:last-of-type,
  ul.refs li > span:last-of-type { grid-column: 1; grid-row: 1; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
