/* 
beware: didn't clean this this up due to lack of time 
i intended i spend on this project. there will be some 
inconsistencies, redundancies and most likely some 
unintended behavior going on here. 
however, it might still be useful to be cannibalized if needed.
*/

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

/* colors & fonts */
:root {
  --bg-primary: #32343e;
  --bg-secondary: #282c30;
  --accent: #478d73;
  --accent-hover: #6ba95d;
  --text-primary: #e6f0ed;
  --text-secondary: #9fb3ad;
  --border-color: #3f5c57;
  --toggle-pulse-bg: rgba(255, 255, 255, 0.08);
  --toggle-hover-color: #5ba95d;
}
:root.light {
  --bg-primary: #f4f7f6;
  --bg-secondary: #e6ecea;
  --accent: #3f7f69;
  --accent-hover: #5fa04f;
  --text-primary: #1f2a2a;
  --text-secondary: #5f6f6c;
  --border-color: #c7d6d2;
  --toggle-pulse-bg: rgba(0, 0, 0, 0.08);
  --toggle-hover-color: #3f7f69;
}

body {
  font-family: "Roboto", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  padding-bottom: 2rem;
}

/* nav */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--bg-secondary);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.nav-links li a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  transition:
    transform 0.15s ease,
    color 0.15s ease;
}

.nav-links li a:hover {
  color: var(--accent-hover);
  transform: scale(1.02);
}

.nav-logo img {
  position: absolute;
  top: 8px;
  left: 35px;
  max-height: 45px;
  margin: 0;
  border-radius: 15%;
  opacity: 0.6;
}

.nav-logo-bright {
  filter: contrast(110%) brightness(2);
}

.hamburger {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.6rem;
}

/* color-mode toggle */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#themeToggle {
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-secondary);
  margin-top: -0.2em;
  border-radius: 8px;
  cursor: pointer;
  transition:
    color 0.1s ease,
    background 0.05s ease;
}

#themeToggle:hover {
  color: var(--toggle-hover-color);
  cursor: pointer;
  animation: pulseTheme 3.5s ease-in-out infinite;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  outline: 2px;
}

@keyframes pulseTheme {
  0% {
    background-color: var(--text-secondary);
  }
  50% {
    background-color: var(--toggle-pulse-bg);
  }
  100% {
    background-color: var(--text-secondary);
  }
}

@media (prefers-reduced-motion: reduce) {
  #themeToggle:hover {
    animation: none;
  }
}

/* content */
section {
  padding: 6rem 2rem;
  min-height: 100vh;
  margin-bottom: 20px;
}

.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.section-content {
  margin: 1.4em 0;

  p {
    font-size: 1.1em;
    margin: 0.8em 0;
  }
}

#sectionContact {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.about-container {
  margin: 0 auto;
  width: 60%;
}

.grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  column-gap: 1em;
  row-gap: 1em;
  margin: 1em 0;
  text-align: left;
}

/* lists */
dl {
  margin-top: 0.5em;
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 1em;
}

dl dd {
  padding-left: 2em;
  font-weight: 600;
}

.dl-item {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}

/* grids */
.grid-box {
  padding: 0.8em;
  background-color: var(--bg-secondary);
  border-radius: 4px;
}

grid-box.grid-sm {
  grid-template-columns: 1fr 1fr;
}

/* img */
.gallery-fig {
  display: flex;
  flex-direction: column;
}

.gallery-item {
  cursor: pointer;
}

figcaption {
  text-align: right;
  font-size: 14px;
  font-style: italic;
  padding-top: 5px;
  color: var(--text-secondary);
}

.contact-card {
  display: block;
  margin: 0.5em 0;
  font-size: 14px;
}

#contactIcons {
  margin: 0 0;
  margin-bottom: -6em;
}

.contact-card p {
  color: var(--text-primary);
}

.contact-card h3 {
  margin-bottom: 0.5em;
}

.contact-card a {
  text-decoration: none;
  font-weight: 600;
  color: var(--accent);
}

.contact-card form {
  text-align: left;
}

.contact-link {
  display: flex;
  align-items: center;

  img {
    margin-right: 5px;
  }
}

.contact-card img {
  height: 24px;
}

.social-icons {
  display: flex;
  padding-top: 1em;
  gap: 2.5em;
  justify-content: center;
}

.social-icons img {
  height: 28px;
}

#backToTop {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 0.8rem 1rem;
  font-size: 1.1em;
  font-weight: 600;
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    transform 0.2s ease;
}

#backToTop img {
  width: 36px;
  rotate: 180deg;
}

#backToTop:hover {
  transform: translateY(-2px);
  color: var(--accent-hover);
}

#backToTop.show {
  opacity: 0.8;
  visibility: visible;
}

.unstyled-link {
  text-decoration: none;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

#embeddedList li {
  list-style-type: square;
}

#videoContainer {
  margin-top: 1em;
}

