/* 
  Theme Name: Monden Theme Redesign (No-Build)
  Author: Kenji Monden (Assisted by AI)
  Description: Premium Architectural Portfolio
*/

:root {
  --bg-color: #ffffff;
  --text-color: #111111;
  --accent-color: #555555;
  --grid-gap: 4px;
  /* Tighter gap for architectural feel */
  --font-main: 'Yu Mincho', 'YuMincho', 'Hiragino Mincho ProN', 'HGS Mincho E', 'MS PMincho', 'MS Mincho', serif;
  --transition-speed: 0.4s;
  --modal-bg: rgba(0, 0, 0, 0.95);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main) !important;
  background-color: var(--bg-color);
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
  transition: opacity var(--transition-speed) ease;
}

a:hover {
  opacity: 0.6;
}

/* Utilities */
.wrapper {
  max-width: 1200px;
  /* Wider for modern screens */
  margin: 0 auto;
  padding: 0 40px;
}

/* Header */
#header {
  padding-top: 0;
  /* Removed padding as per user request */
  margin-bottom: 80px;
  position: relative;
}

.site-name {
  font-size: 0.9rem;
  /* Reduced from 1rem */
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 40px;
  text-transform: uppercase;
}

/* Marquee Container - kept for spacing if needed, or can be minimized */
.marquee-container {
  width: 100%;
  position: relative;
  margin-bottom: 60px;
  /* border-bottom: 1px solid #eee; Removed as per user request */
  padding-bottom: 20px;
  /* overflow: hidden; Removed to allow fixed element if needed, though fixed ignores this */
}

/* Floating Emojis - Random Movement */
.floating-emoji {
  display: block;
  font-size: 1.2rem;
  margin: 0;
  padding: 0;
  opacity: 0.8;
  filter: grayscale(100%) brightness(0%);
  /* Black silhouette */
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  /* Ensure visibility on top */
  pointer-events: none;
  z-index: 100;
  pointer-events: none;
  /* CSS Fallback Animation */
  animation: floatX 12s ease-in-out infinite alternate, floatY 17s ease-in-out infinite alternate;
}

.bicycle {
  animation-duration: 25s, 29s;
  /* Different prime numbers for randomness */
}

.house {
  animation-duration: 33s, 41s;
}

@keyframes floatX {
  0% {
    left: 0;
    transform: translateX(0);
  }

  100% {
    left: 100%;
    transform: translateX(-100%);
  }

  /* Move across width */
}

@keyframes floatY {
  0% {
    top: 0;
    transform: translateY(0);
  }

  100% {
    top: 100%;
    transform: translateY(-100%);
  }

  /* Move across height */
}

/* Removed linear animation keyframes as this is now JS driven */

/* Navigation / Description */
#navi .description {
  font-size: 0.85rem;
  /* Reduced from 0.95rem */
  color: #333;
  max-width: 800px;
  text-align: justify;
  margin-left: auto;
  /* Aligns block to right or left? kept left for reading */
  line-height: 1.8;
}

.social-links {
  list-style: none;
  padding: 0;
  margin: 20px 0 0 auto;
  display: flex !important;
  /* Force flex */
  flex-flow: row wrap !important;
  /* Force row, allow wrap if needed but keep horizontal flow */
  gap: 20px;
  justify-content: flex-end;
  font-size: 0.9rem;
  max-width: 800px;
}

.social-links li {
  display: inline-block;
  white-space: nowrap;
  /* Prevent text break within link */
}

/* Cleaned up corrupt block */

.social-links a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-bottom 0.3s;
}

.social-links a:hover {
  border-bottom: 1px solid currentColor;
}

/* Video Grid */
.works-section {
  padding-bottom: 100px;
}

.video-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 20px;
  align-items: center;
  justify-content: flex-start;
  /* Changed from center to avoid clipping left items */
  height: 60vh;
  width: 100%;
  overflow-x: auto;
  padding: 0 40px 20px 40px;
  /* Add padding to sides */

  /* Custom Scrollbar for Webkit */
  scrollbar-width: thin;
  /* Firefox */
  scrollbar-color: #ccc transparent;
  /* Firefox */
}

