@import url('https://fonts.googleapis.com/css?family=Roboto:400,500,700,900');
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@200;300;400;700&family=Source+Code+Pro:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #1a1a1a;
  --bg-secondary: #252525;
  --bg-code: #2d2d2d;
  --text: #e0e0e0;
  --text-muted: #a0a0a0;
  --accent: #6ab0f3;
  --accent-hover: #8bc4f7;
  --border: #3a3a3a;
  --link: #ceb1f1;
  --link-visited: #d8b1f1;
  --forge: #ff8e3e;
  --knock: #b54efc;
  --lantern: #ffe300;
  --heart: #f97a89;
  --grail: #fe6150;
  --moth: #f2e9c2;
  --history: #fe43f0;
  --winter: #beeeff;
  --edge: #d7dd49;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

.image-container {
  background: linear-gradient(
    90deg,
    #1a1a1a 0%,
    #2d2d2d 25%,
    #4a4a4a 50%,
    #2d2d2d 75%,
    #1a1a1a 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: 0% 0; }
}

code span.ex {
  color: #aaddff;
}

.image-container img {
  object-fit: cover;
}
.image-container::after {
  content: "Loading Image..."
}

.crisp {
    /* core thing: tell browser to use nearest-neighbor */
    image-rendering: pixelated;      /* modern */
    image-rendering: crisp-edges;    /* fallback */
  
    /* some ancient browsers, ignore if you don't care */
    image-rendering: -moz-crisp-edges;
    -ms-interpolation-mode: nearest-neighbor;

}

.jxl-warning {
  font-size: 1.2em;
  font-weight: 500;
  background-color: #8d0000;
  padding: .6em;
  border-radius: .5em;
  display: none;
}
.jxl-warning > p {
  margin: 0;
}

figure {
  text-align: center;
}

body {
  /*font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;*/
  font-family: 'Lexend', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
}

/* headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin: 2rem 0 1rem;
  color: #fff;
}

h1 { font-size: 2.25rem; font-weight: 900; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }
h5, h6 { font-size: 1rem; color: var(--text-muted); }

/* links */
a {
  color: var(--link);
  text-decoration: underline;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

a:visited {
  color: var(--link-visited);
}

/* paragraphs and text */
p {
  margin: 1rem 0;
}

strong {
  font-weight: 700;
  color: #fff;
}

em {
  font-style: italic;
}

/* code */
code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.875em;
  background: var(--bg-code);
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
}

/* blockquotes */
blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1rem;
  border-left: 4px solid var(--accent);
  background: var(--bg-secondary);
  color: var(--text-muted);
}

blockquote p {
  margin: 0.5rem 0;
}

/* lists */
ul, ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

li {
  margin: 0.375rem 0;
}

li > ul, li > ol {
  margin: 0.25rem 0;
}

/* tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

th, td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
}

th {
  background: var(--bg-secondary);
  font-weight: 700;
  color: #fff;
}

tr:nth-child(even) {
  background: var(--bg-secondary);
}

/* horizontal rule */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

figure {
  margin: 1.5rem 0;
}

figcaption {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  text-align: center;
}

/* definition lists */
dl {
  margin: 1rem 0;
}

dt {
  font-weight: 700;
  color: #fff;
  margin-top: 1rem;
}

dd {
  margin-left: 1.5rem;
  color: var(--text-muted);
}

/* keyboard input */
kbd {
  font-family: 'Lexend', sans-serif;
  font-size: 0.875em;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.125em 0.375em;
  box-shadow: 0 1px 0 var(--border);
}

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

/* footnotes (pandoc) */
.footnotes {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* table of contents (pandoc) */
nav#TOC {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
}

nav#TOC ul {
  list-style: none;
  padding-left: 1rem;
}

nav#TOC > ul {
  padding-left: 0;
}

/* print styles */
@media print {
  body {
    background: #fff;
    color: #000;
    max-width: none;
  }
  
  a {
    color: #000;
    text-decoration: underline;
  }
  
  pre, code {
    background: #f5f5f5;
    border-color: #ddd;
  }
}


/* --- */

