html {
  overflow-x: clip;
}

html, body {
  margin: 0px;
  background: #f5f5f0;
  color: #333;
  font-family: 'Montserrat', sans-serif;
  padding-top: 0;
  max-width: 100%;
}

html {
  padding-top: 0;
}

/* ============================================
   SIDEBAR (desktop only)
   ============================================ */
.sidebar {
  display: none;
}

/* ============================================
   BRAND BAR (shared / mobile)
   ============================================ */
.brand-bar {
  position: relative;
  left: 0;
  width: 100%;
  z-index: 200;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;
  pointer-events: none;
  margin-bottom: 20px;
}

.brand-logo {
  height: 60px;
  width: auto;
  margin-right: 12px;
}

.brand {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px;
  letter-spacing: 2px;
  background: transparent;
  padding: 0 12px;
  display: flex;
  align-items: center;
  margin: 0;
  text-transform: lowercase;
  box-sizing: border-box;
  max-width: calc(100vw - 80px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ============================================
   HEADER NAV (mobile fallback)
   ============================================ */
header {
  width: 100%;
  z-index: 100;
  position: relative;
  background: transparent;
}

nav {
  display: flex;
  flex-direction: row;
  gap: 30px;
  justify-content: center;
  position: relative;
  z-index: 101;
  background: transparent;
  padding: 10px 0;
}

nav a {
  text-decoration: none;
  color: #333;
  font-size: 16px;
  transition: color 0.2s, border-bottom 0.2s;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding-bottom: 5px;
  border-bottom: 2px solid transparent;
}

nav a:hover {
  color: #666;
}

nav a.active {
  color: #F4A261;
  border-bottom: 2px solid #F4A261;
}

/* ============================================
   SPA SECTION TOGGLE
   ============================================ */
.page-section {
  display: none;
}

.page-section.active-section {
  display: block;
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */
.content-section {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 20px auto;
  padding: 20px 20px;
  box-sizing: border-box;
}

.section-inner {
  width: 100%;
}

.lighter {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 40px;
  box-sizing: border-box;
  background: #e8e8e0;
}

.highlight-row {
  display: flex;
  justify-content: space-between;
  gap: 50px;
  flex-wrap: wrap;
}

.highlight {
  text-align: center;
  min-width: 300px;
  width: 100%;
  max-width: 800px;
}

.reel-section {
  display: block;
}

.reel-project .description {
  margin-top: 10px;
  text-align: left;
}

.reel-project .project-title {
  text-align: left;
}

.reel-cta {
  text-align: center;
  margin-top: 30px;
}

.highlight iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: none;
}

.video-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  cursor: pointer;
  overflow: hidden;
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-thumbnail .play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 33%;
  aspect-ratio: 1;
  background: rgba(244, 162, 97, 0.3);
  border-radius: 50%;
  transition: background 0.2s;
}

.video-thumbnail .play-button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 55%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 30px 0 30px 50px;
  border-color: transparent transparent transparent rgba(255, 255, 255, 0.9);
}

.video-thumbnail:hover .play-button {
  background: rgba(244, 162, 97, 0.5);
}

.highlight h2 {
  font-size: 36px;
  margin-top: 15px;
}

.project {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto auto;
  gap: 10px 30px;
  max-width: 1000px;
  margin: 2rem auto;
  padding-bottom: 2rem;
  border-bottom: 2px solid #ddd;
}

.project:last-child {
  border-bottom: none;
}

.project .project-title {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 20px;
  text-align: left;
}

.project iframe,
.project .video-thumbnail {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: none;
}

.project .description {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  text-align: left;
}

.project .description p {
  line-height: 1.7;
  font-size: 14px;
  margin: 0;
}

.about {
  background: transparent;
  color: #333;
  margin: 0 auto 0 auto;
  max-width: 800px;
  padding: 0 50px 20px 50px;
  text-align: left;
  box-sizing: border-box;
  width: fit-content;
  border-radius: 16px;
}

