@import url("/css/fonts.css");

:root {
  --primary-color: #3498db;
  --font-size-p: 1.1rem;
  --header-title-size: 24px;
  --bg-color: #fafafa;
  --text-color: #05386b;
  --subtitle-color: #05386b;
  --accent-color: #256053;
  --accent-color-alpha: #2560537d;
  --nav-link-size: 15px;
  --algo-box-bg: #37968338;
  --algo-box-headline: #3796836b;
}

/*MARK: Reset  */

* {
  margin: 0;
  padding: 0;
}

/*********** Baseline, reset styles ***********/
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

/* Removes default focus */
input[type="range"]:focus {
  outline: none;
}

/******** Chrome, Safari, Opera and Edge Chromium styles ********/
/* slider track */
input[type="range"]::-webkit-slider-runnable-track {
  background-color: #052644;
  border-radius: 0.5rem;
  height: 0.5rem;
}

/* slider thumb */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; /* Override default look */
  appearance: none;
  margin-top: -4px; /* Centers thumb on the track */
  background-color: #256053;
  border-radius: 0.5rem;
  height: 1rem;
  width: 1rem;
}

input[type="range"]:focus::-webkit-slider-thumb {
  outline: 3px solid #256053;
  outline-offset: 0.125rem;
}

/*********** Firefox styles ***********/
/* slider track */
input[type="range"]::-moz-range-track {
  background-color: #052644;
  border-radius: 0.5rem;
  height: 0.5rem;
}

/* slider thumb */
input[type="range"]::-moz-range-thumb {
  background-color: #256053;
  border: none; /*Removes extra border that FF applies*/
  border-radius: 0.5rem;
  height: 1rem;
  width: 1rem;
}

input[type="range"]:focus::-moz-range-thumb {
  outline: 3px solid #256053;
  outline-offset: 0.125rem;
}

/* Main structure ********************************************************************************/

html,
body {
  position: relative !important;
  overflow-x: hidden !important;
  /* font-family: "Computer Modern Sans", sans-serif; */

  min-height: 100vh;
  background: var(--bg-color);
}

.navcolor {
  background-color: var(--bg-color);
}

.nav-links li {
  /* display: inline-block; */
  /* margin: 0 auto; */

  /* margin-left: 1em; */
  /* margin-left: 10px;
  margin-right: 10px; */
  padding: 10px;
  font-size: var(--nav-link-size);
  font-family: "Nunito", monospace !important;
  font-weight: 600;
}

.nav-links li a {
  text-decoration: none;
}

.nav-links li a:hover {
  /* text-decoration: overline; */
  text-decoration-color: #379683;
  color: #379683;
}

/* MARK: Dark Theme */
.dark-mode {
  --bg-color: #021425;
  --text-color: #fafafa;
  --subtitle-color: #a9c6e8;
  --algo-box-bg: #10c2a462;
  --algo-box-headline: #076353;
}

#theme-toggle {
  background-color: #ffffff00;
  color: var(--bg-color);
  border: none;
  cursor: pointer;
  border-radius: 5px;
}

#theme-toggle:hover {
  background-color: var(--accent-color-alpha);
}

#theme-toggle-icon {
  color: var(--text-color);
  padding: 10px;
}

/* MARK: Algorithm Styling */

.algo-box {
  border-top: 2px solid #05386b;
  border-bottom: 2px solid #05386b;
  background-color: var(--algo-box-headline);
}

.algo-list {
  background-color: var(--algo-box-bg);
}

.algo-line {
  border-top: 2px solid #05386b;
}

/* MARK: Typography */

