* {
  box-sizing: border-box;
    }

:root, .dark-mode {
    --bg-color: #1d1d1d;
    --element-color: #242424;
    --footer-color: #464646;
    --text-color: #fff;
    --text-shadow-color: #000;
    --button-text-color: #fff;
    --corner-rounding: 8px;
    --transition-speed: 0.3s;
    --text-color-h1: #9F76C6;
    --text-color-h2: #fff;
    --text-color-h3: #6D88F3;
    --color-1: #303d88;
    --button-highlight-color: #6ea86b;
    --navigation-color: #000;
}

.light-mode {
    --color-1: #acccb5;
    --button-highlight-color: #5e8137;
    --text-color: #000;
    --button-text-color: #000;
    --text-color-h1: #226940;
    --text-color-h2: #000;
    --text-color-h3: #59a153;
    --text-shadow-color: #fff;
    --bg-color: #ffffff;
    --element-color: #f8f4e2;
    --footer-color: #ece4ca;
    --navigation-color: #8ca86b;
}

.high-contrast-mode {
    --color-1: #ffff00;
    --button-highlight-color: #fff;
    --text-color: #fff;
    --text-shadow-color: #000;
    --button-text-color: #000;
    --text-color-h1: #ff0000;
    --text-color-h2: #fff;
    --text-color-h3: #ffe600;
    --bg-color: #000;
    --element-color: #000;
    --footer-color: #000;
    --navigation-color: #0000ff;
}

html, body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
    line-height: 1.7;
    font-size: large;
    z-index: 1;
    margin: 0; /* WHY IS THIS NEEDED WTF */
    min-height: 100dvh; /* so the footer stays at the bottom +the two lines below */
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

h1 {
    color: var(--text-color-h1);
}
h2 {
    color: var(--text-color-h2);
}
h3 {
    color: var(--text-color-h3);
}

button {
    padding: 30px 50px;
    background: var(--color-1);
    color: var(--button-text-color);
    border: none;
    border-radius: var(--corner-rounding);
    cursor: pointer;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(14px, 2vw, 18px);
    width: 100%;
}

button:hover {
    background: var(--button-highlight-color);
    color: #000;
    transform: scale(1.03);
}

/* Header */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--navigation-color);
    padding: 10px 20px;
}

.navbar-links {
  display: flex;
  flex: 1;
  gap: clamp(2px, 5vw, 9px);
}

.navbar-links a, .navbar-links button {
  flex: 1;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 20px;
  text-decoration: none; /* remove underline from links */
  color: var(--text-color); /* remove default link color */
  transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
  border-radius: var(--corner-rounding);
}

.navbar-links a:hover, .navbar-links button:hover {
  background-color: var(--button-highlight-color);
  color: #000;
  transform: scale(1.03);
}

/* Moblie hamburer menu button */
#hamburger-menu {
  display: none;
  background: none;
  border: none;
  height: 70px;
  padding: 0;
  color: var(--text-color);
}

/* Mobile menu (hidden by default) */
.mobile-menu {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: var(--navigation-color);
  overflow: hidden;
  z-index: 3;
}

/* Mobile menu links */
.mobile-menu a {
  padding: 20px 20px;
  text-decoration: none;
  color: var(--text-color);
  text-align: center;
}

/* Show the mobile menu when active */
.mobile-menu.active {
  display: flex;
}

/* Responsive styles */
@media (max-width: 700px) {
  .navbar-links {
    display: none; /* hide navbar on smaller screens */
  }

  #hamburger-menu {
    display: block; /* show hamburger menu on smaller screens */
  }
}

/* theme toggle */

#theme-toggle{
    background: none;
    color: var(--text-color);
    border: 2px solid var(--text-color);
    padding: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 110px;
    right: 20px;
    z-index: 75;
}

/* Page Header */

.page-header {
    text-align: center;
    margin: clamp(20px, 5vw, 50px) 20px;
}

.element-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
}

.element {
    background-color: var(--element-color);
    border-radius: var(--corner-rounding);
    padding: 10px clamp(20px, 5vw, 30px) 50px;
    margin: 50px;
    display: block;
    align-items: center;
}

@media (max-width: 700px) {
    .element-container {
        grid-template-columns: 1fr;
    }
}

