:root {
  --bg: #141915;
  --bg-image: url('/static/bg.jpg');
  --text: #7E857C;
  --border: #7E857C;
  --input-bg: #141915;
  --section-bg: rgba(20, 25, 21, 0.6);
  --link-hover-bg: #1a1a1a;
  --link-hover-text: #f5f5f5;
}

[data-theme="dark"] {
  --bg: #141915;
  --bg-image: url('/static/bg.jpg');
  --text: #7E857C;
  --border: #7E857C;
  --input-bg: #141915;
  --section-bg: rgba(20, 25, 21, 0.6);
  --link-hover-bg: #1a1a1a;
  --link-hover-text: #f5f5f5;
}

[data-theme="light"] {
  --bg: #f5f5f5;
  --bg-image: none;
  --text: #333333;
  --border: #333333;
  --input-bg: #ffffff;
  --section-bg: rgba(245, 245, 245, 0.6);
  --link-hover-bg: #e0e0e0;
  --link-hover-text: #000000;
}

[data-theme="accessible"] {
  --bg: #ffffff;
  --bg-image: none;
  --text: #000000;
  --border: #000000;
  --input-bg: #ffffff;
  --section-bg: rgba(255, 255, 255, 0.6);
  --link-hover-bg: #f0f0f0;
  --link-hover-text: #000000;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Menlo, monospace;
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--bg);
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  padding: 40px 20px;
  min-height: 100vh;
  position: relative;
  transition: background-color 0.3s, color 0.3s, background-image 0.3s;
  overflow-x: hidden;
}

.layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1800px;
  margin-top: 95px;
}

.layout-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  width: 100%;
}

.container {
  border: 2px solid var(--border);
  background: var(--section-bg);
  padding: 20px 30px;
  min-width: 0;
  max-width: 900px;
  flex: 1 1 600px;
}

.container > :first-child {
  margin-top: 0;
}

.container h1,
.container h2,
.container h3,
.container h4 {
  margin: 1.5em 0 0.5em;
  color: var(--text);
}

.container h1 { font-size: 1.4em; }
.container h3 { font-size: 1.1em; }

.container p { margin-bottom: 1em; }

.container ul,
.container ol {
  margin: 0 0 1em 1.5em;
}

.container li { margin-bottom: 0.3em; }

.container code {
  background: var(--link-hover-bg);
  padding: 2px 4px;
  font-family: Menlo, monospace;
  font-size: 0.9em;
}

.container pre {
  background: var(--link-hover-bg);
  border: 2px solid var(--border);
  padding: 15px;
  overflow-x: auto;
  margin: 1em 0;
  line-height: 1;
}

.container pre code {
  background: none;
  padding: 0;
}

.container blockquote {
  border-left: 3px solid var(--border);
  padding-left: 15px;
  margin: 1em 0;
  opacity: 0.8;
}

.container hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 1.5em 0;
}

.container img {
  max-width: 100%;
  border: 2px solid var(--border);
}

.vault, .graph {
  border: 2px solid var(--border);
  background: var(--section-bg);
  padding: 20px;
  min-width: 200px;
  flex: 0 0 auto;
}

.comments {
	transform: translate(-40px, -40px);
  flex: 1 1 600px;
  max-width: 900px;
  margin-top: 40px;
  border: 2px solid var(--border);
  background: var(--section-bg);
  padding: 20px 30px;
}

.comments h2 {
  margin: 0 0 0.5em;
  color: var(--text);
}

@media (max-width: 1250px) {
  .vault, .graph, .contributions, .contributions-graph {
    display: none;
  }
  .container {
    max-width: 100%;
    min-width: 0;
  }
  .comments {
    max-width: 100%;
  }
}

.contributions {
  padding: 0 20px;
}

.github-contribution-graph {
  font-family: Menlo, monospace !important;
}

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

a:hover {
  background-color: var(--link-hover-bg);
  color: var(--link-hover-text);
}

.user {
  position: absolute;
  top: 10px;
  left: 10px;
}

.search-container {
  position: absolute;
  top: 50px;
  left: 10px;
  width: 230px;
}

.search {
  width: 100%;
  color: var(--text);
  background-color: var(--input-bg);
  border: 2px solid var(--border);
  padding: 5px;
  padding-right: 50px;
  font-family: Menlo, monospace;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

.search::-webkit-search-decoration,
.search::-webkit-search-cancel-button,
.search::-webkit-search-results-button,
.search::-webkit-search-results-circle {
  display: none;
}

.search-shortcut {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text);
  opacity: 0.6;
  font-family: Menlo, monospace;
  font-size: 12px;
  pointer-events: none;
}

.search::placeholder {
  color: var(--text);
  opacity: 0.6;
}

.search:focus {
  outline: none;
}

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  border: 2px solid var(--border);
  border-top: none;
  background-color: var(--input-bg);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
}

.search-dropdown-item {
  padding: 8px 10px;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.search-dropdown-item:hover,
.search-dropdown-item.selected {
  background-color: var(--link-hover-bg);
  color: var(--link-hover-text);
}

.legend-dropdown {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--border);
  background-color: var(--input-bg);
  z-index: 100;
  padding: 0 0 8px 0;
  min-width: 450px;
}

.legend-header {
  padding: 10px;
  color: var(--text);
  font-family: Menlo, monospace;
  font-size: 18px;
  font-weight: bold;
  border-bottom: 2px solid var(--border);
}

.legend-item {
  padding: 4px 10px;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  font-family: Menlo, monospace;
  font-size: 16px;
}

.legend-key {
  font-weight: bold;
}

.legend-desc {
  opacity: 0.8;
}

.search::-webkit-selection,
.search::selection {
  background: transparent;
}

.date {
  position: absolute;
  top: 1em;
  right: 1em;
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 800px) {
  .date {
    display: none;
  }
}

.date a img {
  width: 88px;
  height: 31px;
  opacity: 0.7;
	clip-path: inset(11px 0px 0px 0px);
  filter: grayscale(70%);
  transform: translateY(-2px);
}

.divider {
  position: absolute;
  top: 6em;
  left: 0;
  width: 100%;
  border: none;
  border-top: 2px solid var(--border);
}

.page-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6em;
  background: var(--section-bg);
}

.page-header .user { left: 22px; }
.page-header .search-container { left: 22px; }
.page-header .date { right: 1.7em; }
.page-header .legend-toggle { right: 25px; }
.page-header .theme-toggle { right: 75px; }

.theme-toggle {
  position: absolute;
  top: 61px;
  right: 65px;
  cursor: pointer;
}

.legend-toggle {
  position: absolute;
  top: 53px;
  right: 15px;
  cursor: pointer;
  color: var(--text);
  font-family: Menlo, monospace;
  font-size: 20px;
}

.sun { display: none; }
.moon { display: block; }

[data-theme="light"] .sun { display: block; }
[data-theme="light"] .moon { display: none; }

[data-theme="accessible"] .sun { display: block; }
[data-theme="accessible"] .moon { display: none; }
