/* © 2025 Johann Naudé. All rights reserved. */

:root {
  /* Color System */
  --background-color: #E8E8E8;
  --text-color: #FFFFFF;
  --body-background: #E8E8E8;

  /* Tiered Hover/Focus Scale System */
  --hover-scale-large: 1.05;   /* Large elements: buttons, cards */
  --hover-scale-medium: 1.05;  /* Medium elements: text links */
  --hover-scale-small: 1.1;    /* Small elements: icons */

  /* Active/Pressed State */
  --active-scale: 0.98;

  /* Transitions */
  --transition-transform: transform 0.1s ease-in-out;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  font-size: 100%;
  scroll-behavior: smooth;
  overscroll-behavior: none;
}

body {
  overflow-x: hidden;
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  background: var(--body-background);
}

h1 {
  font-family: 'VT323', monospace;
  font-weight: 400;
  font-style: normal;
  font-size: 2rem;
  margin: 0;
  line-height: 1;
  color: var(--text-color);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Header Styles */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 1rem;
  background-color: transparent;
  z-index: 1000;
}

/* Site logo link */
.site-logo {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-transform);
  color: var(--text-color);
}

.site-logo:hover {
  transform: scale(var(--hover-scale-small));
}

.site-logo:focus-visible {
  transform: scale(var(--hover-scale-small));
  outline: none;
}

.site-logo svg {
  display: block;
  width: 32px;
  height: 32px;
}

/* Portfolio Grid */
.portfolio-grid {
  background: var(--body-background);
  overflow: hidden;
}

.image-item {
  opacity: 0;
  transition: opacity 0.6s ease-out;
}

.image-item.visible {
  opacity: 1;
}

.image-item img {
  height: auto;
}

/* Video Item Styles */
.video-item {
  position: relative;
  cursor: pointer;
  background: #000000;
  aspect-ratio: 16/9;
  width: 100%;
  min-height: 0;
}

.thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.video-item:hover .play-button {
  transform: translate(-50%, -50%) scale(1.1);
  background-color: rgba(0, 0, 0, 0.8);
}

.play-button::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 15px 0 15px 25px;
  border-color: transparent transparent transparent #FFFFFF;
  margin-left: 5px;
}

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

/* Error States */
.thumbnail-error-message,
.video-error-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #FFFFFF;
  background: rgba(0, 0, 0, 0.8);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  max-width: 80%;
  font-size: 1.2rem;
  line-height: 1.5;
}

.thumbnail-error {
  background: #333333;
  min-height: 400px;
}

/* Responsive Design */
@media (max-width: 768px) {
  header {
    padding: 0.75rem;
  }

  h1 {
    font-size: 2rem;
  }

  .play-button {
    width: 60px;
    height: 60px;
  }

  .play-button::after {
    border-width: 12px 0 12px 20px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.6rem;
  }

  header {
    padding: 0.75rem;
  }

  .site-logo svg {
    width: 26px;
    height: 26px;
  }
}

/* Desktop styles */
@media (min-width: 769px) {
  h1 {
    font-size: 2rem;
  }
}