/* components.css - RUVA UI Components */

/* Navigation */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    z-index: 100;
    transition: background-color var(--transition-med),
                transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Hide header by sliding it up — used on mobile when scrolling down */
.site-header.header-hidden {
    transform: translateY(-105%);
    opacity: 0;
    pointer-events: none;
}

.site-header.scrolled {
    background-color: var(--clr-background-dark);
    border-bottom: 1px solid rgba(184, 132, 74, 0.15);
    backdrop-filter: blur(10px);
}

/* Mobile: keep header transparent at top (no background unless .scrolled) */
@media (max-width: 768px) {
    .site-header {
        background-color: transparent;
    }
}

.site-header.scrolled .brand-logo,
.site-header.scrolled .nav-links a {
    color: var(--clr-text-primary);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.brand-logo {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 70px;
    width: auto;
    object-fit: contain;
    transition: transform var(--transition-fast);
}

.brand-logo:hover .header-logo {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 3rem;
    list-style: none;
}

.nav-links a {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--clr-accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition-fast);
}

.nav-links a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.burger-line {
    display: block;
    width: 24px;
    height: 1px;
    background-color: var(--clr-text-primary);
    margin-bottom: 6px;
    transition: transform 0.3s, opacity 0.3s;
}

.burger-line:last-child {
    margin-bottom: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 3.5rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 1px solid var(--clr-accent);
    background-color: transparent;
    color: var(--clr-accent);
    cursor: pointer;
    border-radius: 4px;
    /* Minimal rounded shape */
    transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.btn:hover {
    background-color: var(--clr-text-secondary);
    color: var(--clr-bg);
}

.btn-primary {
    background-color: var(--clr-accent);
    color: var(--clr-bg);
}

.btn-primary:hover {
    background-color: var(--clr-accent-hover);
    border-color: var(--clr-accent-hover);
}

/* Forms */
.form-group {
    margin-bottom: 2rem;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    color: var(--clr-text-secondary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 1rem 1rem;
    background: var(--clr-background-dark);
    border: 1px solid var(--clr-text-secondary);
    color: var(--clr-text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    border-radius: 4px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--clr-accent);
    box-shadow: 0 0 10px rgba(184, 132, 74, 0.15);
    /* Very soft gold glow */
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Layout Blocks */
.content-block {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.content-block p {
    margin: 0 auto 1.5rem;
}

/* Animation Utilities */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Media Queries */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }
}

/* Bounce Cards Animation Component */
.bounceCardsContainer {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 400px;
    height: 400px;
}

.card {
    position: absolute;
    width: 200px;
    aspect-ratio: 1;
    border: 5px solid var(--clr-surface);
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

/* Default Desktop Transforms */
.card.card-0 { transform: rotate(5deg) translate(-150px); }
.card.card-1 { transform: rotate(0deg) translate(-70px); }
.card.card-2 { transform: rotate(-5deg); }
.card.card-3 { transform: rotate(5deg) translate(70px); }
.card.card-4 { transform: rotate(-5deg) translate(150px); }

/* Mobile: scale down bounce cards so they fit within viewport */
@media (max-width: 600px) {
    .bounceCardsContainer {
        width: min(90vw, 340px) !important;
        height: 200px !important;
    }

    .card {
        width: 120px;
        border-radius: 16px;
    }

    /* Re-map the translate offsets to smaller values that fit on mobile */
    .card.card-0 { transform: rotate(5deg)  translate(-88px); }
    .card.card-1 { transform: rotate(0deg)  translate(-42px); }
    .card.card-2 { transform: rotate(-5deg); }
    .card.card-3 { transform: rotate(5deg)  translate(42px);  }
    .card.card-4 { transform: rotate(-5deg) translate(88px);  }
}

.card .image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Spotlight Card Component */
.card-spotlight {
    position: relative;
    border-radius: 1.5rem;
    border: 1px solid rgba(184, 132, 74, 0.15);
    /* RUVA matching border */
    background-color: var(--clr-surface);
    padding: 2rem;
    overflow: hidden;
    --mouse-x: 50%;
    --mouse-y: 50%;
    --spotlight-color: rgba(201, 169, 110, 0.05);
}

.card-spotlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at var(--mouse-x) var(--mouse-y), var(--spotlight-color), transparent 80%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.card-spotlight:hover::before,
.card-spotlight:focus-within::before {
    opacity: 0.6;
}

/* --- Global Footer Styles --- */
.site-footer {
    background-color: var(--clr-surface);
    padding: 4rem 5%;
    border-top: 1px solid rgba(184, 132, 74, 0.15);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    max-width: var(--container-max-width);
    margin: 0 auto;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.footer-brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    display: block;
}

.footer-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    font-size: 0.85rem;
    color: var(--clr-text-secondary);
}

.footer-links a:hover {
    color: var(--clr-text-primary);
}

.footer-bottom {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(184, 132, 74, 0.15);
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--clr-text-secondary);
    max-width: var(--container-max-width);
    margin-left: auto;
    margin-right: auto;
}

/* --- Rotating Text Component --- */
.rotating-text-wrapper {
    display: inline-flex;
    position: relative;
    overflow: hidden;
    vertical-align: bottom;
}

.rotate-text-group {
    display: inline-flex;
    white-space: nowrap;
}

.rotate-char {
    display: inline-block;
    /* Allows transform (y-axis translation) to work on spans */
}

/* ==========================================================================
   Tilted Card Component
   ========================================================================== */

.tilted-card-figure {
    position: relative;
    width: 100%;
    height: 100%;
    /* Added fixed height to make perspective visible */
    min-height: 300px;
    perspective: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    cursor: pointer;
}

.tilted-card-inner {
    position: relative;
    transform-style: preserve-3d;
    width: 100%;
    height: 100%;
    will-change: transform;
    border-radius: 15px;
}

.tilted-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    will-change: transform;
    transform: translateZ(40px);
    /* 3D float distance */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2.5rem;
    text-align: center;
    pointer-events: none;
    /* Let the figure handle hover */
}