:root {
    --md5-bg-primary: #f5f5f5;
    --md5-bg-secondary: white;
    --md5-text-primary: #333;
    --md5-text-secondary: #555;
    --md5-text-tertiary: #666;
    --md5-text-quaternary: #888;
    --md5-border: #ddd;
    --md5-accent: #4CAF50;
    --md5-accent-hover: #45a049;
    --md5-info-bg: #e3f2fd;
    --md5-info-border: #2196F3;
    --md5-output-bg: #f9f9f9;
    --md5-success-bg: #d4edda;
    --md5-success-text: #155724;
    --md5-success-border: #c3e6cb;
    --md5-error-bg: #f8d7da;
    --md5-error-text: #721c24;
    --md5-error-border: #f5c6cb;
    --md5-info-status-bg: #d1ecf1;
    --md5-info-status-text: #0c5460;
    --md5-info-status-border: #bee5eb;
    --md5-shadow: rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --md5-bg-primary: #1a1a1a;
    --md5-bg-secondary: #2d2d2d;
    --md5-text-primary: #e0e0e0;
    --md5-text-secondary: #b0b0b0;
    --md5-text-tertiary: #888;
    --md5-text-quaternary: #666;
    --md5-border: #444;
    --md5-accent: #66bb6a;
    --md5-accent-hover: #5cae60;
    --md5-info-bg: #1e3a5f;
    --md5-info-border: #4a90d9;
    --md5-output-bg: #252525;
    --md5-success-bg: #1e3a2a;
    --md5-success-text: #90ee90;
    --md5-success-border: #2d5a3d;
    --md5-error-bg: #3a1e1e;
    --md5-error-text: #ffb3b3;
    --md5-error-border: #5a2d2d;
    --md5-info-status-bg: #1e2f3a;
    --md5-info-status-text: #7dd3fc;
    --md5-info-status-border: #2d4a5a;
    --md5-shadow: rgba(0,0,0,0.4);
}

.md5_container {
    background: var(--md5-bg-secondary);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--md5-shadow);
}

.md5_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--md5-accent);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.md5_header h1 {
    color: var(--md5-text-primary);
    margin: 0;
}

.md5_theme-toggle {
    background: var(--md5-bg-primary);
    border: 1px solid var(--md5-border);
    color: var(--md5-text-primary);
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.md5_theme-toggle:hover {
    background: var(--md5-border);
}

.md5_info {
    background: var(--md5-info-bg);
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    border-left: 4px solid var(--md5-info-border);
    color: var(--md5-text-primary);
}

button {
    background: var(--md5-accent);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin: 10px 5px;
}

button:hover {
    background: var(--md5-accent-hover);
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.md5_output {
    background: var(--md5-output-bg);
    padding: 15px;
    border: 1px solid var(--md5-border);
    border-radius: 5px;
    margin: 10px 0;
    font-family: monospace;
    font-size: 12px;
    word-break: break-all;
    white-space: pre-wrap;
    color: var(--md5-text-primary);
}

.md5_label {
    font-weight: bold;
    color: var(--md5-text-secondary);
    margin-top: 15px;
}

#status {
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
}

.md5_success {
    background: var(--md5-success-bg);
    color: var(--md5-success-text);
    border: 1px solid var(--md5-success-border);
}

.md5_error {
    background: var(--md5-error-bg);
    color: var(--md5-error-text);
    border: 1px solid var(--md5-error-border);
}

.md5_info-status {
    background: var(--md5-info-status-bg);
    color: var(--md5-info-status-text);
    border: 1px solid var(--md5-info-status-border);
}

textarea {
    background: var(--md5-output-bg);
    color: var(--md5-text-primary);
    border: 1px solid var(--md5-border);
    font-size: 1.5em;
}
@media (min-width: 768px) {
.col {
  display: inline-block;
}
.col-art {
  display: inline-block;
  margin-left:1em;
  top: -8em;
  position: relative;
}
}
@media (max-width: 768px) {
  /* mobile styles */
  textarea {
    font-size: 1em;
  }
  #hashout {
    font-size: 0.8em !important;
  }
}

