/* ----------------------------------- base colors using CSS variables */
:root {
  --bg-color: white;
  --text-color: white;
  --link-color: white;
  --link-hover: yellow;
  --footer-text: black;
  --footer-link: black;
  --footer-link-hover: yellow;
  --short-name-bg: black;
}

:root.dark-mode {
  --bg-color: #121212;
  --text-color: white;
  --link-color: white;
  --link-hover: yellow;
  --footer-text: white;
  --footer-link: white;
  --footer-link-hover: yellow;
  --short-name-bg: white;
}

/* ----------------------------------- body */
body {
  margin-top: 80px;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ----------------------------------- header */
.fixed-links {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 40px;
  z-index: 9999;
  mix-blend-mode: difference;
}

.fixed-links a {
  color: var(--link-color);
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  transition: color 0.2s ease;
}

.fixed-links a:hover {
  color: var(--link-hover);
  text-decoration: none;
}

.fixed-name {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  z-index: 10000;
  mix-blend-mode: difference;
}

.fixed-name a {
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  transition: color 0.2s ease;
  position: relative;
  color: var(--link-color);
}

.fixed-name a:hover {
  color: var(--link-hover);
  text-decoration: none;
}

.fixed-name span.full-name {
  display: inline;
}

.fixed-name span.short-name {
  display: none;
}

.welcome-text {
  color: var(--text-color);
}

#theme-toggle {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1em;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  color: var(--link-color);
  transition: color 0.3s ease;
  padding: 0px 10px;
}

/* ----------------------------------- footer */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 40px;
  font-size: 0.9em;
  color: var(--footer-text);
  border-top: 0.5px solid #ccc;
  margin-top: 80px;
}

.footer-column {
  flex: 1;
  text-align: center;
}

.footer-column:first-child {
  text-align: left;
}

.footer-column:last-child {
  text-align: right;
}

.site-footer a {
  text-decoration: none;
  color: var(--footer-link);
}

.site-footer a:hover {
  text-decoration: none;
  color: var(--footer-link-hover);
  mix-blend-mode: difference;
}

/* ----------------------------------- bw-hover for pictures */
.bw-on-hover {
  filter: grayscale(100%);
  transition: filter 0.3s ease;
}

.bw-on-hover:hover {
  filter: grayscale(0%);
}

/* ----------------------------------- image description */
.image-wrapper {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.image-description {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background-color: transparent;
  color: var(--link-hover);
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8em;
  user-select: none;
  max-width: 90%;
  text-align: right;
  opacity: 0;
  transition: opacity 0.3s ease;
  mix-blend-mode: plus-lighter;
}

.image-wrapper:hover .image-description {
  opacity: 1;
  pointer-events: auto;
}

/* ----------------------------------- contact modal */
.contact-modal {
  display: none;
  position: fixed;
  z-index: 10002;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.contact-modal-content {
  background-color: var(--bg-color);
  margin: 15% auto;
  padding: 40px;
  border: 1px solid var(--footer-text);
  width: 90%;
  max-width: 500px;
  border-radius: 0;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.contact-close {
  color: var(--footer-text);
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}

.contact-close:hover,
.contact-close:focus {
  color: var(--link-hover);
}

.contact-modal h2 {
  color: var(--footer-text);
  margin-bottom: 30px;
  font-weight: bold;
  font-size: 1.5em;
}

.contact-modal form input,
.contact-modal form textarea {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 1px solid var(--footer-text);
  border-radius: 0;
  font-size: 14px;
  font-family: inherit;
  background-color: var(--bg-color);
  color: var(--footer-text);
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.contact-modal form input:focus,
.contact-modal form textarea:focus {
  outline: none;
  border-color: var(--link-hover);
}

.contact-modal form input::placeholder,
.contact-modal form textarea::placeholder {
  color: var(--footer-text);
  opacity: 0.5;
}

.contact-modal form button {
  width: 100%;
  padding: 12px;
  margin-top: 20px;
  background-color: var(--footer-text);
  color: var(--bg-color);
  border: none;
  border-radius: 0;
  font-size: 16px;
  font-weight: bold;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.contact-modal form button:hover {
  opacity: 0.7;
}

#contact-link {
  cursor: pointer;
  text-decoration: none;
}

/* ----------------------------------- mobile adjustments */
@media (hover: none) and (pointer: coarse) {
  .bw-on-hover {
    filter: grayscale(0%) !important;
    transition: none !important;
  }

  .image-description {
    opacity: 1 !important;
    transition: none !important;
  }

  .site-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-column {
    text-align: center !important;
    margin: 8px 0;
  }
}

@media (max-width: 600px) {
  .fixed-name span.full-name {
    display: none !important;
  }

  .fixed-name span.short-name {
    display: inline !important;
  }

  .fixed-links {
    top: 50px;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    justify-content: space-between;
    gap: 0;
    padding: 0 20px;
  }

  .fixed-name {
    top: 10px;
    left: 0;
    padding-left: 20px;
  }

  #theme-toggle {
    top: 10px;
    right: 0;
    padding-right: 20px;
  }
}
