/* Global */
* { box-sizing: border-box; }
html,body { height: 100%; }
body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  background: #000;
  color: #fff;
  text-align: center;
  min-height: 100vh;
  padding-top: 64px; /* room for fixed navbar */
}

/* prevent horizontal overflow and remove side "black bar" */
html, body {
  overflow-x: hidden; /* hide any accidental horizontal overflow */
}

/* ensure all media and iframes can't exceed their containers */
img, video, iframe, .hero-img, .ui-mockup, .Illustration-img, .client-gallery img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* make main layout containers respect viewport */
.container, main, section {
  box-sizing: border-box;
  max-width: 100%;
  overflow-x: hidden;
}

/* if an absolutely positioned element is causing overflow, contain it */
.hero, .section {
  position: relative;
  overflow: hidden;
}

/* Navbar */
.navbar {
  width: 100%;
  background: rgba(34,34,34,0.85);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 64px;
  justify-content: space-between;
  position: relative;
}

.navbar-logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 1px;
  text-decoration: none !important;
  color: inherit !important;
  cursor: pointer;
}

.navbar-logo:hover,
.navbar-logo:focus {
  color: inherit !important;
  text-decoration: none !important;
  outline: none;
}

.navbar-links {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  align-items: center;
}

.navbar-links a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}

.navbar-links a:hover { color: #ffd700; }
.navbar-links a .fa-envelope { font-size: 1.2em; vertical-align: middle; }

/* Hamburger button (hidden on desktop) */
.navbar-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
}

/* Hero */
.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 32px 16px;
  position: relative;
}

.hero-img {
  width: 350px;
  max-width: 80%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  margin-top: 20px;
}

