:root {
  --header-h: 78px;
  --glass-bg: rgba(18, 22, 40, 0.58);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.46);
  --text-color: #eef1ff;
  --accent: #7c5cff;
  --accent-2: #9b7bff;
  --page-bg: radial-gradient(ellipse at 30% 20%, #1e1b4b 0%, #0b1020 70%);
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-color);
  background: var(--page-bg);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(124, 92, 255, 0.12), transparent 35%),
              radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.08), transparent 30%);
  z-index: -2;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.10), transparent 48%, rgba(56, 189, 248, 0.06));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: -1;
  pointer-events: none;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(11, 16, 32, 0.72);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.loading-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-card {
  width: min(520px, calc(100vw - 32px));
  padding: 26px 24px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.loading-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: loadingFill 3.6s ease forwards;
}

@keyframes loadingFill {
  0% { width: 0%; }
  75% { width: 92%; }
  100% { width: 100%; }
}

.hero-stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 10px 20px 0;
}

.search-dock {
  width: min(980px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
  transform: translateY(-30pt);
  transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.2, 1), padding 0.6s, background 0.6s, border-color 0.6s;
}

.search-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.search-tagline {
  text-align: center;
  font-size: 0.92rem;
  opacity: 0.75;
  letter-spacing: 0.01em;
}


.search-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  min-width: 0;
}

.brand-badge {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.22), rgba(155, 123, 255, 0.14));
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 24px;
}

.brand-text {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1;
}

.search-form {
  display: flex;
  gap: 10px;
  align-items: stretch;
  width: 100%;
}

.search-input {
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  outline: none;
  font: inherit;
}

