/* === Variables === */
:root {
  --color-primary: #2B5580;
  --color-secondary: #607080;
  --color-accent: #869CB3;
  --color-bg: #E5E5E5;
  --color-text: #1a1a1a;
  --color-white: #ffffff;
  --color-hr: #B0BEC5;
  --font-main: 'Verdana', 'Geneva', 'Arial', 'Helvetica', sans-serif;
  --thumb-size: 256px;
  --thumb-radius: 8px;
  --icon-size: 64px;
  --max-width: 1100px;
  --header-height: 60px;
}

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

/* === Base === */
body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}

img {
  max-width: 100%;
  height: auto;
  border: 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover, a:active {
  color: var(--color-text);
  text-decoration: underline;
}

hr {
  border: none;
  border-top: 1px solid var(--color-hr);
  margin: 16px 0;
}

/* === Layout === */
.site-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

main.site-container {
  padding-top: 10px;
}

/* === Header === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-hr);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 16px;
}

.header-title h1 {
  color: var(--color-primary);
  font-size: 28px;
  font-variant: small-caps;
  font-weight: normal;
  line-height: 1.2;
}

.header-title h2 {
  color: var(--color-secondary);
  font-size: 16px;
  font-variant: small-caps;
  font-weight: normal;
  line-height: 1.2;
}

/* === Navigation === */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-accent);
  color: var(--color-secondary);
  font-size: 22px;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
}

.nav-main {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-link {
  color: var(--color-secondary);
  font-size: 16px;
  font-variant: small-caps;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-link:hover {
  color: var(--color-text);
  text-decoration: none;
}

.nav-link--active {
  color: var(--color-text);
  border-bottom: 2px dotted var(--color-text);
}

/* === Sections === */
.section {
  margin: 32px 0;
  padding-top: 16px;
  border-top: 1px solid var(--color-hr);
}

.section:first-child {
  border-top: none;
  padding-top: 0;
}

.section h3 {
  color: var(--color-accent);
  font-size: 18px;
  font-variant: small-caps;
  font-weight: normal;
  text-align: center;
  margin-bottom: 20px;
}

/* === Icon Grid (media/game project icons) === */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(var(--icon-cols, 10), var(--icon-size));
  justify-content: center;
  gap: 10px;
}

.icon-grid a {
  display: block;
  flex-shrink: 0;
}

.icon-grid img {
  width: var(--icon-size);
  height: var(--icon-size);
  border-radius: 5px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.icon-grid img:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(43, 85, 128, 0.3);
}

/* === Gallery Grid (thumbnails) === */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  justify-items: center;
}

.gallery-item {
  position: relative;
  width: 100%;
  max-width: var(--thumb-size);
}

.gallery-item__link {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--thumb-radius);
  border: 1px solid var(--color-bg);
}

.gallery-item__img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--thumb-radius);
  transition: opacity 0.3s, filter 0.3s;
}

.gallery-item__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.gallery-item__overlay span {
  background-color: var(--color-primary);
  color: var(--color-white);
  font-size: 14px;
  text-align: center;
  padding: 6px 12px;
  line-height: 1.4;
}

.gallery-item__link:hover .gallery-item__img {
  opacity: 0.7;
  filter: grayscale(50%);
}

.gallery-item__link:hover .gallery-item__overlay {
  opacity: 1;
}

/* === Year Heading (inside gallery) === */
.year-heading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-accent);
  font-size: 18px;
  font-variant: small-caps;
  font-weight: normal;
  margin: 16px 0 4px;
}

/* === Filter Tabs (works page) === */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 24px 0;
}

.filter-tab {
  background: none;
  border: 1px solid var(--color-accent);
  color: var(--color-secondary);
  font-family: var(--font-main);
  font-size: 14px;
  font-variant: small-caps;
  padding: 6px 16px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.filter-tab:hover {
  background: var(--color-accent);
  color: var(--color-white);
}

.filter-tab--active {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

/* === About === */
.about-section {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  justify-content: center;
  margin: 32px 0;
}

.about-photo {
  max-width: 280px;
  border-radius: var(--thumb-radius);
}

.about-info {
  flex: 0 1 auto;
}

.about-label {
  color: var(--color-secondary);
  font-size: 16px;
  font-variant: small-caps;
  margin-top: 16px;
  margin-bottom: 4px;
}

.about-label:first-child {
  margin-top: 0;
}

.about-info p {
  margin-bottom: 4px;
  line-height: 1.8;
}

.about-info img {
  vertical-align: middle;
  margin-right: 4px;
}

.about-social-extra {
  display: flex;
  gap: 12px;
  align-items: center;
}

.about-social-extra img {
  width: 24px;
  height: 24px;
}

.underdash {
  border-bottom: 1px dashed var(--color-primary);
}

.underdash:hover {
  text-decoration: none;
  border-bottom-style: solid;
}

/* === Footer === */
.site-footer {
  text-align: center;
  padding: 24px 16px;
  margin-top: 32px;
  border-top: 1px solid var(--color-hr);
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.footer-social img {
  width: 28px;
  height: 28px;
  transition: transform 0.2s;
}

.footer-social a:hover img {
  transform: scale(1.15);
}

.footer-copy {
  font-size: 10px;
  color: var(--color-secondary);
}

/* === Lightbox === */
.lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox.active {
  display: flex;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  animation: lbZoom 0.3s ease;
}

.lightbox__caption {
  color: #aaa;
  text-align: center;
  padding: 12px 16px;
  max-width: 90vw;
  animation: lbZoom 0.3s ease;
}

.lightbox__caption a {
  color: #fff;
}

.lightbox__caption a:hover {
  color: #fff;
  text-decoration: underline;
  border-bottom: 1px dashed #fff;
}

.lightbox__close {
  position: absolute;
  top: 12px;
  right: 24px;
  background: none;
  border: none;
  color: #f1f1f1;
  font-size: 36px;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 1001;
}

.lightbox__close:hover {
  color: #aaa;
}

.lightbox__prev,
.lightbox__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #f1f1f1;
  font-size: 40px;
  cursor: pointer;
  padding: 16px;
  transition: color 0.2s;
  z-index: 1001;
}

.lightbox__prev { left: 8px; }
.lightbox__next { right: 8px; }

.lightbox__prev:hover,
.lightbox__next:hover {
  color: #aaa;
}

@keyframes lbZoom {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* === Utilities === */
.hidden { display: none !important; }

/* === Responsive === */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 8px 0;
  }

  .header-title h1 { font-size: 22px; }
  .header-title h2 { font-size: 14px; }

  .nav-toggle {
    display: block;
  }

  .nav-main {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 8px;
    padding: 8px 0;
  }

  .nav-main--open {
    display: flex;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
  }

  .about-section {
    flex-direction: column;
    align-items: center;
  }

  .about-photo {
    max-width: 200px;
  }

  .lightbox__prev,
  .lightbox__next {
    font-size: 28px;
    padding: 8px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1025px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
