@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;
}

* {
  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;
}

/* 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: none;
}

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);
}