.search-input:focus {
  border-color: rgba(124, 92, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
}

.search-button {
  padding: 16px 22px;
  border: 0;
  border-radius: 14px;
  /* Baby‑blue gradient (normal state) */
  background: linear-gradient(135deg, #d4eeff, #a4d5f9);
  color: #0b1020;
  font-weight: 800;                     /* bold */
  cursor: pointer;
  font: inherit;
  transition:
    transform 140ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
  box-shadow: 0 10px 24px rgba(124, 92, 255, 0.18);
}

.search-button:hover {
  background: linear-gradient(135deg, #e0f3ff, #b3defa);
}

.search-button:active {
  background: linear-gradient(135deg, #2f7bff, #1f5fe0);
  color: #ffffff;
  transform: translateY(1px) scale(0.97);
  animation: buttonBounce 180ms ease;
}

.search-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(79, 172, 254, 0.25), 0 10px 24px rgba(124, 92, 255, 0.18);
}

.weather-widget {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 70;
  min-width: 290px;
  padding: 14px 16px;
  border-radius: 22px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 0.55s ease, padding 0.55s ease, min-width 0.55s ease, top 0.55s ease, right 0.55s ease;
}

.weather-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.weather-line {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 0.98rem;
}

.weather-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  white-space: nowrap;
}

.weather-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.weather-sep {
  opacity: 0.55;
}

.weather-ico {
  width: 24px;
  text-align: center;
}

.weather-label {
  opacity: 0.82;
  font-size: 0.88rem;
}

.weather-value {
  font-weight: 800;
}

.search-zone {
  width: min(1240px, 100%);
  margin: 10px auto 0;
  padding: 0 20px 40px;
  display: none;
  gap: 22px;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) 360px;
}

.results-area {
  height: calc(100vh - var(--header-h) - 120px);
  overflow-y: auto;
  display: grid;
  gap: 16px;
  padding-right: 6px;
  align-content: start;
}

/*
.results-area {
  min-height: 280px;
  max-height: calc(100vh - var(--header-h) - 220px);
  overflow-y: auto;
  display: grid;
  gap: 16px;
  padding-right: 6px;
}
  */

.result-card,
.result-skeleton,
.viewer-frame {
  border-radius: 24px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.result-card {
  padding: 18px;
}

.result-title {
  font-size: 1.02rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.result-meta {
  opacity: 0.78;
  font-size: 0.92rem;
}

.result-skeleton {
  padding: 18px;
  overflow: hidden;
  animation: bounceSoft 1.1s infinite ease-in-out;
}

.skeleton-line {
  height: 14px;
  width: 80%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  margin-bottom: 10px;
}

.skeleton-line.short {
  width: 58%;
}


/* 

.viewer-shell {
  position: sticky;
  top: calc(var(--header-h) + 40pt + 30px);
  align-self: start;
}
  */

.viewer-shell {
  position: fixed;
  top: calc(var(--header-h) + 40pt + 110px);
  right: calc((100vw - min(1240px, 100%)) / 2 + 20px);
  width: 360px;
  max-height: calc(100vh - var(--header-h) - 40pt - 80px - 10pt);
  overflow-y: auto;
  align-self: start;
}


.viewer-frame {
  min-height: 420px;
  overflow: hidden;
  position: relative;
}

.viewer-hud {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(11, 16, 32, 0.55);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.85rem;
}

.generic-cube {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  perspective: 1200px;
}

.cube {
  width: 104px;
  height: 104px;
  position: relative;
  transform-style: preserve-3d;
  animation: cubeSpin 8s linear infinite;
}

.cube-face {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(124, 92, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cube-face.front { transform: translateZ(52px); }
.cube-face.back { transform: rotateY(180deg) translateZ(52px); }
.cube-face.right { transform: rotateY(90deg) translateZ(52px); }
.cube-face.left { transform: rotateY(-90deg) translateZ(52px); }
.cube-face.top { transform: rotateX(90deg) translateZ(52px); }
.cube-face.bottom { transform: rotateX(-90deg) translateZ(52px); }

.has-searched .search-dock {
  position: sticky;
  top: calc(var(--header-h) + 40pt);
  z-index: 60;
  width: min(1240px, calc(100% - 40px));
  padding: 14px 16px;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  background: rgba(18, 22, 40, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 26px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: searchDockBounce 620ms cubic-bezier(0.16, 1.2, 0.32, 1) both;
  transform: none;
}

.has-searched .search-brand {
  min-width: 150px;
  justify-content: flex-start;
  transform: scale(0.76);
  transform-origin: left center;
}

.has-searched .search-form {
  flex: 1;
  width: auto;
}

.has-searched .weather-widget {
  min-width: 178px;
  padding: 10px 12px;
  transform: translateY(0) scale(0.92);
}

.has-searched .search-tagline {
  display: none;
}

.has-searched .search-copy {
  gap: 0;
}

.has-searched .weather-inline {
  gap: 8px;
}

.has-searched .weather-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}


/*
.has-searched .search-zone {
  display: grid;
  margin-top: 80px;
}

*/

.has-searched .search-zone {
  display: grid;
  margin-top: 80px;
  padding-right: calc(360px + 42px); /* reserves space so results don't slide under the fixed viewer */
  grid-template-columns: minmax(0, 1fr);  /* single column; viewer is now out of flow */
}


.has-searched .hero-stage {
  flex: 0;
  padding: 0;
  min-height: 0;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes bounceSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes cubeSpin {
  0% { transform: rotateX(-16deg) rotateY(0deg); }
  100% { transform: rotateX(-16deg) rotateY(360deg); }
}

@keyframes buttonBounce {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(1px) scale(0.965); }
  100% { transform: translateY(1px) scale(0.97); }
}

@keyframes buttonPress {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.94); }
  100% { transform: scale(1); }
}

@media (max-width: 1024px) {
  .search-dock {
    grid-template-columns: 1fr;
  }

  .search-brand {
    justify-content: flex-start;
    min-width: 0;
  }

  .search-form {
    width: 100%;
  }

   .weather-widget {
    display: none !important;
  }

  .weather-grid {
    grid-template-columns: 1fr;
  }

  .search-zone {
    grid-template-columns: 1fr;
  }

  
  .viewer-shell {
    position: sticky;       /* back to normal flow on mobile */
    top: 0;
    width: 100%;
    right: auto;
  }

  .has-searched .search-zone {
    padding-right: 20px;    /* restore normal padding */
    grid-template-columns: 1fr;
  }

  .results-area {
    height: auto;           /* let it grow naturally on mobile */
    max-height: none;
    overflow-y: visible;
  }
  
}