.about-profile-pic {
  float: right;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 30px 16px 24px;
  shape-outside: circle(50%);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.about h2 {
  font-size: 32px;
  margin-bottom: 20px;
}

.about p {
  max-width: 800px;
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.6;
}

.cv {
  background: #e8e8e0;
  margin: 0 auto;
  max-width: 800px;
  padding: 20px 50px;
  text-align: left;
  box-sizing: border-box;
  width: 100%;
}

.cv h2 {
  font-size: 32px;
  margin-bottom: 20px;
}

.cv-profile-pic {
  display: block;
  margin: 50px auto 0 auto;
  max-width: 160px;
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.cv ul {
  list-style: none;
  padding: 0;
  max-width: 600px;
  margin: 0;
  text-align: left;
}

.cv li {
  font-size: 18px;
  margin-bottom: 10px;
  position: relative;
  padding-left: 20px;
}

.cv li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: #333;
}

.contact {
  text-align: left;
  margin: 0 0 20px 0;
  padding: 0 50px;
}

.contact-btn {
  display: inline-block;
  margin-top: 10px;
  font-size: 18px;
  text-decoration: none;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.contact-btn-primary {
  background: #333;
  color: #fff;
  border: 2px solid #333;
}

.contact-btn-primary:hover {
  background: #555;
  border-color: #555;
}

.contact-btn-secondary {
  color: #333;
  border: 2px solid #333;
  background: transparent;
}

.contact-btn-secondary:hover {
  background: #333;
  color: #f5f5f0;
}

.clients {
  background: #e8e8e0;
  color: #333;
  padding: 20px 50px;
  text-align: left;
  max-width: 800px;
  margin: 0 auto;
  box-sizing: border-box;
}

.clients h2 {
  font-size: 32px;
  margin-bottom: 20px;
}

.clients p {
  font-size: 18px;
  margin-bottom: 40px;
  line-height: 1.6;
}

.client-list-img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.portfolio-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 40px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 20px;
}

.tile {
  position: relative;
  aspect-ratio: 3 / 2;
  display: block;
  text-decoration: none;
  border-radius: 0;
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
}

.tile:hover {
  border: 2px solid #333;
}

.tile-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.tile-front {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.tile-front img {
  transition: filter 0.4s;
}

.tile:hover .tile-front img {
  filter: blur(3px) brightness(0.5);
}

.tile-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 25px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.4s;
  z-index: 2;
}

.tile:hover .tile-back {
  opacity: 1;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.4) 100%);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: opacity 0.4s;
}

.tile:hover .tile-overlay {
  opacity: 0;
}

