/*
     ________  __________  ______  __       _________
    /_____  / / __  __  / / ____/ / /      / _______/
   ______/ / / / / / / / / /     / /      / /______
  /  __   / / / / / / / / /     / /      /_____   /
 /  /_/  / / / / / / / / /     / /____  ______/  /
/_______/ /_/ /_/ /_/ /_/     /______/ /________/

     made by amrls
     @amaryllidinae_

*/

/* ======================================================================================================  fonts */

@font-face {
  font-family: "Ruberoid";
  src: url(fonts/Ruberoid-Regular.ttf);
  font-weight: normal;
}

@font-face {
  font-family: "Ruberoid";
  font-weight: bold;
  src: url(fonts/Ruberoid-Bold.ttf);
}

@font-face {
  font-family: "Ruberoid";
  font-style: italic;
  src: url(fonts/Ruberoid-Oblique.ttf);
}

@font-face {
  font-family: "Ruberoid";
  font-weight: bold;
  font-style: italic;
  src: url(fonts/Ruberoid-BoldOblique.ttf);
}

@font-face {
  font-family: "Ruberoid Light";
  src: url(fonts/Ruberoid-Light.ttf);
}

@font-face {
  font-family: "Ruberoid Light";
  font-weight: bold;
  src: url(fonts/Ruberoid-Bold.ttf);
}

@font-face {
  font-family: "Ruberoid";
  font-weight: 500;
  src: url(fonts/Ruberoid-SemiBold.ttf);
}

@font-face {
  font-family: "Ruberoid";
  font-weight: 500;
  font-style: italic;
  src: url(fonts/Ruberoid-SemiBoldOblique.ttf);
}

@font-face {
  font-family: "decoder-rtk";
  src: url(fonts/decoder-rtk.ttf);
}

@font-face {
  font-family: "JetBrains Mono";
  src: url(fonts/JetBrainsMono-Regular.ttf);
}

/* ====================================================================================== color scheme variables */

:root {
  color-scheme: dark; /* Use dark color scheme */
  --page-color: #2c2c2c; /* Page background color */
  --text-color: #ebebeb; /* Default text color */
}

.theme-red {
  --glow-color: red; /* Primary color for highlights */
  --shadow-color: rgba(195, 0, 0, 0.3); /* Secondary color for shadows */
  --secondary-shadow-color: rgba(195, 0, 0, 0.2); /* Secondary shadow color */
  --link-color: #ff3636; /* Tertiary color for links */
  --link-color-hover: #ff7878; /* Tertiary color for links on hover */
  --page-color: #2c2c2c; /* Page background color */
}

.theme-orange {
  --glow-color: #ff9f00;
  --shadow-color: rgba(180, 90, 0, 0.3);
  --secondary-shadow-color: rgba(180, 90, 0, 0.2);
  --link-color: #ff9f00;
  --link-color-hover: #ffc551;
  --page-color: #2c2c2c;
}

.theme-yellow {
  --glow-color: #ffea00;
  --shadow-color: rgba(180, 150, 0, 0.3);
  --secondary-shadow-color: rgba(180, 150, 0, 0.2);
  --link-color: #ffea00;
  --link-color-hover: #fff59b;
  --page-color: #2c2c2c;
}

.theme-lime {
  --glow-color: #96d700;
  --shadow-color: rgba(58, 184, 0, 0.3);
  --secondary-shadow-color: rgba(58, 184, 0, 0.2);
  --link-color: #96d700;
  --link-color-hover: #d6ff7a;
  --page-color: #2c2c2c;
}

.theme-mint {
  --glow-color: #42ff9a;
  --shadow-color: rgba(0, 146, 88, 0.3);
  --secondary-shadow-color: rgba(0, 146, 88, 0.2);
  --link-color: #42ff9a;
  --link-color-hover: #d6ffe7;
  --page-color: #2c2c2c;
}

.theme-cyan {
  --glow-color: #85f3ff;
  --shadow-color: rgba(0, 121, 161, 0.3);
  --secondary-shadow-color: rgba(0, 121, 161, 0.2);
  --link-color: #85f3ff;
  --link-color-hover: #d7f5ff;
  --page-color: #2c2c2c;
}