input[type="file"] {
    background: var(--md5-output-bg);
    color: var(--md5-text-primary);
    border: 1px solid var(--md5-border);
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

input[type="file"]::file-selector-button {
    background: var(--md5-accent);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

input[type="file"]::file-selector-button:hover {
    background: var(--md5-accent-hover);
}

label {
    color: var(--md5-text-primary);
}


.forge, .fg {
  color: var(--forge);
}

.knock, .kn, .kk {
  color: var(--knock);
}

.lantern, .lt, .ln {
  color: var(--lantern);
}

.heart, .ht, .hr {
  color: var(--heart);
}

.grail, .gr, .gl {
  color: var(--grail);
}

.moth, .mt, .mh {
  color: var(--moth);
}

.history, .hs, .sh {
  color: var(--history);
}

.winter, .wr, .wn {
  color: var(--winter);
}

.edge, .ed, .eg {
  color: var(--edge);
}

.i.sh {
  color: var(--lantern);
}
 
.i.ex {
  color: var(--forge);
}

.i.lh {
  color: var(--knock);
}

.i.py {
  color: var(--forge);
}

.i.en {
  color: var(--heart);
}

.i.fl {
  color: var(--grail);
}

.i.sf {
  color: var(--forge);
}

.i.wd {
  color: var(--moth);
}

.i.gdb {
  color: var(--lantern);
}

.i.null {
  color: var(--winter);
  font-weight: bold;
}

.i {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: rgb(140, 140, 140);
  cursor: help;
}

.i:hover {
  text-decoration-line: underline overline;
  text-decoration-style: dotted;
  text-decoration-color: unset;
  /* position: relative; */
}


.i .tip {
  display: none;
  position: absolute;
  /* background: var(--bg-secondary); */
  background: #42433a;
  border: 1px solid var(--border);
  border-radius: 4px;
  /* top: 100%; */
  top: auto;
  width: max-content;
  /* width: calc( min( 33rem, 100vw ) - 2rem ); */
  max-width: calc( min( 40rem, 100vw ) - 2rem );
  left: 1rem;
  font-size: 1rem;
  z-index: 100;
  text-align: left;
  box-shadow: 0 4px 12px 3px rgb(0 0 0 / 59%);
}

.tip > .tip-body {
  display: block;
  font-weight: normal;
  font-size: 1rem;
  color: white;
  padding-left: 0.4em;
  padding-right: 0.4em;
}
.tip > .tip-attrs {
  display: block;
  padding-top: 0.1em;
  padding-bottom: 0.4em;
  font-weight: normal;
  font-size: 1rem;
  color: white;
  padding-left: 0.4em;
  background: #343629;
}
.tip > .tip-attrs img {
  position: relative;
  height: 2em;
  top: 0.5em;
}
.tip > .tip-header {
  display: block;
  font-weight: bold;
  font-size: 1.2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .1em;
  background: #343629;
  padding: 0.2em 0.4em;
}

@media (hover: hover) {
  .i:hover .tip {
    display: block;
  }
}

.i:focus .tip {
  display: block;
}

.tip .close-btn {
  display: none;
  position: absolute;
  top: 0.2em;
  right: 0.4em;
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  margin: 0;
}

@media (hover: none) {
  .tip .close-btn {
    display: block;
  }
  .i {
    position: inherit !important;
  }
  .i .tip {
    left: 1em !important;
    right: auto;
  }
}

.hero {
  display: inline-block;
  position: relative;
}

.hero .card {
  display: inline-block;
  /* background-color: #ff0000ba; */
  width: 100%;
  height: 100%;
  
  border-radius: 4%;
  box-shadow: 1px 1px 8px 1px #00f6ff94;

  transition: box-shadow 0.3s ease;
}
@media (hover: hover) {
  .hero:hover .card-box .card {
    box-shadow: 1px 1px 8px 1px #00f6ff;
  }

  .hero .card-box:hover .card {
    box-shadow: 2px 2px 16px 4px #00f6ff;
  }

  .hero:hover .card-box .card.large {
    box-shadow: 1px 1px 8px 6px #00f6ff;
  }

  .hero .card-box:hover .card.large {
    box-shadow: 2px 2px 20px 13px #00f6ff;
  }
}
@media (hover: none) {
  .hero .card-box .card {
    box-shadow: 1px 1px 8px 1px #00f6ff;
  }
  .hero:hover .card-box .card.large {
    box-shadow: 1px 1px 8px 6px #00f6ff;
  }
}


.hero1 {
    width: 9%;
    height: 28.5%;
    left: 26.4%;
    top: 30%;
}
.hero1 .card {
transform: skew(355deg, 0deg) rotateX(7deg);
}

.hero2 {
    width: 9.2%;
    height: 30%;
    left: 40.2%;
    top: 44.6%;
}
.hero2 .card {
  transform: skew(359deg, 0deg) rotatex(8deg);
}

.hero3 {
    width: 8.8%;
    height: 27.4%;
    left: 54.6%;
    top: 16%;
}
.hero3 .card {
    transform: skew(1deg, 0deg) rotateX(4deg);
}

.hero4 {
    width: 9.3%;
    height: 30.2%;
    left: 69.3%;
    top: 44.6%;
}
.hero4 .card {
    transform: skew(5deg, 0deg) rotatex(7deg);
}

.hero5 {
    width: 9%;
    height: 28.4%;
    left: 82.9%;
    top: 30%;
}
.hero5 .card {
    transform: skew(9deg, 0deg) rotateX(7deg);
}

.hero6 {
    width: 22.9%;
    height: 68%;
    left: 38.5%;
    top: 16%;
}
.hero6 .card {
    transform: skew(360deg, 0deg) rotateX(3deg);
}

.hero7 {
width: 22.5%;
    height: 71.5%;
    left: 38%;
    top: 12.5%;
}
.hero7 .card {
    transform: skew(362deg, 0deg) rotateX(3deg);
}

.hero8 {
    width: 14.5%;
    height: 29.5%;
    left: 40.8%;
    top: 6.8%;
}
.hero8 .card {
    transform: skew(362deg, 0deg) rotateX(3deg);
}

.hero9 {
    width: 16%;
    height: 35%;
    left: 16.3%;
    top: 55.1%;
}
.hero9 .card {
   transform: skew(359deg, 0deg) rotateX(5deg);
}

.hero10 {
    width: 15.8%;
    height: 35%;
    left: 41.5%;
    top: 55.1%;
}
.hero10 .card {
    transform: skew(362deg, 0deg) rotateX(3deg);
}

.hero11 {
    width: 15.8%;
    height: 34.9%;
    left: 66.6%;
    top: 55.2%;
}
.hero11 .card {
    transform: skew(366deg, 0deg) rotateX(4deg);
}

.hero12 {
    width: 17.9%;
    height: 49%;
    left: 18%;
    top: 10.5%;
}
.hero12 .card {
    transform: skew(360deg, 0deg) rotateX(3deg);
}

.hero13 {
    width: 18.4%;
    height: 51.3%;
    left: 56.5%;
    top: 35.4%;
}
.hero13 .card {
    transform: skew(365deg, 0deg) rotateX(4deg);
}

.hero14 {
    width: 18%;
    height: 49%;
    left: 9.5%;
    top: 7.7%;
}
.hero14 .card {
    transform: skew(357deg, 0deg) rotateX(3deg);
}

.hero15 {
    width: 18.6%;
    height: 51.3%;
    left: 47.7%;
    top: 32.8%;
}
.hero15 .card {
    transform: skew(361.5deg, 0deg) rotateX(4deg);
}

.hero16 {
    width: 22.8%;
    height: 56.5%;
    left: 39.3%;
    top: 21.6%;
}
.hero16 .card {
    transform: skew(361.5deg, 0deg) rotateX(4deg);
}




.hero .card-box{
  display: inline-block;
  position: absolute;
  perspective: 240px;
  perspective-origin: top;
}

.hero .i {
  display: inline-block;
  position: absolute !important;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.hero .tip {
  top: 100%;
}

/* TODO use size instead of hover */
@media (max-width: 768px) {
  .hero1 .tip {
    left: -294% !important
  }
  .hero2 .tip {
    left: -447% !important
  }
  .hero3 .tip {
    left: -620% !important
  }
  .hero4 .tip {
    left: -745% !important
  }
  .hero5 .tip {
    left: -921% !important
  }
  .hero6 .tip {
    left: -170% !important
  }
  .hero7 .tip {
    left: -170% !important
  }
  .hero8 .tip {
    left: -285% !important
  }
  .hero9 .tip {
    left: -104% !important
  }
  .hero10 .tip {
    left: -267% !important
  }
  .hero11 .tip {
    left: -426% !important
  }
  .hero12 .tip {
    left: -105% !important
  }
  .hero13 .tip {
    left: -309% !important
  }
  .hero14 .tip {
    left: -55% !important
  }
  .hero15 .tip {
    left: -259% !important
  }
  .hero16 .tip {
    left: -174% !important
  }
}
  


@media (hover: none) {

  .only-desktop {
    display: none;
  }
  .only-mobile {
    display: block;
  }
}



@media (hover: hover) {
.only-desktop {
  display: block;
}
.only-mobile {
  display: none;
}
}

.footnotes {
  margin-top: 0;
  border-top: 0;
}

.footnotes hr {
  margin-top: 0;
}