/* ==== GLOBAL STYLES ==== */

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

body {
  background-color: #f1dcc8;
  color: #222;
  font-family: 'Comfortaa', sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

a {
  color: #a6dbe7;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==== BRAND CENTER ==== */
.brand-center {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  pointer-events: none;
}

.brand-center img {
  opacity: 0.15;
  width: 120px;
  height: auto;
}

/* ==== SOCIAL NAV ==== */

.social-nav {
  position: fixed;
  top: 1.5rem;
  right: 1rem;
  display: flex;
  gap: 0.75rem;
  z-index: 1000;
}

.social-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000;
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  text-decoration: none;
  transition: background-color 0.3s, transform 0.2s;
  padding: 0.25rem;
}

.social-nav a:hover {
  background-color: #444;
  transform: translateY(-2px);
}

.social-nav a svg {
  width: 20px;
  height: 20px;
  fill: white;
}

/* ==== MAIN MENU ==== */

.main-menu {
  position: fixed;
  top: 1.5rem;
  left: 1rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-weight: bold;
  font-size: 1.2rem;
  font-family: 'Comfortaa', sans-serif;
  z-index: 1000;
  flex-wrap: wrap;
}

.main-menu a {
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  color: #222;
  text-decoration: none;
  position: relative;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.main-menu a:hover {
  background-color: #a6dbe7;
  color: #555;
  border-color: #a6dbe7;
}

.main-menu > *:not(:last-child)::after {
  content: '•';
  position: absolute;
  right: -1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: #222;
}

/* ==== SUBMENU ==== */

.menu-item-with-submenu {
  position: relative;
}

.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  display: none;
  background-color: rgba(241, 220, 200, 0.95);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  padding: 0.5rem 0;
  min-width: 180px;
  z-index: 999;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.submenu a {
  display: block;
  padding: 0.6rem 1.2rem;
  color: #222;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
  border-radius: 6px;
}

.submenu a:hover {
  background-color: #a6dbe7;
  color: #333;
}

.menu-item-with-submenu:hover .submenu,
.menu-item-with-submenu:focus-within .submenu {
  display: block;
}

/* ==== FOOTER ==== */

.dream-footer {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Caveat', cursive;
  font-size: 1.8rem;
  letter-spacing: 0.5px;
  color: #444;
  opacity: 0;
  z-index: 100;
  animation: fadeInSoft 1.8s ease-out 0.5s forwards;
  pointer-events: none;
}

@keyframes fadeInSoft {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 0.8;
    transform: translateX(-50%) translateY(0);
  }
}

/* ==== CONTENT BOX ==== */

.content-box {
  max-width: 700px;
  width: calc(100% - 2rem);
  margin: 6rem auto 4rem;
  padding: 2rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Responsive video */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: 12px;
}

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

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

.portfolio-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8rem 1rem 6rem;
}

.portfolio-toolbar {
  position: sticky;
  top: 1rem;
  background: rgba(241, 220, 200, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  z-index: 950;
}

.portfolio-scroll {
  overflow-y: auto;
}

.portfolio-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.portfolio-filters a {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 2px solid #a6dbe7;
  color: #222;
  background: rgba(166, 219, 231, 0.2);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

.portfolio-filters a[aria-pressed="true"] {
  background: #a6dbe7;
  color: #333;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding-bottom: 3rem;
}

.portfolio-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.portfolio-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.portfolio-card iframe,
.portfolio-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border: 0;
}

.portfolio-card .card-body {
  padding: 1rem 1.25rem;
}

.portfolio-card h3 {
  margin: 0.5rem 0;
  font-size: 1.1rem;
}

.portfolio-card p {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: #666;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* ==== MOBILE STYLES ==== */

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  /* Hide brand center logo on mobile */
  .brand-center {
    display: none;
  }

  /* Compact horizontal menu at top on mobile */
  .main-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    font-size: 1rem;
    padding: 1.25rem 1rem;
    width: 100%;
    background: rgba(241, 220, 200, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 999;
  }

  .main-menu > *:not(:last-child)::after {
    content: '·';
    position: absolute;
    right: -0.9rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: #222;
  }

  .main-menu a {
    padding: 0.4rem 0.6rem;
    font-size: 0.95rem;
  }

  /* Submenu as overlay on mobile */
  .submenu {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    background: rgba(241, 220, 200, 0.98);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 0.75rem 0;
    min-width: 200px;
    max-width: 280px;
    z-index: 998;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .menu-item-with-submenu:hover .submenu,
  .menu-item-with-submenu:focus-within .submenu {
    display: block;
  }

  .submenu a {
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
  }

  /* Social icons below video, centered */
  .social-nav {
    position: fixed;
    top: auto;
    bottom: 8rem;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    gap: 0.75rem;
    z-index: 1001;
  }

  .social-nav a {
    width: 42px;
    height: 42px;
  }

  .social-nav a svg {
    width: 20px;
    height: 20px;
  }

  /* Content box centered vertically with top offset for fixed menu */
  .content-box {
    margin: 0 auto;
    padding: 1.5rem;
    width: calc(100% - 2rem);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 95%;
  }

  .dream-footer {
    font-size: 1.3rem;
    bottom: 1.5rem;
  }

  .portfolio-section {
    padding: 7rem 0.75rem 4rem;
  }

  .portfolio-toolbar {
    padding: 0.75rem;
  }

  .portfolio-filters a {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }

  .portfolio-grid {
    gap: 1rem;
  }
}

@media (min-width: 640px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .content-box {
    margin: 8rem auto 5rem;
  }
}

/* ==== PERFORMANCE OPTIMIZATIONS ==== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