.video-grid::-webkit-scrollbar {
  height: 2px;
  /* Ultra-thin scrollbar */
}

.video-grid::-webkit-scrollbar-track {
  background: transparent;
}

.video-grid::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 0;
  /* Square ends */
}

.grid-item {
  position: relative;
  height: 100%;
  width: auto;
  flex: 0 0 auto;
  background-color: transparent;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: box-shadow 0.3s ease;
  line-height: 0;
}

/* Ensure link fills the container so video height % works */
.grid-item a {
  display: inline-block;
  /* Changed to inline-block/block to allow natural content flow */
  height: 100%;
  width: auto;
  position: relative;
}

.grid-item:hover {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
  z-index: 1;
}

.grid-item video,
.grid-item img {
  height: 100%;
  width: auto;
  object-fit: cover;
  /* Cover is fine if width is auto, behaves like contain */
  display: block;
  /* Aggressive scale to firmly crop top/bottom black bars - Reduced to 1.2 as per user request */
  transform: scale(1.2);
  transition: transform 0.4s ease;
}

/* Ensure videos have a default size before load to prevent collapse */
video {
  min-width: 10px;
}

/* On hover, maybe scale a bit more or reset? Let's keep the crop active but add movement */
.grid-item:hover video,
.grid-item:hover img {
  transform: scale(1.15);
  /* Slight zoom effect on hover */
}

.overlay-title {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 15px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.grid-item:hover .overlay-title {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
#footer {
  /* border-top: 1px solid #eaeaea; Removed as per user request */
  padding: 40px 0;
  font-size: 0.8rem;
  color: #888;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* align-items: center;  Configurable, default left but text is whatever */
}

/* Container for same-line elements */
.footer-row-relative {
  position: relative;
  width: 100%;
  height: 1.5em;
  /* Reserve height for text */
  overflow: hidden;
  margin-bottom: 5px;
}

/* Static Email Link */
.contact-link {
  margin: 0;
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 2;
  /* Bring text above marquee if they cross, or below? Usually text on top is better */
  /* If user wants side-by-side, marquee usually implies running independent. Let's start with overlay style similar to original */
}

/* Scrolling @ */
.footer-marquee {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  /* Or auto if we want it to travel distance */
  font-size: 0.8rem;
  /* Match footer text size */
  line-height: 1.6;
  /* Match body line height */
  white-space: nowrap;
  animation: footerMarquee 10s linear infinite;
  z-index: 1;
  color: #888;
}

@keyframes footerMarquee {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(-100%);
  }
}

/* Removed old .marquee-small */

/* Modal */
.modal {
  display: none;
  /* Hidden by default */
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-bg);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.is-open {
  display: flex;
  opacity: 1;
}

.modal-content {
  width: 90%;
  max-width: 1400px;
  max-height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content video {
  max-width: 100%;
  max-height: 90vh;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  outline: none;
}

.modal-close-btn {
  position: absolute;
  top: 30px;
  right: 40px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  /* Thinner weight for elegance */
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s;
}

.modal-close-btn:hover {
  transform: scale(1.1);
  color: #ddd;
}

/* Responsive */
@media (max-width: 768px) {
  .wrapper {
    padding: 0 20px;
  }

  .video-grid {
    grid-template-columns: 1fr;
    /* Full width on mobile */
  }

  .social-links {
    justify-content: flex-start;
    margin-left: 0;
    gap: 15px;
    font-size: 0.85rem;
  }

  .marquee-content {
    font-size: 3rem;
  }

  .site-name {
    font-size: 0.9rem;
    padding-left: 20px;
    /* Prevent clipping on left edge */
  }

  .grid-item:hover {
    transform: none;
    /* Disable hover lift on touch */
  }

  .overlay-title {
    opacity: 1;
    /* Always show title on mobile */
    transform: translateY(0);
    background: rgba(0, 0, 0, 0.6);
    /* Slightly more visible bg */
    padding: 10px;
  }
}