/* ==========================================================================
   ScrollFloat Animation Component
   ========================================================================== */
.scroll-float {
    overflow: hidden;
}

.scroll-float-text {
    display: inline-flex;
    flex-wrap: wrap; /* handles multi-line wrapping */
}

.char {
    display: inline-block;
}

/* ==========================================================================
   Bubble Menu Component
   ========================================================================== */
.bubble-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  pointer-events: auto;
  z-index: 101;
}

@media (min-width: 769px) {
  .bubble-menu {
    display: none !important;
  }
}

/* Base bubble styling */
.bubble-menu .bubble {
  --bubble-size: 48px;
  width: var(--bubble-size);
  height: var(--bubble-size);
  border-radius: 50%;
  background: var(--clr-bg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.bubble-menu .toggle-bubble {
  will-change: transform;
  width: var(--bubble-size);
  height: var(--bubble-size);
  cursor: pointer;
  border: none;
  background: var(--clr-bg);
  padding: 0;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

.bubble-menu .menu-line {
  width: 24px;
  height: 2px;
  background: var(--clr-text-primary);
  border-radius: 2px;
  display: block;
  margin: 0 auto;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

.bubble-menu .menu-line + .menu-line {
  margin-top: 6px;
}

.bubble-menu .toggle-bubble.open .menu-line:first-child {
  transform: translateY(4px) rotate(45deg);
}

.bubble-menu .toggle-bubble.open .menu-line:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

@media (min-width: 768px) {
  .bubble-menu .bubble {
    --bubble-size: 56px;
  }
}

.bubble-menu-items {
  position: fixed;
  inset: 0;
  display: none; /* toggled via JS */
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  z-index: 99;
  background: rgba(18, 13, 10, 0.95);
  backdrop-filter: blur(8px);
}

.bubble-menu-items .pill-list {
  list-style: none;
  margin: 0;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  row-gap: 4px;
  width: 100%;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
  pointer-events: auto;
  justify-content: stretch;
}

.bubble-menu-items .pill-list .pill-col {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex: 0 0 calc(100% / 3);
  box-sizing: border-box;
}

.bubble-menu-items .pill-list .pill-col:nth-child(4):nth-last-child(2) {
  margin-left: calc(100% / 6);
}

.bubble-menu-items .pill-list .pill-col:nth-child(4):last-child {
  margin-left: calc(100% / 3);
}

.bubble-menu-items .pill-link {
  --pill-bg: var(--clr-bg);
  --pill-color: var(--clr-text-primary);
  --item-rot: 0deg;
  --pill-min-h: 160px;
  --hover-bg: var(--clr-accent);
  --hover-color: var(--clr-bg);
  
  width: 100%;
  min-height: var(--pill-min-h);
  padding: clamp(1.5rem, 3vw, 8rem) 0;
  font-size: clamp(1.5rem, 4vw, 4rem);
  font-weight: 400;
  font-family: var(--font-heading);
  line-height: 0;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-color);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.3s ease, color 0.3s ease;
  will-change: transform;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
}

/* Set specific hover overrides dynamically applied per item */
.bubble-menu-items .pill-link:hover {
    background: var(--hover-bg);
    color: var(--hover-color);
}


@media (min-width: 900px) {
  .bubble-menu-items .pill-link {
    transform: rotate(var(--item-rot));
  }

  .bubble-menu-items .pill-link:hover {
    transform: rotate(var(--item-rot)) scale(1.06);
  }

  .bubble-menu-items .pill-link:active {
    transform: rotate(var(--item-rot)) scale(0.94);
  }
}

.bubble-menu-items .pill-link .pill-label {
  display: inline-block;
  will-change: transform, opacity;
  height: 1.2em;
  line-height: 1.2;
}

@media (max-width: 899px) {
  .bubble-menu-items {
    padding-top: 120px;
    align-items: flex-start;
  }

  .bubble-menu-items .pill-list {
    row-gap: 16px;
  }

  .bubble-menu-items .pill-list .pill-col {
    flex: 0 0 100%;
    margin-left: 0 !important;
    overflow: visible;
  }

  .bubble-menu-items .pill-link {
    font-size: clamp(1.2rem, 3vw, 4rem);
    padding: clamp(1rem, 2vw, 2rem) 0;
    min-height: 80px;
  }

  .bubble-menu-items .pill-link:hover {
    transform: scale(1.06);
  }

  .bubble-menu-items .pill-link:active {
    transform: scale(0.94);
  }
}