/* ===========================================
   HomeSpace - Main Stylesheet
   https://homespace.mu
   =========================================== */

:root {
      --bg-primary: #121212;
      --bg-secondary: #1a1a1a;
      --gold: #D4AF37;
      --gold-soft: #E9CD6F;
      --text-light: #F5F5F5;
      --text-muted: #CCCCCC;
    }
    * { box-sizing: border-box; }
    html, body {
      margin: 0;
      padding: 0;
      background-color: #000;
      color: var(--text-light);
      font-family: 'Poppins', system-ui, sans-serif;
      overflow-x: hidden;
    }
    html {
      height: 100%;
      height: -webkit-fill-available;
    }
    body { 
      min-height: 100vh;
      min-height: 100dvh;
      min-height: -webkit-fill-available;
    }
    a { color: inherit; text-decoration: none; }

    /* Preloader */
    #preloader {
      position: fixed;
      inset: 0;
      background: #000;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 9999;
      transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    #preloader.hidden {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }
    #preloaderInner {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1rem;
    }
    #preloaderInner img {
      width: 120px;
      height: auto;
    }
    .preloader-dot {
      width: 7px;
      height: 7px;
      border-radius: 999px;
      background: var(--gold);
      animation: preloaderPulse 0.9s infinite ease-in-out;
    }
    @keyframes preloaderPulse {
      0%, 100% { transform: scale(0.9); opacity: 0.3; }
      50% { transform: scale(1.25); opacity: 1; }
    }

    /* === GLOBAL HEADER & MENU === */
    #header {
      position: fixed;
      inset-inline: 0;
      top: 0;
      z-index: 50;
      padding: 1.2rem 2.6rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0) 100%);
      pointer-events: none;
    }
    #header > * {
      pointer-events: auto;
    }
    #header .logo img {
      height: 40px;
      width: auto;
      display: block;
    }

    .menu-button {
      border-radius: 999px;
      border: 1px solid rgba(212, 175, 55, 0.8);
      background: rgba(0, 0, 0, 0.55);
      color: var(--text-light);
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      font-size: 0.7rem;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      cursor: pointer;
      padding: 0.38rem 0.9rem 0.42rem;
      pointer-events: auto !important;
      position: relative;
      z-index: 100;
    }
    .menu-button:hover {
      background: rgba(0,0,0,0.85);
      border-color: var(--gold-soft);
    }

    .menu-icon-lines {
      display: inline-flex;
      flex-direction: column;
      gap: 4px;
    }
    .menu-icon-lines span {
      width: 18px;
      height: 2px;
      border-radius: 1px;
      background: var(--gold-soft);
      transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .menu-label {
      font-size: 0.7rem;
      letter-spacing: 0.2em;
      text-transform: uppercase;
    }

    #menuOverlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.96);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 60;
    }
    #menuOverlay.open {
      display: flex;
    }
    #menuCloseBtn {
      position: absolute;
      top: 1.2rem;
      right: 2.6rem;
      background: transparent;
      border: none;
      color: var(--text-light);
      font-size: 1.6rem;
      cursor: pointer;
      padding: 0.5rem;
      line-height: 1;
      transition: color 0.2s ease;
    }
    #menuCloseBtn:hover {
      color: var(--gold-soft);
    }
    @media (max-width: 768px) {
      #menuCloseBtn {
        right: 1.4rem;
      }
    }
    #menuOverlayInner {
      margin: auto;
      max-width: 960px;
      width: 100%;
      padding: 2rem;
      display: grid;
      grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
      gap: 3rem;
    }
    #menuOverlay h2 {
      font-size: 0.85rem;
      letter-spacing: 0.28em;
      text-transform: uppercase;
      margin-bottom: 1.4rem;
      color: var(--gold-soft);
    }
    #menuOverlay nav a {
      display: flex;
      align-items: baseline;
      gap: 0.7rem;
      padding: 0.45rem 0;
      color: var(--text-light);
      border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    #menuOverlay nav a:last-child {
      border-bottom: none;
    }
    #menuOverlay nav a .code {
      font-size: 0.75rem;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: var(--gold-soft);
    }
    #menuOverlay nav a .label {
      font-size: 1.05rem;
      font-weight: 500;
    }
    #menuOverlay nav a:hover {
      color: var(--gold-soft);
    }
    #menuOverlay .meta {
      font-size: 0.85rem;
      color: var(--text-muted);
    }
    #menuOverlay .meta a {
      color: var(--gold-soft);
    }

    /* HERO SECTION */
    #hero {
      position: relative;
      width: 100%;
      height: 100vh;
      height: 100dvh;
      background: #000;
      overflow: hidden;
      z-index: 1;
    }
    .hero-inner {
      position: relative;
      width: 100%;
      height: 100%;
      z-index: 1;
    }
    .hero-slide {
      position: absolute;
      inset: 0;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.6s ease;
    }
    .hero-slide.active {
      opacity: 1;
      pointer-events: auto;
    }
    .hero-media {
      position: absolute;
      inset: 0;
      overflow: hidden;
    }
    .hero-media::after {
      content: "";
      position: absolute;
      inset: 0;
      background: rgba(0, 0, 0, 0.03);
      z-index: 1;
      pointer-events: none;
    }
    .hero-media video,
    .hero-media img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center center;
      display: block;
    }
    .hero-media .stream-iframe {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      border: none;
      z-index: 0;
      pointer-events: none;
      object-fit: cover;
    }
    
    /* Desktop: scale iframe to cover entire viewport */
    @media (min-width: 769px) {
      .hero-media .stream-iframe {
        top: 50%;
        left: 50%;
        width: 100vw;
        height: 56.25vw; /* 16:9 aspect ratio */
        min-height: 100vh;
        min-width: 177.78vh; /* 16:9 aspect ratio */
        transform: translate(-50%, -50%);
      }
    }

    /* Full video option - shows entire video without cropping */
    .hero-media.video-full .stream-iframe {
      width: 100%;
      height: 100%;
      min-width: unset;
      min-height: unset;
      object-fit: contain;
    }

    /* Better image focus on mobile */
    @media (max-width: 768px) and (orientation: portrait) {
      .hero-media img,
      .hero-media video {
        object-position: center 30%;
      }
    }
    .hero-gradient {
      position: absolute;
      inset: 0;
      background:
        linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 15%),
        rgba(0,0,0,0.10);
      z-index: 2;
    }
    .hero-text {
      position: absolute;
      left: 6vw;
      bottom: 20vh;
      max-width: 520px;
      z-index: 15;
      text-shadow: 0 12px 35px rgba(0,0,0,0.85);
    }
    .hero-text .project-num {
      font-size: 0.72rem;
      letter-spacing: 0.22em;
      text-transform: uppercase;
      color: var(--gold-soft);
      margin-bottom: 0.4rem;
    }
    .hero-text .project-name {
      font-family: 'Playfair Display', serif;
      font-weight: 500;
      font-size: clamp(2.4rem, 4.5vw, 3.6rem);
      line-height: 1.05;
      color: #FFFFFF;
    }
    .hero-text .location {
      margin-top: 0.5rem;
      font-size: 0.9rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: #E2E2E2;
    }
    .hero-buttons {
      margin-top: 1.6rem;
      display: flex;
      flex-wrap: wrap;
      gap: 1.8rem;
    }
    .hero-buttons a {
      font-size: 0.78rem;
      text-transform: uppercase;
      letter-spacing: 0.18em;
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      color: var(--gold-soft);
      transition: color 0.2s ease, opacity 0.2s ease;
    }
    .hero-buttons a:hover {
      color: var(--gold-soft);
    }
    .hero-buttons a i {
      font-size: 0.9rem;
      transition: transform 0.2s ease;
    }
    .hero-buttons a:hover i {
      transform: translateX(3px);
    }

    /* CENTERED SCROLLER - between text and bottom bar */
    .hero-scroller {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 10vh;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 1.2rem;
      z-index: 20;
      pointer-events: auto;
    }
    .hero-scroller .hero-nav-arrow {
      font-size: 1.8rem;
      padding: 0.4rem 0.8rem;
      pointer-events: auto;
      cursor: pointer;
    }
    
    /* Progress Dots */
    .hero-dots {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .hero-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: rgba(255,255,255,0.3);
      cursor: pointer;
      transition: all 0.3s ease;
    }
    .hero-dot:hover {
      background: rgba(255,255,255,0.6);
    }
    .hero-dot.active {
      background: var(--gold-soft);
      width: 24px;
      border-radius: 4px;
    }

    /* BOTTOM BAR - contact left, social right */
    .hero-bottom-bar {
      position: absolute;
      inset-inline: 2.6rem;
      bottom: 1.5rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      z-index: 20;
      font-size: 0.8rem;
      color: var(--text-muted);
    }
    .hero-bottom-left {
      display: flex;
      align-items: center;
    }
    .hero-bottom-link {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
    }
    .hero-bottom-link:hover {
      color: var(--gold-soft);
    }
    .hero-bottom-right {
      display: flex;
      align-items: center;
    }
    .hero-bottom-social {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      font-size: 0.72rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--text-muted);
      transition: color 0.2s ease;
    }
    .hero-bottom-social:hover {
      color: var(--gold-soft);
    }
    .hero-nav-arrow {
      border: none;
      background: transparent;
      color: #F5F5F5;
      cursor: pointer;
      font-size: 1.4rem;
      padding: 0.1rem 0.4rem;
      position: relative;
      z-index: 10;
    }
    .hero-nav-arrow:hover {
      color: var(--gold-soft);
    }
    .hero-bottom-line {
      width: 120px;
      height: 1px;
      background: rgba(255,255,255,0.45);
    }
    /* Responsive tweaks */
    @media (max-width: 900px) {
      .hero-text {
        left: 1.6rem;
        right: 1.6rem;
        bottom: 18vh;
        max-width: none;
      }
      .hero-bottom-bar {
        inset-inline: 1.6rem;
      }
    }

    /* Mobile: clean burger icon only */
    @media (max-width: 768px) {
      #header {
        padding: 1rem 1.4rem;
      }
      #menuOverlayInner {
        grid-template-columns: 1fr;
        gap: 1.75rem;
        padding: 1.6rem 1.4rem;
      }
      .menu-label {
        display: none;
      }
      .menu-button {
        border: none;
        background: transparent;
        padding: 0.5rem;
        border-radius: 0;
      }
      .menu-button:hover {
        background: transparent;
      }
      .menu-icon-lines {
        gap: 5px;
      }
      .menu-icon-lines span {
        width: 22px;
        height: 2px;
        background: var(--text-light);
      }
      #hero, .hero-inner {
        min-height: 100vh;
        min-height: 100dvh;
        height: 100dvh;
      }
      /* Full coverage video on mobile */
      .hero-media .stream-iframe {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        min-width: 177.78dvh;
        min-height: 56.25vw;
        transform: translate(-50%, -50%);
      }
      .hero-text {
        bottom: 14vh;
        left: 1.4rem;
        right: 1.4rem;
      }
      .hero-text .project-name {
        font-size: clamp(1.6rem, 6.5vw, 2.2rem);
        line-height: 1.15;
      }
      .hero-text .location {
        font-size: 0.75rem;
        margin-top: 0.4rem;
      }
      /* Larger touch targets for buttons */
      .hero-buttons {
        gap: 0.8rem;
        flex-direction: column;
        align-items: flex-start;
      }
      .hero-buttons a {
        font-size: 0.8rem;
        padding: 0.75rem 1.2rem;
        background: rgba(0,0,0,0.5);
        border: 1px solid rgba(212, 175, 55, 0.6);
        border-radius: 4px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
      }
      .hero-scroller {
        bottom: 4.5rem;
        gap: 0.8rem;
      }
      .hero-dots {
        gap: 6px;
      }
      .hero-dot {
        width: 6px;
        height: 6px;
      }
      .hero-dot.active {
        width: 18px;
      }
      /* Larger arrow touch targets */
      .hero-scroller .hero-nav-arrow {
        font-size: 1.5rem;
        padding: 0.6rem 0.8rem;
        min-width: 44px;
        min-height: 44px;
      }
      .hero-bottom-bar {
        bottom: 1.2rem;
        inset-inline: 1.4rem;
      }
    }

    @media (max-width: 480px) {
      .hero-text {
        bottom: 16vh;
      }
      .hero-text .project-num {
        font-size: 0.65rem;
      }
      .hero-text .project-name {
        font-size: clamp(1.4rem, 6vw, 1.8rem);
      }
      .hero-buttons a {
        font-size: 0.75rem;
        padding: 0.65rem 1rem;
      }
      .hero-scroller {
        bottom: 4rem;
        gap: 0.5rem;
      }
      .hero-dots {
        gap: 4px;
      }
      .hero-dot {
        width: 5px;
        height: 5px;
      }
      .hero-dot.active {
        width: 14px;
      }
      .hero-scroller .hero-nav-arrow {
        font-size: 1.3rem;
        padding: 0.5rem 0.6rem;
      }
      .hero-bottom-link span,
      .hero-bottom-social span {
        font-size: 0.6rem;
        letter-spacing: 0.06em;
      }
    }

    /* ===========================================
       FOOTER STYLES
       =========================================== */
    footer {
      background: var(--bg-secondary);
      border-top: 1px solid rgba(255,255,255,0.06);
      padding: 2.5rem 2rem;
      text-align: center;
    }
    footer p {
      font-size: 0.82rem;
      color: #888888;
      margin: 0;
    }
    footer a {
      color: var(--gold-soft);
      transition: color 0.2s ease;
    }
    footer a:hover {
      color: var(--gold);
    }

    @media (max-width: 480px) {
      footer {
        padding: 2rem 1.4rem;
      }
      footer p {
        font-size: 0.75rem;
      }
    }

    /* ===========================================
       ACCESSIBILITY & UX IMPROVEMENTS
       =========================================== */
    /* Focus states for keyboard navigation */
    a:focus-visible,
    button:focus-visible {
      outline: 2px solid var(--gold-soft);
      outline-offset: 2px;
    }

    /* Smooth scrolling */
    html {
      scroll-behavior: smooth;
    }

    /* Better touch targets on mobile */
    @media (max-width: 768px) {
      #menuOverlay nav a {
        padding: 0.75rem 0;
        min-height: 48px;
        display: flex;
        align-items: center;
      }
    }

    /* Skip to content link for accessibility */
    /* ===========================================
       PROJECT PAGE STYLES
       =========================================== */
    
    /* Project identifier bar */
    .project-bar {
      position: fixed;
      top: 70px;
      left: 0;
      right: 0;
      background: transparent;
      padding: 0 2.6rem;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 0.5rem;
      font-size: 0.68rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: rgba(255,255,255,0.7);
      z-index: 45;
      text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    }
    .project-bar a {
      color: rgba(255,255,255,0.7);
      transition: color 0.2s ease;
    }
    .project-bar a:hover {
      color: var(--gold-soft);
    }
    .project-bar .separator {
      color: var(--gold-soft);
      opacity: 0.7;
    }
    .project-bar .current {
      color: var(--gold-soft);
      font-weight: 500;
    }

    @media (max-width: 768px) {
      .project-bar {
        top: 55px;
        padding: 0 1.4rem;
        font-size: 0.58rem;
      }
    }

    /* Project tagline and CTA */
    .hero-text .project-tagline {
      margin-top: 0.8rem;
      font-size: 0.9rem;
      max-width: 460px;
      color: #E0E0E0;
      line-height: 1.5;
    }
    .hero-text .cta {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      margin-top: 1rem;
      padding: 0.75rem 1.5rem;
      font-size: 0.78rem;
      text-transform: uppercase;
      letter-spacing: 0.15em;
      color: var(--bg-primary);
      background: var(--gold-soft);
      font-weight: 600;
      text-decoration: none;
      pointer-events: auto;
      border-radius: 4px;
      transition: all 0.2s ease;
    }
    .hero-text .cta:hover {
      background: var(--gold);
      transform: translateY(-2px);
      box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    }
    .hero-text .cta i {
      font-size: 0.9rem;
      transition: transform 0.2s ease;
    }
    .hero-text .cta:hover i {
      transform: translateX(3px);
    }

    /* Click hint for image slides */
    .click-hint {
      position: absolute;
      bottom: 1rem;
      right: 1rem;
      display: flex;
      align-items: center;
      gap: 0.4rem;
      color: rgba(255,255,255,0.7);
      font-size: 0.7rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      z-index: 3;
      pointer-events: none;
    }
    .click-hint i {
      font-size: 0.85rem;
    }

    /* Image Modal */
    #mediaModal {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.92);
      display: none;
      align-items: center;
      justify-content: center;
      padding: 1.5rem;
      z-index: 70;
    }
    #mediaModal.open {
      display: flex;
    }
    #mediaModalInner {
      position: relative;
      width: 100%;
      max-width: 1200px;
      max-height: 90vh;
      background: #111;
      border-radius: 1rem;
      padding: 0.75rem;
      box-shadow: 0 20px 50px rgba(0,0,0,0.7);
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }
    #mediaModalClose {
      position: absolute;
      top: 0.65rem;
      right: 0.75rem;
      width: 38px;
      height: 38px;
      border-radius: 999px;
      border: none;
      background: rgba(0,0,0,0.7);
      color: #F5F5F5;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 1rem;
      transition: background 0.2s ease;
      z-index: 2;
    }
    #mediaModalClose:hover {
      background: rgba(0,0,0,0.95);
    }
    #mediaModalContent {
      flex: 1;
      position: relative;
      background: #000;
      border-radius: 0.75rem;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    #mediaModalContent img {
      max-width: 100%;
      max-height: calc(90vh - 60px);
      object-fit: contain;
    }
    #mediaModalContent iframe {
      width: 100%;
      height: 100%;
      min-height: 70vh;
      border: none;
      border-radius: 0.5rem;
    }

    /* Project page hero adjustments */
    .project-page #hero {
      cursor: grab;
      touch-action: pan-y;
    }
    .project-page #hero:active {
      cursor: grabbing;
    }
    .project-page .hero-text {
      pointer-events: none;
    }

    @media (max-width: 768px) {
      .hero-text .project-tagline {
        font-size: 0.85rem;
        max-width: 100%;
      }
      .click-hint span {
        font-size: 0.6rem;
      }
      .click-hint i {
        font-size: 0.75rem;
      }
      #mediaModalInner {
        padding: 0.5rem;
        border-radius: 0.75rem;
      }
      #mediaModalClose {
        width: 34px;
        height: 34px;
        top: 0.5rem;
        right: 0.5rem;
      }
    }

    @media (max-width: 480px) {
      .click-hint span {
        font-size: 0.55rem;
        letter-spacing: 0.04em;
      }
      .click-hint i {
        font-size: 0.7rem;
      }
    }