.theme-blue {
  --glow-color: #478eff;
  --shadow-color: rgba(0, 68, 255, 0.3);
  --secondary-shadow-color: rgba(0, 68, 255, 0.2);
  --link-color: #478eff;
  --link-color-hover: #9cc0ff;
  --page-color: #2c2c2c;
}

.theme-violet {
  --glow-color: #b366ff;
  --shadow-color: rgba(114, 0, 180, 0.3);
  --secondary-shadow-color: rgba(114, 0, 180, 0.2);
  --link-color: #b366ff;
  --link-color-hover: #e1b9ff;
  --page-color: #2c2c2c;
}

.theme-pink {
  --glow-color: #ff4dca;
  --shadow-color: rgba(180, 0, 90, 0.3);
  --secondary-shadow-color: rgba(180, 0, 90, 0.2);
  --link-color: #ff4dca;
  --link-color-hover: #ff97de;
  --page-color: #2c2c2c;
}

.theme-gray {
  --glow-color: #ababab;
  --shadow-color: rgba(159, 159, 159, 0.3);
  --secondary-shadow-color: rgba(159, 159, 159, 0.2);
  --link-color: #ababab;
  --link-color-hover: #cacaca;
  --page-color: #2c2c2c;
}

/* =============================================================================================== rainbow theme */

.rainbow-theme {
  animation: hue-rainbow 3s linear infinite;
}

@keyframes hue-rainbow {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}

/* ================================================================================================== animations */

h1,
h2,
h3,
h4,
h5,
h6,
p,
a,
li,
.subtitle,
table,
button,
#play-pause,
#seekbar,
#volume-slider {
  opacity: 0; /* Start with items hidden */
  animation: fadeIn 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards; /* Fade in animation */
}

@keyframes fadeIn {
  from {
    opacity: 0; /* Start with opacity 0 */
  }
  to {
    opacity: 1; /* End with opacity 1 */
  }
}

.page {
  transition: box-shadow 0.5s;
}

a {
  transition: color 0.3s;
}

/* ================================================================================================= base styles */

html {
  font-size: 10pt; /* Base font size */
}

body {
  margin: 0 auto; /* Get rid of default margin */
  background-color: #191919; /* Dark background incase the image fails to load */
  background-image: url(img/bg.png); /* Background image */
  font-family: "Ruberoid", sans-serif; /* Use Ruberoid font and fallback to sans-serif */
  font-weight: normal; /* Normal font weight */
  min-height: 100vh; /* Minimum height of the viewport */
}

.page-container {
  /* Container for the page itself so we can add a static shadow */
  box-shadow: 0 0 75px var(--secondary-shadow-color); /* Shadow for depth */
  max-width: 850px; /* Set max container width to 850px */
  margin: 0 auto; /* Center the container horizontally */
}

.page {
  max-width: 850px; /* Set max page width to 850px */
  box-sizing: border-box; /* Include padding and border in element's total width and height */
  background-color: var(--page-color); /* Dark background for the container */
  color: var(--text-color); /* Text color */
  box-shadow: 0 0 15px 5px rgba(0, 0, 0, 0.5), 0px 0px 100px var(--shadow-color); /* Dynamic shadow for depth */
  border: 2px solid #464646; /* Border for the container */
  outline: 3px solid #1c1c1c; /* Outline for the container */
  margin: 0 auto; /* Center the container horizontally */
  border-radius: 4px; /* Rounded corners */
  display: flex; /* Use flexbox for layout */
  flex-direction: column; /* Stack children vertically */
  min-height: calc(100vh - 100px); /* Minimum height of the container */
}

.gap {
  min-height: 50px; /* Minimum height for gap elements */
  user-select: none; /* Prevent text selection */
}

.quote {
  border-left: 2px solid var(--link-color);
  padding-left: 20px;
  font-style: italic;
}

/* ======================================================================================================= links */

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

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

/* ====================================================================================================== header */

