/* Import Google Fonts - Roboto */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

@layer utilities {
  .tap-highlight-transparent {
    -webkit-tap-highlight-color: transparent;
  }

  .smooth-edges {
    -webkit-backface-visibility: hidden;
  }

  .animate-wave {
    animation-name: wave;
    animation-duration: 2.5s;
    animation-iteration-count: infinite;
    transform-origin: 70% 70%;
    display: inline-block;
  }
  @keyframes wave {
    0% {
      transform: rotate(0deg);
    }
    10% {
      transform: rotate(14deg);
    }
    20% {
      transform: rotate(-8deg);
    }
    30% {
      transform: rotate(14deg);
    }
    40% {
      transform: rotate(-4deg);
    }
    50% {
      transform: rotate(10deg);
    }
    60% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(0deg);
    }
  }
}

/* Basic Reset & Color Scheme */
:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --link-hover-color: #0078d4;
    --tile-bg: #f0f0f0;
    --tile-border-color: #ddd;
    --tile-overlay-bg: rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --text-color: #ffffff;
        --link-hover-color: #bbbbbb;
        --tile-bg: #1e1e1e;
        --tile-border-color: #333333;
        --tile-overlay-bg: rgba(0, 0, 0, 0.7);
    }

    .logo {
        filter: invert(1);
    }
}

body, html {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

*, *:before, *:after {
    box-sizing: inherit;
}

/* Header */
.header {
    background-color: var(--bg-color);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2px 20px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    height: 90px;
}

h1 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 300;
    list-style: none;
    padding: 0;
}

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

/* Navigation */
.navbar {
    /* This element is now inside the header, so it doesn't need its own background or border. */
}

.nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    display: inline-block;
    margin-left: 20px;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    transition: color 0.3s;
    padding: 10px 15px;
    display: block;
}

.nav-link:hover, .nav-link.active {
    color: var(--link-hover-color);
}

.nav-item.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--bg-color);
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    list-style: none;
    padding: 5px 0;
    margin-top: 5px;
    border-radius: 5px;
    border: 1px solid var(--tile-border-color);
}

.dropdown-menu li a {
    color: var(--text-color);
    padding: 10px 20px;
    text-decoration: none;
    display: block;
    text-align: left;
}

.dropdown-menu li a:hover {
    background-color: var(--tile-overlay-bg);
}

.nav-item.dropdown:hover .dropdown-menu {
    display: block;
}

/* Main Content & Tiles */
.tile-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 20px auto;
}

.tile {
    position: relative;
    overflow: hidden;
    background-color: var(--tile-bg);
    text-decoration: none;
    display: block;
    aspect-ratio: 4 / 5;
    border-radius: 4px;
}

.tile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.tile:hover .tile-image {
    transform: scale(1.1);
}

.tile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    transition: background-color 0.4s ease;
}

.tile:hover .tile-overlay {
    background-color: transparent;
}

.tile-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 400;
}

.tile-subtitle {
    margin: 5px 0 0;
    font-size: 0.9rem;
    font-weight: 300;
    opacity: 0.9;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .tile-container {
        padding: 20px;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .nav-item {
        display: block;
        margin: 15px 0;
    }
    .tile-container {
        grid-template-columns: 1fr;
    }
}

/* Project Page Specifics */
.page-content {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px 40px;
}

.content-container .page-title {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 10px;
}

.content-container .project-tags {
    font-size: 1rem;
    color: #888;
    margin-bottom: 30px;
}

.content-container .main-image {
    width: 100%;
    height: auto;
    margin-bottom: 30px;
    border-radius: 4px;
}

.project-text p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    margin: 40px 0;
}

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

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.gallery-grid img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
    max-width: 100%; /* Ensure images don't exceed container width */
}

.project-credits {
    margin-top: 40px;
    font-style: italic;
    color: #666;
}

.project-credits a {
    color: #0078d4;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.image-gallery img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.project-section {
    margin-bottom: 50px;
}

.project-section h3 {
    font-size: 1.2rem;
    font-weight: 400;
    font-style: italic;
    color: #888;
    margin-bottom: 20px;
}

.text-right { text-align: right; }
.text-center { text-align: center; }

.project-text.small-text p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 2px;
}

.image-gallery.two-cols {
    grid-template-columns: repeat(2, 1fr);
}

.image-gallery.three-cols {
    grid-template-columns: repeat(3, 1fr);
}

.image-gallery.single-image {
    display: flex;
    justify-content: center;
}

.image-gallery.single-image.justify-end {
    justify-content: flex-end;
}

.image-gallery .img-w50 {
    max-width: 100%;
}

.image-gallery .img-w25-centered {
    width: 25%;
    margin: 0 auto;
    display: block;
}

.introvert-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
    margin-bottom: 30px;
}

.introvert-gallery figure {
    width: 100%;
    max-width: 900px;
    margin: 0;
}

.introvert-gallery img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.introvert-gallery figcaption {
    text-align: center;
    margin-top: 10px;
    font-style: italic;
    color: #888;
}

.text-center {
    text-align: center;
}

.columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.columns img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.media-text {
    display: flex;
    gap: 30px;
    align-items: center;
    margin: 40px 0;
}

.media-text .media-text-content {
    flex: 1;
}

.media-text .media-text-media {
    flex: 1;
}

.media-text img {
    width: 100%;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .media-text {
        flex-direction: column;
    }
}

@media (max-width: 900px) {
    .image-gallery.three-cols {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 600px) {
    .image-gallery.two-cols,
    .image-gallery.three-cols {
        grid-template-columns: 1fr;
    }
    .image-gallery .img-w50 {
        max-width: 100%;
    }
}

.square-crop {
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 350px;
  height: auto;
  object-fit: cover;
  object-position: bottom;
  display: block;
  margin: 0 auto;
}