@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
  100% {
    transform: translateY(0);
  }
}

.floating-link {
  color: var(--text-secondary);
  display: inline-block;
  margin-top: 2em;
  font-size: 1.4em;
  font-weight: 600;
  text-decoration: none;
  animation: float 1.5s ease-in-out infinite;
}

#double-arrow-start {
  width: 36px;
  padding-top: 0.5em;
}

.prev-section {
  margin-bottom: auto;
  padding-bottom: 1em;
}
.next-section {
  margin-top: auto;
  padding-top: 1em;
}

.section-arrow {
  width: 24px;
  opacity: 0.8;
  transition: transform 0.25s ease-in-out;
}
.section-arrow:hover {
  transform: translateY(2px);
}
.section-arrow.arrow-up {
  rotate: 180deg;
}

.hero h1,
h2,
h3 {
  color: var(--text-secondary);
}

.projects-table {
  width: 100%;
  border-collapse: collapse;
  margin: 3rem 0;
  font-size: 0.95rem;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.projects-table caption {
  caption-side: top;
  text-align: center;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.list-headline {
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* tables */
.projects-table thead,
tfoot {
  background: var(--accent);
  color: white;
}

.projects-table th,
.projects-table td {
  padding: 0.9rem 1.2rem;
  text-align: left;
}

.projects-table thead,
tfoot th {
  font-weight: 600;
  letter-spacing: 0.5px;
}

.projects-table thead th {
  text-align: center;
}

.projects-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s ease;
}

.projects-table .slot {
  background-color: #202326;
}

.projects-table #slotLunch {
  text-align: center;
  font-weight: 600;
  background-color: rgba(219, 219, 214, 0.239);
}

.projects-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.projects-table tbody tr:last-child {
  border-bottom: none;
}

.projects-table .projects-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.projects-table a {
  text-decoration: none;
  color: var(--accent);
  font-weight: 400;
  font-style: italic;
  font-size: 0.9em;
}

.projects-table tbody td {
  text-align: center;
}

.projects-table tbody tr td:last-child {
  font-style: oblique;
}

.diff-easy {
  color: green;
}

.diff-medium {
  color: yellow;
}

.diff-hard {
  color: red;
}

.projects-table tfoot td {
  text-align: right;
  font-weight: 600;
}

fieldset {
  margin: 1em 0;
  padding: 0.8em 0.8em;
  color: var(--text-primary);
  border-color: var(--border-color);
  border-radius: 8px;
}

fieldset legend {
  font-weight: 600;
}

.form-group {
  display: block;
}

.form-group input,
textarea {
  font-size: 14px;
  width: 100%;
  padding: 0.2em 0.2em;
  margin-top: 0.4em;
}

input,
textarea::placeholder {
  font-style: italic;
}

form button {
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  padding: 0.5em;
  border-radius: 4px;
}

form span {
  font-style: italic;
}

#formBtnContainer {
  display: flex;
  justify-content: space-between;
  margin-top: 1em;
}

#contact a:hover {
  color: var(--accent-hover);
}
ul li::marker,
ol li::marker {
  color: var(--accent);
  font-weight: 600;
}

#galleryTip {
  font-size: 14px;
  margin-top: 1.5em;
  margin-bottom: -1em;
  color: var(--text-secondary);
  justify-self: right;
}

/* lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
}

.lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.lightbox-close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #e6f0ed;
  /* color: var(--text-secondary); */
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
}

.lightbox-close:hover {
  opacity: 0.7;
}

.lightbox-image {
  width: 100%;
  height: 75vh;
  object-fit: cover;
}

.lightbox-image .image-placeholder {
  width: 100%;
  height: 100%;
  font-size: var(--font-size-2xl);
}

footer {
  padding: 0 2rem;
  margin-bottom: 0.6rem;
  text-align: center;
  /* min-height: 100vh; */
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .nav-menu {
    position: absolute;
    top: 65px;
    right: 3px;
    width: auto;
    background: var(--bg-secondary);
    padding: 0.8rem;
    border-radius: 0 0 12px 12px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    gap: 0.75rem;
  }

  #themeToggle {
    width: 100%;
    justify-content: center;
    display: flex;
    padding: 0.3rem 0.4rem;
    background: var(--bg-primary);
    opacity: 0.9;
  }

  #backToTop {
    bottom: 12px;
    right: 12px;
    font-size: 0.9em;
    opacity: 0.8;
  }

  .section-arrow {
    width: 20px;
  }

  #backToTop img {
    width: 28px;
  }

  .nav-links.active {
    display: flex;
  }

  .projects-table {
    overflow-x: auto;
  }
}

/* progress bar */
#scrollProgress {
  position: fixed;
  top: 60px;
  left: 0;
  height: 4px;
  width: 100%;
  background: var(--accent);
  opacity: 0.25;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.55;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.05s linear;
}

@media (prefers-reduced-motion: reduce) {
  #scrollProgress {
    transition: none;
  }
}