.header {
  min-height: 150px; /* Set header height to at least 175px */
  background:
    /* Top layer: transparent PNG overlay */ url("img/glass.png")
      no-repeat 35%,
    /* Middle layer: gradient */
      linear-gradient(to right, #0a0a0a 310px, transparent 90%),
    /* Bottom layer: header background image */ url("img/header-bg.jpg")
      no-repeat center 35%;
  background-size: cover, /* overlay.png */ cover, /* gradient */ cover; /* header-bg.jpg */
  display: flex; /* Flexbox for centering content */
  flex-direction: column; /* Order header content vertically */
  justify-content: center;
  padding-left: 40px; /* Padding on the left */
  /*text-shadow: 0 0 5px white, 0 0 40px white; /* Header text glow */
  border-radius: 2px 2px 0 0; /* Rounded corners for the top of the header */
  position: relative; /* Position header content relatively */
}

.header-right {
  /* Clickable transparent area for JS to detect clicks */
  position: absolute; /* Position header right content absolutely */
  right: 0; /* Align to the right */
  min-width: 50%; /* Minimum width for header right content */
  min-height: 100%; /* Minimum height for header right content */
  user-select: none; /* Prevent text selection */
}

.title {
  font-size: 2.125rem; /* Title font size (same as h1) */
  font-family: "decoder-rtk", "sans-serif";
  font-size: 45pt;
  text-shadow: 0 0 5px #ababab, 0 0 10px rgba(200, 200, 200, 0.5);
  margin-top: -5px;
}

.subtitle {
  user-select: none; /* make text non selectable so its easier to click */
  font-size: 9pt;
  font-style: italic;
  font-weight: 400;
  text-shadow: 0 0 5px #fff, 0 0 10px rgba(255, 255, 255, 0.3);
  margin-top: -5px;
}

.title a {
  text-decoration: none; /* Remove underline from title link */
  color: white; /* Default color for title link */
  transition: text-shadow 0.3s; /* Smooth transition for hover effects */
}

.title a:hover {
  text-shadow: 0 0 5px var(--glow-color), 0 0 10px var(--glow-color),
    0 0 15px var(--glow-color), 0 0 40px var(--glow-color); /* Header text glow */
}

/* ============================================================================================== navigation bar */

.navbar {
  display: flex; /* Flexbox for navigation bar */
  justify-content: center; /* Center navigation items */
  align-items: center; /* Center items vertically */
  background: linear-gradient(
    to bottom,
    #606060,
    #252525 50%,
    #000 50%,
    #202020
  ); /* Gradient background for navbar */
  padding: 4px; /* Padding for the navbar */
  position: sticky; /* Make navbar sticky */
  top: 0; /* Stick to the top of the viewport */
  border-top: 1px solid #999; /* Border for navbar */
  border-bottom: 1px solid #555; /* Border for navbar */
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5); /* Shadow for navbar */
  z-index: 1000; /* Ensure navbar is above other content */
}

.navbar a {
  color: white; /* Text color for links */
  text-decoration: none; /* Remove underline from links */
  transition: text-shadow 0.3s; /* Smooth transition for hover effects */
  padding: 8px 20px; /* Padding for links */
  border-radius: 3px; /* Rounded corners for links */
}

.navbar a:hover {
  /* Hover effect for links */
  background: linear-gradient(
    to bottom,
    #757575,
    #404040 50%,
    #111 50%,
    #303030
  ); /* Light background on hover */
  text-shadow: 0 0 5px var(--glow-color), 0 0 10px var(--glow-color),
    0 0 20px var(--glow-color), 0 0 40px var(--glow-color); /* Red glow on text */
  box-shadow: inset 0 0 0 1px #606060; /* Outline on button (shadow can be animated as opposed to border) */
  outline: 1px solid #050505;
}

#theme-switcher {
  position: absolute; /* Position toggle button absolutely */
  right: 40px; /* Right align toggle button */
  background: transparent; /* Transparent background for toggle button */
  box-sizing: border-box; /* Include padding and border in element's total width and height */
  border-radius: 3px; /* Rounded corners for toggle button */
  font-family: "Ruberoid", sans-serif; /* Use Ruberoid font for toggle button */
  padding: 4px 4px; /* Padding for toggle button */
  border: none;
}