h1,
h2,
h3,
h4 {
  font-family: "LMSans10", sans-serif;
  font-weight: 600;
  margin-bottom: 20px;
  margin-top: 20px;
  padding-left: 0px;
  border-radius: 8px 8px 0px 8px;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
a,
ul,
ol {
  color: var(--text-color);
}

a:hover {
  color: var(--subtitle-color);
}

h3.subtitle {
  font-family: "Nunito", Courier, monospace;
  color: var(--subtitle-color);
}

.date-post {
  color: var(--subtitle-color);
  font-weight: 300;
  font-size: 18px;
  border-left: 4px solid var(--subtitle-color) !important;
  border-radius: 0px;
  padding-left: 5px;
}

.tag-color {
  color: var(--subtitle-color);
}

::selection {
  background: #3796838a; /* WebKit/Blink Browsers */
}
::-moz-selection {
  background: #3796838a; /* Gecko Browsers */
}

.post-box {
  padding: 40px;
  margin-top: 50px;
}

p.lead {
  font-family: "Nunito", sans-serif !important;
}

.frontmatp {
  font-family: "Nunito", sans-serif !important;

  font-weight: 400;
  font-size: var(--font-size-p);
}

.datetext {
  font-family: "Nunito", sans-serif !important;

  font-weight: 500;
  font-size: 14px;
}

.post-box > p,
li {
  font-size: var(--font-size-p);
  font-family: "Nunito", sans-serif;
  line-height: 1.75;
}

/* MARK: Graph Box */

.graph-box {
  background-color: white;
  border: 4px solid #eee;
  border-radius: 10px;
}

/*MARK: Links */

.cool-link {
  transition: color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
  box-shadow: inset 0 0 0 0 #adb5bd;
  text-decoration-color: #379683;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
  text-decoration-thickness: 3px;
}

.cool-link:hover {
  box-shadow: inset 100vw 0 0 0 #379683;
  font-weight: 300;
  color: #edf5e1;
}

.cool-link2 {
  transition: color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
  box-shadow: inset 0 0 0 0 #adb5bd;
  text-decoration-color: #379683;
  text-decoration-thickness: 3px;
}

.cool-link3 {
  box-shadow: inset 0 0 0 0 #379683;
  color: var(--text-color);
  text-decoration-color: #379683;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
  transition: color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}
.cool-link3:hover {
  box-shadow: inset 800px 0 0 0 #379683;
  color: white;
}

.tag-box {
  margin-top: -10px;
}

.cool-link4 {
  text-decoration: none;
  font-weight: 500;
  font-size: 12px;
  color: white !important;
  border-radius: 5px;
  white-space: nowrap;
  padding: 2px 5px;
  background-color: #20487093;
  border: 1px solid #00366d93;
}

/* Physics related */
.cool-link4[data-tag="physics"],
.cool-link4[data-tag="statistical-physics"] {
  background-color: #20487093;
  border: 1px solid #00366d93;
}

.cool-link4:hover {
  background-color: #05386b;
  color: white !important;
}

/* Programming related */

.cool-link4[data-tag="chinese"],
.cool-link4[data-tag="pinyin"] {
  background-color: #e4869593;
  border: 1px solid #df294793;
}

.cool-link4:hover[data-tag="chinese"],
.cool-link4:hover[data-tag="pinyin"] {
  background-color: #df294793;
  color: white !important;
}

/* Electronics related */

.cool-link4[data-tag="electronics"] {
  background-color: #f0d78c;
  border: 1px solid #f7b801;
}

.cool-link4:hover[data-tag="electronics"] {
  background-color: #dfba17d3;
  color: white !important;
}

/* Electronics related */

.cool-link4[data-tag="physics"],
.cool-link4[data-tag="statistical-physics"] {
  background-color: #509b8bd3;
  border: 1px solid #0ba080d3;
}

.cool-link4:hover[data-tag="physics"],
.cool-link4:hover[data-tag="statistical-physics"] {
  background-color: #0ba080d3;
  color: white !important;
}

/* Programming related */

.cool-link4[data-tag="programming"],
.cool-link4[data-tag="optimization"],
.cool-link4[data-tag="algorithms"],
.cool-link4[data-tag="generative-programming"],
.cool-link4[data-tag="maps-generation"] {
  background-color: #4e51666e;
  border: 1px solid #4e5166;
}

.cool-link4:hover[data-tag="programming"],
.cool-link4:hover[data-tag="optimization"],
.cool-link4:hover[data-tag="algorithms"],
.cool-link4:hover[data-tag="generative-programming"],
.cool-link4:hover[data-tag="maps-generation"] {
  background-color: #4e5166;
  color: white !important;
}

.cool-link5 {
  background-color: #05386b;
  font-size: 13px;
}

.cool-link6 {
  position: relative;
  color: var(--text-color);
  text-decoration: none;
}

.cool-link6:hover {
  color: #379683;
}

.cool-link6::before {
  content: "";
  position: absolute;
  display: block;
  width: 100%;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: #379683;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.cool-link6:hover::before {
  transform: scaleX(1);
}

.social-link {
  display: inline;
  list-style: none;
  margin: 0 auto;
  padding: 0px;
  display: flex;
  /* justify-content: space-between; */
}

.social-link a {
  font-size: 20px !important;
  color: #379683;
}

.social-link a:hover {
  color: #8ee4af;
}

.nav-links {
  list-style: none;
  display: flex;
}

.post-list {
  margin: 0px;
  padding: 0px;
  list-style: none;
}

/* MARK: Responsive Design */

@media only screen and (max-width: 480px) {
  :root {
    --header-title-size: 20px;
    --nav-link-size: 12px;
    --font-size-p: 14px;
  }

  .katex-display {
    font-size: 12pt !important;
  }

  .hljs pre {
    font-size: 11px !important;
  }

  .post-box {
    padding: 20px;
  }

  .post-box h1 {
    font-size: 22px;
  }

  .post-box h2 {
    font-size: 20px;
  }

  .post-box h3 {
    font-size: 16px;
  }

  .post-box p,
  ul,
  li {
    font-size: 15px;
  }

  .frontmatp {
    font-size: 14px;
  }

  .cool-link4 {
    font-size: 10px;
  }

  .datetext {
    font-size: 12px;
  }

  time {
    font-size: 14px;
  }
}

.heading-title {
  font-size: var(--header-title-size);
}

.figcaption {
  border-left: 5px solid var(--algo-box-headline);
  padding-left: 5px;
  margin-top: 5px;
  text-align: start;
}

.img-box {
  background-color: white;
  border: 3px solid var(--algo-box-headline);
}

.hr-img {
  height: 0px;
  border: none;
  border-top: 3px dashed #379683;
  opacity: 1;
}

hr {
  height: 0px;
  border: none;
  border-top: 3px solid #379683;
  opacity: 1;
}

.hljs {
  border-left: 2px solid var(--primary-color);
}

@keyframes shake {
  0%,
  100% {
    transform: rotate(-10deg);
  }
  50% {
    transform: rotate(10deg);
  }
}

.wave {
  display: inline-block;
  animation: shake 0.5s; /* Adjust the time as needed */
  animation-iteration-count: infinite;
}

.menu-bar {
  border-radius: 10px;
  padding: 0px 10px 0px 10px;
}

footer {
  background-color: #fff;
  padding-bottom: 0px;
  left: 0;
  position: absolute;
  right: 0;
  bottom: 0;
}

.footer-text {
  font-size: 15px;
  color: var(--text-color);
  font-weight: 200px;
}

.project-text {
  font-family: "Nunito", sans-serif;
  font-size: 16px;
}

.project-box:hover {
  background-color: #a9c6e832;
  border-radius: 10px;
  -webkit-transition: background-color 300ms linear;
  -ms-transition: background-color 300ms linear;
  transition: background-color 300ms linear;
}

/* MAKR: HANZI */
.pinyin-output {
  text-align: center;
  line-height: 1.5;
}

ruby {
  font-size: 16pt;
  display: inline-block;
  line-height: 1em;
  position: relative;
  vertical-align: middle; /* Ensures ruby characters align properly with normal text */
}

rb {
  display: inline-block;
  padding-top: 1.6em;
  font-size: 16pt;
}

rt {
  font-size: 0.8em;
  position: absolute;
  display: block;
  line-height: 1.3em;
  top: 0.25em; /* Adjust the pinyin position */
  left: 0em;
  width: 100%;
  text-align: center; /* Centers the pinyin text above the Hanzi */
}

/*MARK: Text animation */

@keyframes textEaseInFromBelow {
  0% {
    transform: translateY(20px); /* Start below */
    opacity: 0; /* Start invisible */
  }
  100% {
    transform: translateY(0); /* End at normal position */
    opacity: 1; /* End visible */
  }
}

article,
.presentation-box {
  animation: textEaseInFromBelow 1s ease-out forwards; /* Apply animation */
  transition: opacity 0.3s ease, transform 0.5s ease-out; /* Smooth transition */
}

/*MARK: Button animation */

/* From Uiverse.io by aasisodiya */
/* From Uiverse.io by krlozCJ */
.interactive-btn {
  margin-left: 0.5em;
  margin-right: 0.5em;
  border: none;
  outline: none;
  background-color: #379683;
  padding: 10px 20px;
  font-size: var(--font-size-p);
  font-weight: 700;
  color: #fff;
  border-radius: 5px;
  transition: all ease 0.1s;
  box-shadow: 0px 5px 0px 0px #256053;
}

.interactive-btn:active {
  transform: translateY(5px);
  box-shadow: 0px 0px 0px 0px #256053;
}

.interactive-btn:hover {
  background-color: #179178;
}
