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

/* =========================
   Variables
   ========================= */
:root {
  --site-width: 1400px;
  --page-padding: 40px;
  --gutter: 24px;

  --bg: #ffffff;
  --panel: #111111;
  --video-bg: #9c0b0b;

  --text: #000000;
  --text-muted: rgba(255,255,255,0.7);

  --transition-fast: 0.25s;
  --header-height: 52px;

  --footer-height: 52px;
}

/* =========================
   Base
   ========================= */
body {
  font-family: Georgia, "Times New Roman", Times, serif;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("../assets/texture1.jpg");
  background-repeat: no-repeat;
  opacity: 0;
  background-size: 100%;
  pointer-events: none;
  z-index: -1;
}

button:focus,
a:focus {
  outline: none;
}

/* =========================
   Global Container
   ========================= */
.site-width {
  width: 100%;
  max-width: var(--site-width);
  margin: 0 auto;
  padding-left: var(--page-padding);
  padding-right: var(--page-padding);
}

/* =========================
   Header
   ========================= */
.site-header {
  width: 100%;
}

.site-header .site-width {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: 16px;
  padding-bottom: 16px;
}

.site-brand h1 {
  font-size: 1.4rem;
  font-style: bold;
}

.site-brand span {
  font-size: 0.9rem;
  display: block;
  margin-top: 1px;
  opacity: 0.7;
}

.site-nav {
  display: flex;
  gap: 32px;
  margin-top: 10px;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-style: italic;
}

/* Mobile Header: centered, menu below name */
@media (max-width: 768px) {
  .site-header .site-width {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .site-nav {
    width: 100%;
    display: flex;
    justify-content: space-evenly;
  }
}

/* =========================
   Footer
   ========================= */
.site-footer {
  width: 100%;
  background: #000000;
  color: rgba(236, 233, 233, 0.7)
}

.site-footer .site-width {
  padding-top: 40px;
  padding-bottom: 40px;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.7;
}

/* =========================
   Homepage
   ========================= */
.home {
  padding-bottom: 40px;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gutter);
}

/* landscape slot */
.project-tile.landscape {
  aspect-ratio: 16 / 9;
}

/* portrait pair container */
.portrait-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gutter);
  aspect-ratio: 16 / 9;
}

.project-tile.portrait {
  aspect-ratio: 9 / 16;
}

.project-tile {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.project-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--transition-fast);
}

.project-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity var(--transition-fast);
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: #ffffff;
}

.project-tile:hover img {
  opacity: 0.5;
}

.project-tile:hover .project-overlay {
  opacity: 1;
}

.video-runtime {
  position: absolute;
  top: 12px;
  right: 12px;

  font-size: 0.75rem;
  padding: 4px 8px;
}

/* =========================
   About Page
   ========================= */
.about-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  padding-top: 80px;
  padding-bottom: 80px;
}

.about-text {
  text-align: justify;
  line-height: 1.7;
}

.about-image {
  display: flex;
  justify-content: flex-start;
}

.about-image.about-image-right {
  justify-content: flex-end; /* right-align the image */
}

.about-image img {
  width: 100%;
  max-width: 420px;
  height: auto;
}

/* =========================
   Work Carousel
   ========================= */
.carousel {
    height: calc(
    100vh -
    var(--header-height) -
    var(--footer-height)
  );
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.carousel-section {
  height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
}

.carousel-layout {
  padding-top: calc(var(--header-height) + 12rem);
}

.video-container {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  width: 100%;
}

.video-frame,
.video-container iframe,
.video-container video {
  width: 100%;
  max-width: 1000px;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border: 0;
}

.video-meta {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.video-title {
  font-size: 1.5rem;
}

.video-category {
  font-size: 0.9rem;
  opacity: 0.7;
}

.video-description {
  line-height: 1.5;
}

.video-credits {
  opacity: 0.6;
  font-size: 0.9rem;
}

/* =========================
   Carousel Fixed Header
   ========================= */
.carousel-page .site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  /*background: rgba(54, 54, 54, 0.95);*/
}

.about-page .site-header {
    /*background: rgba(54, 54, 54, 0.95);*/
}

.carousel-page .site-header .site-width {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  padding-top: 16px;
  padding-bottom: 16px;
}

.carousel-page {
  padding-top: calc(var(--header-height) + 48px);
  height: 100vh;
  overflow: hidden;
}

.carousel-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;

  z-index: 100;
}

.carousel-footer small {
  display: block;

  width: 100%;
  max-width: var(--site-width);

  margin: 0 auto;

  padding: 16px var(--page-padding);

  opacity: 0.7;
  text-align: center;
}

/* =========================
   Responsive Pages
   ========================= */
@media (max-width: 768px) {
  :root {
    --page-padding: 20px;
  }

  .project-list {
    grid-template-columns: 1fr;
  }

  .about-container {
    grid-template-columns: 1fr;
  }

  .about-image img {
    max-width: 70vw;
  }

  .video-container {
    flex-basis: 65%;
  }
}

/* Make the site title link stay white and remove underline */
.site-brand a {
  text-decoration: none;
  color: inherit; /* keeps the h1 color */
}

/* Optional: enforce it even after being visited */
.site-brand a:visited {
  color: inherit;
}