#theme-switcher:hover {
  background: linear-gradient(
    to bottom,
    #757575,
    #404040 50%,
    #111 50%,
    #303030
  );
  cursor: pointer; /* Pointer cursor on hover */
  box-shadow: inset 0 0 0 1px #606060; /* Border for toggle button */
  outline: 1px solid #050505; /* Outline for toggle button */
}

#theme-switcher img {
  width: 24px; /* Width for theme toggle icon */
  vertical-align: middle; /* Align icon vertically in the middle */
}

/* ====================================================================================================== player */

.player {
  display: flex;
  gap: 20px;
  align-items: center;
  background: #1d1d1d;
  border-bottom: 1px solid #2c2c2c;
  padding: 0px 40px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5); /* Shadow for navbar */
  position: sticky;
  top: 43px;
  z-index: 1001;
}

#play-pause {
  background: linear-gradient(
    to bottom,
    #757575,
    #404040 50%,
    #000 50%,
    #303030
  );
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: "Ruberoid Light", sans-serif;
  min-width: 30px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px #808080; /* Border for toggle button */
  outline: 1px solid #000; /* Outline for toggle button */
  margin: 4px 0px;
}

#play-pause:hover {
  background: linear-gradient(
    to bottom,
    #909090,
    #505050 50%,
    #111 50%,
    #303030
  );
}

#seekbar {
  appearance: none;
  flex: 1;
  accent-color: var(--link-color); /* For modern browsers */
  background-color: #424242;
  height: 2px;
  margin: 0px;
  border-top: 12px solid #1d1d1d;
  border-bottom: 12px solid #1d1d1d;
}

#volume-slider {
  appearance: none;
  width: 80px;
  accent-color: var(--link-color); /* For modern browsers */
  background-color: #424242;
  height: 2px;
  margin: 0px;
  border-top: 12px solid #1d1d1d;
  border-bottom: 12px solid #1d1d1d;
}

/* Track background for Chrome, Edge, Safari */
#seekbar::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(
    to right,
    var(--link-color) 0%,
    var(--link-color) calc(var(--seekbar-progress, 0%)),
    #424242 calc(var(--seekbar-progress, 0%)),
    #424242 100%
  );
}

/* Volume slider background for Chrome, Edge, Safari */
#volume-slider::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(
    to right,
    var(--link-color) 0%,
    var(--link-color) calc(var(--volume-progress, 0%)),
    #424242 calc(var(--volume-progress, 0%)),
    #424242 100%
  );
}

/* Seekbar thumb for Chrome, Edge, Safari */
#seekbar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 6px;
  height: 15px;
  border-radius: 0%;
  background: var(--link-color);
  border: 1px solid #2d2d2d;
  cursor: pointer;
  box-shadow: 0 0 4px var(--link-color);
  margin-top: -6.5px;
}

/* Volume slider thumb for Chrome, Edge, Safari */
#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 6px;
  height: 15px;
  border-radius: 0%;
  background: var(--link-color);
  border: 1px solid #2d2d2d;
  cursor: pointer;
  box-shadow: 0 0 4px var(--link-color);
  margin-top: -6.5px;
}

/* Track background for Firefox */
#seekbar::-moz-range-track {
  background: #424242;
}
#seekbar::-moz-range-progress {
  background: var(--link-color);
}

/* Volume slider background for Firefox */
#volume-slider::-moz-range-track {
  background: #424242;
}
#volume-slider::-moz-range-progress {
  background: var(--link-color);
}

/* Seekbar thumb for Firefox */
#seekbar::-moz-range-thumb {
  width: 4px;
  height: 14px;
  border-radius: 0%;
  background: var(--link-color);
  border: 1px solid #2d2d2d;
  cursor: pointer;
  box-shadow: 0 0 4px var(--link-color);
}

/* Volume slider thumb for Firefox */
#volume-slider::-moz-range-thumb {
  width: 4px;
  height: 14px;
  border-radius: 0%;
  background: var(--link-color);
  border: 1px solid #2d2d2d;
  cursor: pointer;
  box-shadow: 0 0 4px var(--link-color);
}
/* ===================================================================================================== content */