.tile-title {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.tile-info {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  color: #fff;
  margin-top: auto;
}

.tile-info p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.tile:hover .tile-info {
  opacity: 0;
}

.tile-back h3 {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 10px 0;
  line-height: 1.3;
}

.tile-back p {
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  margin: 5px 0;
}

.tile-back .year {
  color: #F4A261;
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.copyright {
  text-align: center;
  font-size: 0.9rem;
  color: #888888;
  padding: 1rem 0;
  background-color: #f8f8f8;
  font-family: Arial, sans-serif;
}

.copyright strong {
  color: #000000;
}

/* ============================================
   MOBILE STYLES (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
  body {
    padding-top: 130px;
    padding-bottom: 0;
  }

  /* Hide sidebar on mobile */
  .sidebar {
    display: none !important;
  }

  /* Hide desktop header nav on mobile */
  nav {
    display: none;
  }

  .content-section,
  .lighter {
    margin-bottom: 100px;
  }

  .brand-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
    min-height: 60px;
    padding: 8px 8px 12px 8px;
    margin-bottom: 0;
    background: rgba(245, 245, 240, 0.98);
    z-index: 300;
  }

  .brand-logo {
    margin-right: 0;
    margin-bottom: 6px;
  }

  .brand {
    font-size: 16px;
    margin: 0 12px;
    text-align: center;
    word-break: break-word;
    white-space: pre-line;
    line-height: 1.2;
    display: block;
    text-transform: lowercase;
    max-width: calc(100vw - 32px);
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 8px;
  }

  header {
    display: none;
  }

  .lighter {
    padding: 20px 15px;
  }

  .reel-section {
    display: block;
    padding-top: 0;
    padding-bottom: 20px;
    overflow-x: hidden;
  }

  .reel-project {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .reel-project .video-thumbnail {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .video-thumbnail {
    width: 100%;
    max-width: 100%;
  }

  .reel-section .reel-cta {
    margin-top: 20px;
    padding-bottom: 0;
  }

  .reel-project .project-title {
    font-size: 20px;
  }

  .about-profile-pic {
    float: none;
    display: block;
    width: 120px;
    height: 120px;
    margin: 0 auto 16px auto;
    shape-outside: none;
  }

  .contact {
    padding: 0 15px;
    text-align: center;
  }

  .cv div[style] {
    text-align: center !important;
  }

  .project {
    display: flex !important;
    flex-direction: column !important;
    margin: 10px auto;
    gap: 6px;
    max-width: 100%;
    padding: 15px;
    text-align: left;
  }

  .project .project-title {
    font-size: 16px;
    margin: 0;
    text-align: left;
  }

  .project iframe,
  .project .video-thumbnail {
    aspect-ratio: 16/9;
    width: 100%;
    min-width: 100%;
  }

  .project .description {
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
    text-align: left;
    align-self: stretch;
  }

  .project .description p {
    font-size: 12px;
    margin-top: 0;
    margin-bottom: 10px;
    text-align: left;
  }

  .about {
    padding: 0 15px 20px 15px;
  }

  .about h2 {
    font-size: 22px;
  }

  .about p {
    font-size: 14px;
    margin-left: 0;
    margin-right: 0;
  }

  .cv {
    padding: 20px 15px;
  }

  .cv h2 {
    font-size: 22px;
    margin-left: 0;
    margin-right: 0;
  }

  .cv li {
    font-size: 14px;
  }

  .clients {
    padding: 20px 15px;
  }

  /* --- Top Navigation Bar (below brand bar) --- */
  .mobile-cube-nav {
    display: flex;
    flex-direction: row;
    position: fixed;
    top: 82px;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    z-index: 300;
    background: rgba(245, 245, 240, 0.98);
    border-bottom: 1px solid rgba(51, 51, 51, 0.2);
    padding: 8px 0;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    overflow: hidden;
  }

  .cube-toggle {
    width: auto;
    height: auto;
    background: transparent;
    color: #333;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 600;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none;
    border: none;
    transition: color 0.2s;
    padding: 5px 8px;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 1;
    min-width: 0;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  .cube-toggle:hover,
  .cube-toggle:active {
    color: #F4A261;
  }

  .cube-toggle.active {
    background: #F4A261;
    color: #fff;
    border-radius: 8px;
  }

  .portfolio-tiles {
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 30px;
    padding: 0 10px;
  }

  .tile-title {
    font-size: 18px;
  }

  .tile-info p {
    font-size: 13px;
  }
}

/* ============================================
   DESKTOP STYLES (min-width: 769px)
   ============================================ */
@media (min-width: 769px) {
  /* Hide mobile-only elements */
  .mobile-cube-nav {
    display: none;
  }

  .brand-bar {
    display: none;
  }

  header {
    display: none;
  }

  /* --- SIDEBAR --- */
  .sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 20vw;
    min-width: 220px;
    max-width: 300px;
    background: #f5f5f0;
    border-right: 1px solid rgba(51, 51, 51, 0.1);
    z-index: 500;
    padding: 40px 30px;
    box-sizing: border-box;
    overflow-y: auto;
  }

  .sidebar-brand {
    margin-bottom: 30px;
  }

  .sidebar-logo {
    display: block;
    height: 50px;
    width: auto;
    margin-bottom: 16px;
  }

  .sidebar-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: lowercase;
    color: #333;
    margin-bottom: 4px;
  }

  .sidebar-slogan {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
  }

  .sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 40px;
  }

  .sidebar-links a {
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 0;
    transition: color 0.2s;
  }

  .sidebar-links a:hover {
    color: #F4A261;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .sidebar-nav a {
    text-decoration: none;
    color: #333;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 12px 0;
    border-bottom: 1px solid rgba(51, 51, 51, 0.08);
    transition: color 0.2s, padding-left 0.2s;
  }

  .sidebar-nav a:hover {
    color: #F4A261;
    padding-left: 6px;
  }

  .sidebar-nav a.active {
    color: #F4A261;
  }

  /* --- MAIN CONTENT AREA --- */
  .content {
    margin-left: 20vw;
    min-height: 100vh;
  }

  @supports (min-width: max(220px, 20vw)) {
    .content {
      margin-left: max(220px, min(20vw, 300px));
    }
  }

  .lighter {
    max-width: none;
    padding: 40px 60px;
  }

  .reel-section {
    display: block;
  }

  .project.reel-project {
    display: flex;
    flex-direction: column;
  }

  .reel-project .video-thumbnail {
    width: 100%;
    min-width: 100%;
  }

  .mobile-only {
    display: none;
  }

  .reel-project .description {
    max-width: 900px;
  }

  .project {
    max-width: 100%;
  }

  .portfolio-tiles {
    max-width: none;
    padding: 0;
  }

  .about,
  .cv,
  .clients,
  .contact {
    max-width: 900px;
    margin-left: 0;
  }
}