h1 { font-size: 48px; margin: 8px 0 4px; letter-spacing: 2px; text-transform: uppercase; }
h2 { font-size: 20px; margin: 0 0 12px; text-transform: uppercase; }
p { font-size: 0.95rem; color: #555; }

/* Galleries and media */
.ui-gallery { width: 100%; background: #000; padding: 40px 0; }
.ui-gallery h2 { color:#fff; font-size:1.4rem; margin-bottom:28px; }
.ui-gallery-row { display:flex; justify-content:center; gap:40px; flex-wrap:wrap; padding:0 12px; }
.ui-mockup { width:300px; max-width:90vw; border-radius:32px; box-shadow:0 4px 32px rgba(0,0,0,0.4); background:#222; }

.Illustration-gallery { display:flex; justify-content:center; gap:24px; flex-wrap:wrap; padding:0 12px; }
.Illustration-img, .Illustration-video { width:350px; max-width:90vw; object-fit:cover; }
.Illustration-gallery-large { display:flex; justify-content:center; margin-top:24px; }
.Illustration-video-large { width:900px; max-width:95vw; object-fit:cover; }

.client-gallery-img {
  width: auto;
  max-width: 90vw;
  height: auto;
  display:block;
  margin: 0 auto;
}

/* Responsive Figma prototype embeds */
.figma-prototype { width:100%; display:flex; justify-content:center; margin-bottom:20px; padding:0 12px; }
.figma-prototype iframe {
  width: 90vw;
  max-width: 900px;
  height: 56.25vw; /* 16:9 ratio by vw */
  max-height: 600px;
  border: 1px solid rgba(0,0,0,0.08);
}

/* Mobile / small screens */
@media (max-width: 700px) {
  .navbar-toggle { display: block; position: absolute; top: 14px; right: 18px; z-index: 210; }

  /* Use collapsible menu with max-height to avoid covering everything */
  .navbar-links {
    flex-direction: column;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    margin: 0;
    display: flex;
    position: absolute;
    top: 64px;
    left: 0;
    background: rgba(34,34,34,0.98);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    overflow: auto;
    max-height: 0;
    transition: max-height 260ms ease;
    z-index: 205;
  }
  .navbar-links.open { max-height: 70vh; } /* not full screen, allows page to be seen below */
  .navbar-links li { width:100%; text-align:left; }
  .navbar-links a { display:block; padding:8px 0; font-size:1rem; }

  /* Hero sizing */
  .hero-img { width: 90vw; max-width:220px; margin-top:12px; }
  h1 { font-size: 1.5rem; margin:6px 0 6px; }
  h2 { font-size: 1rem; margin-bottom:8px; }
  p { font-size: 0.95rem; padding: 0 4vw; }

  /* Galleries stack vertically */
  .ui-gallery-row, .Illustration-gallery { flex-direction:column; align-items:center; gap:18px; }
  .ui-mockup, .Illustration-img, .Illustration-video { width:90vw; max-width:360px; }
  .Illustration-video-large { width:98vw; max-width:420px; height:auto; }
  .client-gallery-img { width:72vw; max-width:260px; }

  /* Ensure prototypes scale nicely on phones (16:9 via vw) */
  .figma-prototype iframe { height: calc(90vw * 9 / 16); max-height: 420px; width: 90vw; }
}

/* Desktop override for large embeds */
@media (min-width: 700px) {
  .figma-prototype iframe { width: 800px; height: 450px; }
}

/* nav / dropdown helpers */
:root {
  --nav-height: 64px; /* adjust if navbar height differs */
  --nav-offset: calc(var(--nav-height) + 12px);
}

/* ensure anchors land below fixed nav */
section[id] {
  scroll-margin-top: var(--nav-offset);
}

/* dropdown styles (used by virtual-companion page) */
.navbar-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 12px; align-items: center; }
.navbar-links li { position: relative; }
.nav-dropdown .dropbtn {
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 6px 8px;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #fff;
  color: #222;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  border-radius: 6px;
  min-width: 180px;
  z-index: 120;
  padding: 6px 0;
}
.dropdown-menu li { margin: 0; }
.dropdown-menu a {
  display: block;
  padding: 8px 12px;
  color: inherit;
  text-decoration: none;
}
.dropdown-menu a:hover { background: rgba(0,0,0,0.05); }

/* optional: smooth scroll behavior for the whole page */
html { scroll-behavior: smooth; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  text-align: left;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  align-items: start;
}

/* tighten prototype caption */
.figma-prototype figcaption {
  margin-top: 8px;
  text-align: center;
  font-size: 0.95rem;
}
.figma-prototype figcaption a { color: #333; text-decoration: underline; }

.hidden-prototypes {
  display: none !important;
}

/* Remove dark frames/backgrounds around UI images and their containers */
.ui-gallery, .ui-gallery .container,
.grid.ui-gallery-row, .ui-gallery-row,
.ui-gallery .ui-mockup, .ui-gallery img,
.client-gallery, .client-gallery img,
.Illustration-gallery, .Illustration-img {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
}

/* Ensure images themselves display without extra styling */
.ui-gallery img,
.client-gallery img,
.Illustration-img,
.ui-mockup img {
  display: block;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

/* If a wrapper element is adding a background via pseudo-elements */
.ui-gallery .ui-mockup::before,
.ui-gallery .ui-mockup::after,
.client-gallery::before,
.client-gallery::after {
  background: transparent !important;
  content: none !important;
}

/* Make all pages/sections dark except the first (hero) */
body {
  background: #000;
  color: #fff;
}

/* default section styling: dark background with light text */
section {
  background: #000;
  color: #fff;
}

/* keep the first page (hero) light */
#hero, .hero {
  background: #fff;    /* or use an image as before */
  color: #111;         /* dark text for hero */
}

/* ensure in-page anchors still respect hero override */
#hero * { color: inherit; }

/* images and galleries keep transparent background so files show correctly */
.section img,
.ui-gallery img,
.Illustration-img,
.client-gallery img {
  background: transparent !important;
  box-shadow: none !important;
}

/* links contrast on dark sections */
section a {
  color: #9dd3ff;
  text-decoration: underline;
}
#hero a { color: inherit; text-decoration: none; }

#ux,
section#ux,
#clients,
section#clients {
  background: #ffffff !important;
  color: #111111 !important;
}

/* ensure links and small UI inside those sections are readable */
#ux a,
#clients a {
  color: #0066cc;
  text-decoration: underline;
}

/* keep images transparent so GIFs/PNGs show correctly */
#ux img,
#clients img {
  background: transparent !important;
  box-shadow: none !important;
}

/* scroll chevron in hero */
.scroll-down {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  z-index: 120;
  color: inherit;
}

/* large chevron without tail, fade/blink animation */
.chevron-icon {
  display: block;
  width: 72px;
  height: 72px;
  line-height: 1;
  color: inherit;
  animation: chevronFade 2s ease-in-out infinite;
  will-change: opacity, transform;
  -webkit-backface-visibility: hidden;
}

/* fade / slight move / subtle scale */
@keyframes chevronFade {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  50%  { opacity: 0.15; transform: translateY(6px) scale(1.03); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .chevron-icon { animation: none; opacity: 1; }
}

.ui-gallery .container {
  display: flex;
}

/* Center three UI images with equal horizontal spacing; middle image sits at page center */
.grid.ui-gallery-row,
.ui-gallery-row {
  display: flex;
  flex-wrap: nowrap;               /* <-- no wrapping, keep a single row */
  justify-content: space-between;
  align-items: center;
  gap: 24px;                       /* spacing fallback */
  max-width: 1200px;                /* container width — adjust as needed */
  margin: 0 auto;                  /* center the whole row in the page */
  padding: 0 16px;
  box-sizing: border-box;
  overflow-x: auto;               /* allow horizontal scroll on very small screens */
}

/* let each image shrink properly without forcing wrap */
.ui-gallery-row img,
.ui-gallery .ui-mockup {
  flex: 1 1 0;                     /* share available space and shrink if needed */
  min-width: 0;                    /* allows flex items to shrink below intrinsic size */
  max-width: 33.333%;              /* visually cap each to ~1/3 of the row */
  width: 33.333%;
  height: auto;
  object-fit: contain;
  display: block;
}

/* UI Work header on its own centered line, images row directly below */
section#ui .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
}

/* force a single row and distribute the three images evenly across the full row */
.grid.ui-gallery-row,
.ui-gallery-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between; /* evenly distribute space between items */
  align-items: center;
  width: 100%;
  max-width: 1200px;              /* change this to control how wide the row can grow */
  margin: 0 auto;
  padding: 0 32px;                /* page side padding */
  box-sizing: border-box;
}

/* keep each image the same visual size so middle one sits centered */
.ui-gallery-row img,
.ui-gallery .ui-mockup {
  flex: 0 1 30%;                  /* each image takes ~30% of the row and can shrink */
  max-width: 33.333%;
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
  object-fit: contain;
}

/* small screens: allow horizontal scroll rather than wrapping */
@media (max-width: 760px) {
  .grid.ui-gallery-row,
  .ui-gallery-row {
    overflow-x: auto;
    gap: 16px;
    padding: 0 12px;
  }
  .ui-gallery-row img,
  .ui-gallery .ui-mockup {
    flex: 0 0 280px;
    max-width: none;
  }
}

/* Responsive: stack on small screens */
@media (max-width: 800px) {
  .grid.ui-gallery-row,
  .ui-gallery-row {
    flex-direction: column;
    gap: 16px;
    align-items: center;
    max-width: 100%;
    padding: 0 12px;
  }
  .ui-gallery-row img,
  .ui-gallery .ui-mockup {
    flex: 0 0 auto;
    max-width: 92%;
  }
}