.content {
  padding: 10px 40px 25px; /* Padding for content area */
  line-height: 1.8; /* Line height for readability */
  box-shadow: inset 10px 0 20px -10px rgba(0, 0, 0, 0.5),
    /* Left side */ inset -10px 0 20px -10px rgba(0, 0, 0, 0.5); /* Right side */
  flex-grow: 1; /* Allow content to grow and fill available space */
}

.author {
  font-size: 9pt;
  font-style: italic;
  margin-top: -20px;
}

code {
  font-family: "JetBrains Mono";
  background-color: #202020;
  padding: 2px 4px;
  margin: 0px 2px;
  border-radius: 2px;
  font-weight: initial;
  color: #ffffff;
  font-size: 10pt;
  word-break: break-all;
}

.image {
  width: 300px;
  border-radius: 3px;
  border: 2px solid #727272;
  margin: 8px;
}

hr {
  border: none;
  border-bottom: 1px solid #727272;
}

/* ====================================================================================================== tables */

table {
  width: 100%; /* Full width for tables */
  border-collapse: collapse; /* Collapse borders */
  font-size: clamp(6px, 1.5vw, 9pt); /* Responsive font size for tables */
  line-height: 1.6; /* Line height for table text */
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5); /* Shadow for tables */
  margin-bottom: 20px; /* Margin at the bottom of tables */
}

th,
td {
  border: 1px solid #727272; /* Border for table cells */
  text-align: center; /* Left align text */
  padding: 4px 6px; /* Padding for table cells */
}

tr:nth-child(odd) {
  background-color: #343434; /* Dark background for odd table rows */
}

th {
  font-weight: bold; /* Bold text for headers */
  background: linear-gradient(
    to bottom,
    #353535,
    #111
  ); /* Dark background for headers */
}

.table-notes {
  text-align: left; /* Left align text for notes */
}

/* ====================================================================================================== footer */

.footer {
  padding: 10px 40px; /* Padding for footer area */
  border-top: 2px solid #464646; /* Top border for footer */
  margin-top: auto; /* Push footer to the bottom of the container */
  font-family: "Ruberoid Light", sans-serif; /* Use Ruberoid Light font for footer */
  line-height: 1; /* Line height for footer */
  text-align: center; /* Center footer text */
  background: linear-gradient(to bottom, var(--page-color), #111111);
  border-radius: 0 0 2px 2px; /* Rounded corners for the bottom of the footer */
  box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.5); /* Subtle shadow for footer */
}

.footer a {
  font-family: "Ruberoid", sans-serif; /* Regular font for footer links */
}

/* =========================================================================================== responsive layout */
@media (max-width: 900px) {
  .container {
    padding: 0 2%; /* Reduce padding for smaller screens */
  }

  .header {
    padding-left: 20px; /* Reduce padding for smaller screens */
  }

  .navbar {
    justify-content: initial; /* Return navbar icons to the left */
    padding-left: 10px; /* Add padding to the left for smaller screens */
  }

  .navbar a {
    padding: 8px 10px; /* Adjust padding for smaller screens */
  }

  #theme-switcher {
    right: 20px; /* Adjust position for smaller screens */
  }

  .player {
    padding: 0px 20px;
  }

  .content {
    padding: 0px 20px 20px; /* Reduce padding for smaller screens */
  }

  .quote {
    padding-left: 13px;
  }

  table,
  tr,
  th,
  td {
    padding: 4px; /* Reduce padding for smaller screens */
    font-size: clamp(6px, 1.5vw, 9pt); /* Responsive font size for tables */
    overflow-x: auto; /* Allow horizontal scrolling for tables */
  }
}

/* ====================================================================================================== Jekyll */
pre {
  background: #202020;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid #727272;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Because Jekyll makes this automatically a figure, we have to override browser styles */
figure.highlight {
  margin-inline-start: 0.5rem;
  margin-inline-end: 0.5rem;
}

.toc-container {
  height: 100%;
  background-color: #202020;
  padding: 3px;
}

.toc-cell {
  width: 200px;
  display: flex;
  flex-direction: column;
  padding-left: 3px;
}