/* homepage */

.homepage-grid {
    column-count: 4;
    column-gap: 20px;
    padding: 15px clamp(10px, 5vw, 80px) clamp(20px, 5vw, 80px);
    box-sizing: border-box;
}

.homepage-element {
    background-color: var(--element-color);
    border-radius: var(--corner-rounding);
    padding: 10px clamp(20px, 5vw, 30px) 50px;
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin-top: 15px;
  transition: transform var(--transition-speed) ease;
  border-radius: var(--corner-rounding); 
}

.video-wrapper:hover {
  transform: scale(1.03);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

@media (max-width: 1690px) {
    .homepage-grid {
        column-count: 3;
    }
}

@media (max-width: 1200px) {
    .homepage-grid {
        column-count: 2;
    }
}

@media (max-width: 735px) {
    .homepage-grid {
        column-count: 1;
    }
}


/* usts.html */


.project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 0 clamp(10px, 5vw, 80px);
  box-sizing: border-box;
}

.project-item {
  background: var(--element-color);
  border-radius: var(--corner-rounding);
  transition: transform var(--transition-speed) ease;
}

.project-item:hover {
  transform: translateY(-5px);
}

.project-title {
  color: var(--text-color-h3);
  text-align:center;
  font-size: 1.1em;
  word-break: break-word;
}

.project-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}

.project-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.download-button-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    margin-bottom: 6px;
}

.download-button {
    display: inline-block;
    white-space: nowrap;
    padding: 10px 20px;
    background: var(--color-1);
    color: var(--button-text-color);
    border-radius: var(--corner-rounding);
    text-decoration: none;
    text-align: center;
    align-self: center;
    transition: all var(--transition-speed) ease;
    text-wrap: wrap;
  word-break: break-word;
}


.download-button:hover {
    background: var(--button-highlight-color);
    color:#000;
    transform: scale(1.05);
}

@media (max-width: 1200px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .project-grid {
        grid-template-columns: 1fr;
    }
}

/* commissions.html */

.wide-button-container {
    width: 100%;
    height:400px;
    border-radius: var(--corner-rounding);
    padding: 15px clamp(20px, 5vw, 80px) clamp(20px, 5vw, 80px);
}

.wide-button-container button {
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wide-button-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.wide-button-content {
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
    /* ^ for wrod breaking */
    position: relative;
    z-index: 2;
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    color: white;
    text-shadow: 2px 3px black;
}


/*commissions/oto.html*/

.text-page-container {
    padding: 15px clamp(20px, 5vw, 80px) clamp(20px, 5vw, 80px);
}

/* about.html */

.about-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(20px, 5vw, 50px);
    text-align: center;
    word-break: break-word; /* necessary for software word or it breaks it all lmao */
    padding: 15px clamp(20px, 5vw, 80px) clamp(20px, 5vw, 80px);
}

.about-container > :nth-child(1),
.about-container > :nth-child(2) {
    grid-column: span 2;
}

.about-container > :nth-child(n + 3) {
    align-self: start;
    text-align: left;
    padding: 0 clamp(20px, 5vw, 30px) 10px;
}

.about-column {
    background-color: var(--element-color);
    padding: 30px;
    border-radius: var(--corner-rounding);
}

.about-column img {
    width: 100%;
    max-width: 800px;
    height: auto;
}

@media (max-width: 700px) {
    .about-container {
        grid-template-columns: 1fr;
    }

    .about-container > :nth-child(1),
    .about-container > :nth-child(2) {
        grid-column: span 1;
    }

    .about-container > :nth-child(n + 3) {
        text-align: center;
    }
}

/* Footer */

.footer {
    padding: 5px 20px;
    text-align: center;
    background-color: var(--footer-color);
    color: var(--text-color);
    position: relative;
    margin-top: auto;
}

.footer-container {
    display: flex;
    flex: wrap;
    justify-content: center;
    gap: 20px;
}

.footer-button {
    flex: 1;
    min-width: 150px;
    text-align: center;
}

.footer button {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  padding: 15px 20px;
  font-size: clamp(14px, 2vw, 16px);
}

@media (max-width: 600px) {
  .footer-container {
    flex-direction: column;
    align-items: center;
  }

  .footer-button {
    width: 100%;
  }
}